diff --git a/.gitignore b/.gitignore index 59ec847b..04f175ff 100644 --- a/.gitignore +++ b/.gitignore @@ -2,20 +2,21 @@ .DS_Store *.swp *.tmp -*~ # Project files that should not be in the repo -.* -\#* -!/.gitignore +.project +.settings/ +.settings.xml +.settings +.c9settings.xml +.c9revisions +.settings.xml.old .*.gz -*.tmTheme.js # A handy place to put stuff that git should ignore: /ignore/ node_modules/ -jam/ -* * +tool/node_modules/ .git-ref npm-debug.log diff --git a/.gitmodules b/.gitmodules index 07bbe371..4678c516 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ [submodule "doc/wiki"] path = doc/wiki - url = https://github.com/ajaxorg/ace.wiki.git + url = git://github.com/ajaxorg/ace.wiki.git [submodule "build"] path = build - url = https://github.com/ajaxorg/ace-builds.git + url = git://github.com/ajaxorg/ace-builds.git diff --git a/CNAME b/CNAME deleted file mode 100644 index 75431b15..00000000 --- a/CNAME +++ /dev/null @@ -1 +0,0 @@ -ace.c9.io diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 062af59c..00000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,15 +0,0 @@ -Contributing ------------- - -Ace is a community project and wouldn't be what it is without contributions! We actively encourage and support contributions. The Ace source code is released under the BSD License. This license is very simple, and is friendly to all kinds of projects, whether open source or not. Take charge of your editor and add your favorite language highlighting and keybindings! - -Feel free to fork and improve/enhance Ace any way you want. If you feel that the editor or the Ace community will benefit from your changes, please open a pull request. To protect the interests of the Ace contributors and users we require contributors to sign a Contributors License Agreement (CLA) before we pull the changes into the main repository. Our CLA is the simplest of agreements, requiring that the contributions you make to an ajax.org project are only those you're allowed to make. This helps us significantly reduce future legal risk for everyone involved. It is easy, helps everyone, takes ten minutes, and only needs to be completed once. - -There are two versions of the agreement: - -1. [The Individual CLA](https://docs.google.com/a/c9.io/forms/d/1MfmfrxqD_PNlNsuK0lC2KSelRLxGLGfh_wEcG0ijVvo/viewform): use this version if you're working on the Cloud9 SDK or open source projects in your spare time, or can clearly claim ownership of copyright in what you'll be submitting. -2. [The Corporate CLA](https://docs.google.com/a/c9.io/forms/d/1vFejn4111GdnCNuQ6BfnJDaxdsUEMD4KCo1ayovAfu0/viewform): have your corporate lawyer review and submit this if your company is going to be contributing to the Cloud9 SDK and/or open source projects. - -If you want to contribute to the Cloud9 SDK and/or open source projects please go to the online form, fill it out and submit it. - -Happy coding, Cloud9 diff --git a/ChangeLog.txt b/ChangeLog.txt index 3077d171..76b2313b 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,229 +1,3 @@ -Version 1.2.0-pre - -* New Features - - Indented soft wrap (danyaPostfactum) - -* API Changes - - unified delta types `{start, end, action, lines}` (Alden Daniels https://github.com/ajaxorg/ace/pull/1745) - - "change" event listeners on session and editor get delta objects directly - -2015.04.03 Version 1.1.9 - - - Small Enhancements and Bugfixes - -2014.11.08 Version 1.1.8 - -* API Changes - - `editor.commands.commandKeyBinding` now contains direct map from keys to commands instead of grouping them by hashid - -* New Features - - Improved autoindent for html and php modes (Adam Jimenez) - - Find All from searchbox (Colton Voege) - -* new language modes - - Elixir, Elm - -2014.09.21 Version 1.1.7 - -* Bugfixes - - fix several bugs in autocompletion - - workaround for inaccurate getBoundingClientRect on chrome 37 - -2014.08.17 Version 1.1.6 - -* Bugfixes - - fix regression in double tap to highlight - - Improved Latex Mode (Daniel Felder) - -* API Changes - - editor.destroy destroys editor.session too (call editor.setSession(null) to prevent that) - -* new language modes - - Praat (José Joaquín Atria) - - Eiffel (Victorien Elvinger) - - G-code (Adam Joseph Cook) - -2014.07.09 Version 1.1.5 - -* Bugfixes - - fix regression in autocomplete popup - -* new language modes - - gitignore (Devon Carew) - -2014.07.01 Version 1.1.4 - -* New Features - - Highlight matching tags (Adam Jimenez) - - Improved jump to matching command (Adam Jimenez) - -* new language modes - - AppleScript (Yaogang Lian) - - Vala - -2014.03.08 Version 1.1.3 - -* New Features - - Allow syntax checkers to be loaded from CDN (Derk-Jan Hartman) - - Add ColdFusion behavior (Abram Adams) - - add showLineNumbers option - - Add html syntax checker (danyaPostfactum) - -* new language modes - - Gherkin (Patrick Nevels) - - Smarty - -2013.12.02 Version 1.1.2 - -* New Features - - Accessibility Theme for Ace (Peter Xiao) - - use snipetManager for expanding emmet snippets - - update jshint to 2.1.4 - - improve php syntax checker (jdalegonzalez) - - add option for autoresizing - - add option for autohiding vertical scrollbar - - improvements to highlighting of xml like languages (danyaPostfactum) - - add support for autocompletion and snippets (gjtorikyan danyaPostfactum and others) - - add option to merge similar changes in undo history - - add scrollPastEnd option - - use html5 dragndrop for text dragging (danyaPostfactum) - -* API Changes - - fixed typo in HashHandler commmandManager - -* new language modes - - Nix (Zef Hemel) - - Protobuf (Zef Hemel) - - Soy - - Handlebars - -2013.06.04 Version 1.1.1 - - - Improved emacs keybindings (Robert Krahn) - - Added markClean, isClean methods to UndoManager (Joonsoo Jeon) - - Do not allow `Toggle comments` command to remove spaces from indentation - - Softer colors for indent guides in dark themes - -* new language modes - - Ada - - Assembly_x86 - - Cobol - - D - - ejs - - MATLAB - - MySQL - - Twig - - Verilog - -2013.05.01, Version 1.1.0 - -* API Changes - - Default position of the editor container is changed to relative. Add `.ace_editor {position: absolute}` css rule to restore old behavior - - Changed default line-height to `normal` to not conflict with bootstrap. Use `line-height: inherit` for old behavior. - - Changed marker types accepted by session.addMarker. It now accepts "text"|"line"|"fullLine"|"screenLine" - - Internal classnames used by editor were made more consistent - - Introduced `editor.setOption/getOption/setOptions/getOptions` methods - - Introduced positionToIndex, indexToPosition methods - -* New Features - - Improved emacs mode (chetstone) - with Incremental search and Occur modes (Robert Krahn) - - - Improved ime handling - - Searchbox (Vlad Zinculescu) - - - Added elastic tabstops lite extension (Garen Torikian) - - Added extension for whitespace manipulation - - Added extension for enabling spellchecking from contextmenu - - Added extension for displaying available keyboard shortcuts (Matthew Christopher Kastor-Inare III) - - Added extension for displaying options panel (Matthew Christopher Kastor-Inare III) - - Added modelist extension (Matthew Christopher Kastor-Inare III) - - - Improved toggleCommentLines and added ToggleCommentBlock command - - `:;` pairing in CSS mode (danyaPostfactum) - - - Added suppoert for Delete and SelectAll from context menu (danyaPostfactum) - - - Make wrapping behavior optional - - Selective bracket insertion/skipping - - - Added commands for increase/decrease numbers, sort lines (Vlad Zinculescu) - - Folding for Markdown, Lua, LaTeX - - Selective bracket insertion/skipping for C-like languages - -* Many new languages - - Scheme (Mu Lei) - - Dot (edwardsp) - - FreeMarker (nguillaumin) - - Tiny Mushcode (h3rb) - - Velocity (Ryan Griffith) - - TOML (Garen Torikian) - - LSL (Nemurimasu Neiro, Builders Brewery) - - Curly (Libo Cannici) - - vbScript (Jan Jongboom) - - R (RStudio) - - ABAP - - Lucene (Graham Scott) - - Haml (Garen Torikian) - - Objective-C (Garen Torikian) - - Makefile (Garen Torikian) - - TypeScript (Garen Torikian) - - Lisp (Garen Torikian) - - Stylus (Garen Torikian) - - Dart (Garen Torikian) - -* Live syntax checks - - PHP (danyaPostfactum) - - Lua - -* New Themes - - Chaos - - Terminal - -2012.09.17, Version 1.0.0 - -* New Features - - Multiple cursors and selections (https://c9.io/site/blog/2012/08/be-an-armenian-warrior-with-block-selection-on-steroids/) - - Fold buttons displayed in the gutter - - Indent Guides - - Completely reworked vim mode (Sergi Mansilla) - - Improved emacs keybindings - - Autoclosing of html tags (danyaPostfactum) - -* 20 New language modes - - Coldfusion (Russ) - - Diff - - GLSL (Ed Mackey) - - Go (Davide Saurino) - - Haxe (Jason O'Neil) - - Jade (Garen Torikian) - - jsx (Syu Kato) - - LaTeX (James Allen) - - Less (John Roepke) - - Liquid (Bernie Telles) - - Lua (Lee Gao) - - LuaPage (Choonster) - - Markdown (Chris Spencer) - - PostgreSQL (John DeSoi) - - Powershell (John Kane) - - Sh (Richo Healey) - - SQL (Jonathan Camile) - - Tcl (Cristoph Hochreiner) - - XQuery (William Candillion) - - Yaml (Meg Sharkey) - - * Live syntax checks - - for XQuery and JSON - -* New Themes - - Ambiance (Irakli Gozalishvili) - - Dreamweaver (Adam Jimenez) - - Github (bootstraponline) - - Tommorrow themes (https://github.com/chriskempson/tomorrow-theme) - - XCode - -* Many Small Enhancements and Bugfixes - 2011.08.02, Version 0.2.0 * Split view (Julian Viereck) @@ -253,14 +27,15 @@ Version 1.2.0-pre - SCAD (Jacob Hansson) * Live syntax checks - - Lint for CSS using CSS Lint + - Lint for Css using CSS Lint - CoffeeScript * New Themes - Crimson Editor (iebuggy) - Merbivore (Michael Schwartz) - Merbivore soft (Michael Schwartz) - - Solarized dark/light (David Alan Hjelle) + - Solarized dark/light (David Alan + Hjelle) - Vibrant Ink (Michael Schwartz) * Small Features/Enhancements @@ -273,8 +48,10 @@ Version 1.2.0-pre highlight are not affected (Irakli Gozalishvili) - Added setFontSize method - Improved vi keybindings (Trent Ogren) - - When unfocused make cursor transparent instead of removing it (Harutyun Amirjanyan) - - Support for matching groups in tokenizer with arrays of tokens (Chris Spencer) + - When unfocused make cursor transparent instead of removing it (Harutyun + Amirjanyan) + - Support for matching groups in tokenizer with arrays of tokens (Chris + Spencer) * Bug fixes - Add support for the new OSX scroll bars @@ -282,7 +59,8 @@ Version 1.2.0-pre - Proper handling of unicode characters in JavaScript identifiers - Fix remove lines command on last line (Harutyun Amirjanyan) - Fix scroll wheel sluggishness in Safari - - Make keyboard infrastructure route keys like []^$ the right way (Julian Viereck) + - Make keyboard infrastructure route keys like []^$ the right way (Julian + Viereck) 2011.02.14, Version 0.1.6 @@ -335,4 +113,4 @@ Version 1.2.0-pre * Add Ruby mode contributed by Shlomo Zalman Heigh * Add Java mode contributed by Tom Tasche * Fix annotation bug -* Changing a document added a new empty line at the end +* Changing a document added a new empty line at the end \ No newline at end of file diff --git a/LICENSE b/LICENSE index 4760be2a..853e4fd5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,24 +1,476 @@ -Copyright (c) 2010, Ajax.org B.V. -All rights reserved. +Licensed under the tri-license MPL/LGPL/GPL. -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. + MOZILLA PUBLIC LICENSE + Version 1.1 -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. + --------------- + +1. Definitions. + + 1.0.1. "Commercial Use" means distribution or otherwise making the + Covered Code available to a third party. + + 1.1. "Contributor" means each entity that creates or contributes to + the creation of Modifications. + + 1.2. "Contributor Version" means the combination of the Original + Code, prior Modifications used by a Contributor, and the Modifications + made by that particular Contributor. + + 1.3. "Covered Code" means the Original Code or Modifications or the + combination of the Original Code and Modifications, in each case + including portions thereof. + + 1.4. "Electronic Distribution Mechanism" means a mechanism generally + accepted in the software development community for the electronic + transfer of data. + + 1.5. "Executable" means Covered Code in any form other than Source + Code. + + 1.6. "Initial Developer" means the individual or entity identified + as the Initial Developer in the Source Code notice required by Exhibit + A. + + 1.7. "Larger Work" means a work which combines Covered Code or + portions thereof with code not governed by the terms of this License. + + 1.8. "License" means this document. + + 1.8.1. "Licensable" means having the right to grant, to the maximum + extent possible, whether at the time of the initial grant or + subsequently acquired, any and all of the rights conveyed herein. + + 1.9. "Modifications" means any addition to or deletion from the + substance or structure of either the Original Code or any previous + Modifications. When Covered Code is released as a series of files, a + Modification is: + A. Any addition to or deletion from the contents of a file + containing Original Code or previous Modifications. + + B. Any new file that contains any part of the Original Code or + previous Modifications. + + 1.10. "Original Code" means Source Code of computer software code + which is described in the Source Code notice required by Exhibit A as + Original Code, and which, at the time of its release under this + License is not already Covered Code governed by this License. + + 1.10.1. "Patent Claims" means any patent claim(s), now owned or + hereafter acquired, including without limitation, method, process, + and apparatus claims, in any patent Licensable by grantor. + + 1.11. "Source Code" means the preferred form of the Covered Code for + making modifications to it, including all modules it contains, plus + any associated interface definition files, scripts used to control + compilation and installation of an Executable, or source code + differential comparisons against either the Original Code or another + well known, available Covered Code of the Contributor's choice. The + Source Code can be in a compressed or archival form, provided the + appropriate decompression or de-archiving software is widely available + for no charge. + + 1.12. "You" (or "Your") means an individual or a legal entity + exercising rights under, and complying with all of the terms of, this + License or a future version of this License issued under Section 6.1. + For legal entities, "You" includes any entity which controls, is + controlled by, or is under common control with You. For purposes of + this definition, "control" means (a) the power, direct or indirect, + to cause the direction or management of such entity, whether by + contract or otherwise, or (b) ownership of more than fifty percent + (50%) of the outstanding shares or beneficial ownership of such + entity. + +2. Source Code License. + + 2.1. The Initial Developer Grant. + The Initial Developer hereby grants You a world-wide, royalty-free, + non-exclusive license, subject to third party intellectual property + claims: + (a) under intellectual property rights (other than patent or + trademark) Licensable by Initial Developer to use, reproduce, + modify, display, perform, sublicense and distribute the Original + Code (or portions thereof) with or without Modifications, and/or + as part of a Larger Work; and + + (b) under Patents Claims infringed by the making, using or + selling of Original Code, to make, have made, use, practice, + sell, and offer for sale, and/or otherwise dispose of the + Original Code (or portions thereof). + + (c) the licenses granted in this Section 2.1(a) and (b) are + effective on the date Initial Developer first distributes + Original Code under the terms of this License. + + (d) Notwithstanding Section 2.1(b) above, no patent license is + granted: 1) for code that You delete from the Original Code; 2) + separate from the Original Code; or 3) for infringements caused + by: i) the modification of the Original Code or ii) the + combination of the Original Code with other software or devices. + + 2.2. Contributor Grant. + Subject to third party intellectual property claims, each Contributor + hereby grants You a world-wide, royalty-free, non-exclusive license + + (a) under intellectual property rights (other than patent or + trademark) Licensable by Contributor, to use, reproduce, modify, + display, perform, sublicense and distribute the Modifications + created by such Contributor (or portions thereof) either on an + unmodified basis, with other Modifications, as Covered Code + and/or as part of a Larger Work; and + + (b) under Patent Claims infringed by the making, using, or + selling of Modifications made by that Contributor either alone + and/or in combination with its Contributor Version (or portions + of such combination), to make, use, sell, offer for sale, have + made, and/or otherwise dispose of: 1) Modifications made by that + Contributor (or portions thereof); and 2) the combination of + Modifications made by that Contributor with its Contributor + Version (or portions of such combination). + + (c) the licenses granted in Sections 2.2(a) and 2.2(b) are + effective on the date Contributor first makes Commercial Use of + the Covered Code. + + (d) Notwithstanding Section 2.2(b) above, no patent license is + granted: 1) for any code that Contributor has deleted from the + Contributor Version; 2) separate from the Contributor Version; + 3) for infringements caused by: i) third party modifications of + Contributor Version or ii) the combination of Modifications made + by that Contributor with other software (except as part of the + Contributor Version) or other devices; or 4) under Patent Claims + infringed by Covered Code in the absence of Modifications made by + that Contributor. + +3. Distribution Obligations. + + 3.1. Application of License. + The Modifications which You create or to which You contribute are + governed by the terms of this License, including without limitation + Section 2.2. The Source Code version of Covered Code may be + distributed only under the terms of this License or a future version + of this License released under Section 6.1, and You must include a + copy of this License with every copy of the Source Code You + distribute. You may not offer or impose any terms on any Source Code + version that alters or restricts the applicable version of this + License or the recipients' rights hereunder. However, You may include + an additional document offering the additional rights described in + Section 3.5. + + 3.2. Availability of Source Code. + Any Modification which You create or to which You contribute must be + made available in Source Code form under the terms of this License + either on the same media as an Executable version or via an accepted + Electronic Distribution Mechanism to anyone to whom you made an + Executable version available; and if made available via Electronic + Distribution Mechanism, must remain available for at least twelve (12) + months after the date it initially became available, or at least six + (6) months after a subsequent version of that particular Modification + has been made available to such recipients. You are responsible for + ensuring that the Source Code version remains available even if the + Electronic Distribution Mechanism is maintained by a third party. + + 3.3. Description of Modifications. + You must cause all Covered Code to which You contribute to contain a + file documenting the changes You made to create that Covered Code and + the date of any change. You must include a prominent statement that + the Modification is derived, directly or indirectly, from Original + Code provided by the Initial Developer and including the name of the + Initial Developer in (a) the Source Code, and (b) in any notice in an + Executable version or related documentation in which You describe the + origin or ownership of the Covered Code. + + 3.4. Intellectual Property Matters + (a) Third Party Claims. + If Contributor has knowledge that a license under a third party's + intellectual property rights is required to exercise the rights + granted by such Contributor under Sections 2.1 or 2.2, + Contributor must include a text file with the Source Code + distribution titled "LEGAL" which describes the claim and the + party making the claim in sufficient detail that a recipient will + know whom to contact. If Contributor obtains such knowledge after + the Modification is made available as described in Section 3.2, + Contributor shall promptly modify the LEGAL file in all copies + Contributor makes available thereafter and shall take other steps + (such as notifying appropriate mailing lists or newsgroups) + reasonably calculated to inform those who received the Covered + Code that new knowledge has been obtained. + + (b) Contributor APIs. + If Contributor's Modifications include an application programming + interface and Contributor has knowledge of patent licenses which + are reasonably necessary to implement that API, Contributor must + also include this information in the LEGAL file. + + (c) Representations. + Contributor represents that, except as disclosed pursuant to + Section 3.4(a) above, Contributor believes that Contributor's + Modifications are Contributor's original creation(s) and/or + Contributor has sufficient rights to grant the rights conveyed by + this License. + + 3.5. Required Notices. + You must duplicate the notice in Exhibit A in each file of the Source + Code. If it is not possible to put such notice in a particular Source + Code file due to its structure, then You must include such notice in a + location (such as a relevant directory) where a user would be likely + to look for such a notice. If You created one or more Modification(s) + You may add your name as a Contributor to the notice described in + Exhibit A. You must also duplicate this License in any documentation + for the Source Code where You describe recipients' rights or ownership + rights relating to Covered Code. You may choose to offer, and to + charge a fee for, warranty, support, indemnity or liability + obligations to one or more recipients of Covered Code. However, You + may do so only on Your own behalf, and not on behalf of the Initial + Developer or any Contributor. You must make it absolutely clear than + any such warranty, support, indemnity or liability obligation is + offered by You alone, and You hereby agree to indemnify the Initial + Developer and every Contributor for any liability incurred by the + Initial Developer or such Contributor as a result of warranty, + support, indemnity or liability terms You offer. + + 3.6. Distribution of Executable Versions. + You may distribute Covered Code in Executable form only if the + requirements of Section 3.1-3.5 have been met for that Covered Code, + and if You include a notice stating that the Source Code version of + the Covered Code is available under the terms of this License, + including a description of how and where You have fulfilled the + obligations of Section 3.2. The notice must be conspicuously included + in any notice in an Executable version, related documentation or + collateral in which You describe recipients' rights relating to the + Covered Code. You may distribute the Executable version of Covered + Code or ownership rights under a license of Your choice, which may + contain terms different from this License, provided that You are in + compliance with the terms of this License and that the license for the + Executable version does not attempt to limit or alter the recipient's + rights in the Source Code version from the rights set forth in this + License. If You distribute the Executable version under a different + license You must make it absolutely clear that any terms which differ + from this License are offered by You alone, not by the Initial + Developer or any Contributor. You hereby agree to indemnify the + Initial Developer and every Contributor for any liability incurred by + the Initial Developer or such Contributor as a result of any such + terms You offer. + + 3.7. Larger Works. + You may create a Larger Work by combining Covered Code with other code + not governed by the terms of this License and distribute the Larger + Work as a single product. In such a case, You must make sure the + requirements of this License are fulfilled for the Covered Code. + +4. Inability to Comply Due to Statute or Regulation. + + If it is impossible for You to comply with any of the terms of this + License with respect to some or all of the Covered Code due to + statute, judicial order, or regulation then You must: (a) comply with + the terms of this License to the maximum extent possible; and (b) + describe the limitations and the code they affect. Such description + must be included in the LEGAL file described in Section 3.4 and must + be included with all distributions of the Source Code. Except to the + extent prohibited by statute or regulation, such description must be + sufficiently detailed for a recipient of ordinary skill to be able to + understand it. + +5. Application of this License. + + This License applies to code to which the Initial Developer has + attached the notice in Exhibit A and to related Covered Code. + +6. Versions of the License. + + 6.1. New Versions. + Netscape Communications Corporation ("Netscape") may publish revised + and/or new versions of the License from time to time. Each version + will be given a distinguishing version number. + + 6.2. Effect of New Versions. + Once Covered Code has been published under a particular version of the + License, You may always continue to use it under the terms of that + version. You may also choose to use such Covered Code under the terms + of any subsequent version of the License published by Netscape. No one + other than Netscape has the right to modify the terms applicable to + Covered Code created under this License. + + 6.3. Derivative Works. + If You create or use a modified version of this License (which you may + only do in order to apply it to code which is not already Covered Code + governed by this License), You must (a) rename Your license so that + the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape", + "MPL", "NPL" or any confusingly similar phrase do not appear in your + license (except to note that your license differs from this License) + and (b) otherwise make it clear that Your version of the license + contains terms which differ from the Mozilla Public License and + Netscape Public License. (Filling in the name of the Initial + Developer, Original Code or Contributor in the notice described in + Exhibit A shall not of themselves be deemed to be modifications of + this License.) + +7. DISCLAIMER OF WARRANTY. + + COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF + DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. + THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE + IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, + YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE + COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER + OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF + ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. + +8. TERMINATION. + + 8.1. This License and the rights granted hereunder will terminate + automatically if You fail to comply with terms herein and fail to cure + such breach within 30 days of becoming aware of the breach. All + sublicenses to the Covered Code which are properly granted shall + survive any termination of this License. Provisions which, by their + nature, must remain in effect beyond the termination of this License + shall survive. + + 8.2. If You initiate litigation by asserting a patent infringement + claim (excluding declatory judgment actions) against Initial Developer + or a Contributor (the Initial Developer or Contributor against whom + You file such action is referred to as "Participant") alleging that: + + (a) such Participant's Contributor Version directly or indirectly + infringes any patent, then any and all rights granted by such + Participant to You under Sections 2.1 and/or 2.2 of this License + shall, upon 60 days notice from Participant terminate prospectively, + unless if within 60 days after receipt of notice You either: (i) + agree in writing to pay Participant a mutually agreeable reasonable + royalty for Your past and future use of Modifications made by such + Participant, or (ii) withdraw Your litigation claim with respect to + the Contributor Version against such Participant. If within 60 days + of notice, a reasonable royalty and payment arrangement are not + mutually agreed upon in writing by the parties or the litigation claim + is not withdrawn, the rights granted by Participant to You under + Sections 2.1 and/or 2.2 automatically terminate at the expiration of + the 60 day notice period specified above. + + (b) any software, hardware, or device, other than such Participant's + Contributor Version, directly or indirectly infringes any patent, then + any rights granted to You by such Participant under Sections 2.1(b) + and 2.2(b) are revoked effective as of the date You first made, used, + sold, distributed, or had made, Modifications made by that + Participant. + + 8.3. If You assert a patent infringement claim against Participant + alleging that such Participant's Contributor Version directly or + indirectly infringes any patent where such claim is resolved (such as + by license or settlement) prior to the initiation of patent + infringement litigation, then the reasonable value of the licenses + granted by such Participant under Sections 2.1 or 2.2 shall be taken + into account in determining the amount or value of any payment or + license. + + 8.4. In the event of termination under Sections 8.1 or 8.2 above, + all end user license agreements (excluding distributors and resellers) + which have been validly granted by You or any distributor hereunder + prior to termination shall survive termination. + +9. LIMITATION OF LIABILITY. + + UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT + (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL + DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, + OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR + ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY + CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, + WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER + COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN + INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF + LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY + RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW + PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE + EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO + THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. + +10. U.S. GOVERNMENT END USERS. + + The Covered Code is a "commercial item," as that term is defined in + 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer + software" and "commercial computer software documentation," as such + terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 + C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), + all U.S. Government End Users acquire Covered Code with only those + rights set forth herein. + +11. MISCELLANEOUS. + + This License represents the complete agreement concerning subject + matter hereof. If any provision of this License is held to be + unenforceable, such provision shall be reformed only to the extent + necessary to make it enforceable. This License shall be governed by + California law provisions (except to the extent applicable law, if + any, provides otherwise), excluding its conflict-of-law provisions. + With respect to disputes in which at least one party is a citizen of, + or an entity chartered or registered to do business in the United + States of America, any litigation relating to this License shall be + subject to the jurisdiction of the Federal Courts of the Northern + District of California, with venue lying in Santa Clara County, + California, with the losing party responsible for costs, including + without limitation, court costs and reasonable attorneys' fees and + expenses. The application of the United Nations Convention on + Contracts for the International Sale of Goods is expressly excluded. + Any law or regulation which provides that the language of a contract + shall be construed against the drafter shall not apply to this + License. + +12. RESPONSIBILITY FOR CLAIMS. + + As between Initial Developer and the Contributors, each party is + responsible for claims and damages arising, directly or indirectly, + out of its utilization of rights under this License and You agree to + work with Initial Developer and Contributors to distribute such + responsibility on an equitable basis. Nothing herein is intended or + shall be deemed to constitute any admission of liability. + +13. MULTIPLE-LICENSED CODE. + + Initial Developer may designate portions of the Covered Code as + "Multiple-Licensed". "Multiple-Licensed" means that the Initial + Developer permits you to utilize portions of the Covered Code under + Your choice of the NPL or the alternative licenses, if any, specified + by the Initial Developer in the file described in Exhibit A. + +EXHIBIT A -Mozilla Public License. + + ``The contents of this file are subject to the Mozilla Public License + Version 1.1 (the "License"); you may not use this file except in + compliance with the License. You may obtain a copy of the License at + http://www.mozilla.org/MPL/ + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the + License for the specific language governing rights and limitations + under the License. + + The Original Code is ______________________________________. + + The Initial Developer of the Original Code is ________________________. + Portions created by ______________________ are Copyright (C) ______ + _______________________. All Rights Reserved. + + Contributor(s): ______________________________________. + + Alternatively, the contents of this file may be used under the terms + of the _____ license (the "[___] License"), in which case the + provisions of [______] License are applicable instead of those + above. If you wish to allow use of your version of this file only + under the terms of the [____] License and not to allow others to use + your version of this file under the MPL, indicate your decision by + deleting the provisions above and replace them with the notice and + other provisions required by the [___] License. If you do not delete + the provisions above, a recipient may use your version of this file + under either the MPL or the [___] License." + + [NOTE: The text of this Exhibit A may differ slightly from the text of + the notices in the Source Code files of the Original Code. You should + use the text of this Exhibit A rather than the text found in the + Original Code Source Code for Your Modifications.] + + + + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 \ No newline at end of file diff --git a/Makefile b/Makefile index 29cf0495..1e781dab 100644 --- a/Makefile +++ b/Makefile @@ -13,21 +13,11 @@ pre_build: build: pre_build ./Makefile.dryice.js normal ./Makefile.dryice.js demo - -# Minimal build: call Makefile.dryice.js only if our sources changed -basic: build/src/ace.js - -build/src/ace.js : ${wildcard lib/*} \ - ${wildcard lib/*/*} \ - ${wildcard lib/*/*/*} \ - ${wildcard lib/*/*/*/*} \ - ${wildcard lib/*/*/*/*/*} \ - ${wildcard lib/*/*/*/*/*/*} - ./Makefile.dryice.js + ./Makefile.dryice.js bm doc: cd doc;\ - (test -d node_modules && npm update) || npm install;\ + test -d node_modules || npm install;\ node build.js clean: diff --git a/Makefile.dryice.js b/Makefile.dryice.js index 0ce7c657..b508f2f0 100755 --- a/Makefile.dryice.js +++ b/Makefile.dryice.js @@ -1,54 +1,58 @@ #!/usr/bin/env node /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. * - * 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. + * The Original Code is Ajax.org Code Editor (ACE). * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * Julian Viereck + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * * ***** END LICENSE BLOCK ***** */ var fs = require("fs"); -var path = require("path"); -var copy = require('architect-build/copy'); -var build = require('architect-build/build'); +if (!fs.existsSync) + fs.existsSync = require("path").existsSync; +var copy = require('dryice').copy; var ACE_HOME = __dirname; var BUILD_DIR = ACE_HOME + "/build"; -var CACHE = {}; function main(args) { - if (args.indexOf("updateModes") !== -1) { - return updateModes(); - } var type = "minimal"; args = args.map(function(x) { if (x[0] == "-" && x[1] != "-") return "-" + x; return x; - }).filter(Boolean); - + }); + if (args[2] && (args[2][0] != "-" || args[2].indexOf("h") != -1)) type = args[2]; @@ -56,71 +60,119 @@ function main(args) { if (i != -1 && args[i+1]) BUILD_DIR = args[i+1]; - if (args.indexOf("--h") == -1) { - if (type == "minimal") { - buildAce({ - compress: args.indexOf("--m") != -1, - noconflict: args.indexOf("--nc") != -1, - shrinkwrap: args.indexOf("--s") != -1 - }); - } else if (type == "normal") { - ace(); - } else if (type == "demo") { - demo(); - } else if (type == "full") { - ace(); - demo(); - } else if (type == "highlighter") { - // TODO - } + if (type == "minimal") { + buildAce({ + compress: args.indexOf("--m") != -1, + noconflict: args.indexOf("--nc") != -1 + }); + } else if (type == "normal") { + ace(); + } else if (type == "demo") { + demo(); + } else if (type == "bm") { + bookmarklet(); + } else if (type == "full") { + ace(); + demo(); + bookmarklet(); } -} - -function showHelp(type) { + console.log("--- Ace Dryice Build Tool ---"); console.log(""); console.log("Options:"); - console.log(" minimal Places necessary Ace files out in build dir; uses configuration flags below [default]"); - console.log(" normal Runs four Ace builds--minimal, minimal-noconflict, minimal-min, and minimal-noconflict-min"); - console.log(" demo Runs demo build of Ace"); - console.log(" full all of above"); - console.log(" highlighter "); - console.log("args:"); - console.log(" --target ./path path to build folder"); + console.log(" normal Runs embedded build of Ace"); + console.log(" demo Runs demo build of Ace"); + console.log(" bm Runs bookmarklet build of Ace"); + console.log(" full all of above"); console.log("flags:"); - console.log(" --h print this help"); - console.log(" --m minify"); - console.log(" --nc namespace require"); - console.log(" --s shrinkwrap (combines all output files into one)"); + console.log(" -m minify"); + console.log(" -nc namespace require"); + console.log(" --target ./path path to build folder"); console.log(""); - if (type) - console.log(" output for " + type + " generated in " + BUILD_DIR); + if (BUILD_DIR) + console.log(" output generated in " + type + __dirname + "/" + BUILD_DIR) + + process.exit(0); + +} + +function bookmarklet() { + var targetDir = BUILD_DIR + "/textarea"; + copy({ + source: "build_support/editor_textarea.html", + dest: targetDir + '/editor.html' + }); + copy({ + source: "build_support/style.css", + dest: targetDir + '/style.css' + }); + + buildAce({ + targetDir: targetDir + "/src", + ns: "__ace_shadowed__", + exportModule: "ace/ext/textarea", + compress: false, + noconflict: true, + suffix: "", + name: "ace-bookmarklet", + workers: [], + keybindings: [] + }); } function ace() { + console.log('# ace ---------'); + + // uncompressed + buildAce({ + compress: false, + noconflict: false + }); + buildAce({ + compress: false, + noconflict: true + }); + + // compressed + buildAce({ + compress: true, + noconflict: false + }); + buildAce({ + compress: true, + noconflict: true + }); + console.log('# ace License | Readme | Changelog ---------'); - copy.file(ACE_HOME + "/build_support/editor.html", BUILD_DIR + "/editor.html"); - copy.file(ACE_HOME + "/LICENSE", BUILD_DIR + "/LICENSE"); - copy.file(ACE_HOME + "/ChangeLog.txt", BUILD_DIR + "/ChangeLog.txt"); - - console.log('# ace ---------'); - for (var i = 0; i < 4; i++) - buildAce({compress: i & 2, noconflict: i & 1}); + copy({ + source: ACE_HOME + "/build_support/editor.html", + dest: BUILD_DIR + "/editor.html" + }); + copy({ + source: ACE_HOME + "/LICENSE", + dest: BUILD_DIR + "/LICENSE" + }); + copy({ + source: ACE_HOME + "/ChangeLog.txt", + dest: BUILD_DIR + "/ChangeLog.txt" + }); } function demo() { console.log('# kitchen sink ---------'); - var version = "", ref = ""; + var version, ref; try { version = JSON.parse(fs.readFileSync(ACE_HOME + "/package.json")).version; ref = fs.readFileSync(ACE_HOME + "/.git-ref").toString(); - } catch(e) {} + } catch(e) { + ref = ""; + version = ""; + } function changeComments(data) { return (data - .replace("doc/site/images/ace-logo.png", "demo/kitchen-sink/ace-logo.png") .replace(//g, "") .replace(/PACKAGE\-\->|")} - function script(str) {result.push('')} - scripts.forEach(function(s) { - s = s.replace(/"/g, ""); - if (s == "ace/ace") { - comment("load ace"); - script("ace"); - } else { - var extName = s.match(/[^/]*$/)[0]; - comment("load ace " + extName + " extension"); - script("ext-" + extName); - } - }); - result.push(" ``` -The mode can then be used like this: +Then the mode can be used like this: ```javascript - var JavaScriptMode = ace.require("ace/mode/javascript").Mode; + var JavaScriptMode = require("ace/mode/javascript").Mode; editor.getSession().setMode(new JavaScriptMode()); ``` +and take a look at the one of [included](https://github.com/ajaxorg/ace-builds/blob/master/editor.html) [demos](https://github.com/ajaxorg/ace/blob/master/demo/kitchen-sink/demo.js) of how to use Ace. + Documentation ------------- -Additional usage information, including events to listen to and extending syntax highlighters, can be found [on the main Ace website](http://ace.c9.io). +You can find api documentation at [http://ajaxorg.github.com/ace/api/index.html](http://ajaxorg.github.com/ace/api/index.html). -You can also find API documentation at [http://ace.c9.io/#nav=api](http://ace.c9.io/#nav=api). +And a lot more sample code in the [demo app](https://github.com/ajaxorg/ace/blob/master/demo/kitchen-sink/demo.js). -Also check out the sample code for the kitchen sink [demo app](https://github.com/ajaxorg/ace/blob/master/demo/kitchen-sink/demo.js). +There is also some documentation on the [wiki page](https://github.com/ajaxorg/ace/wiki). -If you still need help, feel free to drop a mail on the [ace mailing list](http://groups.google.com/group/ace-discuss), or at `irc.freenode.net#ace`. +If you still need help, feel free to drop a mail on the [ace mailing list](http://groups.google.com/group/ace-discuss). Running Ace ----------- -After the checkout Ace works out of the box. No build step is required. To try it out, simply start the bundled mini HTTP server: +After the checkout Ace works out of the box. No build step is required. To open editor with a file:/// URL see [wiki](https://github.com/ajaxorg/ace/wiki/Running-Ace-from-file:---). Or Simply start bundled mini HTTP server: ```bash ./static.py @@ -112,31 +120,16 @@ Or using Node.JS The editor can then be opened at http://localhost:8888/kitchen-sink.html. -To open the editor with a file:/// URL see [the wiki](https://github.com/ajaxorg/ace/wiki/Running-Ace-from-file). - -Building Ace +Package Ace ----------- -You do not generally need to build ACE. The [ace-builds repository](https://github.com/ajaxorg/ace-builds/) endeavours to maintain the latest build, and you can just copy one of _src*_ subdirectories somewhere into your project. - -However, all you need is Node.js and npm installed to package ACE. Just run `npm install` in the ace folder to install dependencies: +To package Ace we use the dryice build tool developed by the Mozilla Skywriter team. (see the [wiki](https://github.com/ajaxorg/ace/wiki/Building-ace) for more details) ```bash npm install node ./Makefile.dryice.js ``` -To package Ace, we use the dryice build tool developed by the Mozilla Skywriter team. Call `node Makefile.dryice.js` on the command-line to start the packing. This build script accepts the following options - -```bash --m minify build files with uglify-js --nc namespace require and define calls with "ace" --bm builds the bookmarklet version ---target ./path specify relative path for output folder (default value is "./build") -``` - -To generate all the files in the ace-builds repository, run `node Makefile.dryice.js full --target ../ace-builds` - Running the Unit Tests ---------------------- @@ -152,17 +145,27 @@ You can also run the tests in your browser by serving: This makes debugging failing tests way more easier. -Contributing ------------------------------ - -Ace is a community project and wouldn't be what it is without contributions! We actively encourage and support contributions. The Ace source code is released under the BSD License. This license is very simple, and is friendly to all kinds of projects, whether open source or not. Take charge of your editor and add your favorite language highlighting and keybindings! - -Feel free to fork and improve/enhance Ace any way you want. If you feel that the editor or the Ace community will benefit from your changes, please open a pull request. For more information on our contributing guidelines, see [CONTRIBUTING.md](https://github.com/ajaxorg/ace/blob/master/CONTRIBUTING.md). - Continuous Integration status ----------------------------- This project is tested with [Travis CI](http://travis-ci.org) -[![Build Status](https://secure.travis-ci.org/ajaxorg/ace.png?branch=master)](http://travis-ci.org/ajaxorg/ace) +[![Build Status](https://secure.travis-ci.org/ajaxorg/ace.png)](http://travis-ci.org/ajaxorg/ace) +Contributing +------------ +Ace wouldn't be what it is without contributions! Feel free to fork and improve/enhance Ace any way you want. If you feel that the editor or the Ace community will benefit from your changes, please open a pull request. To protect the interests of the Ace contributors and users we require contributors to sign a Contributors License Agreement (CLA) before we pull the changes into the main repository. Our CLA is the simplest of agreements, requiring that the contributions you make to an ajax.org project are only those you're allowed to make. This helps us significantly reduce future legal risk for everyone involved. It is easy, helps everyone, takes ten minutes, and only needs to be completed once. There are two versions of the agreement: + +1. [The Individual CLA](https://github.com/ajaxorg/ace/raw/master/doc/Contributor_License_Agreement-v2.pdf): use this version if you're working on an ajax.org in your spare time, or can clearly claim ownership of copyright in what you'll be submitting. +2. [The Corporate CLA](https://github.com/ajaxorg/ace/raw/master/doc/Corporate_Contributor_License_Agreement-v2.pdf): have your corporate lawyer review and submit this if your company is going to be contributing to ajax.org projects + +If you want to contribute to an ajax.org project please print the CLA and fill it out and sign it. Then either send it by snail mail or fax to us or send it back scanned (or as a photo) by email. + +Email: fabian.jakobs@web.de + +Fax: +31 (0) 206388953 + +Address: Ajax.org B.V. + Keizersgracht 241 + 1016 EA, Amsterdam + the Netherlands \ No newline at end of file diff --git a/api/ace.html b/api/ace.html index c0f40b1d..db3f017e 100644 --- a/api/ace.html +++ b/api/ace.html @@ -1,149 +1,14 @@ + + + + Ace - Ace API

The main class required to set up an Ace instance in the browser.

+

Methods

This method embeds the Ace editor into the DOM, at the element provided by el.

+

   

This method embeds the Ace editor into the DOM, at the element provided by el.

+

Arguments

elString | DOMElementRequired. Either the id of an element, or the element itself
+ + + + + \ No newline at end of file diff --git a/api/anchor.html b/api/anchor.html index 727c1cb8..8e7c78de 100644 --- a/api/anchor.html +++ b/api/anchor.html @@ -1,272 +1,26 @@ + + + + Anchor - Ace API

Defines the floating pointer in the document. Whenever text is inserted or deleted before the cursor, the position of the cursor is updated

+

Constructors

Creates a new Anchor and associates it with a document.

+

   

Creates a new Anchor and associates it with a document.

+

Arguments

docDocumentRequired. The document to associate with the anchor
rowNumberRequired. The starting row position
columnNumberRequired. The starting column position

Events

    • Anchor.on("change", function(Event e))

    Fires whenever the anchor position changes. Events that can trigger this function include 'insertText', 'insertLines', 'removeText', and 'removeLines'.

    +

       

    Fires whenever the anchor position changes. Events that can trigger this function include 'insertText', 'insertLines', 'removeText', and 'removeLines'.

    +

    Arguments

    eEventRequired. Contains data about the event

    Methods

      • Internal

    Clips the anchor position to the specified row and column.

    +

       

    Clips the anchor position to the specified row and column.

    +

    Arguments

    rowNumberRequired. The row index to clip the anchor to
    columnNumberRequired. The column index to clip the anchor to
      • Anchor.detach()

      When called, the 'change' event listener is removed.

      +

         

      When called, the 'change' event listener is removed.

      +

      Returns the current document.

      +

         

      Returns the current document.

      +

      Returns an object identifying the row and column position of the current anchor.

      +

         

      Returns an object identifying the row and column position of the current anchor.

      +

      Sets the anchor position to the specified row and column. If noClip is true, the position is not clipped.

      +

         

      Sets the anchor position to the specified row and column. If noClip is true, the position is not clipped.

      +

      Arguments

      rowNumberRequired. The row index to move the anchor to
      columnNumberRequired. The column index to move the anchor to
      noClipBooleanRequired. Identifies if you want the position to be clipped
      + + + + + \ No newline at end of file diff --git a/api/background_tokenizer.html b/api/background_tokenizer.html index a4ef22c2..3e49b546 100644 --- a/api/background_tokenizer.html +++ b/api/background_tokenizer.html @@ -1,320 +1,28 @@ + + + + BackgroundTokenizer - Ace API

      Tokenizes the current Document in the background, and caches the tokenized rows for future use. If a certain row is changed, everything below that row is re-tokenized.

      +

      Constructors

      Creates a new BackgroundTokenizer object.

      +

         

      Creates a new BackgroundTokenizer object.

      +

      Arguments

      tokenizerTokenizerRequired. The tokenizer to use
      editorEditorRequired. The editor to associate with

      Methods

        • BackgroundTokenizer.fireUpdateEvent(Number firstRow, Number lastRow)

        Emits the 'update' event. firstRow and lastRow are used to define the boundaries of the region to be updated.

        +

           

        Emits the 'update' event. firstRow and lastRow are used to define the boundaries of the region to be updated.

        +

        Arguments

        firstRowNumberRequired. The starting row region
        lastRowNumberRequired. The final row region

        Returns the state of tokenization at the end of a row.

        +

           

        Returns the state of tokenization at the end of a row.

        +

        Arguments

        rowNumberRequired. The row to get state at

        Gives list of tokens of the row. (tokens are cached)

        +

           

        Gives list of tokens of the row. (tokens are cached)

        +

        Arguments

        rowNumberRequired. The row to get tokens at
          • BackgroundTokenizer.setDocument(Document doc)

          Sets a new document to associate with this object.

          +

             

          Sets a new document to associate with this object.

          +

          Arguments

          docDocumentRequired. The new document to associate with
            • BackgroundTokenizer.setTokenizer(Tokenizer tokenizer)

            Sets a new tokenizer for this object.

            +

               

            Sets a new tokenizer for this object.

            +

            Arguments

            tokenizerTokenizerRequired. The new tokenizer to use
              • BackgroundTokenizer.start(Number startRow)

              Starts tokenizing at the row indicated.

              +

                 

              Starts tokenizing at the row indicated.

              +

              Arguments

              startRowNumberRequired. The row to start at
                • BackgroundTokenizer.stop()

                Stops tokenizing.

                +

                   

                Stops tokenizing.

                +
                + + + + + \ No newline at end of file diff --git a/api/command_manager.html b/api/command_manager.html index 142ca741..77143c13 100644 --- a/api/command_manager.html +++ b/api/command_manager.html @@ -1,55 +1,13 @@ + + + + CommandManager - Ace API

                Constructors

                TODO

                +

                   

                TODO

                +

                Arguments

                platformStringRequired. Identifier for the platform; must be either 'mac' or 'win'
                commandsArrayRequired. A list of commands
                + + + + + \ No newline at end of file diff --git a/api/document.html b/api/document.html index f1fc2ff5..3fe3280a 100644 --- a/api/document.html +++ b/api/document.html @@ -1,927 +1,60 @@ + + + + Document - Ace API

                Contains the text of the document. Document can be attached to several EditSessions. At its core, Documents are just an array of strings, with each row in the document matching up to the array index.

                +

                Constructors

                Creates a new Document. If text is included, the Document contains those strings; otherwise, it's empty.

                +

                   

                Creates a new Document. If text is included, the Document contains those strings; otherwise, it's empty.

                +

                Arguments

                textString | ArrayRequired. The starting text

                Methods

                  • Document.$clipPosition(position)
                  • Internal

                   

                  • Document.$detectNewLine(text)
                    • Void
                  • Internal

                   

                Splits a string of text on any newline (\n) or carriage-return ('\r') characters.

                +

                   

                Splits a string of text on any newline (\n) or carriage-return ('\r') characters.

                +

                Arguments

                textStringRequired. The text to work with
                  • Document.applyDeltas(deltas)
                    • Void

                  Applies all the changes previously accumulated. These can be either 'includeText', 'insertLines', 'removeText', and 'removeLines'.

                  +

                     

                  Applies all the changes previously accumulated. These can be either 'includeText', 'insertLines', 'removeText', and 'removeLines'.

                  +

                  Creates a new Anchor to define a floating point in the document.

                  +

                     

                  Creates a new Anchor to define a floating point in the document.

                  +

                  Arguments

                  rowNumberRequired. The row number to use
                  columnNumberRequired. The column number to use
                    • Document.getAllLines()

                    Returns all lines in the document as string array. Warning: The caller should not modify this array!

                    +

                       

                    Returns all lines in the document as string array. Warning: The caller should not modify this array!

                    +

                    Returns the number of rows in the document.

                    +

                       

                    Returns the number of rows in the document.

                    +

                    Returns a verbatim copy of the given line as it is in the document

                    +

                       

                    Returns a verbatim copy of the given line as it is in the document

                    +

                    Arguments

                    rowNumberRequired. The row index to retrieve

                    Returns an array of strings of the rows between firstRow and lastRow. This function is inclusive of lastRow.

                    +

                       

                    Returns an array of strings of the rows between firstRow and lastRow. This function is inclusive of lastRow.

                    +

                    Arguments

                    firstRowNumberRequired. The first row index to retrieve
                    lastRowNumberRequired. The final row index to retrieve
                      • Document.getNewLineCharacter()

                      Returns the newline character that's being used, depending on the value of newLineMode.

                      +

                         

                      Returns the newline character that's being used, depending on the value of newLineMode.

                      +
                        • Document.getNewLineMode()

                        Returns the type of newlines being used; either windows, unix, or auto

                        +

                           

                        Returns the type of newlines being used; either windows, unix, or auto

                        +

                        Given a range within the document, this function returns all the text within that range as a single string.

                        +

                           

                        Given a range within the document, this function returns all the text within that range as a single string.

                        +

                        Arguments

                        rangeRangeRequired. The range to work with

                        Returns all the lines in the document as a single string, split by the new line character.

                        +

                           

                        Returns all the lines in the document as a single string, split by the new line character.

                        +

                           

                        Arguments

                        positionNumberRequired. The position to start inserting at
                        textStringRequired. A chunk of text to insert

                        Inserts text into the position at the current row. This method also triggers the 'change' event.

                        +

                           

                        Inserts text into the position at the current row. This method also triggers the 'change' event.

                        +

                        Arguments

                        positionNumberRequired. The position to insert at
                        textStringRequired. A chunk of text

                        Inserts the elements in lines into the document, starting at the row index given by row. This method also triggers the 'change' event.

                        +

                           

                        Inserts the elements in lines into the document, starting at the row index given by row. This method also triggers the 'change' event.

                        +

                        Arguments

                        rowNumberRequired. The index of the row to insert at
                        linesArrayRequired. An array of strings

                        Inserts a new line into the document at the current row's position. This method also triggers the 'change' event.

                        +

                           

                        Inserts a new line into the document at the current row's position. This method also triggers the 'change' event.

                        +

                        Arguments

                        positionStringRequired. The position to insert at

                        Returns true if text is a newline character (either \r\n, \r, or \n).

                        +

                           

                        Returns true if text is a newline character (either \r\n, \r, or \n).

                        +

                        Arguments

                        textStringRequired. The text to check

                        Removes the range from the document.

                        +

                           

                        Removes the range from the document.

                        +

                        Arguments

                        rangeRangeRequired. A specified Range to remove

                        Removes the specified columns from the row. This method also triggers the 'change' event.

                        +

                           

                        Removes the specified columns from the row. This method also triggers the 'change' event.

                        +

                        Arguments

                        rowNumberRequired. The row to remove from
                        startColumnNumberRequired. The column to start removing at
                        endColumnNumberRequired. The column to stop removing at

                        Removes a range of full lines. This method also triggers the 'change' event.

                        +

                           

                        Removes a range of full lines. This method also triggers the 'change' event.

                        +

                        Arguments

                        firstRowNumberRequired. The first row to be removed
                        lastRowNumberRequired. The last row to be removed
                          • Document.removeNewLine(Number row)
                            • Void

                          Removes the new line between row and the row immediately following it. This method also triggers the 'change' event.

                          +

                             

                          Removes the new line between row and the row immediately following it. This method also triggers the 'change' event.

                          +

                          Arguments

                          rowNumberRequired. The row to check

                          Replaces a range in the document with the new text.

                          +

                             

                          Replaces a range in the document with the new text.

                          +

                          Arguments

                          rangeRangeRequired. A specified Range to replace
                          textStringRequired. The new text to use as a replacement
                            • Document.revertDeltas(deltas)
                              • Void

                            Reverts any changes previously applied. These can be either 'includeText', 'insertLines', 'removeText', and 'removeLines'.

                            +

                               

                            Reverts any changes previously applied. These can be either 'includeText', 'insertLines', 'removeText', and 'removeLines'.

                            +
                              • Document.setNewLineMode(String newLineMode)
                                • Void

                              Sets the new line mode.

                              +

                                 

                              Sets the new line mode.

                              +

                              Arguments

                              newLineModeStringRequired. The newline mode to use; can be either windows, unix, or auto
                                • Document.setValue(String text)
                                  • Void

                                Replaces all the lines in the current Document with the value of text.

                                +

                                   

                                Replaces all the lines in the current Document with the value of text.

                                +

                                Arguments

                                textStringRequired. The text to use
                                + + + + + \ No newline at end of file diff --git a/api/edit_session.html b/api/edit_session.html index 11e79ed0..d924a865 100644 --- a/api/edit_session.html +++ b/api/edit_session.html @@ -1,3235 +1,182 @@ - -
                                -
                                -
                                -
                                -
                                -

                                EditSession -

                                - -
                                -
                                -
                                -
                                -

                                Stores all the data about Editor state providing easy way to change editors state.

                                -

                                EditSession can be attached to only one Document. Same Document can be attached to several EditSessions.

                                - -
                                -
                                -
                                -

                                Constructors

                                -
                                -
                                -
                                -
                                - -
                                -
                                -

                                Sets up a new EditSession and associates it with the given Document and TextMode.

                                - -
                                -

                                Sets up a new EditSession and associates it with the given Document and TextMode.

                                - -

                                Arguments

                                textDocument | String

                                Required. If text is a Document, it associates the EditSession with it. Otherwise, a new Document is created, with the initial text

                                -
                                modeTextMode

                                Required. The inital language mode to use for the document

                                -
                                -
                                -
                                -
                                -
                                -
                                -

                                Events

                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.on("change", function(Object e))
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Emitted when the document changes.

                                - -
                                -

                                Emitted when the document changes.

                                - -

                                Arguments

                                eObject

                                Required. An object containing a delta of information about the change.

                                -
                                -
                                -
                                -
                                -
                                -
                                - -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.on("changeBackMarker", function())
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Emitted when a back marker changes.

                                - -
                                -

                                Emitted when a back marker changes.

                                - -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.on("changeBreakpoint", function())
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Emitted when the gutter changes, either by setting or removing breakpoints, or when the gutter decorations change.

                                - -
                                -

                                Emitted when the gutter changes, either by setting or removing breakpoints, or when the gutter decorations change.

                                - -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.on("changeFold", function())
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Emitted when a code fold is added or removed.

                                - -
                                -

                                Emitted when a code fold is added or removed.

                                - -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.on("changeFrontMarker", function())
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Emitted when a front marker changes.

                                - -
                                -

                                Emitted when a front marker changes.

                                - -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.on("changeMode", function())
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Emitted when the current mode changes.

                                - -
                                -

                                Emitted when the current mode changes.

                                - -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.on("changeOverwrite", function())
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Emitted when the ability to overwrite text changes, via EditSession.setOverwrite().

                                - -
                                -

                                Emitted when the ability to overwrite text changes, via EditSession.setOverwrite().

                                - -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.on("changeScrollLeft", function(Number scrollLeft))
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Emitted when the scroll left changes.

                                - -
                                -

                                Emitted when the scroll left changes.

                                - -

                                Arguments

                                scrollLeftNumber

                                Required. The new scroll left value

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.on("changeScrollTop", function(Number scrollTop))
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Emitted when the scroll top changes.

                                - -
                                -

                                Emitted when the scroll top changes.

                                - -

                                Arguments

                                scrollTopNumber

                                Required. The new scroll top value

                                -
                                -
                                -
                                -
                                -
                                -
                                - -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.on("changeWrapLimit", function())
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Emitted when the wrapping limit changes.

                                - -
                                -

                                Emitted when the wrapping limit changes.

                                - -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.on("changeWrapMode", function())
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Emitted when the wrap mode changes.

                                - -
                                -

                                Emitted when the wrap mode changes.

                                - -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.on("tokenizerUpdate", function(Object e))
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Emitted when a background tokenizer asynchronously processes new rows.

                                - -
                                -

                                Emitted when a background tokenizer asynchronously processes new rows.

                                - -

                                Arguments

                                eObject

                                Required. An object containing one property, "data", that contains information about the changing rows

                                -
                                -
                                -
                                -
                                -
                                -
                                -

                                Methods

                                -
                                -
                                -
                                -
                                -
                                  -
                                • - -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Adds a dynamic marker to the session.

                                - -
                                -

                                Adds a dynamic marker to the session.

                                - -

                                Arguments

                                markerObject

                                Required. object with update method

                                -
                                inFrontBoolean

                                Required. Set to true to establish a front marker

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.addGutterDecoration(Number row, String className)
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Adds className to the row, to be used for CSS stylings and whatnot.

                                - -
                                -

                                Adds className to the row, to be used for CSS stylings and whatnot.

                                - -

                                Arguments

                                rowNumber

                                Required. The row number

                                -
                                classNameString

                                Required. The class to add

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                - -
                                -
                                -

                                Adds a new marker to the given Range. If inFront is true, a front marker is defined, and the 'changeFrontMarker' event fires; otherwise, the 'changeBackMarker' event fires.

                                - -
                                -

                                Adds a new marker to the given Range. If inFront is true, a front marker is defined, and the 'changeFrontMarker' event fires; otherwise, the 'changeBackMarker' event fires.

                                - -

                                Arguments

                                rangeRange

                                Required. Define the range of the marker

                                -
                                clazzString

                                Required. Set the CSS class for the marker

                                -
                                typeFunction | String

                                Required. Identify the type of the marker

                                -
                                inFrontBoolean

                                Required. Set to true to establish a front marker

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.clearAnnotations()
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Clears all the annotations for this session. This function also triggers the 'changeAnnotation' event.

                                - -
                                -

                                Clears all the annotations for this session. This function also triggers the 'changeAnnotation' event.

                                - -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.clearBreakpoint(Number row)
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Removes a breakpoint on the row number given by rows. This function also emites the 'changeBreakpoint' event.

                                - -
                                -

                                Removes a breakpoint on the row number given by rows. This function also emites the 'changeBreakpoint' event.

                                - -

                                Arguments

                                rowNumber

                                Required. A row index

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.clearBreakpoints()
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Removes all breakpoints on the rows. This function also emites the 'changeBreakpoint' event.

                                - -
                                -

                                Removes all breakpoints on the rows. This function also emites the 'changeBreakpoint' event.

                                - -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • - -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                For the given document row and column, returns the screen column.

                                - -
                                -

                                For the given document row and column, returns the screen column.

                                - -

                                Arguments

                                rowNumber

                                Required.

                                -
                                docColumnNumber

                                Required.

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.documentToScreenPosition(Number docRow, Number docColumn) -
                                  • - -
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Converts document coordinates to screen coordinates. This takes into account code folding, word wrap, tab size, and any other visual modifications.

                                - -
                                -

                                Converts document coordinates to screen coordinates. This takes into account code folding, word wrap, tab size, and any other visual modifications.

                                - -

                                Arguments

                                docRowNumber

                                Required. The document row to check

                                -
                                docColumnNumber

                                Required. The document column to check

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.documentToScreenRow(Number docRow, Number docColumn)
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                For the given document row and column, returns the screen row.

                                - -
                                -

                                For the given document row and column, returns the screen row.

                                - -

                                Arguments

                                docRowNumber

                                Required.

                                -
                                docColumnNumber

                                Required.

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • - -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Duplicates all the text between firstRow and lastRow.

                                - -
                                -

                                Duplicates all the text between firstRow and lastRow.

                                - -

                                Arguments

                                firstRowNumber

                                Required. The starting row to duplicate

                                -
                                lastRowNumber

                                Required. The final row to duplicate

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.getAnnotations() -
                                  • - -
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Returns the annotations for the EditSession.

                                - -
                                -

                                Returns the annotations for the EditSession.

                                - -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • - -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Gets the range of a word, including its right whitespace.

                                - -
                                -

                                Gets the range of a word, including its right whitespace.

                                - -

                                Arguments

                                rowNumber

                                Required. The row number to start from

                                -
                                columnNumber

                                Required. The column number to start from

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.getBreakpoints() -
                                  • - -
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Returns an array of numbers, indicating which rows have breakpoints.

                                - -
                                -

                                Returns an array of numbers, indicating which rows have breakpoints.

                                - -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.getDocument() -
                                  • - -
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Returns the Document associated with this session.

                                - -
                                -

                                Returns the Document associated with this session.

                                - -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.getDocumentLastRowColumn(Number docRow, Number docColumn)
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                For the given document row and column, this returns the column position of the last screen row.

                                - -
                                -

                                For the given document row and column, this returns the column position of the last screen row.

                                - -

                                Arguments

                                docRowNumber

                                Required.

                                -
                                docColumnNumber

                                Required.

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.getDocumentLastRowColumnPosition(Number docRow, Number docColumn)
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                For the given document row and column, this returns the document position of the last row.

                                - -
                                -

                                For the given document row and column, this returns the document position of the last row.

                                - -

                                Arguments

                                docRowNumber

                                Required.

                                -
                                docColumnNumber

                                Required.

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.getLength() -
                                  • - -
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Returns the number of rows in the document.

                                - -
                                -

                                Returns the number of rows in the document.

                                - -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • - -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Returns a verbatim copy of the given line as it is in the document

                                - -
                                -

                                Returns a verbatim copy of the given line as it is in the document

                                - -

                                Arguments

                                rowNumber

                                Required. The row to retrieve from

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                - -
                                -
                                -

                                Returns an array of strings of the rows between firstRow and lastRow. This function is inclusive of lastRow.

                                - -
                                -

                                Returns an array of strings of the rows between firstRow and lastRow. This function is inclusive of lastRow.

                                - -

                                Arguments

                                firstRowNumber

                                Required. The first row index to retrieve

                                -
                                lastRowNumber

                                Required. The final row index to retrieve

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.getMarkers(Boolean inFront) -
                                  • - -
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Returns an array containing the IDs of all the markers, either front or back.

                                - -
                                -

                                Returns an array containing the IDs of all the markers, either front or back.

                                - -

                                Arguments

                                inFrontBoolean

                                Required. If true, indicates you only want front markers; false indicates only back markers

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.getMode() -
                                  • - -
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Returns the current text mode.

                                - -
                                -

                                Returns the current text mode.

                                - -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.getNewLineMode() -
                                  • - -
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Returns the current new line mode.

                                - -
                                -

                                Returns the current new line mode.

                                - -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.getOverwrite()
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Returns true if overwrites are enabled; false otherwise.

                                - -
                                -

                                Returns true if overwrites are enabled; false otherwise.

                                - -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • - -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Returns number of screenrows in a wrapped line.

                                - -
                                -

                                Returns number of screenrows in a wrapped line.

                                - -

                                Arguments

                                rowNumber

                                Required. The row number to check

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.getRowSplitData(Object row) -
                                  • - -
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                For the given row, this returns the split data.

                                - -
                                -

                                For the given row, this returns the split data.

                                - -

                                Arguments

                                rowObject

                                Required.

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.getScreenLastRowColumn(Number screenRow) -
                                  • - -
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Returns the position (on screen) for the last character in the provided screen row.

                                - -
                                -

                                Returns the position (on screen) for the last character in the provided screen row.

                                - -

                                Arguments

                                screenRowNumber

                                Required. The screen row to check

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.getScreenLength() -
                                  • - -
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Returns the length of the screen.

                                - -
                                -

                                Returns the length of the screen.

                                - -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.getScreenTabSize(Number screenColumn) -
                                  • - -
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                The distance to the next tab stop at the specified screen column.

                                - -
                                -

                                The distance to the next tab stop at the specified screen column.

                                - -

                                Arguments

                                screenColumnNumber

                                Required. The screen column to check

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.getScreenWidth() -
                                  • - -
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Returns the width of the screen.

                                - -
                                -

                                Returns the width of the screen.

                                - -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.getScrollLeft() -
                                  • - -
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Returns the value of the distance between the left of the editor and the leftmost part of the visible content.

                                - -
                                -

                                Returns the value of the distance between the left of the editor and the leftmost part of the visible content.

                                - -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.getScrollTop() -
                                  • - -
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Returns the value of the distance between the top of the editor and the topmost part of the visible content.

                                - -
                                -

                                Returns the value of the distance between the top of the editor and the topmost part of the visible content.

                                - -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.getSelection()
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Returns the string of the current selection.

                                - -
                                -

                                Returns the string of the current selection.

                                - -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.getState(Number row)
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Returns the state of tokenization at the end of a row.

                                - -
                                -

                                Returns the state of tokenization at the end of a row.

                                - -

                                Arguments

                                rowNumber

                                Required. The row to start at

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.getTabSize()
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Returns the current tab size.

                                - -
                                -

                                Returns the current tab size.

                                - -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.getTabString()
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Returns the current value for tabs. If the user is using soft tabs, this will be a series of spaces (defined by getTabSize()); otherwise it's simply '\t'.

                                - -
                                -

                                Returns the current value for tabs. If the user is using soft tabs, this will be a series of spaces (defined by getTabSize()); otherwise it's simply '\t'.

                                - -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.getTextRange(Range range) -
                                  • - -
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Given a range within the document, this function returns all the text within that range as a single string.

                                - -
                                -

                                Given a range within the document, this function returns all the text within that range as a single string.

                                - -

                                Arguments

                                rangeRange

                                Required. The range to work with

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • - -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Returns an object indicating the token at the current row. The object has two properties: index and start.

                                - -
                                -

                                Returns an object indicating the token at the current row. The object has two properties: index and start.

                                - -

                                Arguments

                                rowNumber

                                Required. The row number to retrieve from

                                -
                                columnNumber

                                Required. The column number to retrieve from

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.getTokens(Number row)
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Starts tokenizing at the row indicated. Returns a list of objects of the tokenized rows.

                                - -
                                -

                                Starts tokenizing at the row indicated. Returns a list of objects of the tokenized rows.

                                - -

                                Arguments

                                rowNumber

                                Required. The row to start at

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.getUndoManager()
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Returns the current undo manager.

                                - -
                                -

                                Returns the current undo manager.

                                - -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.getUseSoftTabs() -
                                  • - -
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Returns true if soft tabs are being used, false otherwise.

                                - -
                                -

                                Returns true if soft tabs are being used, false otherwise.

                                - -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.getUseWorker()
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Returns true if workers are being used.

                                - -
                                -

                                Returns true if workers are being used.

                                - -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.getUseWrapMode() -
                                  • - -
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Returns true if wrap mode is being used; false otherwise.

                                - -
                                -

                                Returns true if wrap mode is being used; false otherwise.

                                - -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.getValue() -
                                  • - -
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Returns the current Document as a string.

                                - -
                                -

                                Returns the current Document as a string.

                                - -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • - -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Given a starting row and column, this method returns the Range of the first word boundary it finds.

                                - -
                                -

                                Given a starting row and column, this method returns the Range of the first word boundary it finds.

                                - -

                                Arguments

                                rowNumber

                                Required. The row to start at

                                -
                                columnNumber

                                Required. The column to start at

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.getWrapLimit() -
                                  • - -
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Returns the value of wrap limit.

                                - -
                                -

                                Returns the value of wrap limit.

                                - -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.getWrapLimitRange() -
                                  • - -
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Returns an object that defines the minimum and maximum of the wrap limit; it looks something like this:

                                - -
                                -

                                Returns an object that defines the minimum and maximum of the wrap limit; it looks something like this:

                                -

                                { min: wrapLimitRange_min, max: wrapLimitRange_max }

                                - -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.highlight()
                                  • -
                                  -
                                    -
                                  • Undocumented
                                  • -
                                  -
                                • -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.highlightLines()
                                  • -
                                  -
                                    -
                                  • Undocumented
                                  • -
                                  -
                                • -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • - -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Indents all the rows, from startRow to endRow (inclusive), by prefixing each row with the token in indentString.

                                - -
                                -

                                Indents all the rows, from startRow to endRow (inclusive), by prefixing each row with the token in indentString.

                                -

                                If indentString contains the '\t' character, it's replaced by whatever is defined by getTabString().

                                - -

                                Arguments

                                startRowNumber

                                Required. Starting row

                                -
                                endRowNumber

                                Required. Ending row

                                -
                                indentStringString

                                Required. The indent token

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                - -
                                -
                                -

                                Inserts a block of text and the indicated position.

                                - -
                                -

                                Inserts a block of text and the indicated position.

                                - -

                                Arguments

                                positionObject

                                Required. The position {row, column} to start inserting at

                                -
                                textString

                                Required. A chunk of text to insert

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.isTabStop(Object position)
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Returns true if the character at the position is a soft tab.

                                - -
                                -

                                Returns true if the character at the position is a soft tab.

                                - -

                                Arguments

                                positionObject

                                Required. The position to check

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • - -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Shifts all the lines in the document down one, starting from firstRow and ending at lastRow.

                                - -
                                -

                                Shifts all the lines in the document down one, starting from firstRow and ending at lastRow.

                                - -

                                Arguments

                                firstRowNumber

                                Required. The starting row to move down

                                -
                                lastRowNumber

                                Required. The final row to move down

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • - -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Shifts all the lines in the document up one, starting from firstRow and ending at lastRow.

                                - -
                                -

                                Shifts all the lines in the document up one, starting from firstRow and ending at lastRow.

                                - -

                                Arguments

                                firstRowNumber

                                Required. The starting row to move up

                                -
                                lastRowNumber

                                Required. The final row to move up

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • - -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Moves a range of text from the given range to the given position. toPosition is an object that looks like this:

                                -
                                   { row: newRowLocation, column: newColumnLocation }
                                - -
                                -

                                Moves a range of text from the given range to the given position. toPosition is an object that looks like this:

                                -
                                   { row: newRowLocation, column: newColumnLocation }
                                - -

                                Arguments

                                fromRangeRange

                                Required. The range of text you want moved within the document

                                -
                                toPositionObject

                                Required. The location (row and column) where you want to move the text to

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.onChange()
                                  • -
                                  -
                                    -
                                  • Undocumented
                                  • -
                                  -
                                • -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.onChangeFold()
                                  • -
                                  -
                                    -
                                  • Undocumented
                                  • -
                                  -
                                • -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.onReloadTokenizer(Object e)
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Reloads all the tokens on the current session. This function calls BackgroundTokenizer.start () to all the rows; it also emits the 'tokenizerUpdate' event.

                                - -
                                -

                                Reloads all the tokens on the current session. This function calls BackgroundTokenizer.start () to all the rows; it also emits the 'tokenizerUpdate' event.

                                - -

                                Arguments

                                eObject

                                Required.

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.outdentRows(Range range)
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Outdents all the rows defined by the start and end properties of range.

                                - -
                                -

                                Outdents all the rows defined by the start and end properties of range.

                                - -

                                Arguments

                                rangeRange

                                Required. A range of rows

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.redo()
                                  • -
                                  -
                                    -
                                  • Undocumented
                                  • -
                                  -
                                • -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • - -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Re-implements a previously undone change to your document.

                                - -
                                -

                                Re-implements a previously undone change to your document.

                                - -

                                Arguments

                                deltasArray

                                Required. An array of previous changes

                                -
                                dontSelectBoolean

                                Required. If true, doesn't select the range of where the change occured

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • - -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Removes the range from the document.

                                - -
                                -

                                Removes the range from the document.

                                - -

                                Arguments

                                rangeRange

                                Required. A specified Range to remove

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.removeGutterDecoration(Number row, String className)
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Removes className from the row.

                                - -
                                -

                                Removes className from the row.

                                - -

                                Arguments

                                rowNumber

                                Required. The row number

                                -
                                classNameString

                                Required. The class to add

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.removeMarker(Number markerId)
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Removes the marker with the specified ID. If this marker was in front, the 'changeFrontMarker' event is emitted. If the marker was in the back, the 'changeBackMarker' event is emitted.

                                - -
                                -

                                Removes the marker with the specified ID. If this marker was in front, the 'changeFrontMarker' event is emitted. If the marker was in the back, the 'changeBackMarker' event is emitted.

                                - -

                                Arguments

                                markerIdNumber

                                Required. A number representing a marker

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                - -
                                -
                                -

                                Replaces a range in the document with the new text.

                                - -
                                -

                                Replaces a range in the document with the new text.

                                - -

                                Arguments

                                rangeRange

                                Required. A specified Range to replace

                                -
                                textString

                                Required. The new text to use as a replacement

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.reset()
                                  • -
                                  -
                                    -
                                  • Undocumented
                                  • -
                                  -
                                • -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.resetCaches()
                                  • -
                                  -
                                    -
                                  • Undocumented
                                  • -
                                  -
                                • -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.screenToDocumentColumn()
                                  • -
                                  -
                                    -
                                  • Undocumented
                                  • -
                                  -
                                • -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.screenToDocumentPosition(Number screenRow, Number screenColumn) -
                                  • - -
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Converts characters coordinates on the screen to characters coordinates within the document. This takes into account code folding, word wrap, tab size, and any other visual modifications.

                                - -
                                -

                                Converts characters coordinates on the screen to characters coordinates within the document. This takes into account code folding, word wrap, tab size, and any other visual modifications.

                                - -

                                Arguments

                                screenRowNumber

                                Required. The screen row to check

                                -
                                screenColumnNumber

                                Required. The screen column to check

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.screenToDocumentRow()
                                  • -
                                  -
                                    -
                                  • Undocumented
                                  • -
                                  -
                                • -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.setAnnotations(Array annotations)
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Sets annotations for the EditSession. This functions emits the 'changeAnnotation' event.

                                - -
                                -

                                Sets annotations for the EditSession. This functions emits the 'changeAnnotation' event.

                                - -

                                Arguments

                                annotationsArray

                                Required. A list of annotations

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.setBreakpoint(Number row, String className)
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Sets a breakpoint on the row number given by rows. This function also emites the 'changeBreakpoint' event.

                                - -
                                -

                                Sets a breakpoint on the row number given by rows. This function also emites the 'changeBreakpoint' event.

                                - -

                                Arguments

                                rowNumber

                                Required. A row index

                                -
                                classNameString

                                Required. Class of the breakpoint

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.setBreakpoints(Array rows)
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Sets a breakpoint on every row number given by rows. This function also emites the 'changeBreakpoint' event.

                                - -
                                -

                                Sets a breakpoint on every row number given by rows. This function also emites the 'changeBreakpoint' event.

                                - -

                                Arguments

                                rowsArray

                                Required. An array of row indices

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.setDocument(Document doc)
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Sets the EditSession to point to a new Document. If a BackgroundTokenizer exists, it also points to doc.

                                - -
                                -

                                Sets the EditSession to point to a new Document. If a BackgroundTokenizer exists, it also points to doc.

                                - -

                                Arguments

                                docDocument

                                Required. The new Document to use

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.setMode()
                                  • -
                                  -
                                    -
                                  • Undocumented
                                  • -
                                  -
                                • -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.setNewLineMode(String newLineMode)
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Sets the new line mode.

                                - -
                                -

                                Sets the new line mode.

                                - -

                                Arguments

                                newLineModeString

                                Required. The newline mode to use; can be either windows, unix, or auto

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.setOverwrite(Boolean overwrite)
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Pass in true to enable overwrites in your session, or false to disable.

                                - -
                                -

                                Pass in true to enable overwrites in your session, or false to disable.

                                -

                                If overwrites is enabled, any text you enter will type over any text after it. If the value of overwrite changes, this function also emites the changeOverwrite event.

                                - -

                                Arguments

                                overwriteBoolean

                                Required. Defines wheter or not to set overwrites

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.setScrollLeft(Object scrollLeft)
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Sets the value of the distance between the left of the editor and the leftmost part of the visible content.

                                - -
                                -

                                Sets the value of the distance between the left of the editor and the leftmost part of the visible content.

                                - -

                                Arguments

                                scrollLeftObject

                                Required.

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.setScrollTop(Number scrollTop)
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                This function sets the scroll top value. It also emits the 'changeScrollTop' event.

                                - -
                                -

                                This function sets the scroll top value. It also emits the 'changeScrollTop' event.

                                - -

                                Arguments

                                scrollTopNumber

                                Required. The new scroll top value

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.setTabSize(Number tabSize)
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Set the number of spaces that define a soft tab; for example, passing in 4 transforms the soft tabs to be equivalent to four spaces. This function also emits the changeTabSize event.

                                - -
                                -

                                Set the number of spaces that define a soft tab; for example, passing in 4 transforms the soft tabs to be equivalent to four spaces. This function also emits the changeTabSize event.

                                - -

                                Arguments

                                tabSizeNumber

                                Required. The new tab size

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.setUndoManager(UndoManager undoManager)
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Sets the undo manager.

                                - -
                                -

                                Sets the undo manager.

                                - -

                                Arguments

                                undoManagerUndoManager

                                Required. The new undo manager

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.setUndoSelect(Boolean enable)
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Enables or disables highlighting of the range where an undo occured.

                                - -
                                -

                                Enables or disables highlighting of the range where an undo occured.

                                - -

                                Arguments

                                enableBoolean

                                Required. If true, selects the range of the reinserted change

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.setUseSoftTabs(Boolean useSoftTabs)
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Pass true to enable the use of soft tabs. Soft tabs means you're using spaces instead of the tab character ('\t').

                                - -
                                -

                                Pass true to enable the use of soft tabs. Soft tabs means you're using spaces instead of the tab character ('\t').

                                - -

                                Arguments

                                useSoftTabsBoolean

                                Required. Value indicating whether or not to use soft tabs

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.setUseWorker(Boolean useWorker)
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Identifies if you want to use a worker for the EditSession.

                                - -
                                -

                                Identifies if you want to use a worker for the EditSession.

                                - -

                                Arguments

                                useWorkerBoolean

                                Required. Set to true to use a worker

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.setUseWrapMode(Boolean useWrapMode)
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Sets whether or not line wrapping is enabled. If useWrapMode is different than the current value, the 'changeWrapMode' event is emitted.

                                - -
                                -

                                Sets whether or not line wrapping is enabled. If useWrapMode is different than the current value, the 'changeWrapMode' event is emitted.

                                - -

                                Arguments

                                useWrapModeBoolean

                                Required. Enable (or disable) wrap mode

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.setValue(String text)
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Sets the session text.

                                - -
                                -

                                Sets the session text.

                                - -

                                Arguments

                                textString

                                Required. The new text to place

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • - -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                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.

                                - -
                                -

                                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.

                                - -

                                Arguments

                                minNumber

                                Required. The minimum wrap value (the left side wrap)

                                -
                                maxNumber

                                Required. The maximum wrap value (the right side wrap)

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.toggleOverwrite()
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Sets the value of overwrite to the opposite of whatever it currently is.

                                - -
                                -

                                Sets the value of overwrite to the opposite of whatever it currently is.

                                - -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.toString() -
                                  • - -
                                  • -
                                  -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Returns the current Document as a string.

                                - -
                                -

                                Returns the current Document as a string.

                                - -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • -
                                    -
                                  • EditSession.undo()
                                  • -
                                  -
                                    -
                                  • Undocumented
                                  • -
                                  -
                                • -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                  -
                                • - -
                                    -
                                  -
                                • -
                                -
                                -
                                -

                                Reverts previous changes to your document.

                                - -
                                -

                                Reverts previous changes to your document.

                                - -

                                Arguments

                                deltasArray

                                Required. An array of previous changes

                                -
                                dontSelectBoolean

                                Required. If true, doesn't select the range of where the change occured

                                -
                                -
                                -
                                -
                                -
                                -
                                -
                                - - - - - -
                                -
                                \ No newline at end of file + + + + EditSession - Ace API

                                Stores all the data about Editor state providing easy way to change editors state. EditSession can be attached to only one Document. Same Document can be attached to several EditSessions.

                                +

                                Constructors

                                Sets up a new EditSession and associates it with the given Document and TextMode.

                                +

                                   

                                Sets up a new EditSession and associates it with the given Document and TextMode.

                                +

                                Arguments

                                textDocument | StringRequired. If text is a Document, it associates the EditSession with it. Otherwise, a new Document is created, with the initial text
                                modeTextModeRequired. The inital language mode to use for the document

                                Events

                                  • EditSession.on("change", function(e))

                                  Emitted when the document changes.

                                  +

                                     

                                  Emitted when the document changes.

                                  +
                                    • EditSession.on("changeFold", function(e))

                                    Emitted when a code fold added or removed.

                                    +

                                       

                                    Emitted when a code fold added or removed.

                                    +
                                      • EditSession.on("changeScrollLeft", function())

                                      Emitted when the scroll left changes.

                                      +

                                         

                                      Emitted when the scroll left changes.

                                      +
                                        • EditSession.on("changeScrollTop", function())

                                        Emitted when the scroll top changes.

                                        +

                                           

                                        Emitted when the scroll top changes.

                                        +
                                          • EditSession.on("tokenizerUpdate", function(e))

                                          Emitted when a background tokenizer asynchronousely processes new rows.

                                          +

                                             

                                          Emitted when a background tokenizer asynchronousely processes new rows.

                                          +

                                          Methods

                                            • EditSession.$computeWrapSplits(tokens, wrapLimit)
                                            • Internal

                                             

                                            • EditSession.$constrainWrapLimit(wrapLimit)
                                            • Internal

                                             

                                            • EditSession.$detectNewLine(String text)
                                            • Internal

                                          If text contains either the newline (\n) or carriage-return ('\r') characters, $autoNewLine stores that value.

                                          +

                                             

                                          If text contains either the newline (\n) or carriage-return ('\r') characters, $autoNewLine stores that value.

                                          +

                                          Arguments

                                          textStringRequired. A block of text

                                          Given a string, returns an array of the display characters, including tabs and spaces.

                                          +

                                             

                                          Given a string, returns an array of the display characters, including tabs and spaces.

                                          +

                                          Arguments

                                          strStringRequired. The string to check
                                          offsetNumberRequired. The value to start at

                                          Calculates the width of the string str on the screen while assuming that the string starts at the first column on the screen.

                                          +

                                             

                                          Calculates the width of the string str on the screen while assuming that the string starts at the first column on the screen.

                                          +

                                          Arguments

                                          strStringRequired. The string to calculate the screen width of
                                          maxScreenColumnNumberRequired.
                                          screenColumnNumberRequired.
                                            • EditSession.$getUndoSelection(deltas, isUndo, lastUndoRange)
                                            • Internal

                                             

                                            • EditSession.$resetRowCache(Number row)
                                            • Internal

                                             

                                          Arguments

                                          rowNumberRequired. The row to work with
                                            • EditSession.$startWorker()
                                            • Internal

                                             

                                            • EditSession.$syncInformUndoManager()
                                            • Internal

                                             

                                            • EditSession.$updateInternalDataOnChange()
                                            • Internal

                                             

                                            • EditSession.$updateWrapData(firstRow, lastRow)
                                            • Internal

                                             

                                          Adds a dynamic marker to the session.

                                          +

                                             

                                          Adds a dynamic marker to the session.

                                          +

                                          Arguments

                                          markerObjectRequired. object with update method
                                          inFrontBooleanRequired. Set to true to establish a front marker
                                            • EditSession.addGutterDecoration(Number row, String className)
                                              • Void

                                            Adds className to the row, to be used for CSS stylings and whatnot.

                                            +

                                               

                                            Adds className to the row, to be used for CSS stylings and whatnot.

                                            +

                                            Arguments

                                            rowNumberRequired. The row number
                                            classNameStringRequired. The class to add

                                            Adds a new marker to the given Range. If inFront is true, a front marker is defined, and the 'changeFrontMarker' event fires; otherwise, the 'changeBackMarker' event fires.

                                            +

                                               

                                            Adds a new marker to the given Range. If inFront is true, a front marker is defined, and the 'changeFrontMarker' event fires; otherwise, the 'changeBackMarker' event fires.

                                            +

                                            Arguments

                                            rangeRangeRequired. Define the range of the marker
                                            clazzStringRequired. Set the CSS class for the marker
                                            typeFunction | StringRequired. Identify the type of the marker
                                            inFrontBooleanRequired. Set to true to establish a front marker

                                            This should generally only be called by the renderer when a resize is detected.

                                            +

                                               

                                            This should generally only be called by the renderer when a resize is detected.

                                            +

                                            Arguments

                                            desiredLimitNumberRequired. The new wrap limit
                                              • EditSession.clearAnnotations()

                                              Clears all the annotations for this session. This function also triggers the 'changeAnnotation' event.

                                              +

                                                 

                                              Clears all the annotations for this session. This function also triggers the 'changeAnnotation' event.

                                              +
                                                • EditSession.clearBreakpoint(Number row)

                                                Removes a breakpoint on the row number given by rows. This function also emites the 'changeBreakpoint' event.

                                                +

                                                   

                                                Removes a breakpoint on the row number given by rows. This function also emites the 'changeBreakpoint' event.

                                                +

                                                Arguments

                                                rowNumberRequired. A row index
                                                  • EditSession.clearBreakpoints()

                                                  Removes all breakpoints on the rows. This function also emites the 'changeBreakpoint' event.

                                                  +

                                                     

                                                  Removes all breakpoints on the rows. This function also emites the 'changeBreakpoint' event.

                                                  +
                                                    • EditSession.documentToScreenColumn(row, docColumn)
                                                    • Internal

                                                     

                                                  Converts document coordinates to screen coordinates. This takes into account code folding, word wrap, tab size, and any other visual modifications.

                                                  +

                                                     

                                                  Converts document coordinates to screen coordinates. This takes into account code folding, word wrap, tab size, and any other visual modifications.

                                                  +

                                                  Arguments

                                                  docRowNumberRequired. The document row to check
                                                  docColumnNumberRequired. The document column to check
                                                    • EditSession.documentToScreenRow(docRow, docColumn)
                                                    • Internal

                                                     

                                                  Duplicates all the text between firstRow and lastRow.

                                                  +

                                                     

                                                  Duplicates all the text between firstRow and lastRow.

                                                  +

                                                  Arguments

                                                  firstRowNumberRequired. The starting row to duplicate
                                                  lastRowNumberRequired. The final row to duplicate
                                                    • EditSession.getAnnotations()

                                                    Returns the annotations for the EditSession.

                                                    +

                                                       

                                                    Returns the annotations for the EditSession.

                                                    +

                                                    Gets the range of a word, including its right whitespace.

                                                    +

                                                       

                                                    Gets the range of a word, including its right whitespace.

                                                    +

                                                    Arguments

                                                    rowNumberRequired. The row number to start from
                                                    columnNumberRequired. The column number to start from
                                                      • EditSession.getBreakpoints()

                                                      Returns an array of numbers, indicating which rows have breakpoints.

                                                      +

                                                         

                                                      Returns an array of numbers, indicating which rows have breakpoints.

                                                      +

                                                      Returns the Document associated with this session.

                                                      +

                                                         

                                                      Returns the Document associated with this session.

                                                      +
                                                        • EditSession.getDocumentLastRowColumnPosition(docRow, docColumn)
                                                        • Internal

                                                         

                                                      Returns the number of rows in the document.

                                                      +

                                                         

                                                      Returns the number of rows in the document.

                                                      +

                                                      Returns a verbatim copy of the given line as it is in the document

                                                      +

                                                         

                                                      Returns a verbatim copy of the given line as it is in the document

                                                      +

                                                      Arguments

                                                      rowNumberRequired. The row to retrieve from

                                                      Returns an array of strings of the rows between firstRow and lastRow. This function is inclusive of lastRow.

                                                      +

                                                         

                                                      Returns an array of strings of the rows between firstRow and lastRow. This function is inclusive of lastRow.

                                                      +

                                                      Arguments

                                                      firstRowNumberRequired. The first row index to retrieve
                                                      lastRowNumberRequired. The final row index to retrieve

                                                      Returns an array containing the IDs of all the markers, either front or back.

                                                      +

                                                         

                                                      Returns an array containing the IDs of all the markers, either front or back.

                                                      +

                                                      Arguments

                                                      inFrontBooleanRequired. If true, indicates you only want front markers; false indicates only back markers

                                                      Returns the current text mode.

                                                      +

                                                         

                                                      Returns the current text mode.

                                                      +

                                                      Returns the current new line mode.

                                                      +

                                                         

                                                      Returns the current new line mode.

                                                      +

                                                      Returns true if overwrites are enabled; false otherwise.

                                                      +

                                                         

                                                      Returns true if overwrites are enabled; false otherwise.

                                                      +

                                                      Returns number of screenrows in a wrapped line.

                                                      +

                                                         

                                                      Returns number of screenrows in a wrapped line.

                                                      +

                                                      Arguments

                                                      rowNumberRequired. The row number to check
                                                        • EditSession.getRowSplitData(row)
                                                        • Internal

                                                         

                                                      Returns the column position (on screen) for the last character in the provided row.

                                                      +

                                                         

                                                      Returns the column position (on screen) for the last character in the provided row.

                                                      +

                                                      Arguments

                                                      screenRowNumberRequired. The screen row to check
                                                        • EditSession.getScreenLength()

                                                        Returns the length of the screen.

                                                        +

                                                           

                                                        Returns the length of the screen.

                                                        +

                                                        The distance to the next tab stop at the specified screen column.

                                                        +

                                                           

                                                        The distance to the next tab stop at the specified screen column.

                                                        +

                                                        Arguments

                                                        screenColumnNumberRequired. The screen column to check
                                                          • EditSession.getScreenWidth()

                                                          Returns the width of the screen.

                                                          +

                                                             

                                                          Returns the width of the screen.

                                                          +
                                                            • EditSession.getScrollLeft()

                                                            Returns the value of the distance between the left of the editor and the leftmost part of the visible content.

                                                            +

                                                               

                                                            Returns the value of the distance between the left of the editor and the leftmost part of the visible content.

                                                            +
                                                              • EditSession.getScrollTop()

                                                              Returns the value of the distance between the top of the editor and the topmost part of the visible content.

                                                              +

                                                                 

                                                              Returns the value of the distance between the top of the editor and the topmost part of the visible content.

                                                              +
                                                                • EditSession.getSelection()

                                                                Returns the string of the current selection.

                                                                +

                                                                   

                                                                Returns the string of the current selection.

                                                                +

                                                                Returns the state of tokenization at the end of a row.

                                                                +

                                                                   

                                                                Returns the state of tokenization at the end of a row.

                                                                +

                                                                Arguments

                                                                rowNumberRequired. The row to start at
                                                                  • EditSession.getTabSize()

                                                                  Returns the current tab size.

                                                                  +

                                                                     

                                                                  Returns the current tab size.

                                                                  +
                                                                    • EditSession.getTabString()

                                                                    Returns the current value for tabs. If the user is using soft tabs, this will be a series of spaces (defined by getTabSize); otherwise it's simply '\t'.

                                                                    +

                                                                       

                                                                    Returns the current value for tabs. If the user is using soft tabs, this will be a series of spaces (defined by getTabSize); otherwise it's simply '\t'.

                                                                    +

                                                                    Given a range within the document, this function returns all the text within that range as a single string.

                                                                    +

                                                                       

                                                                    Given a range within the document, this function returns all the text within that range as a single string.

                                                                    +

                                                                    Arguments

                                                                    rangeStringRequired. The range to work with

                                                                    Returns an array of tokens at the indicated row and column.

                                                                    +

                                                                       

                                                                    Returns an array of tokens at the indicated row and column.

                                                                    +

                                                                    Arguments

                                                                    rowNumberRequired. The row number to retrieve from
                                                                    columnNumberRequired. The column number to retrieve from

                                                                    Starts tokenizing at the row indicated. Returns a list of objects of the tokenized rows.

                                                                    +

                                                                       

                                                                    Starts tokenizing at the row indicated. Returns a list of objects of the tokenized rows.

                                                                    +

                                                                    Arguments

                                                                    rowNumberRequired. The row to start at

                                                                    Returns the current undo manager.

                                                                    +

                                                                       

                                                                    Returns the current undo manager.

                                                                    +
                                                                      • EditSession.getUseSoftTabs()

                                                                      Returns true if soft tabs are being used, false otherwise.

                                                                      +

                                                                         

                                                                      Returns true if soft tabs are being used, false otherwise.

                                                                      +

                                                                      Returns true if workers are being used.

                                                                      +

                                                                         

                                                                      Returns true if workers are being used.

                                                                      +
                                                                        • EditSession.getUseWrapMode()

                                                                        Returns true if wrap mode is being used; false otherwise.

                                                                        +

                                                                           

                                                                        Returns true if wrap mode is being used; false otherwise.

                                                                        +

                                                                        Given a starting row and column, this method returns the Range of the first word boundary it finds.

                                                                        +

                                                                           

                                                                        Given a starting row and column, this method returns the Range of the first word boundary it finds.

                                                                        +

                                                                        Arguments

                                                                        rowNumberRequired. The row to start at
                                                                        columnNumberRequired. The column to start at
                                                                          • EditSession.getWrapLimit()

                                                                          Returns the value of wrap limit.

                                                                          +

                                                                             

                                                                          Returns the value of wrap limit.

                                                                          +
                                                                            • EditSession.getWrapLimitRange()

                                                                            Returns an object that defines the minimum and maximum of the wrap limit; it looks something like this:

                                                                            +

                                                                               

                                                                            Returns an object that defines the minimum and maximum of the wrap limit; it looks something like this:

                                                                            +
                                                                            { min: wrapLimitRange_min, max: wrapLimitRange_max }
                                                                            +

                                                                            Indents all the rows, from startRow to endRow (inclusive), by prefixing each row with the token in indentString.

                                                                            +

                                                                               

                                                                            Indents all the rows, from startRow to endRow (inclusive), by prefixing each row with the token in indentString.

                                                                            +

                                                                            If indentString contains the '\t' character, it's replaced by whatever is defined by getTabString.

                                                                            +

                                                                            Arguments

                                                                            startRowNumberRequired. Starting row
                                                                            endRowNumberRequired. Ending row
                                                                            indentStringStringRequired. The indent token

                                                                            Inserts a block of text and the indicated position.

                                                                            +

                                                                               

                                                                            Inserts a block of text and the indicated position.

                                                                            +

                                                                            Arguments

                                                                            positionNumberRequired. The position to start inserting at
                                                                            textStringRequired. A chunk of text to insert

                                                                            Returns true if the character at the position is a soft tab.

                                                                            +

                                                                               

                                                                            Returns true if the character at the position is a soft tab.

                                                                            +

                                                                            Arguments

                                                                            positionObjectRequired. The position to check

                                                                            Shifts all the lines in the document up one, starting from firstRow and ending at lastRow.

                                                                            +

                                                                               

                                                                            Shifts all the lines in the document up one, starting from firstRow and ending at lastRow.

                                                                            +

                                                                            Arguments

                                                                            firstRowNumberRequired. The starting row to move up
                                                                            lastRowNumberRequired. The final row to move up

                                                                            { row: newRowLocation, column: newColumnLocation }

                                                                            +

                                                                               

                                                                            { row: newRowLocation, column: newColumnLocation }

                                                                            +

                                                                            Arguments

                                                                            fromRangeRangeRequired. The range of text you want moved within the document
                                                                            toPositionObjectRequired. The location (row and column) where you want to move the text to
                                                                              • EditSession.onReloadTokenizer(e)

                                                                              Reloads all the tokens on the current session. This function calls start to all the rows; it also emits the 'tokenizerUpdate' event.

                                                                              +

                                                                                 

                                                                              Reloads all the tokens on the current session. This function calls start to all the rows; it also emits the 'tokenizerUpdate' event.

                                                                              +
                                                                                • EditSession.outdentRows(Range range)

                                                                                Outdents all the rows defined by the start and end properties of range.

                                                                                +

                                                                                   

                                                                                Outdents all the rows defined by the start and end properties of range.

                                                                                +

                                                                                Arguments

                                                                                rangeRangeRequired. A range of rows

                                                                                Re-implements a previously undone change to your document.

                                                                                +

                                                                                   

                                                                                Re-implements a previously undone change to your document.

                                                                                +

                                                                                Arguments

                                                                                deltasArrayRequired. An array of previous changes
                                                                                dontSelectBooleanRequired. If true, doesn't select the range of where the change occured

                                                                                Removes the range from the document.

                                                                                +

                                                                                   

                                                                                Removes the range from the document.

                                                                                +

                                                                                Arguments

                                                                                rangeRangeRequired. A specified Range to remove
                                                                                  • EditSession.removeGutterDecoration(Number row, String className)
                                                                                    • Void

                                                                                  Removes className from the row.

                                                                                  +

                                                                                     

                                                                                  Removes className from the row.

                                                                                  +

                                                                                  Arguments

                                                                                  rowNumberRequired. The row number
                                                                                  classNameStringRequired. The class to add
                                                                                    • EditSession.removeMarker(Number markerId)

                                                                                    Removes the marker with the specified ID. If this marker was in front, the 'changeFrontMarker' event is emitted. If the marker was in the back, the 'changeBackMarker' event is emitted.

                                                                                    +

                                                                                       

                                                                                    Removes the marker with the specified ID. If this marker was in front, the 'changeFrontMarker' event is emitted. If the marker was in the back, the 'changeBackMarker' event is emitted.

                                                                                    +

                                                                                    Arguments

                                                                                    markerIdNumberRequired. A number representing a marker

                                                                                    Replaces a range in the document with the new text.

                                                                                    +

                                                                                       

                                                                                    Replaces a range in the document with the new text.

                                                                                    +

                                                                                    Arguments

                                                                                    rangeRangeRequired. A specified Range to replace
                                                                                    textStringRequired. The new text to use as a replacement
                                                                                      • EditSession.screenToDocumentColumn(screenRow, screenColumn)
                                                                                      • Internal

                                                                                       

                                                                                    Converts characters coordinates on the screen to characters coordinates within the document. This takes into account code folding, word wrap, tab size, and any other visual modifications.

                                                                                    +

                                                                                       

                                                                                    Converts characters coordinates on the screen to characters coordinates within the document. This takes into account code folding, word wrap, tab size, and any other visual modifications.

                                                                                    +

                                                                                    Arguments

                                                                                    screenRowNumberRequired. The screen row to check
                                                                                    screenColumnNumberRequired. The screen column to check
                                                                                      • EditSession.screenToDocumentRow(screenRow, screenColumn)
                                                                                      • Internal

                                                                                       

                                                                                      • EditSession.setAnnotations(Array annotations)

                                                                                      Sets annotations for the EditSession. This functions emits the 'changeAnnotation' event.

                                                                                      +

                                                                                         

                                                                                      Sets annotations for the EditSession. This functions emits the 'changeAnnotation' event.

                                                                                      +

                                                                                      Arguments

                                                                                      annotationsArrayRequired. A list of annotations

                                                                                      Sets a breakpoint on the row number given by rows. This function also emites the 'changeBreakpoint' event.

                                                                                      +

                                                                                         

                                                                                      Sets a breakpoint on the row number given by rows. This function also emites the 'changeBreakpoint' event.

                                                                                      +

                                                                                      Arguments

                                                                                      rowNumberRequired. A row index
                                                                                      classNameStringRequired. Class of the breakpoint
                                                                                        • EditSession.setBreakpoints(Array rows)

                                                                                        Sets a breakpoint on every row number given by rows. This function also emites the 'changeBreakpoint' event.

                                                                                        +

                                                                                           

                                                                                        Sets a breakpoint on every row number given by rows. This function also emites the 'changeBreakpoint' event.

                                                                                        +

                                                                                        Arguments

                                                                                        rowsArrayRequired. An array of row indicies

                                                                                        Sets the EditSession to point to a new Document. If a BackgroundTokenizer exists, it also points to doc.

                                                                                        +

                                                                                           

                                                                                        Sets the EditSession to point to a new Document. If a BackgroundTokenizer exists, it also points to doc.

                                                                                        +

                                                                                        Arguments

                                                                                        docDocumentRequired. The new Document to use

                                                                                        Sets a new text mode for the EditSession. This method also emits the 'changeMode' event. If a BackgroundTokenizer is set, the 'tokenizerUpdate' event is also emitted.

                                                                                        +

                                                                                           

                                                                                        Sets a new text mode for the EditSession. This method also emits the 'changeMode' event. If a BackgroundTokenizer is set, the 'tokenizerUpdate' event is also emitted.

                                                                                        +

                                                                                        Arguments

                                                                                        modeTextModeRequired. Set a new text mode

                                                                                        Sets the new line mode.

                                                                                        +

                                                                                           

                                                                                        Sets the new line mode.

                                                                                        +

                                                                                        Arguments

                                                                                        newLineModeStringRequired. The newline mode to use; can be either windows, unix, or auto
                                                                                          • EditSession.setOverwrite(Boolean overwrite)

                                                                                          Pass in true to enable overwrites in your session, or false to disable. If overwrites is enabled, any text you enter will type over any text after it. If the value of overwrite changes, this function also emites the changeOverwrite event.

                                                                                          +

                                                                                             

                                                                                          Pass in true to enable overwrites in your session, or false to disable. If overwrites is enabled, any text you enter will type over any text after it. If the value of overwrite changes, this function also emites the changeOverwrite event.

                                                                                          +

                                                                                          Arguments

                                                                                          overwriteBooleanRequired. Defines wheter or not to set overwrites
                                                                                            • EditSession.setScrollLeft(scrollLeft)

                                                                                            Sets the value of the distance between the left of the editor and the leftmost part of the visible content.

                                                                                            +

                                                                                               

                                                                                            Sets the value of the distance between the left of the editor and the leftmost part of the visible content.

                                                                                            +
                                                                                              • EditSession.setScrollTop(Number scrollTop)

                                                                                              This function sets the scroll top value. It also emits the 'changeScrollTop' event.

                                                                                              +

                                                                                                 

                                                                                              This function sets the scroll top value. It also emits the 'changeScrollTop' event.

                                                                                              +

                                                                                              Arguments

                                                                                              scrollTopNumberRequired. The new scroll top value
                                                                                                • EditSession.setTabSize(Number tabSize)

                                                                                                Set the number of spaces that define a soft tab; for example, passing in 4 transforms the soft tabs to be equivalent to four spaces. This function also emits the changeTabSize event.

                                                                                                +

                                                                                                   

                                                                                                Set the number of spaces that define a soft tab; for example, passing in 4 transforms the soft tabs to be equivalent to four spaces. This function also emits the changeTabSize event.

                                                                                                +

                                                                                                Arguments

                                                                                                tabSizeNumberRequired. The new tab size

                                                                                                Sets the undo manager.

                                                                                                +

                                                                                                   

                                                                                                Sets the undo manager.

                                                                                                +

                                                                                                Arguments

                                                                                                undoManagerUndoManagerRequired. The new undo manager
                                                                                                  • EditSession.setUndoSelect(Boolean enable)

                                                                                                  ENables or disables highlighting of the range where an undo occured.

                                                                                                  +

                                                                                                     

                                                                                                  ENables or disables highlighting of the range where an undo occured.

                                                                                                  +

                                                                                                  Arguments

                                                                                                  enableBooleanRequired. If true, selects the range of the reinserted change
                                                                                                    • EditSession.setUseSoftTabs(Boolean useSoftTabs)

                                                                                                    Pass true to enable the use of soft tabs. Soft tabs means you're using spaces instead of the tab character ('\t').

                                                                                                    +

                                                                                                       

                                                                                                    Pass true to enable the use of soft tabs. Soft tabs means you're using spaces instead of the tab character ('\t').

                                                                                                    +

                                                                                                    Arguments

                                                                                                    useSoftTabsBooleanRequired. Value indicating whether or not to use soft tabs
                                                                                                      • EditSession.setUseWorker(Boolean useWorker)

                                                                                                      Identifies if you want to use a worker for the EditSession.

                                                                                                      +

                                                                                                         

                                                                                                      Identifies if you want to use a worker for the EditSession.

                                                                                                      +

                                                                                                      Arguments

                                                                                                      useWorkerBooleanRequired. Set to true to use a worker
                                                                                                        • EditSession.setUseWrapMode(Boolean useWrapMode)

                                                                                                        Sets whether or not line wrapping is enabled. If useWrapMode is different than the current value, the 'changeWrapMode' event is emitted.

                                                                                                        +

                                                                                                           

                                                                                                        Sets whether or not line wrapping is enabled. If useWrapMode is different than the current value, the 'changeWrapMode' event is emitted.

                                                                                                        +

                                                                                                        Arguments

                                                                                                        useWrapModeBooleanRequired. Enable (or disable) wrap mode
                                                                                                          • EditSession.setValue(String text)

                                                                                                          Sets the session text.

                                                                                                          +

                                                                                                             

                                                                                                          Sets the session text.

                                                                                                          +

                                                                                                          Arguments

                                                                                                          textStringRequired. The new text to place

                                                                                                          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.

                                                                                                          +

                                                                                                             

                                                                                                          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.

                                                                                                          +

                                                                                                          Arguments

                                                                                                          minNumberRequired. The minimum wrap value (the left side wrap)
                                                                                                          maxNumberRequired. The maximum wrap value (the right side wrap)
                                                                                                            • EditSession.stopWorker()
                                                                                                            • Internal

                                                                                                             

                                                                                                            • EditSession.toggleOverwrite()

                                                                                                            Sets the value of overwrite to the opposite of whatever it currently is.

                                                                                                            +

                                                                                                               

                                                                                                            Sets the value of overwrite to the opposite of whatever it currently is.

                                                                                                            +

                                                                                                            Reverts previous changes to your document.

                                                                                                            +

                                                                                                               

                                                                                                            Reverts previous changes to your document.

                                                                                                            +

                                                                                                            Arguments

                                                                                                            deltasArrayRequired. An array of previous changes
                                                                                                            dontSelectBooleanRequired. If true, doesn't select the range of where the change occured
                                                                                                            + + + + + \ No newline at end of file diff --git a/api/editor.html b/api/editor.html index 6ffe4369..e2b7c172 100644 --- a/api/editor.html +++ b/api/editor.html @@ -1,4689 +1,278 @@ - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Editor -

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            The main entry point into the Ace functionality.

                                                                                                            -

                                                                                                            The Editor manages the EditSession (which manages Documents), as well as the VirtualRenderer, which draws everything to the screen.

                                                                                                            -

                                                                                                            Event sessions dealing with the mouse and keyboard are bubbled up from Document to the Editor, which decides what to do with them.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Constructors

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            - -
                                                                                                            -
                                                                                                            -

                                                                                                            Creates a new Editor object.

                                                                                                            - -
                                                                                                            -

                                                                                                            Creates a new Editor object.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            rendererVirtualRenderer

                                                                                                            Required. Associated VirtualRenderer that draws everything

                                                                                                            -
                                                                                                            sessionEditSession

                                                                                                            Required. The EditSession to refer to

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Events

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.on("blur", function())
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Emitted once the editor has been blurred.

                                                                                                            - -
                                                                                                            -

                                                                                                            Emitted once the editor has been blurred.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.on("change", function(Object e))
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Emitted whenever the document is changed.

                                                                                                            - -
                                                                                                            -

                                                                                                            Emitted whenever the document is changed.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            eObject

                                                                                                            Required. Contains a single property, data, which has the delta of changes

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.on("changeSelectionStyle", function(Object data))
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Emitted when the selection style changes, via Editor.setSelectionStyle().

                                                                                                            - -
                                                                                                            -

                                                                                                            Emitted when the selection style changes, via Editor.setSelectionStyle().

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            dataObject

                                                                                                            Required. Contains one property, data, which indicates the new selection style

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.on("changeSession", function(Object e))
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Emitted whenever the EditSession changes.

                                                                                                            - -
                                                                                                            -

                                                                                                            Emitted whenever the EditSession changes.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            eObject

                                                                                                            Required. An object with two properties, oldSession and session, that represent the old and new EditSessions.

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.on("copy", function(String text))
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Emitted when text is copied.

                                                                                                            - -
                                                                                                            -

                                                                                                            Emitted when text is copied.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            textString

                                                                                                            Required. The copied text

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.on("focus", function())
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Emitted once the editor comes into focus.

                                                                                                            - -
                                                                                                            -

                                                                                                            Emitted once the editor comes into focus.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.on("paste", function(Object e))
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Emitted when text is pasted.

                                                                                                            - -
                                                                                                            -

                                                                                                            Emitted when text is pasted.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            eObject

                                                                                                            Required. An object which contains one property, text, that represents the text to be pasted. Editing this property will alter the text that is pasted.

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Methods

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.addSelectionMarker(Range orientedRange) -
                                                                                                              • - -
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Adds the selection and cursor.

                                                                                                            - -
                                                                                                            -

                                                                                                            Adds the selection and cursor.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            orientedRangeRange

                                                                                                            Required. A range containing a cursor

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.alignCursors()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Aligns the cursors or selected text.

                                                                                                            - -
                                                                                                            -

                                                                                                            Aligns the cursors or selected text.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.blockOutdent()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Outdents the current line.

                                                                                                            - -
                                                                                                            -

                                                                                                            Outdents the current line.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.blur()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Blurs the current textInput.

                                                                                                            - -
                                                                                                            -

                                                                                                            Blurs the current textInput.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.centerSelection()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Attempts to center the current selection on the screen.

                                                                                                            - -
                                                                                                            -

                                                                                                            Attempts to center the current selection on the screen.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.clearSelection()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Empties the selection (by de-selecting it). This function also emits the 'changeSelection' event.

                                                                                                            - -
                                                                                                            -

                                                                                                            Empties the selection (by de-selecting it). This function also emits the 'changeSelection' event.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.copyLinesDown() -
                                                                                                              • - -
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Copies all the selected lines down one row.

                                                                                                            - -
                                                                                                            -

                                                                                                            Copies all the selected lines down one row.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.copyLinesUp() -
                                                                                                              • - -
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Copies all the selected lines up one row.

                                                                                                            - -
                                                                                                            -

                                                                                                            Copies all the selected lines up one row.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.destroy()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Cleans up the entire editor.

                                                                                                            - -
                                                                                                            -

                                                                                                            Cleans up the entire editor.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.duplicateSelection()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              • Undocumented
                                                                                                              • -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.execCommand()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              • Undocumented
                                                                                                              • -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.exitMultiSelectMode()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Removes all the selections except the last added one.

                                                                                                            - -
                                                                                                            -

                                                                                                            Removes all the selections except the last added one.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            - -
                                                                                                            -
                                                                                                            -

                                                                                                            Attempts to find needle within the document. For more information on options, see Search.

                                                                                                            - -
                                                                                                            -

                                                                                                            Attempts to find needle within the document. For more information on options, see Search.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            needleString

                                                                                                            Required. The text to search for (optional)

                                                                                                            -
                                                                                                            optionsObject

                                                                                                            Required. An object defining various search properties

                                                                                                            -
                                                                                                            animateBoolean

                                                                                                            Required. If true animate scrolling

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            - -
                                                                                                            -
                                                                                                            -

                                                                                                            Finds and selects all the occurences of needle.

                                                                                                            - -
                                                                                                            -

                                                                                                            Finds and selects all the occurences of needle.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            TheString

                                                                                                            Required. text to find

                                                                                                            -
                                                                                                            TheObject

                                                                                                            Required. search options

                                                                                                            -
                                                                                                            keepsBoolean

                                                                                                            Required.

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • - -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Performs another search for needle in the document. For more information on options, see Search.

                                                                                                            - -
                                                                                                            -

                                                                                                            Performs another search for needle in the document. For more information on options, see Search.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            optionsObject

                                                                                                            Required. search options

                                                                                                            -
                                                                                                            animateBoolean

                                                                                                            Required. If true animate scrolling

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • - -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Performs a search for needle backwards. For more information on options, see Search.

                                                                                                            - -
                                                                                                            -

                                                                                                            Performs a search for needle backwards. For more information on options, see Search.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            optionsObject

                                                                                                            Required. search options

                                                                                                            -
                                                                                                            animateBoolean

                                                                                                            Required. If true animate scrolling

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.focus()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Brings the current textInput into focus.

                                                                                                            - -
                                                                                                            -

                                                                                                            Brings the current textInput into focus.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • - -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Executes a command for each selection range.

                                                                                                            - -
                                                                                                            -

                                                                                                            Executes a command for each selection range.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            cmdString

                                                                                                            Required. The command to execute

                                                                                                            -
                                                                                                            argsString

                                                                                                            Required. Any arguments for the command

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.getAnimatedScroll()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              • Undocumented
                                                                                                              • -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.getBehavioursEnabled() -
                                                                                                              • - -
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Returns true if the behaviors are currently enabled. "Behaviors" in this case is the auto-pairing of special characters, like quotation marks, parenthesis, or brackets.

                                                                                                            - -
                                                                                                            -

                                                                                                            Returns true if the behaviors are currently enabled. "Behaviors" in this case is the auto-pairing of special characters, like quotation marks, parenthesis, or brackets.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.getCopyText() -
                                                                                                              • - -
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Returns the string of text currently highlighted.

                                                                                                            - -
                                                                                                            -

                                                                                                            Returns the string of text currently highlighted.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.getCursorPosition() -
                                                                                                              • - -
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Gets the current position of the cursor.

                                                                                                            - -
                                                                                                            -

                                                                                                            Gets the current position of the cursor.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.getCursorPositionScreen() -
                                                                                                              • - -
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Returns the screen position of the cursor.

                                                                                                            - -
                                                                                                            -

                                                                                                            Returns the screen position of the cursor.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.getDisplayIndentGuides()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              • Undocumented
                                                                                                              • -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.getDragDelay() -
                                                                                                              • - -
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Returns the current mouse drag delay.

                                                                                                            - -
                                                                                                            -

                                                                                                            Returns the current mouse drag delay.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.getFadeFoldWidgets()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              • Undocumented
                                                                                                              • -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.getFirstVisibleRow() -
                                                                                                              • - -
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Returns the index of the first visible row.

                                                                                                            - -
                                                                                                            -

                                                                                                            Returns the index of the first visible row.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.getHighlightActiveLine() -
                                                                                                              • - -
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Returns true if current lines are always highlighted.

                                                                                                            - -
                                                                                                            -

                                                                                                            Returns true if current lines are always highlighted.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.getHighlightGutterLine()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              • Undocumented
                                                                                                              • -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.getHighlightSelectedWord() -
                                                                                                              • - -
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Returns true if currently highlighted words are to be highlighted.

                                                                                                            - -
                                                                                                            -

                                                                                                            Returns true if currently highlighted words are to be highlighted.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.getKeyboardHandler() -
                                                                                                              • - -
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Returns the keyboard handler, such as "vim" or "windows".

                                                                                                            - -
                                                                                                            -

                                                                                                            Returns the keyboard handler, such as "vim" or "windows".

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.getLastSearchOptions() -
                                                                                                              • - -
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Returns an object containing all the search options. For more information on options, see Search.

                                                                                                            - -
                                                                                                            -

                                                                                                            Returns an object containing all the search options. For more information on options, see Search.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.getLastVisibleRow() -
                                                                                                              • - -
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Returns the index of the last visible row.

                                                                                                            - -
                                                                                                            -

                                                                                                            Returns the index of the last visible row.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.getOverwrite() -
                                                                                                              • - -
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Returns true if overwrites are enabled; false otherwise.

                                                                                                            - -
                                                                                                            -

                                                                                                            Returns true if overwrites are enabled; false otherwise.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.getPrintMarginColumn() -
                                                                                                              • - -
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Returns the column number of where the print margin is.

                                                                                                            - -
                                                                                                            -

                                                                                                            Returns the column number of where the print margin is.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.getReadOnly() -
                                                                                                              • - -
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Returns true if the editor is set to read-only mode.

                                                                                                            - -
                                                                                                            -

                                                                                                            Returns true if the editor is set to read-only mode.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.getScrollSpeed() -
                                                                                                              • - -
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Returns the value indicating how fast the mouse scroll speed is (in milliseconds).

                                                                                                            - -
                                                                                                            -

                                                                                                            Returns the value indicating how fast the mouse scroll speed is (in milliseconds).

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.getSelection() -
                                                                                                              • - -
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Returns the currently highlighted selection.

                                                                                                            - -
                                                                                                            -

                                                                                                            Returns the currently highlighted selection.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.getSelectionRange() -
                                                                                                              • - -
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Returns the Range for the selected text.

                                                                                                            - -
                                                                                                            -

                                                                                                            Returns the Range for the selected text.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.getSelectionStyle() -
                                                                                                              • - -
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Returns the current selection style.

                                                                                                            - -
                                                                                                            -

                                                                                                            Returns the current selection style.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • - -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Returns the current session being used.

                                                                                                            - -
                                                                                                            -

                                                                                                            Returns the current session being used.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.getShowFoldWidgets() -
                                                                                                              • - -
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Returns true if the fold widgets are shown.

                                                                                                            - -
                                                                                                            -

                                                                                                            Returns true if the fold widgets are shown.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.getShowInvisibles() -
                                                                                                              • - -
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Returns true if invisible characters are being shown.

                                                                                                            - -
                                                                                                            -

                                                                                                            Returns true if invisible characters are being shown.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.getShowPrintMargin() -
                                                                                                              • - -
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Returns true if the print margin is being shown.

                                                                                                            - -
                                                                                                            -

                                                                                                            Returns true if the print margin is being shown.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.getTheme() -
                                                                                                              • - -
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Returns the path of the current theme.

                                                                                                            - -
                                                                                                            -

                                                                                                            Returns the path of the current theme.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.getValue() -
                                                                                                              • - -
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Returns the current session's content.

                                                                                                            - -
                                                                                                            -

                                                                                                            Returns the current session's content.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.getWrapBehavioursEnabled()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Returns true if the wrapping behaviors are currently enabled.

                                                                                                            - -
                                                                                                            -

                                                                                                            Returns true if the wrapping behaviors are currently enabled.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            - -
                                                                                                            -
                                                                                                            -

                                                                                                            Moves the cursor to the specified line number, and also into the indiciated column.

                                                                                                            - -
                                                                                                            -

                                                                                                            Moves the cursor to the specified line number, and also into the indiciated column.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            lineNumberNumber

                                                                                                            Required. The line number to go to

                                                                                                            -
                                                                                                            columnNumber

                                                                                                            Required. A column number to go to

                                                                                                            -
                                                                                                            animateBoolean

                                                                                                            Required. If true animates scolling

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.gotoPageDown()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Shifts the document to wherever "page down" is, as well as moving the cursor position.

                                                                                                            - -
                                                                                                            -

                                                                                                            Shifts the document to wherever "page down" is, as well as moving the cursor position.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.gotoPageUp()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Shifts the document to wherever "page up" is, as well as moving the cursor position.

                                                                                                            - -
                                                                                                            -

                                                                                                            Shifts the document to wherever "page up" is, as well as moving the cursor position.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.indent()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Indents the current line.

                                                                                                            - -
                                                                                                            -

                                                                                                            Indents the current line.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.insert(String text)
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Inserts text into wherever the cursor is pointing.

                                                                                                            - -
                                                                                                            -

                                                                                                            Inserts text into wherever the cursor is pointing.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            textString

                                                                                                            Required. The new text to add

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.isFocused() -
                                                                                                              • - -
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Returns true if the current textInput is in focus.

                                                                                                            - -
                                                                                                            -

                                                                                                            Returns true if the current textInput is in focus.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • - -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Indicates if the entire row is currently visible on the screen.

                                                                                                            - -
                                                                                                            -

                                                                                                            Indicates if the entire row is currently visible on the screen.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            rowNumber

                                                                                                            Required. The row to check

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • - -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Indicates if the row is currently visible on the screen.

                                                                                                            - -
                                                                                                            -

                                                                                                            Indicates if the row is currently visible on the screen.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            rowNumber

                                                                                                            Required. The row to check

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.jumpToMatching(Object select)
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Moves the cursor's row and column to the next matching bracket.

                                                                                                            - -
                                                                                                            -

                                                                                                            Moves the cursor's row and column to the next matching bracket.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            selectObject

                                                                                                            Required.

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.modifyNumber(Number amount)
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            If the character before the cursor is a number, this functions changes its value by amount.

                                                                                                            - -
                                                                                                            -

                                                                                                            If the character before the cursor is a number, this functions changes its value by amount.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            amountNumber

                                                                                                            Required. The value to change the numeral by (can be negative to decrease value)

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • - -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Moves the cursor to the specified row and column. Note that this does not de-select the current selection.

                                                                                                            - -
                                                                                                            -

                                                                                                            Moves the cursor to the specified row and column. Note that this does not de-select the current selection.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            rowNumber

                                                                                                            Required. The new row number

                                                                                                            -
                                                                                                            columnNumber

                                                                                                            Required. The new column number

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.moveCursorToPosition(Object pos)
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Moves the cursor to the position indicated by pos.row and pos.column.

                                                                                                            - -
                                                                                                            -

                                                                                                            Moves the cursor to the position indicated by pos.row and pos.column.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            posObject

                                                                                                            Required. An object with two properties, row and column

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.moveLinesDown() -
                                                                                                              • - -
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Shifts all the selected lines down one row.

                                                                                                            - -
                                                                                                            -

                                                                                                            Shifts all the selected lines down one row.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.moveLinesUp() -
                                                                                                              • - -
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Shifts all the selected lines up one row.

                                                                                                            - -
                                                                                                            -

                                                                                                            Shifts all the selected lines up one row.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.moveText()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              • Undocumented
                                                                                                              • -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.navigateDown(Number times)
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Moves the cursor down in the document the specified number of times. Note that this does de-select the current selection.

                                                                                                            - -
                                                                                                            -

                                                                                                            Moves the cursor down in the document the specified number of times. Note that this does de-select the current selection.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            timesNumber

                                                                                                            Required. The number of times to change navigation

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.navigateFileEnd()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Moves the cursor to the end of the current file. Note that this does de-select the current selection.

                                                                                                            - -
                                                                                                            -

                                                                                                            Moves the cursor to the end of the current file. Note that this does de-select the current selection.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.navigateFileStart()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Moves the cursor to the start of the current file. Note that this does de-select the current selection.

                                                                                                            - -
                                                                                                            -

                                                                                                            Moves the cursor to the start of the current file. Note that this does de-select the current selection.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.navigateLeft(Number times)
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Moves the cursor left in the document the specified number of times. Note that this does de-select the current selection.

                                                                                                            - -
                                                                                                            -

                                                                                                            Moves the cursor left in the document the specified number of times. Note that this does de-select the current selection.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            timesNumber

                                                                                                            Required. The number of times to change navigation

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.navigateLineEnd()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Moves the cursor to the end of the current line. Note that this does de-select the current selection.

                                                                                                            - -
                                                                                                            -

                                                                                                            Moves the cursor to the end of the current line. Note that this does de-select the current selection.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.navigateLineStart()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Moves the cursor to the start of the current line. Note that this does de-select the current selection.

                                                                                                            - -
                                                                                                            -

                                                                                                            Moves the cursor to the start of the current line. Note that this does de-select the current selection.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.navigateRight(Number times)
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Moves the cursor right in the document the specified number of times. Note that this does de-select the current selection.

                                                                                                            - -
                                                                                                            -

                                                                                                            Moves the cursor right in the document the specified number of times. Note that this does de-select the current selection.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            timesNumber

                                                                                                            Required. The number of times to change navigation

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • - -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Moves the cursor to the specified row and column. Note that this does de-select the current selection.

                                                                                                            - -
                                                                                                            -

                                                                                                            Moves the cursor to the specified row and column. Note that this does de-select the current selection.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            rowNumber

                                                                                                            Required. The new row number

                                                                                                            -
                                                                                                            columnNumber

                                                                                                            Required. The new column number

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.navigateUp(Number times)
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Moves the cursor up in the document the specified number of times. Note that this does de-select the current selection.

                                                                                                            - -
                                                                                                            -

                                                                                                            Moves the cursor up in the document the specified number of times. Note that this does de-select the current selection.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            timesNumber

                                                                                                            Required. The number of times to change navigation

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.navigateWordLeft()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Moves the cursor to the word immediately to the left of the current position. Note that this does de-select the current selection.

                                                                                                            - -
                                                                                                            -

                                                                                                            Moves the cursor to the word immediately to the left of the current position. Note that this does de-select the current selection.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.navigateWordRight()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Moves the cursor to the word immediately to the right of the current position. Note that this does de-select the current selection.

                                                                                                            - -
                                                                                                            -

                                                                                                            Moves the cursor to the word immediately to the right of the current position. Note that this does de-select the current selection.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.onBlur()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              • Undocumented
                                                                                                              • -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.onChangeAnnotation()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              • Undocumented
                                                                                                              • -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.onChangeBackMarker()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              • Undocumented
                                                                                                              • -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.onChangeBreakpoint()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              • Undocumented
                                                                                                              • -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.onChangeFold()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              • Undocumented
                                                                                                              • -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.onChangeFrontMarker()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              • Undocumented
                                                                                                              • -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.onChangeMode()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              • Undocumented
                                                                                                              • -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.onChangeWrapLimit()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              • Undocumented
                                                                                                              • -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.onChangeWrapMode()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              • Undocumented
                                                                                                              • -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.onCommandKey()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              • Undocumented
                                                                                                              • -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.onCompositionEnd()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              • Undocumented
                                                                                                              • -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.onCompositionStart()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              • Undocumented
                                                                                                              • -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.onCompositionUpdate()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              • Undocumented
                                                                                                              • -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.onCopy()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Called whenever a text "copy" happens.

                                                                                                            - -
                                                                                                            -

                                                                                                            Called whenever a text "copy" happens.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.onCursorChange()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Emitted when the selection changes.

                                                                                                            - -
                                                                                                            -

                                                                                                            Emitted when the selection changes.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.onCut()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Called whenever a text "cut" happens.

                                                                                                            - -
                                                                                                            -

                                                                                                            Called whenever a text "cut" happens.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.onDocumentChange()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              • Undocumented
                                                                                                              • -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.onFocus()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              • Undocumented
                                                                                                              • -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.onPaste(String text)
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Called whenever a text "paste" happens.

                                                                                                            - -
                                                                                                            -

                                                                                                            Called whenever a text "paste" happens.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            textString

                                                                                                            Required. The pasted text

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.onScrollLeftChange()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              • Undocumented
                                                                                                              • -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.onScrollTopChange()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              • Undocumented
                                                                                                              • -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.onSelectionChange()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              • Undocumented
                                                                                                              • -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.onTextInput()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              • Undocumented
                                                                                                              • -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.onTokenizerUpdate()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              • Undocumented
                                                                                                              • -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.redo()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Perform a redo operation on the document, reimplementing the last change.

                                                                                                            - -
                                                                                                            -

                                                                                                            Perform a redo operation on the document, reimplementing the last change.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.remove(String dir)
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Removes words of text from the editor. A "word" is defined as a string of characters bookended by whitespace.

                                                                                                            - -
                                                                                                            -

                                                                                                            Removes words of text from the editor. A "word" is defined as a string of characters bookended by whitespace.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            dirString

                                                                                                            Required. The direction of the deletion to occur, either "left" or "right"

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.removeLines()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Removes all the lines in the current selection

                                                                                                            - -
                                                                                                            -

                                                                                                            Removes all the lines in the current selection

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.removeSelectionMarker(Range The)
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Removes the selection marker.

                                                                                                            - -
                                                                                                            -

                                                                                                            Removes the selection marker.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            TheRange

                                                                                                            Required. selection range added with addSelectionMarker().

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.removeToLineEnd()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Removes all the words to the right of the current selection, until the end of the line.

                                                                                                            - -
                                                                                                            -

                                                                                                            Removes all the words to the right of the current selection, until the end of the line.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.removeToLineStart()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Removes all the words to the left of the current selection, until the start of the line.

                                                                                                            - -
                                                                                                            -

                                                                                                            Removes all the words to the left of the current selection, until the start of the line.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.removeWordLeft()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Removes the word directly to the left of the current selection.

                                                                                                            - -
                                                                                                            -

                                                                                                            Removes the word directly to the left of the current selection.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.removeWordRight()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Removes the word directly to the right of the current selection.

                                                                                                            - -
                                                                                                            -

                                                                                                            Removes the word directly to the right of the current selection.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • - -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Replaces the first occurance of options.needle with the value in replacement.

                                                                                                            - -
                                                                                                            -

                                                                                                            Replaces the first occurance of options.needle with the value in replacement.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            replacementString

                                                                                                            Required. The text to replace with

                                                                                                            -
                                                                                                            optionsObject

                                                                                                            Required. The Search options to use

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • - -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Replaces all occurances of options.needle with the value in replacement.

                                                                                                            - -
                                                                                                            -

                                                                                                            Replaces all occurances of options.needle with the value in replacement.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            replacementString

                                                                                                            Required. The text to replace with

                                                                                                            -
                                                                                                            optionsObject

                                                                                                            Required. The Search options to use

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • - -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Triggers a resize of the editor.

                                                                                                            - -
                                                                                                            -

                                                                                                            Triggers a resize of the editor.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            forceBoolean

                                                                                                            Required. If true, recomputes the size, even if the height and width haven't changed

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.revealRange()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              • Undocumented
                                                                                                              • -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.scrollPageDown()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Scrolls the document to wherever "page down" is, without changing the cursor position.

                                                                                                            - -
                                                                                                            -

                                                                                                            Scrolls the document to wherever "page down" is, without changing the cursor position.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.scrollPageUp()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Scrolls the document to wherever "page up" is, without changing the cursor position.

                                                                                                            - -
                                                                                                            -

                                                                                                            Scrolls the document to wherever "page up" is, without changing the cursor position.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            - -
                                                                                                            -
                                                                                                            -

                                                                                                            Scrolls to a line. If center is true, it puts the line in middle of screen (or attempts to).

                                                                                                            - -
                                                                                                            -

                                                                                                            Scrolls to a line. If center is true, it puts the line in middle of screen (or attempts to).

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            lineNumber

                                                                                                            Required. The line to scroll to

                                                                                                            -
                                                                                                            centerBoolean

                                                                                                            Required. If true

                                                                                                            -
                                                                                                            animateBoolean

                                                                                                            Required. If true animates scrolling

                                                                                                            -
                                                                                                            callbackFunction

                                                                                                            Required. Function to be called when the animation has finished

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.scrollToRow(Object row)
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Moves the editor to the specified row.

                                                                                                            - -
                                                                                                            -

                                                                                                            Moves the editor to the specified row.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            rowObject

                                                                                                            Required.

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.selectAll()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Selects all the text in editor.

                                                                                                            - -
                                                                                                            -

                                                                                                            Selects all the text in editor.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            - -
                                                                                                            -
                                                                                                            -

                                                                                                            Finds the next occurence of text in an active selection and adds it to the selections.

                                                                                                            - -
                                                                                                            -

                                                                                                            Finds the next occurence of text in an active selection and adds it to the selections.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            dirNumber

                                                                                                            Required. The direction of lines to select: -1 for up, 1 for down

                                                                                                            -
                                                                                                            skipBoolean

                                                                                                            Required. If true, removes the active selection range

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • - -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Adds a cursor above or below the active cursor.

                                                                                                            - -
                                                                                                            -

                                                                                                            Adds a cursor above or below the active cursor.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            dirNumber

                                                                                                            Required. The direction of lines to select: -1 for up, 1 for down

                                                                                                            -
                                                                                                            skipBoolean

                                                                                                            Required. If true, removes the active selection range

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.selectPageDown()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Selects the text from the current position of the document until where a "page down" finishes.

                                                                                                            - -
                                                                                                            -

                                                                                                            Selects the text from the current position of the document until where a "page down" finishes.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.selectPageUp()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Selects the text from the current position of the document until where a "page up" finishes.

                                                                                                            - -
                                                                                                            -

                                                                                                            Selects the text from the current position of the document until where a "page up" finishes.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.setAnimatedScroll()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              • Undocumented
                                                                                                              • -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.setBehavioursEnabled(Boolean enabled)
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Specifies whether to use behaviors or not. "Behaviors" in this case is the auto-pairing of special characters, like quotation marks, parenthesis, or brackets.

                                                                                                            - -
                                                                                                            -

                                                                                                            Specifies whether to use behaviors or not. "Behaviors" in this case is the auto-pairing of special characters, like quotation marks, parenthesis, or brackets.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            enabledBoolean

                                                                                                            Required. Enables or disables behaviors

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.setDisplayIndentGuides()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              • Undocumented
                                                                                                              • -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.setDragDelay(Number dragDelay)
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Sets the delay (in milliseconds) of the mouse drag.

                                                                                                            - -
                                                                                                            -

                                                                                                            Sets the delay (in milliseconds) of the mouse drag.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            dragDelayNumber

                                                                                                            Required. A value indicating the new delay

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.setFadeFoldWidgets()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              • Undocumented
                                                                                                              • -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.setFontSize(Number size)
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Set a new font size (in pixels) for the editor text.

                                                                                                            - -
                                                                                                            -

                                                                                                            Set a new font size (in pixels) for the editor text.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            sizeNumber

                                                                                                            Required. A font size

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.setHighlightActiveLine(Boolean shouldHighlight)
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Determines whether or not the current line should be highlighted.

                                                                                                            - -
                                                                                                            -

                                                                                                            Determines whether or not the current line should be highlighted.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            shouldHighlightBoolean

                                                                                                            Required. Set to true to highlight the current line

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.setHighlightGutterLine()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              • Undocumented
                                                                                                              • -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.setHighlightSelectedWord(Boolean shouldHighlight)
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Determines if the currently selected word should be highlighted.

                                                                                                            - -
                                                                                                            -

                                                                                                            Determines if the currently selected word should be highlighted.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            shouldHighlightBoolean

                                                                                                            Required. Set to true to highlight the currently selected word

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.setKeyboardHandler(String keyboardHandler)
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Sets a new key handler, such as "vim" or "windows".

                                                                                                            - -
                                                                                                            -

                                                                                                            Sets a new key handler, such as "vim" or "windows".

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            keyboardHandlerString

                                                                                                            Required. The new key handler

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.setOverwrite(Boolean overwrite)
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Pass in true to enable overwrites in your session, or false to disable. If overwrites is enabled, any text you enter will type over any text after it. If the value of overwrite changes, this function also emites the changeOverwrite event.

                                                                                                            - -
                                                                                                            -

                                                                                                            Pass in true to enable overwrites in your session, or false to disable. If overwrites is enabled, any text you enter will type over any text after it. If the value of overwrite changes, this function also emites the changeOverwrite event.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            overwriteBoolean

                                                                                                            Required. Defines wheter or not to set overwrites

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.setPrintMarginColumn(Number showPrintMargin)
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Sets the column defining where the print margin should be.

                                                                                                            - -
                                                                                                            -

                                                                                                            Sets the column defining where the print margin should be.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            showPrintMarginNumber

                                                                                                            Required. Specifies the new print margin

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.setReadOnly(Boolean readOnly)
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            If readOnly is true, then the editor is set to read-only mode, and none of the content can change.

                                                                                                            - -
                                                                                                            -

                                                                                                            If readOnly is true, then the editor is set to read-only mode, and none of the content can change.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            readOnlyBoolean

                                                                                                            Required. Specifies whether the editor can be modified or not

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.setScrollSpeed(Number speed)
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Sets how fast the mouse scrolling should do.

                                                                                                            - -
                                                                                                            -

                                                                                                            Sets how fast the mouse scrolling should do.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            speedNumber

                                                                                                            Required. A value indicating the new speed (in milliseconds)

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.setSelectionStyle(String style)
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Indicates how selections should occur.

                                                                                                            - -
                                                                                                            -

                                                                                                            Indicates how selections should occur.

                                                                                                            -

                                                                                                            By default, selections are set to "line". There are no other styles at the moment, -although this code change in the future.

                                                                                                            -

                                                                                                            This function also emits the 'changeSelectionStyle' event.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            styleString

                                                                                                            Required. The new selection style

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • - -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Sets a new editsession to use. This method also emits the 'changeSession' event.

                                                                                                            - -
                                                                                                            -

                                                                                                            Sets a new editsession to use. This method also emits the 'changeSession' event.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            sessionEditSession

                                                                                                            Required. The new session to use

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.setShowFoldWidgets(Boolean show)
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Indicates whether the fold widgets are shown or not.

                                                                                                            - -
                                                                                                            -

                                                                                                            Indicates whether the fold widgets are shown or not.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            showBoolean

                                                                                                            Required. Specifies whether the fold widgets are shown

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.setShowInvisibles(Boolean showInvisibles)
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            If showInvisibles is set to true, invisible characters—like spaces or new lines—are show in the editor.

                                                                                                            - -
                                                                                                            -

                                                                                                            If showInvisibles is set to true, invisible characters—like spaces or new lines—are show in the editor.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            showInvisiblesBoolean

                                                                                                            Required. Specifies whether or not to show invisible characters

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.setShowPrintMargin(Boolean showPrintMargin)
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            If showPrintMargin is set to true, the print margin is shown in the editor.

                                                                                                            - -
                                                                                                            -

                                                                                                            If showPrintMargin is set to true, the print margin is shown in the editor.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            showPrintMarginBoolean

                                                                                                            Required. Specifies whether or not to show the print margin

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.setStyle(String style)
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Adds a new class, style, to the editor.

                                                                                                            - -
                                                                                                            -

                                                                                                            Adds a new class, style, to the editor.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            styleString

                                                                                                            Required. A class name

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.setTheme(String theme)
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Sets a new theme for the editor. theme should exist, and be a directory path, like ace/theme/textmate.

                                                                                                            - -
                                                                                                            -

                                                                                                            Sets a new theme for the editor. theme should exist, and be a directory path, like ace/theme/textmate.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            themeString

                                                                                                            Required. The path to a theme

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            - -
                                                                                                            -
                                                                                                            -

                                                                                                            Sets the current document to val.

                                                                                                            - -
                                                                                                            -

                                                                                                            Sets the current document to val.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            valString

                                                                                                            Required. The new value to set for the document

                                                                                                            -
                                                                                                            cursorPosNumber

                                                                                                            Required. Where to set the new value. undefined or 0 is selectAll, -1 is at the document start, and 1 is at the end

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.setWrapBehavioursEnabled(Boolean enabled)
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Specifies whether to use wrapping behaviors or not, i.e. automatically wrapping the selection with characters such as brackets -when such a character is typed in.

                                                                                                            - -
                                                                                                            -

                                                                                                            Specifies whether to use wrapping behaviors or not, i.e. automatically wrapping the selection with characters such as brackets -when such a character is typed in.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            enabledBoolean

                                                                                                            Required. Enables or disables wrapping behaviors

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.sortLines()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              • Undocumented
                                                                                                              • -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.splitLine()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Splits the line at the current selection (by inserting an '\n').

                                                                                                            - -
                                                                                                            -

                                                                                                            Splits the line at the current selection (by inserting an '\n').

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.toggleCommentLines()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Given the currently selected range, this function either comments all the lines, or uncomments all of them.

                                                                                                            - -
                                                                                                            -

                                                                                                            Given the currently selected range, this function either comments all the lines, or uncomments all of them.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.toggleOverwrite()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Sets the value of overwrite to the opposite of whatever it currently is.

                                                                                                            - -
                                                                                                            -

                                                                                                            Sets the value of overwrite to the opposite of whatever it currently is.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.toLowerCase()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Converts the current selection entirely into lowercase.

                                                                                                            - -
                                                                                                            -

                                                                                                            Converts the current selection entirely into lowercase.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.toUpperCase()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Converts the current selection entirely into uppercase.

                                                                                                            - -
                                                                                                            -

                                                                                                            Converts the current selection entirely into uppercase.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.transposeLetters()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Transposes current line.

                                                                                                            - -
                                                                                                            -

                                                                                                            Transposes current line.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.transposeSelections(Number dir)
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Transposes the selected ranges.

                                                                                                            - -
                                                                                                            -

                                                                                                            Transposes the selected ranges.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            dirNumber

                                                                                                            Required. The direction to rotate selections

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.undo()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Perform an undo operation on the document, reverting the last change.

                                                                                                            - -
                                                                                                            -

                                                                                                            Perform an undo operation on the document, reverting the last change.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.unsetStyle(Object style)
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Removes the class style from the editor.

                                                                                                            - -
                                                                                                            -

                                                                                                            Removes the class style from the editor.

                                                                                                            - -

                                                                                                            Arguments

                                                                                                            styleObject

                                                                                                            Required.

                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                              -
                                                                                                            • -
                                                                                                                -
                                                                                                              • Editor.updateSelectionMarkers()
                                                                                                              • -
                                                                                                              -
                                                                                                                -
                                                                                                              -
                                                                                                            • -
                                                                                                            -
                                                                                                            -
                                                                                                            -

                                                                                                            Updates the cursor and marker layers.

                                                                                                            - -
                                                                                                            -

                                                                                                            Updates the cursor and marker layers.

                                                                                                            - -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            -
                                                                                                            - - - - - -
                                                                                                            -
                                                                                                            \ No newline at end of file + + + + Editor - Ace API

                                                                                                            Editor[edit]

                                                                                                            The main entry point into the Ace functionality. The Editor manages the EditSession (which manages Documents), as well as the VirtualRenderer, which draws everything to the screen. Event sessions dealing with the mouse and keyboard are bubbled up from Document to the Editor, which decides what to do with them.

                                                                                                            +

                                                                                                            Constructors

                                                                                                            Creates a new Editor object.

                                                                                                            +

                                                                                                               

                                                                                                            Creates a new Editor object.

                                                                                                            +

                                                                                                            Arguments

                                                                                                            rendererVirtualRendererRequired. Associated VirtualRenderer that draws everything
                                                                                                            sessionEditSessionRequired. The EditSession to refer to

                                                                                                            Events

                                                                                                              • Editor.on("blur", function())

                                                                                                              Emitted once the editor has been blurred.

                                                                                                              +

                                                                                                                 

                                                                                                              Emitted once the editor has been blurred.

                                                                                                              +
                                                                                                                • Editor.on("change", function(Object e))

                                                                                                                Emitted whenever the document is changed.

                                                                                                                +

                                                                                                                   

                                                                                                                Emitted whenever the document is changed.

                                                                                                                +

                                                                                                                Arguments

                                                                                                                eObjectRequired. Contains a single property, data, which has the delta of changes
                                                                                                                  • Editor.on("changeAnnotation", function())

                                                                                                                  Emitted when an annotation changes.

                                                                                                                  +

                                                                                                                     

                                                                                                                  Emitted when an annotation changes.

                                                                                                                  +
                                                                                                                    • Editor.on("changeBackMarker", function())

                                                                                                                    Emitted when a back marker changes.

                                                                                                                    +

                                                                                                                       

                                                                                                                    Emitted when a back marker changes.

                                                                                                                    +
                                                                                                                      • Editor.on("changeBreakpoint", function())

                                                                                                                      Emitted when a breakpoint changes.

                                                                                                                      +

                                                                                                                         

                                                                                                                      Emitted when a breakpoint changes.

                                                                                                                      +
                                                                                                                        • Editor.on("changeFold", function())

                                                                                                                        Emitted when the code folds change.

                                                                                                                        +

                                                                                                                           

                                                                                                                        Emitted when the code folds change.

                                                                                                                        +
                                                                                                                          • Editor.on("changeFrontMarker", function())

                                                                                                                          Emitted when a front marker changes.

                                                                                                                          +

                                                                                                                             

                                                                                                                          Emitted when a front marker changes.

                                                                                                                          +
                                                                                                                            • Editor.on("changeMode", function())

                                                                                                                            Emitted when the mode changes.

                                                                                                                            +

                                                                                                                               

                                                                                                                            Emitted when the mode changes.

                                                                                                                            +
                                                                                                                              • Editor.on("changeWrapLimit", function())

                                                                                                                              Emitted when the wrap limit changes.

                                                                                                                              +

                                                                                                                                 

                                                                                                                              Emitted when the wrap limit changes.

                                                                                                                              +
                                                                                                                                • Editor.on("changeWrapMode", function())

                                                                                                                                Emitted when the wrap mode changes.

                                                                                                                                +

                                                                                                                                   

                                                                                                                                Emitted when the wrap mode changes.

                                                                                                                                +
                                                                                                                                  • Editor.on("cursorChange", function())

                                                                                                                                  Emitted when the cursor changes.

                                                                                                                                  +

                                                                                                                                     

                                                                                                                                  Emitted when the cursor changes.

                                                                                                                                  +
                                                                                                                                    • Editor.on("focus", function())

                                                                                                                                    Emitted once the editor comes into focus.

                                                                                                                                    +

                                                                                                                                       

                                                                                                                                    Emitted once the editor comes into focus.

                                                                                                                                    +
                                                                                                                                      • Editor.on("selectionChange", function(Object e))

                                                                                                                                      Emitted when a selection has changed.

                                                                                                                                      +

                                                                                                                                         

                                                                                                                                      Emitted when a selection has changed.

                                                                                                                                      +

                                                                                                                                      Arguments

                                                                                                                                      eObjectRequired. Contains a single property, data, which has the delta of changes

                                                                                                                                      Methods

                                                                                                                                        • Editor.$getSelectedRows()

                                                                                                                                        Returns an object indicating the currently selected rows. The object looks like this:

                                                                                                                                        +

                                                                                                                                           

                                                                                                                                        Returns an object indicating the currently selected rows. The object looks like this:

                                                                                                                                        +

                                                                                                                                        { first: range.start.row, last: range.end.row }

                                                                                                                                        +
                                                                                                                                          • Editor.$getVisibleRowCount()

                                                                                                                                          Returns the number of currently visibile rows.

                                                                                                                                          +

                                                                                                                                             

                                                                                                                                          Returns the number of currently visibile rows.

                                                                                                                                          +
                                                                                                                                            • Editor.$highlightBrackets()
                                                                                                                                            • Internal

                                                                                                                                             

                                                                                                                                          Executes a specific function, which can be anything that manipulates selected lines, such as copying them, duplicating them, or shifting them.

                                                                                                                                          +

                                                                                                                                             

                                                                                                                                          Executes a specific function, which can be anything that manipulates selected lines, such as copying them, duplicating them, or shifting them.

                                                                                                                                          +

                                                                                                                                          Arguments

                                                                                                                                          moverFunctionRequired. A method to call on each selected row
                                                                                                                                            • Editor.$updateHighlightActiveLine()
                                                                                                                                            • Internal

                                                                                                                                             

                                                                                                                                            • Editor.addSelectionMarker(Range orientedRange)

                                                                                                                                            Adds the selection and cursor.

                                                                                                                                            +

                                                                                                                                               

                                                                                                                                            Adds the selection and cursor.

                                                                                                                                            +

                                                                                                                                            Arguments

                                                                                                                                            orientedRangeRangeRequired. A range containing a cursor

                                                                                                                                            Outdents the current line.

                                                                                                                                            +

                                                                                                                                               

                                                                                                                                            Outdents the current line.

                                                                                                                                            +
                                                                                                                                              • Editor.blur()

                                                                                                                                              Blurs the current textInput.

                                                                                                                                              +

                                                                                                                                                 

                                                                                                                                              Blurs the current textInput.

                                                                                                                                              +
                                                                                                                                                • Editor.centerSelection()

                                                                                                                                                Attempts to center the current selection on the screen.

                                                                                                                                                +

                                                                                                                                                   

                                                                                                                                                Attempts to center the current selection on the screen.

                                                                                                                                                +

                                                                                                                                                Empties the selection (by de-selecting it). This function also emits the 'changeSelection' event.

                                                                                                                                                +

                                                                                                                                                   

                                                                                                                                                Empties the selection (by de-selecting it). This function also emits the 'changeSelection' event.

                                                                                                                                                +

                                                                                                                                                Copies all the selected lines down one row.

                                                                                                                                                +

                                                                                                                                                   

                                                                                                                                                Copies all the selected lines down one row.

                                                                                                                                                +
                                                                                                                                                  • Editor.destroy()

                                                                                                                                                  Cleans up the entire editor.

                                                                                                                                                  +

                                                                                                                                                     

                                                                                                                                                  Cleans up the entire editor.

                                                                                                                                                  +
                                                                                                                                                    • Editor.exitMultiSelectMode()
                                                                                                                                                      • Void

                                                                                                                                                    Removes all the selections except the last added one.

                                                                                                                                                    +

                                                                                                                                                       

                                                                                                                                                    Removes all the selections except the last added one.

                                                                                                                                                    +

                                                                                                                                                    Attempts to find needle within the document. For more information on options, see Search.

                                                                                                                                                    +

                                                                                                                                                       

                                                                                                                                                    Attempts to find needle within the document. For more information on options, see Search.

                                                                                                                                                    +

                                                                                                                                                    Arguments

                                                                                                                                                    needleStringRequired. The text to search for (optional)
                                                                                                                                                    optionsObjectRequired. An object defining various search properties
                                                                                                                                                    animateBooleanRequired. If true animate scrolling

                                                                                                                                                    Finds and selects all the occurences of needle.

                                                                                                                                                    +

                                                                                                                                                       

                                                                                                                                                    Finds and selects all the occurences of needle.

                                                                                                                                                    +

                                                                                                                                                    Arguments

                                                                                                                                                    needleStringRequired. The text to find
                                                                                                                                                    optionsObjectRequired. The search options
                                                                                                                                                    additiveBooleanRequired. keeps

                                                                                                                                                    Performs another search for needle in the document. For more information on options, see Search.

                                                                                                                                                    +

                                                                                                                                                       

                                                                                                                                                    Performs another search for needle in the document. For more information on options, see Search.

                                                                                                                                                    +

                                                                                                                                                    Arguments

                                                                                                                                                    optionsObjectRequired. search options
                                                                                                                                                    animateBooleanRequired. If true animate scrolling

                                                                                                                                                    Performs a search for needle backwards. For more information on options, see Search.

                                                                                                                                                    +

                                                                                                                                                       

                                                                                                                                                    Performs a search for needle backwards. For more information on options, see Search.

                                                                                                                                                    +

                                                                                                                                                    Arguments

                                                                                                                                                    optionsObjectRequired. search options
                                                                                                                                                    animateBooleanRequired. If true animate scrolling
                                                                                                                                                      • Editor.focus()

                                                                                                                                                      Brings the current textInput into focus.

                                                                                                                                                      +

                                                                                                                                                         

                                                                                                                                                      Brings the current textInput into focus.

                                                                                                                                                      +

                                                                                                                                                      Executes a command for each selection range.

                                                                                                                                                      +

                                                                                                                                                         

                                                                                                                                                      Executes a command for each selection range.

                                                                                                                                                      +

                                                                                                                                                      Arguments

                                                                                                                                                      cmdStringRequired. The command to execute
                                                                                                                                                      argsStringRequired. Any arguments for the command
                                                                                                                                                        • Editor.getBehavioursEnabled()

                                                                                                                                                        Returns true if the behaviors are currently enabled. "Behaviors" in this case is the auto-pairing of special characters, like quotation marks, parenthesis, or brackets.

                                                                                                                                                        +

                                                                                                                                                           

                                                                                                                                                        Returns true if the behaviors are currently enabled. "Behaviors" in this case is the auto-pairing of special characters, like quotation marks, parenthesis, or brackets.

                                                                                                                                                        +

                                                                                                                                                        Returns the string of text currently highlighted.

                                                                                                                                                        +

                                                                                                                                                           

                                                                                                                                                        Returns the string of text currently highlighted.

                                                                                                                                                        +

                                                                                                                                                        Gets the current position of the cursor.

                                                                                                                                                        +

                                                                                                                                                           

                                                                                                                                                        Gets the current position of the cursor.

                                                                                                                                                        +

                                                                                                                                                        Returns the current mouse drag delay.

                                                                                                                                                        +

                                                                                                                                                           

                                                                                                                                                        Returns the current mouse drag delay.

                                                                                                                                                        +
                                                                                                                                                          • Editor.getHighlightActiveLine()

                                                                                                                                                          Returns true if current lines are always highlighted.

                                                                                                                                                          +

                                                                                                                                                             

                                                                                                                                                          Returns true if current lines are always highlighted.

                                                                                                                                                          +
                                                                                                                                                            • Editor.getHighlightSelectedWord()

                                                                                                                                                            Returns true if currently highlighted words are to be highlighted.

                                                                                                                                                            +

                                                                                                                                                               

                                                                                                                                                            Returns true if currently highlighted words are to be highlighted.

                                                                                                                                                            +

                                                                                                                                                            Returns the keyboard handler.

                                                                                                                                                            +

                                                                                                                                                               

                                                                                                                                                            Returns the keyboard handler.

                                                                                                                                                            +

                                                                                                                                                            Returns an object containing all the search options. For more information on options, see Search.

                                                                                                                                                            +

                                                                                                                                                               

                                                                                                                                                            Returns an object containing all the search options. For more information on options, see Search.

                                                                                                                                                            +

                                                                                                                                                            Returns true if overwrites are enabled; false otherwise.

                                                                                                                                                            +

                                                                                                                                                               

                                                                                                                                                            Returns true if overwrites are enabled; false otherwise.

                                                                                                                                                            +
                                                                                                                                                              • Editor.getPrintMarginColumn()

                                                                                                                                                              Returns the column number of where the print margin is.

                                                                                                                                                              +

                                                                                                                                                                 

                                                                                                                                                              Returns the column number of where the print margin is.

                                                                                                                                                              +

                                                                                                                                                              Returns true if the editor is set to read-only mode.

                                                                                                                                                              +

                                                                                                                                                                 

                                                                                                                                                              Returns true if the editor is set to read-only mode.

                                                                                                                                                              +

                                                                                                                                                              Returns the value indicating how fast the mouse scroll speed is.

                                                                                                                                                              +

                                                                                                                                                                 

                                                                                                                                                              Returns the value indicating how fast the mouse scroll speed is.

                                                                                                                                                              +

                                                                                                                                                              Returns the currently highlighted selection.

                                                                                                                                                              +

                                                                                                                                                                 

                                                                                                                                                              Returns the currently highlighted selection.

                                                                                                                                                              +
                                                                                                                                                                • Editor.getSelectionStyle()

                                                                                                                                                                Returns the current selection style.

                                                                                                                                                                +

                                                                                                                                                                   

                                                                                                                                                                Returns the current selection style.

                                                                                                                                                                +

                                                                                                                                                                Returns the current session being used.

                                                                                                                                                                +

                                                                                                                                                                   

                                                                                                                                                                Returns the current session being used.

                                                                                                                                                                +

                                                                                                                                                                Returns true if the fold widgets are shown.

                                                                                                                                                                +

                                                                                                                                                                   

                                                                                                                                                                Returns true if the fold widgets are shown.

                                                                                                                                                                +

                                                                                                                                                                Returns true if invisible characters are being shown.

                                                                                                                                                                +

                                                                                                                                                                   

                                                                                                                                                                Returns true if invisible characters are being shown.

                                                                                                                                                                +

                                                                                                                                                                Returns true if the print margin is being shown.

                                                                                                                                                                +

                                                                                                                                                                   

                                                                                                                                                                Returns true if the print margin is being shown.

                                                                                                                                                                +

                                                                                                                                                                Returns the current session's content.

                                                                                                                                                                +

                                                                                                                                                                   

                                                                                                                                                                Returns the current session's content.

                                                                                                                                                                +

                                                                                                                                                                Moves the cursor to the specified line number, and also into the indiciated column.

                                                                                                                                                                +

                                                                                                                                                                   

                                                                                                                                                                Moves the cursor to the specified line number, and also into the indiciated column.

                                                                                                                                                                +

                                                                                                                                                                Arguments

                                                                                                                                                                lineNumberNumberRequired. The line number to go to
                                                                                                                                                                columnNumberRequired. A column number to go to
                                                                                                                                                                animateBooleanRequired. If true animates scolling
                                                                                                                                                                  • Editor.gotoPageDown()

                                                                                                                                                                  Shifts the document to wherever "page down" is, as well as moving the cursor position.

                                                                                                                                                                  +

                                                                                                                                                                     

                                                                                                                                                                  Shifts the document to wherever "page down" is, as well as moving the cursor position.

                                                                                                                                                                  +
                                                                                                                                                                    • Editor.gotoPageUp()

                                                                                                                                                                    Shifts the document to wherever "page up" is, as well as moving the cursor position.

                                                                                                                                                                    +

                                                                                                                                                                       

                                                                                                                                                                    Shifts the document to wherever "page up" is, as well as moving the cursor position.

                                                                                                                                                                    +

                                                                                                                                                                    Inserts text into wherever the cursor is pointing.

                                                                                                                                                                    +

                                                                                                                                                                       

                                                                                                                                                                    Inserts text into wherever the cursor is pointing.

                                                                                                                                                                    +

                                                                                                                                                                    Arguments

                                                                                                                                                                    textStringRequired. The new text to add

                                                                                                                                                                    Returns true if the current textInput is in focus.

                                                                                                                                                                    +

                                                                                                                                                                       

                                                                                                                                                                    Returns true if the current textInput is in focus.

                                                                                                                                                                    +

                                                                                                                                                                    Indicates if the entire row is currently visible on the screen.

                                                                                                                                                                    +

                                                                                                                                                                       

                                                                                                                                                                    Indicates if the entire row is currently visible on the screen.

                                                                                                                                                                    +

                                                                                                                                                                    Arguments

                                                                                                                                                                    rowNumberRequired. The row to check

                                                                                                                                                                    Indicates if the row is currently visible on the screen.

                                                                                                                                                                    +

                                                                                                                                                                       

                                                                                                                                                                    Indicates if the row is currently visible on the screen.

                                                                                                                                                                    +

                                                                                                                                                                    Arguments

                                                                                                                                                                    rowNumberRequired. The row to check
                                                                                                                                                                      • Editor.jumpToMatching()

                                                                                                                                                                      Moves the cursor's row and column to the next matching bracket.

                                                                                                                                                                      +

                                                                                                                                                                         

                                                                                                                                                                      Moves the cursor's row and column to the next matching bracket.

                                                                                                                                                                      +

                                                                                                                                                                      Moves the cursor to the specified row and column. Note that this does not de-select the current selection.

                                                                                                                                                                      +

                                                                                                                                                                         

                                                                                                                                                                      Moves the cursor to the specified row and column. Note that this does not de-select the current selection.

                                                                                                                                                                      +

                                                                                                                                                                      Arguments

                                                                                                                                                                      rowNumberRequired. The new row number
                                                                                                                                                                      columnNumberRequired. The new column number

                                                                                                                                                                      Moves the cursor to the position indicated by pos.row and pos.column.

                                                                                                                                                                      +

                                                                                                                                                                         

                                                                                                                                                                      Moves the cursor to the position indicated by pos.row and pos.column.

                                                                                                                                                                      +

                                                                                                                                                                      Arguments

                                                                                                                                                                      posObjectRequired. An object with two properties, row and column

                                                                                                                                                                      Shifts all the selected lines down one row.

                                                                                                                                                                      +

                                                                                                                                                                         

                                                                                                                                                                      Shifts all the selected lines down one row.

                                                                                                                                                                      +

                                                                                                                                                                      Shifts all the selected lines up one row.

                                                                                                                                                                      +

                                                                                                                                                                         

                                                                                                                                                                      Shifts all the selected lines up one row.

                                                                                                                                                                      +

                                                                                                                                                                      Moves a range of text from the given range to the given position. toPosition is an object that looks like this:

                                                                                                                                                                      +

                                                                                                                                                                         

                                                                                                                                                                      Moves a range of text from the given range to the given position. toPosition is an object that looks like this:

                                                                                                                                                                      +

                                                                                                                                                                      { row: newRowLocation, column: newColumnLocation }

                                                                                                                                                                      +

                                                                                                                                                                      Arguments

                                                                                                                                                                      fromRangeRangeRequired. The range of text you want moved within the document
                                                                                                                                                                      toPositionObjectRequired. The location (row and column) where you want to move the text to
                                                                                                                                                                        • Editor.navigateDown(Number times)

                                                                                                                                                                        Moves the cursor down in the document the specified number of times. Note that this does de-select the current selection.

                                                                                                                                                                        +

                                                                                                                                                                           

                                                                                                                                                                        Moves the cursor down in the document the specified number of times. Note that this does de-select the current selection.

                                                                                                                                                                        +

                                                                                                                                                                        Arguments

                                                                                                                                                                        timesNumberRequired. The number of times to change navigation
                                                                                                                                                                          • Editor.navigateFileEnd()

                                                                                                                                                                          Moves the cursor to the end of the current file. Note that this does de-select the current selection.

                                                                                                                                                                          +

                                                                                                                                                                             

                                                                                                                                                                          Moves the cursor to the end of the current file. Note that this does de-select the current selection.

                                                                                                                                                                          +
                                                                                                                                                                            • Editor.navigateFileStart()

                                                                                                                                                                            Moves the cursor to the start of the current file. Note that this does de-select the current selection.

                                                                                                                                                                            +

                                                                                                                                                                               

                                                                                                                                                                            Moves the cursor to the start of the current file. Note that this does de-select the current selection.

                                                                                                                                                                            +
                                                                                                                                                                              • Editor.navigateLeft(Number times)

                                                                                                                                                                              Moves the cursor left in the document the specified number of times. Note that this does de-select the current selection.

                                                                                                                                                                              +

                                                                                                                                                                                 

                                                                                                                                                                              Moves the cursor left in the document the specified number of times. Note that this does de-select the current selection.

                                                                                                                                                                              +

                                                                                                                                                                              Arguments

                                                                                                                                                                              timesNumberRequired. The number of times to change navigation
                                                                                                                                                                                • Editor.navigateLineEnd()

                                                                                                                                                                                Moves the cursor to the end of the current line. Note that this does de-select the current selection.

                                                                                                                                                                                +

                                                                                                                                                                                   

                                                                                                                                                                                Moves the cursor to the end of the current line. Note that this does de-select the current selection.

                                                                                                                                                                                +
                                                                                                                                                                                  • Editor.navigateLineStart()

                                                                                                                                                                                  Moves the cursor to the start of the current line. Note that this does de-select the current selection.

                                                                                                                                                                                  +

                                                                                                                                                                                     

                                                                                                                                                                                  Moves the cursor to the start of the current line. Note that this does de-select the current selection.

                                                                                                                                                                                  +
                                                                                                                                                                                    • Editor.navigateRight(Number times)

                                                                                                                                                                                    Moves the cursor right in the document the specified number of times. Note that this does de-select the current selection.

                                                                                                                                                                                    +

                                                                                                                                                                                       

                                                                                                                                                                                    Moves the cursor right in the document the specified number of times. Note that this does de-select the current selection.

                                                                                                                                                                                    +

                                                                                                                                                                                    Arguments

                                                                                                                                                                                    timesNumberRequired. The number of times to change navigation

                                                                                                                                                                                    Moves the cursor to the specified row and column. Note that this does de-select the current selection.

                                                                                                                                                                                    +

                                                                                                                                                                                       

                                                                                                                                                                                    Moves the cursor to the specified row and column. Note that this does de-select the current selection.

                                                                                                                                                                                    +

                                                                                                                                                                                    Arguments

                                                                                                                                                                                    rowNumberRequired. The new row number
                                                                                                                                                                                    columnNumberRequired. The new column number
                                                                                                                                                                                      • Editor.navigateUp(Number times)

                                                                                                                                                                                      Moves the cursor up in the document the specified number of times. Note that this does de-select the current selection.

                                                                                                                                                                                      +

                                                                                                                                                                                         

                                                                                                                                                                                      Moves the cursor up in the document the specified number of times. Note that this does de-select the current selection.

                                                                                                                                                                                      +

                                                                                                                                                                                      Arguments

                                                                                                                                                                                      timesNumberRequired. The number of times to change navigation
                                                                                                                                                                                        • Editor.navigateWordLeft()

                                                                                                                                                                                        Moves the cursor to the word immediately to the left of the current position. Note that this does de-select the current selection.

                                                                                                                                                                                        +

                                                                                                                                                                                           

                                                                                                                                                                                        Moves the cursor to the word immediately to the left of the current position. Note that this does de-select the current selection.

                                                                                                                                                                                        +
                                                                                                                                                                                          • Editor.navigateWordRight()

                                                                                                                                                                                          Moves the cursor to the word immediately to the right of the current position. Note that this does de-select the current selection.

                                                                                                                                                                                          +

                                                                                                                                                                                             

                                                                                                                                                                                          Moves the cursor to the word immediately to the right of the current position. Note that this does de-select the current selection.

                                                                                                                                                                                          +
                                                                                                                                                                                            • Editor.onCopy()

                                                                                                                                                                                            Called whenever a text "copy" happens.

                                                                                                                                                                                            +

                                                                                                                                                                                               

                                                                                                                                                                                            Called whenever a text "copy" happens.

                                                                                                                                                                                            +
                                                                                                                                                                                              • Editor.onCut()

                                                                                                                                                                                              called whenever a text "cut" happens.

                                                                                                                                                                                              +

                                                                                                                                                                                                 

                                                                                                                                                                                              called whenever a text "cut" happens.

                                                                                                                                                                                              +
                                                                                                                                                                                                • Editor.onPaste()

                                                                                                                                                                                                called whenever a text "paste" happens.

                                                                                                                                                                                                +

                                                                                                                                                                                                   

                                                                                                                                                                                                called whenever a text "paste" happens.

                                                                                                                                                                                                +

                                                                                                                                                                                                Perform a redo operation on the document, reimplementing the last change.

                                                                                                                                                                                                +

                                                                                                                                                                                                   

                                                                                                                                                                                                Perform a redo operation on the document, reimplementing the last change.

                                                                                                                                                                                                +

                                                                                                                                                                                                Removes words of text from the editor. A "word" is defined as a string of characters bookended by whitespace.

                                                                                                                                                                                                +

                                                                                                                                                                                                   

                                                                                                                                                                                                Removes words of text from the editor. A "word" is defined as a string of characters bookended by whitespace.

                                                                                                                                                                                                +

                                                                                                                                                                                                Arguments

                                                                                                                                                                                                dirStringRequired. The direction of the deletion to occur, either "left" or "right"

                                                                                                                                                                                                Removes all the lines in the current selection

                                                                                                                                                                                                +

                                                                                                                                                                                                   

                                                                                                                                                                                                Removes all the lines in the current selection

                                                                                                                                                                                                +
                                                                                                                                                                                                  • Editor.removeSelectionMarker(Range range)

                                                                                                                                                                                                  Removes the selection marker.

                                                                                                                                                                                                  +

                                                                                                                                                                                                     

                                                                                                                                                                                                  Removes the selection marker.

                                                                                                                                                                                                  +

                                                                                                                                                                                                  Arguments

                                                                                                                                                                                                  rangeRangeRequired. The selection range added with addSelectionMarker.
                                                                                                                                                                                                    • Editor.removeToLineEnd()

                                                                                                                                                                                                    Removes all the words to the right of the current selection, until the end of the line.

                                                                                                                                                                                                    +

                                                                                                                                                                                                       

                                                                                                                                                                                                    Removes all the words to the right of the current selection, until the end of the line.

                                                                                                                                                                                                    +
                                                                                                                                                                                                      • Editor.removeToLineStart()

                                                                                                                                                                                                      Removes all the words to the left of the current selection, until the start of the line.

                                                                                                                                                                                                      +

                                                                                                                                                                                                         

                                                                                                                                                                                                      Removes all the words to the left of the current selection, until the start of the line.

                                                                                                                                                                                                      +
                                                                                                                                                                                                        • Editor.removeWordLeft()

                                                                                                                                                                                                        Removes the word directly to the left of the current selection.

                                                                                                                                                                                                        +

                                                                                                                                                                                                           

                                                                                                                                                                                                        Removes the word directly to the left of the current selection.

                                                                                                                                                                                                        +
                                                                                                                                                                                                          • Editor.removeWordRight()

                                                                                                                                                                                                          Removes the word directly to the right of the current selection.

                                                                                                                                                                                                          +

                                                                                                                                                                                                             

                                                                                                                                                                                                          Removes the word directly to the right of the current selection.

                                                                                                                                                                                                          +

                                                                                                                                                                                                          Replaces the first occurance of options.needle with the value in replacement.

                                                                                                                                                                                                          +

                                                                                                                                                                                                             

                                                                                                                                                                                                          Replaces the first occurance of options.needle with the value in replacement.

                                                                                                                                                                                                          +

                                                                                                                                                                                                          Arguments

                                                                                                                                                                                                          replacementStringRequired. The text to replace with
                                                                                                                                                                                                          optionsObjectRequired. The Search options to use

                                                                                                                                                                                                          Replaces all occurances of options.needle with the value in replacement.

                                                                                                                                                                                                          +

                                                                                                                                                                                                             

                                                                                                                                                                                                          Replaces all occurances of options.needle with the value in replacement.

                                                                                                                                                                                                          +

                                                                                                                                                                                                          Arguments

                                                                                                                                                                                                          replacementStringRequired. The text to replace with
                                                                                                                                                                                                          optionsObjectRequired. The Search options to use

                                                                                                                                                                                                          Triggers a resize of the editor.

                                                                                                                                                                                                          +

                                                                                                                                                                                                             

                                                                                                                                                                                                          Triggers a resize of the editor.

                                                                                                                                                                                                          +
                                                                                                                                                                                                            • Editor.scrollPageDown()

                                                                                                                                                                                                            Scrolls the document to wherever "page down" is, without changing the cursor position.

                                                                                                                                                                                                            +

                                                                                                                                                                                                               

                                                                                                                                                                                                            Scrolls the document to wherever "page down" is, without changing the cursor position.

                                                                                                                                                                                                            +
                                                                                                                                                                                                              • Editor.scrollPageUp()

                                                                                                                                                                                                              Scrolls the document to wherever "page up" is, without changing the cursor position.

                                                                                                                                                                                                              +

                                                                                                                                                                                                                 

                                                                                                                                                                                                              Scrolls the document to wherever "page up" is, without changing the cursor position.

                                                                                                                                                                                                              +

                                                                                                                                                                                                              TODO scrolls a to line, if center == true, puts line in middle of screen or attempts to)

                                                                                                                                                                                                              +

                                                                                                                                                                                                                 

                                                                                                                                                                                                              TODO scrolls a to line, if center == true, puts line in middle of screen or attempts to)

                                                                                                                                                                                                              +

                                                                                                                                                                                                              Arguments

                                                                                                                                                                                                              lineNumberRequired. The line to scroll to
                                                                                                                                                                                                              centerBooleanRequired. If true
                                                                                                                                                                                                              animateBooleanRequired. If true animates scrolling
                                                                                                                                                                                                              callbackFunctionRequired. Function to be called when the animation has finished

                                                                                                                                                                                                              Moves the editor to the specified row.

                                                                                                                                                                                                              +

                                                                                                                                                                                                                 

                                                                                                                                                                                                              Moves the editor to the specified row.

                                                                                                                                                                                                              +

                                                                                                                                                                                                              Arguments

                                                                                                                                                                                                              rowNumberRequired. The row to move to

                                                                                                                                                                                                              Selects all the text in editor.

                                                                                                                                                                                                              +

                                                                                                                                                                                                                 

                                                                                                                                                                                                              Selects all the text in editor.

                                                                                                                                                                                                              +

                                                                                                                                                                                                              Finds the next occurence of text in an active selection and adds it to the selections.

                                                                                                                                                                                                              +

                                                                                                                                                                                                                 

                                                                                                                                                                                                              Finds the next occurence of text in an active selection and adds it to the selections.

                                                                                                                                                                                                              +

                                                                                                                                                                                                              Arguments

                                                                                                                                                                                                              dirNumberRequired. The direction of lines to select: -1 for up, 1 for down
                                                                                                                                                                                                              skipBooleanRequired. If true, removes the active selection range

                                                                                                                                                                                                              Adds a cursor above or below the active cursor.

                                                                                                                                                                                                              +

                                                                                                                                                                                                                 

                                                                                                                                                                                                              Adds a cursor above or below the active cursor.

                                                                                                                                                                                                              +

                                                                                                                                                                                                              Arguments

                                                                                                                                                                                                              dirNumberRequired. The direction of lines to select: -1 for up, 1 for down
                                                                                                                                                                                                              skipBooleanRequired. If true, removes the active selection range
                                                                                                                                                                                                                • Editor.selectPageDown()

                                                                                                                                                                                                                Selects the text from the current position of the document until where a "page down" finishes.

                                                                                                                                                                                                                +

                                                                                                                                                                                                                   

                                                                                                                                                                                                                Selects the text from the current position of the document until where a "page down" finishes.

                                                                                                                                                                                                                +
                                                                                                                                                                                                                  • Editor.selectPageUp()

                                                                                                                                                                                                                  Selects the text from the current position of the document until where a "page up" finishes.

                                                                                                                                                                                                                  +

                                                                                                                                                                                                                     

                                                                                                                                                                                                                  Selects the text from the current position of the document until where a "page up" finishes.

                                                                                                                                                                                                                  +
                                                                                                                                                                                                                    • Editor.setBehavioursEnabled(Boolean enabled)

                                                                                                                                                                                                                    Specifies whether to use behaviors or not. "Behaviors" in this case is the auto-pairing of special characters, like quotation marks, parenthesis, or brackets.

                                                                                                                                                                                                                    +

                                                                                                                                                                                                                       

                                                                                                                                                                                                                    Specifies whether to use behaviors or not. "Behaviors" in this case is the auto-pairing of special characters, like quotation marks, parenthesis, or brackets.

                                                                                                                                                                                                                    +

                                                                                                                                                                                                                    Arguments

                                                                                                                                                                                                                    enabledBooleanRequired. Enables or disables behaviors
                                                                                                                                                                                                                      • Editor.setDragDelay(Number dragDelay)

                                                                                                                                                                                                                      Sets the delay (in milliseconds) of the mouse drag.

                                                                                                                                                                                                                      +

                                                                                                                                                                                                                         

                                                                                                                                                                                                                      Sets the delay (in milliseconds) of the mouse drag.

                                                                                                                                                                                                                      +

                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                      dragDelayNumberRequired. A value indicating the new delay
                                                                                                                                                                                                                        • Editor.setFontSize(Number size)

                                                                                                                                                                                                                        Set a new font size (in pixels) for the editor text.

                                                                                                                                                                                                                        +

                                                                                                                                                                                                                           

                                                                                                                                                                                                                        Set a new font size (in pixels) for the editor text.

                                                                                                                                                                                                                        +

                                                                                                                                                                                                                        Arguments

                                                                                                                                                                                                                        sizeNumberRequired. A font size
                                                                                                                                                                                                                          • Editor.setHighlightActiveLine(Boolean shouldHighlight)

                                                                                                                                                                                                                          Determines whether or not the current line should be highlighted.

                                                                                                                                                                                                                          +

                                                                                                                                                                                                                             

                                                                                                                                                                                                                          Determines whether or not the current line should be highlighted.

                                                                                                                                                                                                                          +

                                                                                                                                                                                                                          Arguments

                                                                                                                                                                                                                          shouldHighlightBooleanRequired. Set to true to highlight the current line
                                                                                                                                                                                                                            • Editor.setHighlightSelectedWord(Boolean shouldHighlight)

                                                                                                                                                                                                                            Determines if the currently selected word should be highlighted.

                                                                                                                                                                                                                            +

                                                                                                                                                                                                                               

                                                                                                                                                                                                                            Determines if the currently selected word should be highlighted.

                                                                                                                                                                                                                            +

                                                                                                                                                                                                                            Arguments

                                                                                                                                                                                                                            shouldHighlightBooleanRequired. Set to true to highlight the currently selected word
                                                                                                                                                                                                                              • Editor.setKeyboardHandler(keyboardHandler)

                                                                                                                                                                                                                              Sets a new keyboard handler.

                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                 

                                                                                                                                                                                                                              Sets a new keyboard handler.

                                                                                                                                                                                                                              +

                                                                                                                                                                                                                              Pass in true to enable overwrites in your session, or false to disable. If overwrites is enabled, any text you enter will type over any text after it. If the value of overwrite changes, this function also emites the changeOverwrite event.

                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                 

                                                                                                                                                                                                                              Pass in true to enable overwrites in your session, or false to disable. If overwrites is enabled, any text you enter will type over any text after it. If the value of overwrite changes, this function also emites the changeOverwrite event.

                                                                                                                                                                                                                              +

                                                                                                                                                                                                                              Arguments

                                                                                                                                                                                                                              overwriteBooleanRequired. Defines wheter or not to set overwrites
                                                                                                                                                                                                                                • Editor.setPrintMarginColumn(Number showPrintMargin)

                                                                                                                                                                                                                                Sets the column defining where the print margin should be.

                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                   

                                                                                                                                                                                                                                Sets the column defining where the print margin should be.

                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                Arguments

                                                                                                                                                                                                                                showPrintMarginNumberRequired. Specifies the new print margin
                                                                                                                                                                                                                                  • Editor.setReadOnly(Boolean readOnly)

                                                                                                                                                                                                                                  If readOnly is true, then the editor is set to read-only mode, and none of the content can change.

                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                     

                                                                                                                                                                                                                                  If readOnly is true, then the editor is set to read-only mode, and none of the content can change.

                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                  Arguments

                                                                                                                                                                                                                                  readOnlyBooleanRequired. Specifies whether the editor can be modified or not
                                                                                                                                                                                                                                    • Editor.setScrollSpeed(Number speed)

                                                                                                                                                                                                                                    Sets how fast the mouse scrolling should do.

                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                       

                                                                                                                                                                                                                                    Sets how fast the mouse scrolling should do.

                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                    Arguments

                                                                                                                                                                                                                                    speedNumberRequired. A value indicating the new speed
                                                                                                                                                                                                                                      • Editor.setSelectionStyle(String style)

                                                                                                                                                                                                                                      Indicates how selections should occur. By default, selections are set to "line". This function also emits the 'changeSelectionStyle' event.

                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                         

                                                                                                                                                                                                                                      Indicates how selections should occur. By default, selections are set to "line". This function also emits the 'changeSelectionStyle' event.

                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                      styleStringRequired. The new selection style

                                                                                                                                                                                                                                      Sets a new editsession to use. This method also emits the 'changeSession' event.

                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                         

                                                                                                                                                                                                                                      Sets a new editsession to use. This method also emits the 'changeSession' event.

                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                      sessionEditSessionRequired. The new session to use
                                                                                                                                                                                                                                        • Editor.setShowFoldWidgets(Boolean show)

                                                                                                                                                                                                                                        Indicates whether the fold widgets are shown or not.

                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                           

                                                                                                                                                                                                                                        Indicates whether the fold widgets are shown or not.

                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                        Arguments

                                                                                                                                                                                                                                        showBooleanRequired. Specifies whether the fold widgets are shown
                                                                                                                                                                                                                                          • Editor.setShowInvisibles(Boolean showInvisibles)

                                                                                                                                                                                                                                          If showInvisibiles is set to true, invisible characters—like spaces or new lines—are show in the editor.

                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                             

                                                                                                                                                                                                                                          If showInvisibiles is set to true, invisible characters—like spaces or new lines—are show in the editor.

                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                          Arguments

                                                                                                                                                                                                                                          showInvisiblesBooleanRequired. Specifies whether or not to show invisible characters
                                                                                                                                                                                                                                            • Editor.setShowPrintMargin(Boolean showPrintMargin)

                                                                                                                                                                                                                                            If showPrintMargin is set to true, the print margin is shown in the editor.

                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                            If showPrintMargin is set to true, the print margin is shown in the editor.

                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                            Arguments

                                                                                                                                                                                                                                            showPrintMarginBooleanRequired. Specifies whether or not to show the print margin

                                                                                                                                                                                                                                            Adds a new class, style, to the editor.

                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                            Adds a new class, style, to the editor.

                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                              • Editor.setTheme(theme)

                                                                                                                                                                                                                                              Sets a new theme for the editor. theme should exist, and be a directory path, like ace/theme/textmate.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                 

                                                                                                                                                                                                                                              Sets a new theme for the editor. theme should exist, and be a directory path, like ace/theme/textmate.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Sets the current document to val.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                 

                                                                                                                                                                                                                                              Sets the current document to val.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Arguments

                                                                                                                                                                                                                                              valStringRequired. The new value to set for the document
                                                                                                                                                                                                                                              cursorPosNumberRequired. Where to set the new value. undefined or 0 is selectAll, -1 is at the document start, and 1 is at the end
                                                                                                                                                                                                                                                • Editor.splitLine()

                                                                                                                                                                                                                                                Splits the line at the current selection (by inserting an '\n').

                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                   

                                                                                                                                                                                                                                                Splits the line at the current selection (by inserting an '\n').

                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                  • Editor.toggleCommentLines()

                                                                                                                                                                                                                                                  Given the currently selected range, this function either comments all lines or uncomments all lines (depending on whether it's commented or not).

                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                     

                                                                                                                                                                                                                                                  Given the currently selected range, this function either comments all lines or uncomments all lines (depending on whether it's commented or not).

                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                  Sets the value of overwrite to the opposite of whatever it currently is.

                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                     

                                                                                                                                                                                                                                                  Sets the value of overwrite to the opposite of whatever it currently is.

                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                    • Editor.toLowerCase()

                                                                                                                                                                                                                                                    Converts the current selection entirely into lowercase.

                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                       

                                                                                                                                                                                                                                                    Converts the current selection entirely into lowercase.

                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                      • Editor.toUpperCase()

                                                                                                                                                                                                                                                      Converts the current selection entirely into uppercase.

                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                         

                                                                                                                                                                                                                                                      Converts the current selection entirely into uppercase.

                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                        • Editor.transposeLetters()

                                                                                                                                                                                                                                                        Transposes current line.

                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                           

                                                                                                                                                                                                                                                        Transposes current line.

                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                          • Editor.transposeSelections(Number dir)

                                                                                                                                                                                                                                                          Transposes the selected ranges.

                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                             

                                                                                                                                                                                                                                                          Transposes the selected ranges.

                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                          Arguments

                                                                                                                                                                                                                                                          dirNumberRequired. The direction to rotate selections

                                                                                                                                                                                                                                                          Perform an undo operation on the document, reverting the last change. Returns the range of the undo.

                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                             

                                                                                                                                                                                                                                                          Perform an undo operation on the document, reverting the last change. Returns the range of the undo.

                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                          Removes the class style from the editor.

                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                             

                                                                                                                                                                                                                                                          Removes the class style from the editor.

                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                            • Editor.updateSelectionMarkers()

                                                                                                                                                                                                                                                            Updates the cursor and marker layers.

                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                            Updates the cursor and marker layers.

                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                            + + + + + \ No newline at end of file diff --git a/api/index.html b/api/index.html index cccaab54..a4e4af82 100644 --- a/api/index.html +++ b/api/index.html @@ -1,12 +1,14 @@ - -

                                                                                                                                                                                                                                                            Ace API Reference

                                                                                                                                                                                                                                                            + + + + Ace API

                                                                                                                                                                                                                                                            Ace API Reference

                                                                                                                                                                                                                                                            Welcome to the Ace API Reference Guide. Ace is a standalone code editor written in JavaScript that you can embed onto any website. We're used in a bunch of places already, like GitHub, Google, and Facebook.

                                                                                                                                                                                                                                                            On the left, you'll find a list of all of our currently documented classes. There are plenty more to do, but these represent the "core" set. For more information on how to work with Ace, check out the main Ace website.

                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                            + + + + + \ No newline at end of file diff --git a/api/placeholder.html b/api/placeholder.html index fa12a958..627e7abf 100644 --- a/api/placeholder.html +++ b/api/placeholder.html @@ -1,293 +1,28 @@ + + + + PlaceHolder - Ace API

                                                                                                                                                                                                                                                            TODO

                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                            Constructors

                                                                                                                                                                                                                                                            Events

                                                                                                                                                                                                                                                              • PlaceHolder.on("onCursorChange", function(e))

                                                                                                                                                                                                                                                              Emitted when the cursor changes.

                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                 

                                                                                                                                                                                                                                                              Emitted when the cursor changes.

                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                • PlaceHolder.on("onUpdate", function(e))

                                                                                                                                                                                                                                                                Emitted when the place holder updates.

                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                   

                                                                                                                                                                                                                                                                Emitted when the place holder updates.

                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                Methods

                                                                                                                                                                                                                                                                  • PlaceHolder.cancel()

                                                                                                                                                                                                                                                                  TODO

                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                     

                                                                                                                                                                                                                                                                  TODO

                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                    • PlaceHolder.detach()

                                                                                                                                                                                                                                                                    TODO

                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                       

                                                                                                                                                                                                                                                                    TODO

                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                      • PlaceHolder.hideOtherMarkers()

                                                                                                                                                                                                                                                                      Hides all over markers in the EditSession that are not the currently selected one.

                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                         

                                                                                                                                                                                                                                                                      Hides all over markers in the EditSession that are not the currently selected one.

                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                        • PlaceHolder.setup()

                                                                                                                                                                                                                                                                        TODO

                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                           

                                                                                                                                                                                                                                                                        TODO

                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                          • PlaceHolder.showOtherMarkers()

                                                                                                                                                                                                                                                                          TODO

                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                             

                                                                                                                                                                                                                                                                          TODO

                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                          + + + + + \ No newline at end of file diff --git a/api/range.html b/api/range.html index 9779fe27..d37137e4 100644 --- a/api/range.html +++ b/api/range.html @@ -1,968 +1,67 @@ + + + + Range - Ace API

                                                                                                                                                                                                                                                                          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.

                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                          Constructors

                                                                                                                                                                                                                                                                          Creates a new Range object with the given starting and ending row and column points.

                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                             

                                                                                                                                                                                                                                                                          Creates a new Range object with the given starting and ending row and column points.

                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                          Arguments

                                                                                                                                                                                                                                                                          startRowNumberRequired. The starting row
                                                                                                                                                                                                                                                                          startColumnNumberRequired. The starting column
                                                                                                                                                                                                                                                                          endRowNumberRequired. The ending row
                                                                                                                                                                                                                                                                          endColumnNumberRequired. The ending column

                                                                                                                                                                                                                                                                          Methods

                                                                                                                                                                                                                                                                          Returns the part of the current Range that occurs within the boundaries of firstRow and lastRow as a new Range object.

                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                             

                                                                                                                                                                                                                                                                          Returns the part of the current Range that occurs within the boundaries of firstRow and lastRow as a new Range object.

                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                          Arguments

                                                                                                                                                                                                                                                                          firstRowNumberRequired. The starting row
                                                                                                                                                                                                                                                                          lastRowNumberRequired. The ending row

                                                                                                                                                                                                                                                                          Returns a duplicate of the calling range.

                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                             

                                                                                                                                                                                                                                                                          Returns a duplicate of the calling range.

                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                            • Range.collapseRows()

                                                                                                                                                                                                                                                                            Returns a range containing the starting and ending rows of the original range, but with a column value of 0.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                            Returns a range containing the starting and ending rows of the original range, but with a column value of 0.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Checks the row and column points with the row and column points of the calling range.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                            Checks the row and column points with the row and column points of the calling range.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Arguments

                                                                                                                                                                                                                                                                            rowNumberRequired. A row point to compare with
                                                                                                                                                                                                                                                                            columnNumberRequired. A column point to compare with

                                                                                                                                                                                                                                                                            Checks the row and column points with the row and column points of the calling range.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                            Checks the row and column points with the row and column points of the calling range.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Arguments

                                                                                                                                                                                                                                                                            rowNumberRequired. A row point to compare with
                                                                                                                                                                                                                                                                            columnNumberRequired. A column point to compare with

                                                                                                                                                                                                                                                                            Checks the row and column points with the row and column points of the calling range.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                            Checks the row and column points with the row and column points of the calling range.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Arguments

                                                                                                                                                                                                                                                                            rowNumberRequired. A row point to compare with
                                                                                                                                                                                                                                                                            columnNumberRequired. A column point to compare with

                                                                                                                                                                                                                                                                            Checks the row and column points of p with the row and column points of the calling range.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                            Checks the row and column points of p with the row and column points of the calling range.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Arguments

                                                                                                                                                                                                                                                                            pRangeRequired. A point to compare with

                                                                                                                                                                                                                                                                            Compares this range (A) with another range (B).

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                            Compares this range (A) with another range (B).

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Arguments

                                                                                                                                                                                                                                                                            rangeRangeRequired. A range to compare with

                                                                                                                                                                                                                                                                            Checks the row and column points with the row and column points of the calling range.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                            Checks the row and column points with the row and column points of the calling range.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Arguments

                                                                                                                                                                                                                                                                            rowNumberRequired. A row point to compare with
                                                                                                                                                                                                                                                                            columnNumberRequired. A column point to compare with

                                                                                                                                                                                                                                                                            Returns true if the row and column provided are within the given range. This can better be expressed as returning true if:

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                            Returns true if the row and column provided are within the given range. This can better be expressed as returning true if:

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            this.start.row <= row <= this.end.row && + this.start.column <= column <= this.end.column

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Arguments

                                                                                                                                                                                                                                                                            rowNumberRequired. A row to check for
                                                                                                                                                                                                                                                                            columnNumberRequired. A column to check for

                                                                                                                                                                                                                                                                            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.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                            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.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Arguments

                                                                                                                                                                                                                                                                            rangeRangeRequired. A range to compare with

                                                                                                                                                                                                                                                                            Changes the row and column points for the calling range for both the starting and ending points. This method returns that range with a new row.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                            Changes the row and column points for the calling range for both the starting and ending points. This method returns that range with a new row.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Arguments

                                                                                                                                                                                                                                                                            rowNumberRequired. A new row to extend to
                                                                                                                                                                                                                                                                            columnNumberRequired. A new column to extend to

                                                                                                                                                                                                                                                                            Creates and returns a new Range based on the row and column of the given parameters.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                            Creates and returns a new Range based on the row and column of the given parameters.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Arguments

                                                                                                                                                                                                                                                                            startRangeRequired. A starting point to use
                                                                                                                                                                                                                                                                            endRangeRequired. An ending point to use

                                                                                                                                                                                                                                                                            Returns true if the row and column are within the given range.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                            Returns true if the row and column are within the given range.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Arguments

                                                                                                                                                                                                                                                                            rowNumberRequired. A row point to compare with
                                                                                                                                                                                                                                                                            columnNumberRequired. A column point to compare with

                                                                                                                                                                                                                                                                            Returns true if the row and column are within the given range's ending points.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                            Returns true if the row and column are within the given range's ending points.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Arguments

                                                                                                                                                                                                                                                                            rowNumberRequired. A row point to compare with
                                                                                                                                                                                                                                                                            columnNumberRequired. A column point to compare with

                                                                                                                                                                                                                                                                            Returns true if the row and column are within the given range's starting points.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                            Returns true if the row and column are within the given range's starting points.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Arguments

                                                                                                                                                                                                                                                                            rowNumberRequired. A row point to compare with
                                                                                                                                                                                                                                                                            columnNumberRequired. A column point to compare with

                                                                                                                                                                                                                                                                            Returns true if passed in range intersects with the one calling this method.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                            Returns true if passed in range intersects with the one calling this method.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Arguments

                                                                                                                                                                                                                                                                            rangeRangeRequired. A range 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.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                            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.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Arguments

                                                                                                                                                                                                                                                                            rowNumberRequired. A row point to compare with
                                                                                                                                                                                                                                                                            columnNumberRequired. A column point to compare with

                                                                                                                                                                                                                                                                            Returns true if and only if the starting row and column, and ending tow and column, are equivalent to those given by range.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                            Returns true if and only if the starting row and column, and ending tow and column, are equivalent to those given by range.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Arguments

                                                                                                                                                                                                                                                                            rangeRangeRequired. A range to check against

                                                                                                                                                                                                                                                                            Returns true if the range spans across multiple lines.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                            Returns true if the range spans across multiple lines.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            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.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                            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.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Arguments

                                                                                                                                                                                                                                                                            rowNumberRequired. A row point to compare with
                                                                                                                                                                                                                                                                            columnNumberRequired. A column point to compare with

                                                                                                                                                                                                                                                                            Sets the starting row and column for the range.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                            Sets the starting row and column for the range.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Arguments

                                                                                                                                                                                                                                                                            rowNumberRequired. A row point to set
                                                                                                                                                                                                                                                                            columnNumberRequired. A column point to set

                                                                                                                                                                                                                                                                            Sets the starting row and column for the range.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                            Sets the starting row and column for the range.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Arguments

                                                                                                                                                                                                                                                                            rowNumberRequired. A row point to set
                                                                                                                                                                                                                                                                            columnNumberRequired. A column point to set

                                                                                                                                                                                                                                                                            Given the current Range, this function converts those starting and ending points into screen positions, and then returns a new Range object.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                            Given the current Range, this function converts those starting and ending points into screen positions, and then returns a new Range object.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Arguments

                                                                                                                                                                                                                                                                            sessionEditSessionRequired. The EditSession to retrieve coordinates from

                                                                                                                                                                                                                                                                            Returns a string containing the range's row and column information, given like this:

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                            Returns a string containing the range's row and column information, given like this:

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            [start.row/start.column] -> [end.row/end.column]

                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                            + + + + + \ No newline at end of file diff --git a/api/renderloop.html b/api/renderloop.html index 59c98a0c..bdc7cae3 100644 --- a/api/renderloop.html +++ b/api/renderloop.html @@ -1,55 +1,12 @@ + + + + RenderLoop - Ace API

                                                                                                                                                                                                                                                                            Batches changes (that force something to be redrawn) in the background.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Constructors

                                                                                                                                                                                                                                                                              • new RenderLoop(onRender, win)
                                                                                                                                                                                                                                                                              • Internal

                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                            Methods

                                                                                                                                                                                                                                                                              • RenderLoop.schedule(Array change)
                                                                                                                                                                                                                                                                              • Internal

                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                            Arguments

                                                                                                                                                                                                                                                                            changeArrayRequired.
                                                                                                                                                                                                                                                                            + + + + + \ No newline at end of file diff --git a/api/resources/csses/ace_api.css b/api/resources/csses/ace_api.css index 7a90b4c3..b703b26b 100644 --- a/api/resources/csses/ace_api.css +++ b/api/resources/csses/ace_api.css @@ -1,21 +1,22 @@ /* Generic "affects everything" stuff */ - -#wrapper .content .column2 { - float: none; +body { + min-width: 1010px; + color: #2D2D2D; + background: #EDF5FA url(../images/main_bg.png) 0 0 repeat; } -#documentation ul { +ul { font-size: 13px; } -#documentation li { +li { color: black; } -pre { - background-color: #FFFFFF; +a, a:hover { + color : #00438a; } code { @@ -24,13 +25,14 @@ code { font-family: 'Ubuntu Mono',Monaco,Consolas,monospace !important; background-color: #F9F9F9; border-radius: 3px 3px 3px 3px; + box-shadow: 0 0 2px #888888; display: inline-block; padding: 0 4px; margin: 2px 1px; color: inherit; } -#documentation pre { +pre { margin-top: 10px; border-radius: none; box-shadow: none; @@ -49,27 +51,29 @@ code { background : white; } -#documentation pre code { +pre code { background-color: transparent; border-radius: none; box-shadow: none; } -#documentation a code { +a code { color: #00438a; } -#documentation h2 { +h2 { font-size: 26px; } -#documentation p { +p { font-size: 13px; + line-height : 20px; + margin-bottom : 13px; } -#documentation li p:last-child { +li p:last-child { margin-bottom : 5px; } -#documentation blockquote p{ +blockquote p{ font-size: 14px; font-weight: 500; line-height: 23px; @@ -90,10 +94,6 @@ code { zoom:1; /* hasLayout ie7 trigger */ } -.navbar .nav > li > a { - padding: 10px 15px 11px; -} - .navbar { text-align:center; } @@ -111,8 +111,8 @@ code { margin-left: 0px; } .brand { - background: transparent url(../images/ace_logo_menu.png) no-repeat 33px 5px; - width: 80px; + background: transparent url(../images/ace_logo_menu.png) no-repeat 13px 5px; + width: 105px; outline: none; height: 40px; padding: 0 10px !important; @@ -142,34 +142,25 @@ code { Menu venue */ - -h3.api_title { - padding-top: 10px; -} - ul.menu { - margin-left: 2px; + margin-left: 16px; } .menu li { list-style-image: url(../images/menu_disc.png); - margin-bottom: 4px; - font-weight: 700; - padding-left: 10px; - margin-left: 0; + margin-bottom: 3px; + font-weight : 700; } .menu li .menu-item a.menuLink, .menu li .menu-item span.menuLink { - color: #3E7096; - font-weight: 100; + color: #262626; } .menuTwo { margin-bottom: 5px; margin-top: 2px; } .menuTwo li .menu-item a.menuLink { - color: #3E7096; - font-weight: 100; + color: #262626; } /* need specificity to "beat" the above colors */ @@ -181,6 +172,50 @@ ul.menu { Members and the tabs that represent them */ +.members { +/* width: 800px; */ + /*width: 700px;*/ +/* margin: 0 10px;*/ + + height: 42px; + left: 0; +/* position: fixed;*/ + top: 0; +/* transition-duration: 300ms, 300ms; + transition-property: box-shadow, height; + transition-timing-function: ease-out, ease-out; + -moz-transition-duration: 300ms, 300ms; + -moz-transition-property: -moz-box-shadow, height; + -moz-transition-timing-function: ease-out, ease-out; + -o-transition-duration: 300ms, 300ms; + -o-transition-property: -o-box-shadow, height; + -o-transition-timing-function: ease-out, ease-out; + -webkit-transition-duration: 300ms, 300ms; + -webkit-transition-property: -webkit-box-shadow, height; + -webkit-transition-timing-function: ease-out, ease-out;*/ +/* width: 100%;*/ + /*transition-duration: 300ms; + transition-property: box-shadow; + transition-timing-function: ease-out; + -moz-transition-duration: 300ms, 300ms; + -moz-transition-property: -moz-box-shadow, height; + -moz-transition-timing-function: ease-out, ease-out; + -o-transition-duration: 300ms; + -o-transition-property: -o-box-shadow; + -o-transition-timing-function: ease-out;*/ + -webkit-transition-duration: 400ms, 0ms; + -webkit-transition-property: -webkit-box-shadow, background; + -webkit-transition-timing-function: ease-out, ease-out; + z-index: 100; + padding-bottom : 5px; + overflow: visible !important; + +/* background: #FFF; + width: 100%; + padding-bottom: 13px; + top: 40px; + position: fixed;*/ +} .srolled .members { width: 100%; /* -webkit-box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.35); @@ -188,6 +223,7 @@ ul.menu { box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.35); */ padding-bottom: 15px; /* height: 31px;*/ + top: 40px; position: fixed; } .shadow.members{ @@ -234,15 +270,10 @@ ul.menu { } .srolled .membersContent { /*top : 0;*/ - width: 625px; - padding-left: 327px; + width : 695px; + padding-left : 305px; margin : 0 auto 0 auto; } - -.srolled ul.nav { - padding-right: 10px; -} - .membersBackground { /* background-color: white; position: fixed; @@ -276,18 +307,13 @@ ul.menu { } -ul.tabs li:first-child ul{ - left: -63px; -} - .tabs a.menu:after, .tabs .dropdown-toggle:after { margin-top: 22px; } -.nav .dropdown-toggle .caret { - margin-top: 12px; - border-top-color: #6D8CA0; - border-bottom-color: #6D8CA0; +.dropdown .caret { + margin-top: 14px; + color: #6D8CA0; } li.dropdown { @@ -295,12 +321,14 @@ li.dropdown { font-weight: bold; } -.editInC9 { + +.backToMDN, .editInC9 { font-size: 11px; color: #657383; + margin : 0 0 0 5px; } -.editInC9 a { +.backToMDN a, .editInC9 a { color: #657383; font-weight: normal; position : relative; @@ -308,7 +336,7 @@ li.dropdown { } .tabs { - padding-top: 14px; + padding-top: 10px; /*border-bottom: 1px solid #848484;*/ min-height : 27px; padding-bottom : 5px; @@ -335,10 +363,14 @@ li.dropdown { margin-left: 6px; } +.members .tabs ul li { + font-weight: bold; +} + .memberLink a { margin-left: 0 !important; } -.menu-dropdown { +.menu-dropdown, .dropdown-menu { min-width : 105px; max-height: 350px; overflow: auto; @@ -351,6 +383,9 @@ li.dropdown { background-color: #ffffff; color: #000000; } +.dropdown-menu { + border-top: none; +} .tabs a.menu:after, .tabs .dropdown-toggle:after { margin-top: 13px; @@ -398,8 +433,9 @@ li.dropdown { } .tabs .menu-dropdown, .tabs .dropdown-menu { border-radius: 0 0 6px 6px; - left: 10px; - width: 160px; + top: 32px; + right: 0px; + width: 150px; } .srolled .tabs .menu-dropdown, .srolled .tabs .dropdown-menu { top: 32px; @@ -435,6 +471,11 @@ ul.tabs .double ul, ul.tabs .triple ul, ul.tabs .quad ul{ .content { height: 100%; } +.content .row { + width: 1060px; + margin-left: auto; + margin-right: auto; +} header.filler { position: relative; @@ -442,6 +483,11 @@ header.filler { width: 100%; } +.centerpiece { + background: url(../images/sidebar_border.png) repeat-y 230px 0; + height: 100%; +} + /* .container-fluid .row-fluid { width: 1000px; @@ -455,42 +501,44 @@ header.filler { margin-bottom: 3px; } +#sidebarContainer { + margin-right: 60px; +} + +#sidebar { + margin-top: 9px; + /*background: url(../images/sidebar-border.png) repeat-y right 0;*/ + margin-left: 12px; +/* width: 280px;*/ +/* overflow: auto;*/ + padding-right : 10px; +} + #sidebar h3 a, #sidebar h3 a:hover { color: #404040; } -#sidebarContainer { - padding-top: 20px; -} - #mainContent { margin-left: 30px; } #documentation { - padding-top: 35px; padding-bottom: 10px; } #documentation article.article { +/* border-bottom: 1px solid #e9e9e9;*/ border-top: 1px solid #e9e9e9; padding: 16px 10px 2px; - -webkit-transition: padding 0.2s; - -moz-transition: padding 0.2s; - -o-transition: padding 0.2s; } - -#documentation h3.sectionHeader + article.article { - border-top: none; -} - div#documentation article:last-child { border-bottom: 1px solid #e9e9e9; padding-bottom: 40px; } #documentation article.article.methodToggleOpen { background: rgba(255, 255, 255, 0.5); + padding: 20px; font-size: 13px; line-height: 24px; margin: 0 0 10px 0; @@ -615,7 +663,7 @@ li.signature { cursor: pointer; } -#documentation .signature-call a { +.signature-call a { color: #8e487e; } @@ -626,7 +674,7 @@ li.signature { .eventObjName { font-style: italic; } -.eventListenerStart, .eventListenerClose, .eventFunctionOpen, .eventFunctionClose { +.eventListenerStart, .eventFunctionOpen, .eventFunctionClose { color: #999999; } .eventMember { @@ -662,19 +710,14 @@ li.signature { text-transform: capitalize; } -.undocumented { - background-color: #B94A48; - color: #ffffff; -} - -#documentation .alias a, #documentation .related-to a { +.alias a, .related-to a { color: #ffffff; /* text-decoration: underline; */ } -#documentation .alias a:hover, #documentation .related-to a:hover { +.alias a:hover, .related-to a:hover { text-decoration: none; } -.#documentation alias:hover, #documentation .related-to:hover { +.alias:hover, .related-to:hover { opacity: 0.8; cursor: pointer; } @@ -698,8 +741,8 @@ li.signature { color: #ffffff; } .description h4 { - padding-top: 10px; font-size: 18px; + margin: 20px 0 10px; line-height : 18px; } @@ -722,34 +765,15 @@ li.signature { Everyday I'm togglin' */ -#documentation i.methodToggle { - cursor: pointer; - color: #9f9f9f; - padding-top: 2px; - float: left; +#documentation h3 { + font-size: 24px; + margin-top: 5px; } -#documentation i.methodToggle.methodToggleHover { - text-shadow: 0 0 10px #4699d5; - color: #4699d5; +#documentation h3.methodToggle { + margin: 0; } -#documentation i.methodToggle.active { - text-shadow: 0 0 10px #4699d5; - color: #4699d5; - /* Safari */ - -webkit-transform: rotate(45deg); - - /* Firefox */ - -moz-transform: rotate(45deg); - - /* IE */ - -ms-transform: rotate(45deg); - - /* Opera */ - -o-transform: rotate(45deg); - padding-top: 9px; -} - #documentation h3.sectionHeader { + margin: 10px 0 17px 0; line-height : 24px; } @@ -910,3 +934,25 @@ body #dsq-reply h3{ #dsq-global-toolbar, #dsq-pagination, .dsq-trackback-url{ display : none; } + +/* Sticky footer stuff */ + +* { + margin: 0; +} +html, body { + height: 100%; +} +#nonFooter { + height: 100%; + margin: 0 auto -40px; /* the bottom margin is the negative value of the footer's height */ +} +div.push { + height: 40px; /* .push must be the same height as .footer */ +} +#footer, div.push { +clear: both; +} +#footer { + margin-top: 40px; +} \ No newline at end of file diff --git a/api/resources/csses/bootstrap.min.css b/api/resources/csses/bootstrap.min.css new file mode 100644 index 00000000..c9514677 --- /dev/null +++ b/api/resources/csses/bootstrap.min.css @@ -0,0 +1,689 @@ +article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block;} +audio,canvas,video{display:inline-block;*display:inline;*zoom:1;} +audio:not([controls]){display:none;} +html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;} +a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;} +a:hover,a:active{outline:0;} +sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline;} +sup{top:-0.5em;} +sub{bottom:-0.25em;} +img{height:auto;border:0;-ms-interpolation-mode:bicubic;vertical-align:middle;} +button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle;} +button,input{*overflow:visible;line-height:normal;} +button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0;} +button,input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button;} +input[type="search"]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;} +input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none;} +textarea{overflow:auto;vertical-align:top;} +.clearfix{*zoom:1;}.clearfix:before,.clearfix:after{display:table;content:"";} +.clearfix:after{clear:both;} +.hide-text{overflow:hidden;text-indent:100%;white-space:nowrap;} +.input-block-level{display:block;width:100%;min-height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;} +body{margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;line-height:18px;color:#333333;background-color:#ffffff;} +a{color:#0088cc;text-decoration:none;} +a:hover{color:#005580;text-decoration:underline;} +.row{margin-left:-20px;*zoom:1;}.row:before,.row:after{display:table;content:"";} +.row:after{clear:both;} +[class*="span"]{float:left;margin-left:20px;} +.container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px;} +.span12{width:940px;} +.span11{width:860px;} +.span10{width:780px;} +.span9{width:700px;} +.span8{width:620px;} +.span7{width:540px;} +.span6{width:460px;} +.span5{width:380px;} +.span4{width:300px;} +.span3{width:220px;} +.span2{width:140px;} +.span1{width:60px;} +.offset12{margin-left:980px;} +.offset11{margin-left:900px;} +.offset10{margin-left:820px;} +.offset9{margin-left:740px;} +.offset8{margin-left:660px;} +.offset7{margin-left:580px;} +.offset6{margin-left:500px;} +.offset5{margin-left:420px;} +.offset4{margin-left:340px;} +.offset3{margin-left:260px;} +.offset2{margin-left:180px;} +.offset1{margin-left:100px;} +.row-fluid{width:100%;*zoom:1;}.row-fluid:before,.row-fluid:after{display:table;content:"";} +.row-fluid:after{clear:both;} +.row-fluid>[class*="span"]{float:left;margin-left:2.127659574%;} +.row-fluid>[class*="span"]:first-child{margin-left:0;} +.row-fluid > .span12{width:99.99999998999999%;} +.row-fluid > .span11{width:91.489361693%;} +.row-fluid > .span10{width:82.97872339599999%;} +.row-fluid > .span9{width:74.468085099%;} +.row-fluid > .span8{width:65.95744680199999%;} +.row-fluid > .span7{width:57.446808505%;} +.row-fluid > .span6{width:48.93617020799999%;} +.row-fluid > .span5{width:40.425531911%;} +.row-fluid > .span4{width:31.914893614%;} +.row-fluid > .span3{width:23.404255317%;} +.row-fluid > .span2{width:14.89361702%;} +.row-fluid > .span1{width:6.382978723%;} +.container{margin-left:auto;margin-right:auto;*zoom:1;}.container:before,.container:after{display:table;content:"";} +.container:after{clear:both;} +.container-fluid{padding-left:20px;padding-right:20px;*zoom:1;}.container-fluid:before,.container-fluid:after{display:table;content:"";} +.container-fluid:after{clear:both;} +p{margin:0 0 9px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;line-height:18px;}p small{font-size:11px;color:#999999;} +.lead{margin-bottom:18px;font-size:20px;font-weight:200;line-height:27px;} +h1,h2,h3,h4,h5,h6{margin:0;font-family:inherit;font-weight:bold;color:inherit;text-rendering:optimizelegibility;}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{font-weight:normal;color:#999999;} +h1{font-size:30px;line-height:36px;}h1 small{font-size:18px;} +h2{font-size:24px;line-height:36px;}h2 small{font-size:18px;} +h3{line-height:27px;font-size:18px;}h3 small{font-size:14px;} +h4,h5,h6{line-height:18px;} +h4{font-size:14px;}h4 small{font-size:12px;} +h5{font-size:12px;} +h6{font-size:11px;color:#999999;text-transform:uppercase;} +.page-header{padding-bottom:17px;margin:18px 0;border-bottom:1px solid #eeeeee;} +.page-header h1{line-height:1;} +ul,ol{padding:0;margin:0 0 9px 25px;} +ul ul,ul ol,ol ol,ol ul{margin-bottom:0;} +ul{list-style:disc;} +ol{list-style:decimal;} +li{line-height:18px;} +ul.unstyled,ol.unstyled{margin-left:0;list-style:none;} +dl{margin-bottom:18px;} +dt,dd{line-height:18px;} +dt{font-weight:bold;line-height:17px;} +dd{margin-left:9px;} +.dl-horizontal dt{float:left;clear:left;width:120px;text-align:right;} +.dl-horizontal dd{margin-left:130px;} +hr{margin:18px 0;border:0;border-top:1px solid #eeeeee;border-bottom:1px solid #ffffff;} +strong{font-weight:bold;} +em{font-style:italic;} +.muted{color:#999999;} +abbr[title]{border-bottom:1px dotted #ddd;cursor:help;} +abbr.initialism{font-size:90%;text-transform:uppercase;} +blockquote{padding:0 0 0 15px;margin:0 0 18px;border-left:5px solid #eeeeee;}blockquote p{margin-bottom:0;font-size:16px;font-weight:300;line-height:22.5px;} +blockquote small{display:block;line-height:18px;color:#999999;}blockquote small:before{content:'\2014 \00A0';} +blockquote.pull-right{float:right;padding-left:0;padding-right:15px;border-left:0;border-right:5px solid #eeeeee;}blockquote.pull-right p,blockquote.pull-right small{text-align:right;} +q:before,q:after,blockquote:before,blockquote:after{content:"";} +address{display:block;margin-bottom:18px;line-height:18px;font-style:normal;} +small{font-size:100%;} +cite{font-style:normal;} +code,pre{padding:0 3px 2px;font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;color:#333333;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} +code{padding:2px 4px;color:#d14;background-color:#f7f7f9;border:1px solid #e1e1e8;} +pre{display:block;padding:8.5px;margin:0 0 9px;font-size:12.025px;line-height:18px;background-color:#f5f5f5;border:1px solid #ccc;border:1px solid rgba(0, 0, 0, 0.15);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;white-space:pre;white-space:pre-wrap;word-break:break-all;word-wrap:break-word;}pre.prettyprint{margin-bottom:18px;} +pre code{padding:0;color:inherit;background-color:transparent;border:0;} +.pre-scrollable{max-height:340px;overflow-y:scroll;} +form{margin:0 0 18px;} +fieldset{padding:0;margin:0;border:0;} +legend{display:block;width:100%;padding:0;margin-bottom:27px;font-size:19.5px;line-height:36px;color:#333333;border:0;border-bottom:1px solid #eee;}legend small{font-size:13.5px;color:#999999;} +label,input,button,select,textarea{font-size:13px;font-weight:normal;line-height:18px;} +input,button,select,textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;} +label{display:block;margin-bottom:5px;color:#333333;} +input,textarea,select,.uneditable-input{display:inline-block;width:210px;height:18px;padding:4px;margin-bottom:9px;font-size:13px;line-height:18px;color:#555555;border:1px solid #cccccc;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} +.uneditable-textarea{width:auto;height:auto;} +label input,label textarea,label select{display:block;} +input[type="image"],input[type="checkbox"],input[type="radio"]{width:auto;height:auto;padding:0;margin:3px 0;*margin-top:0;line-height:normal;cursor:pointer;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;border:0 \9;} +input[type="image"]{border:0;} +input[type="file"]{width:auto;padding:initial;line-height:initial;border:initial;background-color:#ffffff;background-color:initial;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;} +input[type="button"],input[type="reset"],input[type="submit"]{width:auto;height:auto;} +select,input[type="file"]{height:28px;*margin-top:4px;line-height:28px;} +input[type="file"]{line-height:18px \9;} +select{width:220px;background-color:#ffffff;} +select[multiple],select[size]{height:auto;} +input[type="image"]{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;} +textarea{height:auto;} +input[type="hidden"]{display:none;} +.radio,.checkbox{padding-left:18px;} +.radio input[type="radio"],.checkbox input[type="checkbox"]{float:left;margin-left:-18px;} +.controls>.radio:first-child,.controls>.checkbox:first-child{padding-top:5px;} +.radio.inline,.checkbox.inline{display:inline-block;padding-top:5px;margin-bottom:0;vertical-align:middle;} +.radio.inline+.radio.inline,.checkbox.inline+.checkbox.inline{margin-left:10px;} +input,textarea{-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-webkit-transition:border linear 0.2s,box-shadow linear 0.2s;-moz-transition:border linear 0.2s,box-shadow linear 0.2s;-ms-transition:border linear 0.2s,box-shadow linear 0.2s;-o-transition:border linear 0.2s,box-shadow linear 0.2s;transition:border linear 0.2s,box-shadow linear 0.2s;} +input:focus,textarea:focus{border-color:rgba(82, 168, 236, 0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 8px rgba(82, 168, 236, 0.6);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 8px rgba(82, 168, 236, 0.6);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 8px rgba(82, 168, 236, 0.6);outline:0;outline:thin dotted \9;} +input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus,select:focus{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;} +.input-mini{width:60px;} +.input-small{width:90px;} +.input-medium{width:150px;} +.input-large{width:210px;} +.input-xlarge{width:270px;} +.input-xxlarge{width:530px;} +input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input{float:none;margin-left:0;} +input,textarea,.uneditable-input{margin-left:0;} +input.span12, textarea.span12, .uneditable-input.span12{width:930px;} +input.span11, textarea.span11, .uneditable-input.span11{width:850px;} +input.span10, textarea.span10, .uneditable-input.span10{width:770px;} +input.span9, textarea.span9, .uneditable-input.span9{width:690px;} +input.span8, textarea.span8, .uneditable-input.span8{width:610px;} +input.span7, textarea.span7, .uneditable-input.span7{width:530px;} +input.span6, textarea.span6, .uneditable-input.span6{width:450px;} +input.span5, textarea.span5, .uneditable-input.span5{width:370px;} +input.span4, textarea.span4, .uneditable-input.span4{width:290px;} +input.span3, textarea.span3, .uneditable-input.span3{width:210px;} +input.span2, textarea.span2, .uneditable-input.span2{width:130px;} +input.span1, textarea.span1, .uneditable-input.span1{width:50px;} +input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{background-color:#eeeeee;border-color:#ddd;cursor:not-allowed;} +.control-group.warning>label,.control-group.warning .help-block,.control-group.warning .help-inline{color:#c09853;} +.control-group.warning input,.control-group.warning select,.control-group.warning textarea{color:#c09853;border-color:#c09853;}.control-group.warning input:focus,.control-group.warning select:focus,.control-group.warning textarea:focus{border-color:#a47e3c;-webkit-box-shadow:0 0 6px #dbc59e;-moz-box-shadow:0 0 6px #dbc59e;box-shadow:0 0 6px #dbc59e;} +.control-group.warning .input-prepend .add-on,.control-group.warning .input-append .add-on{color:#c09853;background-color:#fcf8e3;border-color:#c09853;} +.control-group.error>label,.control-group.error .help-block,.control-group.error .help-inline{color:#b94a48;} +.control-group.error input,.control-group.error select,.control-group.error textarea{color:#b94a48;border-color:#b94a48;}.control-group.error input:focus,.control-group.error select:focus,.control-group.error textarea:focus{border-color:#953b39;-webkit-box-shadow:0 0 6px #d59392;-moz-box-shadow:0 0 6px #d59392;box-shadow:0 0 6px #d59392;} +.control-group.error .input-prepend .add-on,.control-group.error .input-append .add-on{color:#b94a48;background-color:#f2dede;border-color:#b94a48;} +.control-group.success>label,.control-group.success .help-block,.control-group.success .help-inline{color:#468847;} +.control-group.success input,.control-group.success select,.control-group.success textarea{color:#468847;border-color:#468847;}.control-group.success input:focus,.control-group.success select:focus,.control-group.success textarea:focus{border-color:#356635;-webkit-box-shadow:0 0 6px #7aba7b;-moz-box-shadow:0 0 6px #7aba7b;box-shadow:0 0 6px #7aba7b;} +.control-group.success .input-prepend .add-on,.control-group.success .input-append .add-on{color:#468847;background-color:#dff0d8;border-color:#468847;} +input:focus:required:invalid,textarea:focus:required:invalid,select:focus:required:invalid{color:#b94a48;border-color:#ee5f5b;}input:focus:required:invalid:focus,textarea:focus:required:invalid:focus,select:focus:required:invalid:focus{border-color:#e9322d;-webkit-box-shadow:0 0 6px #f8b9b7;-moz-box-shadow:0 0 6px #f8b9b7;box-shadow:0 0 6px #f8b9b7;} +.form-actions{padding:17px 20px 18px;margin-top:18px;margin-bottom:18px;background-color:#eeeeee;border-top:1px solid #ddd;*zoom:1;}.form-actions:before,.form-actions:after{display:table;content:"";} +.form-actions:after{clear:both;} +.uneditable-input{display:block;background-color:#ffffff;border-color:#eee;-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);-moz-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);cursor:not-allowed;} +:-moz-placeholder{color:#999999;} +::-webkit-input-placeholder{color:#999999;} +.help-block,.help-inline{color:#555555;} +.help-block{display:block;margin-bottom:9px;} +.help-inline{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;padding-left:5px;} +.input-prepend,.input-append{margin-bottom:5px;}.input-prepend input,.input-append input,.input-prepend select,.input-append select,.input-prepend .uneditable-input,.input-append .uneditable-input{*margin-left:0;-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0;}.input-prepend input:focus,.input-append input:focus,.input-prepend select:focus,.input-append select:focus,.input-prepend .uneditable-input:focus,.input-append .uneditable-input:focus{position:relative;z-index:2;} +.input-prepend .uneditable-input,.input-append .uneditable-input{border-left-color:#ccc;} +.input-prepend .add-on,.input-append .add-on{display:inline-block;width:auto;min-width:16px;height:18px;padding:4px 5px;font-weight:normal;line-height:18px;text-align:center;text-shadow:0 1px 0 #ffffff;vertical-align:middle;background-color:#eeeeee;border:1px solid #ccc;} +.input-prepend .add-on,.input-append .add-on,.input-prepend .btn,.input-append .btn{-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;} +.input-prepend .active,.input-append .active{background-color:#a9dba9;border-color:#46a546;} +.input-prepend .add-on,.input-prepend .btn{margin-right:-1px;} +.input-append input,.input-append select .uneditable-input{-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;} +.input-append .uneditable-input{border-left-color:#eee;border-right-color:#ccc;} +.input-append .add-on,.input-append .btn{margin-left:-1px;-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0;} +.input-prepend.input-append input,.input-prepend.input-append select,.input-prepend.input-append .uneditable-input{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} +.input-prepend.input-append .add-on:first-child,.input-prepend.input-append .btn:first-child{margin-right:-1px;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;} +.input-prepend.input-append .add-on:last-child,.input-prepend.input-append .btn:last-child{margin-left:-1px;-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0;} +.search-query{padding-left:14px;padding-right:14px;margin-bottom:0;-webkit-border-radius:14px;-moz-border-radius:14px;border-radius:14px;} +.form-search input,.form-inline input,.form-horizontal input,.form-search textarea,.form-inline textarea,.form-horizontal textarea,.form-search select,.form-inline select,.form-horizontal select,.form-search .help-inline,.form-inline .help-inline,.form-horizontal .help-inline,.form-search .uneditable-input,.form-inline .uneditable-input,.form-horizontal .uneditable-input,.form-search .input-prepend,.form-inline .input-prepend,.form-horizontal .input-prepend,.form-search .input-append,.form-inline .input-append,.form-horizontal .input-append{display:inline-block;margin-bottom:0;} +.form-search .hide,.form-inline .hide,.form-horizontal .hide{display:none;} +.form-search label,.form-inline label{display:inline-block;} +.form-search .input-append,.form-inline .input-append,.form-search .input-prepend,.form-inline .input-prepend{margin-bottom:0;} +.form-search .radio,.form-search .checkbox,.form-inline .radio,.form-inline .checkbox{padding-left:0;margin-bottom:0;vertical-align:middle;} +.form-search .radio input[type="radio"],.form-search .checkbox input[type="checkbox"],.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{float:left;margin-left:0;margin-right:3px;} +.control-group{margin-bottom:9px;} +legend+.control-group{margin-top:18px;-webkit-margin-top-collapse:separate;} +.form-horizontal .control-group{margin-bottom:18px;*zoom:1;}.form-horizontal .control-group:before,.form-horizontal .control-group:after{display:table;content:"";} +.form-horizontal .control-group:after{clear:both;} +.form-horizontal .control-label{float:left;width:140px;padding-top:5px;text-align:right;} +.form-horizontal .controls{margin-left:160px;*display:inline-block;*margin-left:0;*padding-left:20px;} +.form-horizontal .help-block{margin-top:9px;margin-bottom:0;} +.form-horizontal .form-actions{padding-left:160px;} +table{max-width:100%;border-collapse:collapse;border-spacing:0;background-color:transparent;} +.table{width:100%;margin-bottom:18px;}.table th,.table td{padding:8px;line-height:18px;text-align:left;vertical-align:top;border-top:1px solid #dddddd;} +.table th{font-weight:bold;} +.table thead th{vertical-align:bottom;} +.table colgroup+thead tr:first-child th,.table colgroup+thead tr:first-child td,.table thead:first-child tr:first-child th,.table thead:first-child tr:first-child td{border-top:0;} +.table tbody+tbody{border-top:2px solid #dddddd;} +.table-condensed th,.table-condensed td{padding:4px 5px;} +.table-bordered{border:1px solid #dddddd;border-left:0;border-collapse:separate;*border-collapse:collapsed;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}.table-bordered th,.table-bordered td{border-left:1px solid #dddddd;} +.table-bordered thead:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child td{border-top:0;} +.table-bordered thead:first-child tr:first-child th:first-child,.table-bordered tbody:first-child tr:first-child td:first-child{-webkit-border-radius:4px 0 0 0;-moz-border-radius:4px 0 0 0;border-radius:4px 0 0 0;} +.table-bordered thead:first-child tr:first-child th:last-child,.table-bordered tbody:first-child tr:first-child td:last-child{-webkit-border-radius:0 4px 0 0;-moz-border-radius:0 4px 0 0;border-radius:0 4px 0 0;} +.table-bordered thead:last-child tr:last-child th:first-child,.table-bordered tbody:last-child tr:last-child td:first-child{-webkit-border-radius:0 0 0 4px;-moz-border-radius:0 0 0 4px;border-radius:0 0 0 4px;} +.table-bordered thead:last-child tr:last-child th:last-child,.table-bordered tbody:last-child tr:last-child td:last-child{-webkit-border-radius:0 0 4px 0;-moz-border-radius:0 0 4px 0;border-radius:0 0 4px 0;} +.table-striped tbody tr:nth-child(odd) td,.table-striped tbody tr:nth-child(odd) th{background-color:#f9f9f9;} +.table tbody tr:hover td,.table tbody tr:hover th{background-color:#f5f5f5;} +table .span1{float:none;width:44px;margin-left:0;} +table .span2{float:none;width:124px;margin-left:0;} +table .span3{float:none;width:204px;margin-left:0;} +table .span4{float:none;width:284px;margin-left:0;} +table .span5{float:none;width:364px;margin-left:0;} +table .span6{float:none;width:444px;margin-left:0;} +table .span7{float:none;width:524px;margin-left:0;} +table .span8{float:none;width:604px;margin-left:0;} +table .span9{float:none;width:684px;margin-left:0;} +table .span10{float:none;width:764px;margin-left:0;} +table .span11{float:none;width:844px;margin-left:0;} +table .span12{float:none;width:924px;margin-left:0;} +table .span13{float:none;width:1004px;margin-left:0;} +table .span14{float:none;width:1084px;margin-left:0;} +table .span15{float:none;width:1164px;margin-left:0;} +table .span16{float:none;width:1244px;margin-left:0;} +table .span17{float:none;width:1324px;margin-left:0;} +table .span18{float:none;width:1404px;margin-left:0;} +table .span19{float:none;width:1484px;margin-left:0;} +table .span20{float:none;width:1564px;margin-left:0;} +table .span21{float:none;width:1644px;margin-left:0;} +table .span22{float:none;width:1724px;margin-left:0;} +table .span23{float:none;width:1804px;margin-left:0;} +table .span24{float:none;width:1884px;margin-left:0;} +[class^="icon-"],[class*=" icon-"]{display:inline-block;width:14px;height:14px;line-height:14px;vertical-align:text-top;background-image:url("../img/glyphicons-halflings.png");background-position:14px 14px;background-repeat:no-repeat;*margin-right:.3em;}[class^="icon-"]:last-child,[class*=" icon-"]:last-child{*margin-left:0;} +.icon-white{background-image:url("../img/glyphicons-halflings-white.png");} +.icon-glass{background-position:0 0;} +.icon-music{background-position:-24px 0;} +.icon-search{background-position:-48px 0;} +.icon-envelope{background-position:-72px 0;} +.icon-heart{background-position:-96px 0;} +.icon-star{background-position:-120px 0;} +.icon-star-empty{background-position:-144px 0;} +.icon-user{background-position:-168px 0;} +.icon-film{background-position:-192px 0;} +.icon-th-large{background-position:-216px 0;} +.icon-th{background-position:-240px 0;} +.icon-th-list{background-position:-264px 0;} +.icon-ok{background-position:-288px 0;} +.icon-remove{background-position:-312px 0;} +.icon-zoom-in{background-position:-336px 0;} +.icon-zoom-out{background-position:-360px 0;} +.icon-off{background-position:-384px 0;} +.icon-signal{background-position:-408px 0;} +.icon-cog{background-position:-432px 0;} +.icon-trash{background-position:-456px 0;} +.icon-home{background-position:0 -24px;} +.icon-file{background-position:-24px -24px;} +.icon-time{background-position:-48px -24px;} +.icon-road{background-position:-72px -24px;} +.icon-download-alt{background-position:-96px -24px;} +.icon-download{background-position:-120px -24px;} +.icon-upload{background-position:-144px -24px;} +.icon-inbox{background-position:-168px -24px;} +.icon-play-circle{background-position:-192px -24px;} +.icon-repeat{background-position:-216px -24px;} +.icon-refresh{background-position:-240px -24px;} +.icon-list-alt{background-position:-264px -24px;} +.icon-lock{background-position:-287px -24px;} +.icon-flag{background-position:-312px -24px;} +.icon-headphones{background-position:-336px -24px;} +.icon-volume-off{background-position:-360px -24px;} +.icon-volume-down{background-position:-384px -24px;} +.icon-volume-up{background-position:-408px -24px;} +.icon-qrcode{background-position:-432px -24px;} +.icon-barcode{background-position:-456px -24px;} +.icon-tag{background-position:0 -48px;} +.icon-tags{background-position:-25px -48px;} +.icon-book{background-position:-48px -48px;} +.icon-bookmark{background-position:-72px -48px;} +.icon-print{background-position:-96px -48px;} +.icon-camera{background-position:-120px -48px;} +.icon-font{background-position:-144px -48px;} +.icon-bold{background-position:-167px -48px;} +.icon-italic{background-position:-192px -48px;} +.icon-text-height{background-position:-216px -48px;} +.icon-text-width{background-position:-240px -48px;} +.icon-align-left{background-position:-264px -48px;} +.icon-align-center{background-position:-288px -48px;} +.icon-align-right{background-position:-312px -48px;} +.icon-align-justify{background-position:-336px -48px;} +.icon-list{background-position:-360px -48px;} +.icon-indent-left{background-position:-384px -48px;} +.icon-indent-right{background-position:-408px -48px;} +.icon-facetime-video{background-position:-432px -48px;} +.icon-picture{background-position:-456px -48px;} +.icon-pencil{background-position:0 -72px;} +.icon-map-marker{background-position:-24px -72px;} +.icon-adjust{background-position:-48px -72px;} +.icon-tint{background-position:-72px -72px;} +.icon-edit{background-position:-96px -72px;} +.icon-share{background-position:-120px -72px;} +.icon-check{background-position:-144px -72px;} +.icon-move{background-position:-168px -72px;} +.icon-step-backward{background-position:-192px -72px;} +.icon-fast-backward{background-position:-216px -72px;} +.icon-backward{background-position:-240px -72px;} +.icon-play{background-position:-264px -72px;} +.icon-pause{background-position:-288px -72px;} +.icon-stop{background-position:-312px -72px;} +.icon-forward{background-position:-336px -72px;} +.icon-fast-forward{background-position:-360px -72px;} +.icon-step-forward{background-position:-384px -72px;} +.icon-eject{background-position:-408px -72px;} +.icon-chevron-left{background-position:-432px -72px;} +.icon-chevron-right{background-position:-456px -72px;} +.icon-plus-sign{background-position:0 -96px;} +.icon-minus-sign{background-position:-24px -96px;} +.icon-remove-sign{background-position:-48px -96px;} +.icon-ok-sign{background-position:-72px -96px;} +.icon-question-sign{background-position:-96px -96px;} +.icon-info-sign{background-position:-120px -96px;} +.icon-screenshot{background-position:-144px -96px;} +.icon-remove-circle{background-position:-168px -96px;} +.icon-ok-circle{background-position:-192px -96px;} +.icon-ban-circle{background-position:-216px -96px;} +.icon-arrow-left{background-position:-240px -96px;} +.icon-arrow-right{background-position:-264px -96px;} +.icon-arrow-up{background-position:-289px -96px;} +.icon-arrow-down{background-position:-312px -96px;} +.icon-share-alt{background-position:-336px -96px;} +.icon-resize-full{background-position:-360px -96px;} +.icon-resize-small{background-position:-384px -96px;} +.icon-plus{background-position:-408px -96px;} +.icon-minus{background-position:-433px -96px;} +.icon-asterisk{background-position:-456px -96px;} +.icon-exclamation-sign{background-position:0 -120px;} +.icon-gift{background-position:-24px -120px;} +.icon-leaf{background-position:-48px -120px;} +.icon-fire{background-position:-72px -120px;} +.icon-eye-open{background-position:-96px -120px;} +.icon-eye-close{background-position:-120px -120px;} +.icon-warning-sign{background-position:-144px -120px;} +.icon-plane{background-position:-168px -120px;} +.icon-calendar{background-position:-192px -120px;} +.icon-random{background-position:-216px -120px;} +.icon-comment{background-position:-240px -120px;} +.icon-magnet{background-position:-264px -120px;} +.icon-chevron-up{background-position:-288px -120px;} +.icon-chevron-down{background-position:-313px -119px;} +.icon-retweet{background-position:-336px -120px;} +.icon-shopping-cart{background-position:-360px -120px;} +.icon-folder-close{background-position:-384px -120px;} +.icon-folder-open{background-position:-408px -120px;} +.icon-resize-vertical{background-position:-432px -119px;} +.icon-resize-horizontal{background-position:-456px -118px;} +.dropdown{position:relative;} +.dropdown-toggle{*margin-bottom:-3px;} +.dropdown-toggle:active,.open .dropdown-toggle{outline:0;} +.caret{display:inline-block;width:0;height:0;vertical-align:top;border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid #000000;opacity:0.3;filter:alpha(opacity=30);content:"";} +.dropdown .caret{margin-top:8px;margin-left:2px;} +.dropdown:hover .caret,.open.dropdown .caret{opacity:1;filter:alpha(opacity=100);} +.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;float:left;display:none;min-width:160px;padding:4px 0;margin:0;list-style:none;background-color:#ffffff;border-color:#ccc;border-color:rgba(0, 0, 0, 0.2);border-style:solid;border-width:1px;-webkit-border-radius:0 0 5px 5px;-moz-border-radius:0 0 5px 5px;border-radius:0 0 5px 5px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box;*border-right-width:2px;*border-bottom-width:2px;}.dropdown-menu.pull-right{right:0;left:auto;} +.dropdown-menu .divider{height:1px;margin:8px 1px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #ffffff;*width:100%;*margin:-5px 0 5px;} +.dropdown-menu a{display:block;padding:3px 15px;clear:both;font-weight:normal;line-height:18px;color:#333333;white-space:nowrap;} +.dropdown-menu li>a:hover,.dropdown-menu .active>a,.dropdown-menu .active>a:hover{color:#ffffff;text-decoration:none;background-color:#0088cc;} +.dropdown.open{*z-index:1000;}.dropdown.open .dropdown-toggle{color:#ffffff;background:#ccc;background:rgba(0, 0, 0, 0.3);} +.dropdown.open .dropdown-menu{display:block;} +.pull-right .dropdown-menu{left:auto;right:0;} +.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid #000000;content:"\2191";} +.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px;} +.typeahead{margin-top:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} +.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #eee;border:1px solid rgba(0, 0, 0, 0.05);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);}.well blockquote{border-color:#ddd;border-color:rgba(0, 0, 0, 0.15);} +.well-large{padding:24px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;} +.well-small{padding:9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} +.fade{-webkit-transition:opacity 0.15s linear;-moz-transition:opacity 0.15s linear;-ms-transition:opacity 0.15s linear;-o-transition:opacity 0.15s linear;transition:opacity 0.15s linear;opacity:0;}.fade.in{opacity:1;} +.collapse{-webkit-transition:height 0.35s ease;-moz-transition:height 0.35s ease;-ms-transition:height 0.35s ease;-o-transition:height 0.35s ease;transition:height 0.35s ease;position:relative;overflow:hidden;height:0;}.collapse.in{height:auto;} +.close{float:right;font-size:20px;font-weight:bold;line-height:18px;color:#000000;text-shadow:0 1px 0 #ffffff;opacity:0.2;filter:alpha(opacity=20);}.close:hover{color:#000000;text-decoration:none;opacity:0.4;filter:alpha(opacity=40);cursor:pointer;} +.btn{display:inline-block;*display:inline;*zoom:1;padding:4px 10px 4px;margin-bottom:0;font-size:13px;line-height:18px;color:#333333;text-align:center;text-shadow:0 1px 1px rgba(255, 255, 255, 0.75);vertical-align:middle;background-color:#f5f5f5;background-image:-moz-linear-gradient(top, #ffffff, #e6e6e6);background-image:-ms-linear-gradient(top, #ffffff, #e6e6e6);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));background-image:-webkit-linear-gradient(top, #ffffff, #e6e6e6);background-image:-o-linear-gradient(top, #ffffff, #e6e6e6);background-image:linear-gradient(top, #ffffff, #e6e6e6);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0);border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);filter:progid:dximagetransform.microsoft.gradient(enabled=false);border:1px solid #cccccc;border-bottom-color:#b3b3b3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);cursor:pointer;*margin-left:.3em;}.btn:hover,.btn:active,.btn.active,.btn.disabled,.btn[disabled]{background-color:#e6e6e6;} +.btn:active,.btn.active{background-color:#cccccc \9;} +.btn:first-child{*margin-left:0;} +.btn:hover{color:#333333;text-decoration:none;background-color:#e6e6e6;background-position:0 -15px;-webkit-transition:background-position 0.1s linear;-moz-transition:background-position 0.1s linear;-ms-transition:background-position 0.1s linear;-o-transition:background-position 0.1s linear;transition:background-position 0.1s linear;} +.btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;} +.btn.active,.btn:active{background-image:none;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);background-color:#e6e6e6;background-color:#d9d9d9 \9;outline:0;} +.btn.disabled,.btn[disabled]{cursor:default;background-image:none;background-color:#e6e6e6;opacity:0.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;} +.btn-large{padding:9px 14px;font-size:15px;line-height:normal;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;} +.btn-large [class^="icon-"]{margin-top:1px;} +.btn-small{padding:5px 9px;font-size:11px;line-height:16px;} +.btn-small [class^="icon-"]{margin-top:-1px;} +.btn-mini{padding:2px 6px;font-size:11px;line-height:14px;} +.btn-primary,.btn-primary:hover,.btn-warning,.btn-warning:hover,.btn-danger,.btn-danger:hover,.btn-success,.btn-success:hover,.btn-info,.btn-info:hover,.btn-inverse,.btn-inverse:hover{text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);color:#ffffff;} +.btn-primary.active,.btn-warning.active,.btn-danger.active,.btn-success.active,.btn-info.active,.btn-inverse.active{color:rgba(255, 255, 255, 0.75);} +.btn-primary{background-color:#0074cc;background-image:-moz-linear-gradient(top, #0088cc, #0055cc);background-image:-ms-linear-gradient(top, #0088cc, #0055cc);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0055cc));background-image:-webkit-linear-gradient(top, #0088cc, #0055cc);background-image:-o-linear-gradient(top, #0088cc, #0055cc);background-image:linear-gradient(top, #0088cc, #0055cc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0055cc', GradientType=0);border-color:#0055cc #0055cc #003580;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);filter:progid:dximagetransform.microsoft.gradient(enabled=false);}.btn-primary:hover,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled]{background-color:#0055cc;} +.btn-primary:active,.btn-primary.active{background-color:#004099 \9;} +.btn-warning{background-color:#faa732;background-image:-moz-linear-gradient(top, #fbb450, #f89406);background-image:-ms-linear-gradient(top, #fbb450, #f89406);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));background-image:-webkit-linear-gradient(top, #fbb450, #f89406);background-image:-o-linear-gradient(top, #fbb450, #f89406);background-image:linear-gradient(top, #fbb450, #f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fbb450', endColorstr='#f89406', GradientType=0);border-color:#f89406 #f89406 #ad6704;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);filter:progid:dximagetransform.microsoft.gradient(enabled=false);}.btn-warning:hover,.btn-warning:active,.btn-warning.active,.btn-warning.disabled,.btn-warning[disabled]{background-color:#f89406;} +.btn-warning:active,.btn-warning.active{background-color:#c67605 \9;} +.btn-danger{background-color:#da4f49;background-image:-moz-linear-gradient(top, #ee5f5b, #bd362f);background-image:-ms-linear-gradient(top, #ee5f5b, #bd362f);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f));background-image:-webkit-linear-gradient(top, #ee5f5b, #bd362f);background-image:-o-linear-gradient(top, #ee5f5b, #bd362f);background-image:linear-gradient(top, #ee5f5b, #bd362f);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#bd362f', GradientType=0);border-color:#bd362f #bd362f #802420;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);filter:progid:dximagetransform.microsoft.gradient(enabled=false);}.btn-danger:hover,.btn-danger:active,.btn-danger.active,.btn-danger.disabled,.btn-danger[disabled]{background-color:#bd362f;} +.btn-danger:active,.btn-danger.active{background-color:#942a25 \9;} +.btn-success{background-color:#5bb75b;background-image:-moz-linear-gradient(top, #62c462, #51a351);background-image:-ms-linear-gradient(top, #62c462, #51a351);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351));background-image:-webkit-linear-gradient(top, #62c462, #51a351);background-image:-o-linear-gradient(top, #62c462, #51a351);background-image:linear-gradient(top, #62c462, #51a351);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#51a351', GradientType=0);border-color:#51a351 #51a351 #387038;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);filter:progid:dximagetransform.microsoft.gradient(enabled=false);}.btn-success:hover,.btn-success:active,.btn-success.active,.btn-success.disabled,.btn-success[disabled]{background-color:#51a351;} +.btn-success:active,.btn-success.active{background-color:#408140 \9;} +.btn-info{background-color:#49afcd;background-image:-moz-linear-gradient(top, #5bc0de, #2f96b4);background-image:-ms-linear-gradient(top, #5bc0de, #2f96b4);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4));background-image:-webkit-linear-gradient(top, #5bc0de, #2f96b4);background-image:-o-linear-gradient(top, #5bc0de, #2f96b4);background-image:linear-gradient(top, #5bc0de, #2f96b4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#2f96b4', GradientType=0);border-color:#2f96b4 #2f96b4 #1f6377;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);filter:progid:dximagetransform.microsoft.gradient(enabled=false);}.btn-info:hover,.btn-info:active,.btn-info.active,.btn-info.disabled,.btn-info[disabled]{background-color:#2f96b4;} +.btn-info:active,.btn-info.active{background-color:#24748c \9;} +.btn-inverse{background-color:#414141;background-image:-moz-linear-gradient(top, #555555, #222222);background-image:-ms-linear-gradient(top, #555555, #222222);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#555555), to(#222222));background-image:-webkit-linear-gradient(top, #555555, #222222);background-image:-o-linear-gradient(top, #555555, #222222);background-image:linear-gradient(top, #555555, #222222);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#555555', endColorstr='#222222', GradientType=0);border-color:#222222 #222222 #000000;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);filter:progid:dximagetransform.microsoft.gradient(enabled=false);}.btn-inverse:hover,.btn-inverse:active,.btn-inverse.active,.btn-inverse.disabled,.btn-inverse[disabled]{background-color:#222222;} +.btn-inverse:active,.btn-inverse.active{background-color:#080808 \9;} +button.btn,input[type="submit"].btn{*padding-top:2px;*padding-bottom:2px;}button.btn::-moz-focus-inner,input[type="submit"].btn::-moz-focus-inner{padding:0;border:0;} +button.btn.btn-large,input[type="submit"].btn.btn-large{*padding-top:7px;*padding-bottom:7px;} +button.btn.btn-small,input[type="submit"].btn.btn-small{*padding-top:3px;*padding-bottom:3px;} +button.btn.btn-mini,input[type="submit"].btn.btn-mini{*padding-top:1px;*padding-bottom:1px;} +.btn-group{position:relative;*zoom:1;*margin-left:.3em;}.btn-group:before,.btn-group:after{display:table;content:"";} +.btn-group:after{clear:both;} +.btn-group:first-child{*margin-left:0;} +.btn-group+.btn-group{margin-left:5px;} +.btn-toolbar{margin-top:9px;margin-bottom:9px;}.btn-toolbar .btn-group{display:inline-block;*display:inline;*zoom:1;} +.btn-group .btn{position:relative;float:left;margin-left:-1px;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} +.btn-group .btn:first-child{margin-left:0;-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px;border-top-left-radius:4px;-webkit-border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px;border-bottom-left-radius:4px;} +.btn-group .btn:last-child,.btn-group .dropdown-toggle{-webkit-border-top-right-radius:4px;-moz-border-radius-topright:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px;border-bottom-right-radius:4px;} +.btn-group .btn.large:first-child{margin-left:0;-webkit-border-top-left-radius:6px;-moz-border-radius-topleft:6px;border-top-left-radius:6px;-webkit-border-bottom-left-radius:6px;-moz-border-radius-bottomleft:6px;border-bottom-left-radius:6px;} +.btn-group .btn.large:last-child,.btn-group .large.dropdown-toggle{-webkit-border-top-right-radius:6px;-moz-border-radius-topright:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;-moz-border-radius-bottomright:6px;border-bottom-right-radius:6px;} +.btn-group .btn:hover,.btn-group .btn:focus,.btn-group .btn:active,.btn-group .btn.active{z-index:2;} +.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0;} +.btn-group .dropdown-toggle{padding-left:8px;padding-right:8px;-webkit-box-shadow:inset 1px 0 0 rgba(255, 255, 255, 0.125),inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 1px 0 0 rgba(255, 255, 255, 0.125),inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 1px 0 0 rgba(255, 255, 255, 0.125),inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);*padding-top:3px;*padding-bottom:3px;} +.btn-group .btn-mini.dropdown-toggle{padding-left:5px;padding-right:5px;*padding-top:1px;*padding-bottom:1px;} +.btn-group .btn-small.dropdown-toggle{*padding-top:4px;*padding-bottom:4px;} +.btn-group .btn-large.dropdown-toggle{padding-left:12px;padding-right:12px;} +.btn-group.open{*z-index:1000;}.btn-group.open .dropdown-menu{display:block;margin-top:1px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;} +.btn-group.open .dropdown-toggle{background-image:none;-webkit-box-shadow:inset 0 1px 6px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 6px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 6px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);} +.btn .caret{margin-top:7px;margin-left:0;} +.btn:hover .caret,.open.btn-group .caret{opacity:1;filter:alpha(opacity=100);} +.btn-mini .caret{margin-top:5px;} +.btn-small .caret{margin-top:6px;} +.btn-large .caret{margin-top:6px;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #000000;} +.btn-primary .caret,.btn-warning .caret,.btn-danger .caret,.btn-info .caret,.btn-success .caret,.btn-inverse .caret{border-top-color:#ffffff;border-bottom-color:#ffffff;opacity:0.75;filter:alpha(opacity=75);} +.alert{padding:8px 35px 8px 14px;margin-bottom:18px;text-shadow:0 1px 0 rgba(255, 255, 255, 0.5);background-color:#fcf8e3;border:1px solid #fbeed5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;color:#c09853;} +.alert-heading{color:inherit;} +.alert .close{position:relative;top:-2px;right:-21px;line-height:18px;} +.alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#468847;} +.alert-danger,.alert-error{background-color:#f2dede;border-color:#eed3d7;color:#b94a48;} +.alert-info{background-color:#d9edf7;border-color:#bce8f1;color:#3a87ad;} +.alert-block{padding-top:14px;padding-bottom:14px;} +.alert-block>p,.alert-block>ul{margin-bottom:0;} +.alert-block p+p{margin-top:5px;} +.nav{margin-left:0;margin-bottom:18px;list-style:none;} +.nav>li>a{display:block;} +.nav>li>a:hover{text-decoration:none;background-color:#eeeeee;} +.nav .nav-header{display:block;padding:3px 15px;font-size:11px;font-weight:bold;line-height:18px;color:#999999;text-shadow:0 1px 0 rgba(255, 255, 255, 0.5);text-transform:uppercase;} +.nav li+.nav-header{margin-top:9px;} +.nav-list{padding-left:15px;padding-right:15px;margin-bottom:0;} +.nav-list>li>a,.nav-list .nav-header{margin-left:-15px;margin-right:-15px;text-shadow:0 1px 0 rgba(255, 255, 255, 0.5);} +.nav-list>li>a{padding:3px 15px;} +.nav-list>.active>a,.nav-list>.active>a:hover{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.2);background-color:#0088cc;} +.nav-list [class^="icon-"]{margin-right:2px;} +.nav-list .divider{height:1px;margin:8px 1px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #ffffff;*width:100%;*margin:-5px 0 5px;} +.nav-tabs,.nav-pills{*zoom:1;}.nav-tabs:before,.nav-pills:before,.nav-tabs:after,.nav-pills:after{display:table;content:"";} +.nav-tabs:after,.nav-pills:after{clear:both;} +.nav-tabs>li,.nav-pills>li{float:left;} +.nav-tabs>li>a,.nav-pills>li>a{padding-right:12px;padding-left:12px;margin-right:2px;line-height:14px;} +.nav-tabs{border-bottom:1px solid #ddd;} +.nav-tabs>li{margin-bottom:-1px;} +.nav-tabs>li>a{padding-top:8px;padding-bottom:8px;line-height:18px;border:1px solid transparent;-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0;}.nav-tabs>li>a:hover{border-color:#eeeeee #eeeeee #dddddd;} +.nav-tabs>.active>a,.nav-tabs>.active>a:hover{color:#555555;background-color:#ffffff;border:1px solid #ddd;border-bottom-color:transparent;cursor:default;} +.nav-pills>li>a{padding-top:8px;padding-bottom:8px;margin-top:2px;margin-bottom:2px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;} +.nav-pills>.active>a,.nav-pills>.active>a:hover{color:#ffffff;background-color:#0088cc;} +.nav-stacked>li{float:none;} +.nav-stacked>li>a{margin-right:0;} +.nav-tabs.nav-stacked{border-bottom:0;} +.nav-tabs.nav-stacked>li>a{border:1px solid #ddd;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} +.nav-tabs.nav-stacked>li:first-child>a{-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0;} +.nav-tabs.nav-stacked>li:last-child>a{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px;} +.nav-tabs.nav-stacked>li>a:hover{border-color:#ddd;z-index:2;} +.nav-pills.nav-stacked>li>a{margin-bottom:3px;} +.nav-pills.nav-stacked>li:last-child>a{margin-bottom:1px;} +.nav-tabs .dropdown-menu,.nav-pills .dropdown-menu{margin-top:1px;border-width:1px;} +.nav-pills .dropdown-menu{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} +.nav-tabs .dropdown-toggle .caret,.nav-pills .dropdown-toggle .caret{border-top-color:#0088cc;border-bottom-color:#0088cc;margin-top:6px;} +.nav-tabs .dropdown-toggle:hover .caret,.nav-pills .dropdown-toggle:hover .caret{border-top-color:#005580;border-bottom-color:#005580;} +.nav-tabs .active .dropdown-toggle .caret,.nav-pills .active .dropdown-toggle .caret{border-top-color:#333333;border-bottom-color:#333333;} +.nav>.dropdown.active>a:hover{color:#000000;cursor:pointer;} +.nav-tabs .open .dropdown-toggle,.nav-pills .open .dropdown-toggle,.nav>.open.active>a:hover{color:#ffffff;background-color:#999999;border-color:#999999;} +.nav .open .caret,.nav .open.active .caret,.nav .open a:hover .caret{border-top-color:#ffffff;border-bottom-color:#ffffff;opacity:1;filter:alpha(opacity=100);} +.tabs-stacked .open>a:hover{border-color:#999999;} +.tabbable{*zoom:1;}.tabbable:before,.tabbable:after{display:table;content:"";} +.tabbable:after{clear:both;} +.tab-content{display:table;width:100%;} +.tabs-below .nav-tabs,.tabs-right .nav-tabs,.tabs-left .nav-tabs{border-bottom:0;} +.tab-content>.tab-pane,.pill-content>.pill-pane{display:none;} +.tab-content>.active,.pill-content>.active{display:block;} +.tabs-below .nav-tabs{border-top:1px solid #ddd;} +.tabs-below .nav-tabs>li{margin-top:-1px;margin-bottom:0;} +.tabs-below .nav-tabs>li>a{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px;}.tabs-below .nav-tabs>li>a:hover{border-bottom-color:transparent;border-top-color:#ddd;} +.tabs-below .nav-tabs .active>a,.tabs-below .nav-tabs .active>a:hover{border-color:transparent #ddd #ddd #ddd;} +.tabs-left .nav-tabs>li,.tabs-right .nav-tabs>li{float:none;} +.tabs-left .nav-tabs>li>a,.tabs-right .nav-tabs>li>a{min-width:74px;margin-right:0;margin-bottom:3px;} +.tabs-left .nav-tabs{float:left;margin-right:19px;border-right:1px solid #ddd;} +.tabs-left .nav-tabs>li>a{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px;} +.tabs-left .nav-tabs>li>a:hover{border-color:#eeeeee #dddddd #eeeeee #eeeeee;} +.tabs-left .nav-tabs .active>a,.tabs-left .nav-tabs .active>a:hover{border-color:#ddd transparent #ddd #ddd;*border-right-color:#ffffff;} +.tabs-right .nav-tabs{float:right;margin-left:19px;border-left:1px solid #ddd;} +.tabs-right .nav-tabs>li>a{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0;} +.tabs-right .nav-tabs>li>a:hover{border-color:#eeeeee #eeeeee #eeeeee #dddddd;} +.tabs-right .nav-tabs .active>a,.tabs-right .nav-tabs .active>a:hover{border-color:#ddd #ddd #ddd transparent;*border-left-color:#ffffff;} +.navbar{*position:relative;*z-index:2;overflow:visible;margin-bottom:18px;} +.navbar-inner{padding-left:20px;padding-right:20px;background-color:#2c2c2c;background-image:-moz-linear-gradient(top, #333333, #222222);background-image:-ms-linear-gradient(top, #333333, #222222);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#333333), to(#222222));background-image:-webkit-linear-gradient(top, #333333, #222222);background-image:-o-linear-gradient(top, #333333, #222222);background-image:linear-gradient(top, #333333, #222222);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 3px rgba(0, 0, 0, 0.25),inset 0 -1px 0 rgba(0, 0, 0, 0.1);-moz-box-shadow:0 1px 3px rgba(0, 0, 0, 0.25),inset 0 -1px 0 rgba(0, 0, 0, 0.1);box-shadow:0 1px 3px rgba(0, 0, 0, 0.25),inset 0 -1px 0 rgba(0, 0, 0, 0.1);} +.navbar .container{width:auto;} +.btn-navbar{display:none;float:right;padding:7px 10px;margin-left:5px;margin-right:5px;background-color:#2c2c2c;background-image:-moz-linear-gradient(top, #333333, #222222);background-image:-ms-linear-gradient(top, #333333, #222222);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#333333), to(#222222));background-image:-webkit-linear-gradient(top, #333333, #222222);background-image:-o-linear-gradient(top, #333333, #222222);background-image:linear-gradient(top, #333333, #222222);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0);border-color:#222222 #222222 #000000;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);filter:progid:dximagetransform.microsoft.gradient(enabled=false);-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.1),0 1px 0 rgba(255, 255, 255, 0.075);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.1),0 1px 0 rgba(255, 255, 255, 0.075);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.1),0 1px 0 rgba(255, 255, 255, 0.075);}.btn-navbar:hover,.btn-navbar:active,.btn-navbar.active,.btn-navbar.disabled,.btn-navbar[disabled]{background-color:#222222;} +.btn-navbar:active,.btn-navbar.active{background-color:#080808 \9;} +.btn-navbar .icon-bar{display:block;width:18px;height:2px;background-color:#f5f5f5;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;-webkit-box-shadow:0 1px 0 rgba(0, 0, 0, 0.25);-moz-box-shadow:0 1px 0 rgba(0, 0, 0, 0.25);box-shadow:0 1px 0 rgba(0, 0, 0, 0.25);} +.btn-navbar .icon-bar+.icon-bar{margin-top:3px;} +.nav-collapse.collapse{height:auto;} +.navbar{color:#999999;}.navbar .brand:hover{text-decoration:none;} +.navbar .brand{float:left;display:block;padding:8px 20px 12px;margin-left:-20px;font-size:20px;font-weight:200;line-height:1;color:#ffffff;} +.navbar .navbar-text{margin-bottom:0;line-height:40px;} +.navbar .btn,.navbar .btn-group{margin-top:5px;} +.navbar .btn-group .btn{margin-top:0;} +.navbar-form{margin-bottom:0;*zoom:1;}.navbar-form:before,.navbar-form:after{display:table;content:"";} +.navbar-form:after{clear:both;} +.navbar-form input,.navbar-form select,.navbar-form .radio,.navbar-form .checkbox{margin-top:5px;} +.navbar-form input,.navbar-form select{display:inline-block;margin-bottom:0;} +.navbar-form input[type="image"],.navbar-form input[type="checkbox"],.navbar-form input[type="radio"]{margin-top:3px;} +.navbar-form .input-append,.navbar-form .input-prepend{margin-top:6px;white-space:nowrap;}.navbar-form .input-append input,.navbar-form .input-prepend input{margin-top:0;} +.navbar-search{position:relative;float:left;margin-top:6px;margin-bottom:0;}.navbar-search .search-query{padding:4px 9px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:1;color:#ffffff;background-color:#626262;border:1px solid #151515;-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1),0 1px 0px rgba(255, 255, 255, 0.15);-moz-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1),0 1px 0px rgba(255, 255, 255, 0.15);box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1),0 1px 0px rgba(255, 255, 255, 0.15);-webkit-transition:none;-moz-transition:none;-ms-transition:none;-o-transition:none;transition:none;}.navbar-search .search-query:-moz-placeholder{color:#cccccc;} +.navbar-search .search-query::-webkit-input-placeholder{color:#cccccc;} +.navbar-search .search-query:focus,.navbar-search .search-query.focused{padding:5px 10px;color:#333333;text-shadow:0 1px 0 #ffffff;background-color:#ffffff;border:0;-webkit-box-shadow:0 0 3px rgba(0, 0, 0, 0.15);-moz-box-shadow:0 0 3px rgba(0, 0, 0, 0.15);box-shadow:0 0 3px rgba(0, 0, 0, 0.15);outline:0;} +.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030;margin-bottom:0;} +.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding-left:0;padding-right:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} +.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px;} +.navbar-fixed-top{top:0;} +.navbar-fixed-bottom{bottom:0;} +.navbar .nav{position:relative;left:0;display:block;float:left;margin:0 10px 0 0;} +.navbar .nav.pull-right{float:right;} +.navbar .nav>li{display:block;float:left;} +.navbar .nav>li>a{float:none;padding:10px 10px 11px;line-height:19px;color:#999999;text-decoration:none;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);} +.navbar .nav>li>a:hover{background-color:transparent;color:#ffffff;text-decoration:none;} +.navbar .nav .active>a,.navbar .nav .active>a:hover{color:#ffffff;text-decoration:none;background-color:#222222;} +.navbar .divider-vertical{height:40px;width:1px;margin:0 9px;overflow:hidden;background-color:#222222;border-right:1px solid #333333;} +.navbar .nav.pull-right{margin-left:10px;margin-right:0;} +.navbar .dropdown-menu{margin-top:1px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}.navbar .dropdown-menu:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-bottom-color:rgba(0, 0, 0, 0.2);position:absolute;top:-7px;left:9px;} +.navbar .dropdown-menu:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #ffffff;position:absolute;top:-6px;left:10px;} +.navbar-fixed-bottom .dropdown-menu:before{border-top:7px solid #ccc;border-top-color:rgba(0, 0, 0, 0.2);border-bottom:0;bottom:-7px;top:auto;} +.navbar-fixed-bottom .dropdown-menu:after{border-top:6px solid #ffffff;border-bottom:0;bottom:-6px;top:auto;} +.navbar .nav .dropdown-toggle .caret,.navbar .nav .open.dropdown .caret{border-top-color:#ffffff;border-bottom-color:#ffffff;} +.navbar .nav .active .caret{opacity:1;filter:alpha(opacity=100);} +.navbar .nav .open>.dropdown-toggle,.navbar .nav .active>.dropdown-toggle,.navbar .nav .open.active>.dropdown-toggle{background-color:transparent;} +.navbar .nav .active>.dropdown-toggle:hover{color:#ffffff;} +.navbar .nav.pull-right .dropdown-menu,.navbar .nav .dropdown-menu.pull-right{left:auto;right:0;}.navbar .nav.pull-right .dropdown-menu:before,.navbar .nav .dropdown-menu.pull-right:before{left:auto;right:12px;} +.navbar .nav.pull-right .dropdown-menu:after,.navbar .nav .dropdown-menu.pull-right:after{left:auto;right:13px;} +.breadcrumb{padding:7px 14px;margin:0 0 18px;list-style:none;background-color:#fbfbfb;background-image:-moz-linear-gradient(top, #ffffff, #f5f5f5);background-image:-ms-linear-gradient(top, #ffffff, #f5f5f5);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f5f5f5));background-image:-webkit-linear-gradient(top, #ffffff, #f5f5f5);background-image:-o-linear-gradient(top, #ffffff, #f5f5f5);background-image:linear-gradient(top, #ffffff, #f5f5f5);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f5f5f5', GradientType=0);border:1px solid #ddd;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 #ffffff;-moz-box-shadow:inset 0 1px 0 #ffffff;box-shadow:inset 0 1px 0 #ffffff;}.breadcrumb li{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 0 #ffffff;} +.breadcrumb .divider{padding:0 5px;color:#999999;} +.breadcrumb .active a{color:#333333;} +.pagination{height:36px;margin:18px 0;} +.pagination ul{display:inline-block;*display:inline;*zoom:1;margin-left:0;margin-bottom:0;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:0 1px 2px rgba(0, 0, 0, 0.05);} +.pagination li{display:inline;} +.pagination a{float:left;padding:0 14px;line-height:34px;text-decoration:none;border:1px solid #ddd;border-left-width:0;} +.pagination a:hover,.pagination .active a{background-color:#f5f5f5;} +.pagination .active a{color:#999999;cursor:default;} +.pagination .disabled span,.pagination .disabled a,.pagination .disabled a:hover{color:#999999;background-color:transparent;cursor:default;} +.pagination li:first-child a{border-left-width:1px;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;} +.pagination li:last-child a{-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0;} +.pagination-centered{text-align:center;} +.pagination-right{text-align:right;} +.pager{margin-left:0;margin-bottom:18px;list-style:none;text-align:center;*zoom:1;}.pager:before,.pager:after{display:table;content:"";} +.pager:after{clear:both;} +.pager li{display:inline;} +.pager a{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px;} +.pager a:hover{text-decoration:none;background-color:#f5f5f5;} +.pager .next a{float:right;} +.pager .previous a{float:left;} +.pager .disabled a,.pager .disabled a:hover{color:#999999;background-color:#fff;cursor:default;} +.modal-open .dropdown-menu{z-index:2050;} +.modal-open .dropdown.open{*z-index:2050;} +.modal-open .popover{z-index:2060;} +.modal-open .tooltip{z-index:2070;} +.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000000;}.modal-backdrop.fade{opacity:0;} +.modal-backdrop,.modal-backdrop.fade.in{opacity:0.8;filter:alpha(opacity=80);} +.modal{position:fixed;top:50%;left:50%;z-index:1050;overflow:auto;width:560px;margin:-250px 0 0 -280px;background-color:#ffffff;border:1px solid #999;border:1px solid rgba(0, 0, 0, 0.3);*border:1px solid #999;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box;}.modal.fade{-webkit-transition:opacity .3s linear, top .3s ease-out;-moz-transition:opacity .3s linear, top .3s ease-out;-ms-transition:opacity .3s linear, top .3s ease-out;-o-transition:opacity .3s linear, top .3s ease-out;transition:opacity .3s linear, top .3s ease-out;top:-25%;} +.modal.fade.in{top:50%;} +.modal-header{padding:9px 15px;border-bottom:1px solid #eee;}.modal-header .close{margin-top:2px;} +.modal-body{overflow-y:auto;max-height:400px;padding:15px;} +.modal-form{margin-bottom:0;} +.modal-footer{padding:14px 15px 15px;margin-bottom:0;text-align:right;background-color:#f5f5f5;border-top:1px solid #ddd;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;-webkit-box-shadow:inset 0 1px 0 #ffffff;-moz-box-shadow:inset 0 1px 0 #ffffff;box-shadow:inset 0 1px 0 #ffffff;*zoom:1;}.modal-footer:before,.modal-footer:after{display:table;content:"";} +.modal-footer:after{clear:both;} +.modal-footer .btn+.btn{margin-left:5px;margin-bottom:0;} +.modal-footer .btn-group .btn+.btn{margin-left:-1px;} +.tooltip{position:absolute;z-index:1020;display:block;visibility:visible;padding:5px;font-size:11px;opacity:0;filter:alpha(opacity=0);}.tooltip.in{opacity:0.8;filter:alpha(opacity=80);} +.tooltip.top{margin-top:-2px;} +.tooltip.right{margin-left:2px;} +.tooltip.bottom{margin-top:2px;} +.tooltip.left{margin-left:-2px;} +.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #000000;} +.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid #000000;} +.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid #000000;} +.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-right:5px solid #000000;} +.tooltip-inner{max-width:200px;padding:3px 8px;color:#ffffff;text-align:center;text-decoration:none;background-color:#000000;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} +.tooltip-arrow{position:absolute;width:0;height:0;} +.popover{position:absolute;top:0;left:0;z-index:1010;display:none;padding:5px;}.popover.top{margin-top:-5px;} +.popover.right{margin-left:5px;} +.popover.bottom{margin-top:5px;} +.popover.left{margin-left:-5px;} +.popover.top .arrow{bottom:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #000000;} +.popover.right .arrow{top:50%;left:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-right:5px solid #000000;} +.popover.bottom .arrow{top:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid #000000;} +.popover.left .arrow{top:50%;right:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid #000000;} +.popover .arrow{position:absolute;width:0;height:0;} +.popover-inner{padding:3px;width:280px;overflow:hidden;background:#000000;background:rgba(0, 0, 0, 0.8);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);} +.popover-title{padding:9px 15px;line-height:1;background-color:#f5f5f5;border-bottom:1px solid #eee;-webkit-border-radius:3px 3px 0 0;-moz-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0;} +.popover-content{padding:14px;background-color:#ffffff;-webkit-border-radius:0 0 3px 3px;-moz-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box;}.popover-content p,.popover-content ul,.popover-content ol{margin-bottom:0;} +.thumbnails{margin-left:-20px;list-style:none;*zoom:1;}.thumbnails:before,.thumbnails:after{display:table;content:"";} +.thumbnails:after{clear:both;} +.thumbnails>li{float:left;margin:0 0 18px 20px;} +.thumbnail{display:block;padding:4px;line-height:1;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:0 1px 1px rgba(0, 0, 0, 0.075);} +a.thumbnail:hover{border-color:#0088cc;-webkit-box-shadow:0 1px 4px rgba(0, 105, 214, 0.25);-moz-box-shadow:0 1px 4px rgba(0, 105, 214, 0.25);box-shadow:0 1px 4px rgba(0, 105, 214, 0.25);} +.thumbnail>img{display:block;max-width:100%;margin-left:auto;margin-right:auto;} +.thumbnail .caption{padding:9px;} +.label{padding:1px 4px 2px;font-size:10.998px;font-weight:bold;line-height:13px;color:#ffffff;vertical-align:middle;white-space:nowrap;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#999999;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} +.label:hover{color:#ffffff;text-decoration:none;} +.label-important{background-color:#b94a48;} +.label-important:hover{background-color:#953b39;} +.label-warning{background-color:#f89406;} +.label-warning:hover{background-color:#c67605;} +.label-success{background-color:#468847;} +.label-success:hover{background-color:#356635;} +.label-info{background-color:#3a87ad;} +.label-info:hover{background-color:#2d6987;} +.label-inverse{background-color:#333333;} +.label-inverse:hover{background-color:#1a1a1a;} +.badge{padding:1px 9px 2px;font-size:12.025px;font-weight:bold;white-space:nowrap;color:#ffffff;background-color:#999999;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px;} +.badge:hover{color:#ffffff;text-decoration:none;cursor:pointer;} +.badge-error{background-color:#b94a48;} +.badge-error:hover{background-color:#953b39;} +.badge-warning{background-color:#f89406;} +.badge-warning:hover{background-color:#c67605;} +.badge-success{background-color:#468847;} +.badge-success:hover{background-color:#356635;} +.badge-info{background-color:#3a87ad;} +.badge-info:hover{background-color:#2d6987;} +.badge-inverse{background-color:#333333;} +.badge-inverse:hover{background-color:#1a1a1a;} +@-webkit-keyframes progress-bar-stripes{from{background-position:0 0;} to{background-position:40px 0;}}@-moz-keyframes progress-bar-stripes{from{background-position:0 0;} to{background-position:40px 0;}}@-ms-keyframes progress-bar-stripes{from{background-position:0 0;} to{background-position:40px 0;}}@keyframes progress-bar-stripes{from{background-position:0 0;} to{background-position:40px 0;}}.progress{overflow:hidden;height:18px;margin-bottom:18px;background-color:#f7f7f7;background-image:-moz-linear-gradient(top, #f5f5f5, #f9f9f9);background-image:-ms-linear-gradient(top, #f5f5f5, #f9f9f9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#f5f5f5), to(#f9f9f9));background-image:-webkit-linear-gradient(top, #f5f5f5, #f9f9f9);background-image:-o-linear-gradient(top, #f5f5f5, #f9f9f9);background-image:linear-gradient(top, #f5f5f5, #f9f9f9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f5f5f5', endColorstr='#f9f9f9', GradientType=0);-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1);-moz-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1);box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} +.progress .bar{width:0%;height:18px;color:#ffffff;font-size:12px;text-align:center;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#0e90d2;background-image:-moz-linear-gradient(top, #149bdf, #0480be);background-image:-ms-linear-gradient(top, #149bdf, #0480be);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#149bdf), to(#0480be));background-image:-webkit-linear-gradient(top, #149bdf, #0480be);background-image:-o-linear-gradient(top, #149bdf, #0480be);background-image:linear-gradient(top, #149bdf, #0480be);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#149bdf', endColorstr='#0480be', GradientType=0);-webkit-box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.15);-moz-box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.15);box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.15);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width 0.6s ease;-moz-transition:width 0.6s ease;-ms-transition:width 0.6s ease;-o-transition:width 0.6s ease;transition:width 0.6s ease;} +.progress-striped .bar{background-color:#149bdf;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);-webkit-background-size:40px 40px;-moz-background-size:40px 40px;-o-background-size:40px 40px;background-size:40px 40px;} +.progress.active .bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-moz-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite;} +.progress-danger .bar{background-color:#dd514c;background-image:-moz-linear-gradient(top, #ee5f5b, #c43c35);background-image:-ms-linear-gradient(top, #ee5f5b, #c43c35);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#c43c35));background-image:-webkit-linear-gradient(top, #ee5f5b, #c43c35);background-image:-o-linear-gradient(top, #ee5f5b, #c43c35);background-image:linear-gradient(top, #ee5f5b, #c43c35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#c43c35', GradientType=0);} +.progress-danger.progress-striped .bar{background-color:#ee5f5b;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);} +.progress-success .bar{background-color:#5eb95e;background-image:-moz-linear-gradient(top, #62c462, #57a957);background-image:-ms-linear-gradient(top, #62c462, #57a957);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#57a957));background-image:-webkit-linear-gradient(top, #62c462, #57a957);background-image:-o-linear-gradient(top, #62c462, #57a957);background-image:linear-gradient(top, #62c462, #57a957);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#57a957', GradientType=0);} +.progress-success.progress-striped .bar{background-color:#62c462;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);} +.progress-info .bar{background-color:#4bb1cf;background-image:-moz-linear-gradient(top, #5bc0de, #339bb9);background-image:-ms-linear-gradient(top, #5bc0de, #339bb9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#339bb9));background-image:-webkit-linear-gradient(top, #5bc0de, #339bb9);background-image:-o-linear-gradient(top, #5bc0de, #339bb9);background-image:linear-gradient(top, #5bc0de, #339bb9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#339bb9', GradientType=0);} +.progress-info.progress-striped .bar{background-color:#5bc0de;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);} +.progress-warning .bar{background-color:#faa732;background-image:-moz-linear-gradient(top, #fbb450, #f89406);background-image:-ms-linear-gradient(top, #fbb450, #f89406);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));background-image:-webkit-linear-gradient(top, #fbb450, #f89406);background-image:-o-linear-gradient(top, #fbb450, #f89406);background-image:linear-gradient(top, #fbb450, #f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fbb450', endColorstr='#f89406', GradientType=0);} +.progress-warning.progress-striped .bar{background-color:#fbb450;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);} +.accordion{margin-bottom:18px;} +.accordion-group{margin-bottom:2px;border:1px solid #e5e5e5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} +.accordion-heading{border-bottom:0;} +.accordion-heading .accordion-toggle{display:block;padding:8px 15px;} +.accordion-inner{padding:9px 15px;border-top:1px solid #e5e5e5;} +.carousel{position:relative;margin-bottom:18px;line-height:1;} +.carousel-inner{overflow:hidden;width:100%;position:relative;} +.carousel .item{display:none;position:relative;-webkit-transition:0.6s ease-in-out left;-moz-transition:0.6s ease-in-out left;-ms-transition:0.6s ease-in-out left;-o-transition:0.6s ease-in-out left;transition:0.6s ease-in-out left;} +.carousel .item>img{display:block;line-height:1;} +.carousel .active,.carousel .next,.carousel .prev{display:block;} +.carousel .active{left:0;} +.carousel .next,.carousel .prev{position:absolute;top:0;width:100%;} +.carousel .next{left:100%;} +.carousel .prev{left:-100%;} +.carousel .next.left,.carousel .prev.right{left:0;} +.carousel .active.left{left:-100%;} +.carousel .active.right{left:100%;} +.carousel-control{position:absolute;top:40%;left:15px;width:40px;height:40px;margin-top:-20px;font-size:60px;font-weight:100;line-height:30px;color:#ffffff;text-align:center;background:#222222;border:3px solid #ffffff;-webkit-border-radius:23px;-moz-border-radius:23px;border-radius:23px;opacity:0.5;filter:alpha(opacity=50);}.carousel-control.right{left:auto;right:15px;} +.carousel-control:hover{color:#ffffff;text-decoration:none;opacity:0.9;filter:alpha(opacity=90);} +.carousel-caption{position:absolute;left:0;right:0;bottom:0;padding:10px 15px 5px;background:#333333;background:rgba(0, 0, 0, 0.75);} +.carousel-caption h4,.carousel-caption p{color:#ffffff;} +.hero-unit{padding:60px;margin-bottom:30px;background-color:#eeeeee;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;}.hero-unit h1{margin-bottom:0;font-size:60px;line-height:1;color:inherit;letter-spacing:-1px;} +.hero-unit p{font-size:18px;font-weight:200;line-height:27px;color:inherit;} +.pull-right{float:right;} +.pull-left{float:left;} +.hide{display:none;} +.show{display:block;} +.invisible{visibility:hidden;} diff --git a/api/resources/csses/prettify.css b/api/resources/csses/prettify.css new file mode 100644 index 00000000..2cd13649 --- /dev/null +++ b/api/resources/csses/prettify.css @@ -0,0 +1,52 @@ +/* Pretty printing styles. Used with prettify.js. */ + +/* SPAN elements with the classes below are added by prettyprint. */ +.pln { color: #000 } /* plain text */ + +@media screen { + .str { color: #2e6a40 } /* string content */ + .kwd { color: #214afc } /* a keyword */ + .com { color: #4c886b } /* a comment */ + .typ { color: #1130ad } /* a type name */ + .lit { color: #1130ad } /* a literal value */ + /* punctuation, lisp open bracket, lisp close bracket */ + .pun, .opn, .clo { color: #2d0603 } + .tag { color: #008 } /* a markup tag name */ + .atn { color: #606 } /* a markup attribute name */ + .atv { color: #080 } /* a markup attribute value */ + .dec, .var { color: #606 } /* a declaration; a variable name */ + .fun { color: #1130ad } /* a function name */ +} + +/* Use higher contrast and text-weight for printable form. */ +@media print, projection { + .str { color: #060 } + .kwd { color: #006; font-weight: bold } + .com { color: #600; font-style: italic } + .typ { color: #404; font-weight: bold } + .lit { color: #044 } + .pun, .opn, .clo { color: #440 } + .tag { color: #006; font-weight: bold } + .atn { color: #404 } + .atv { color: #060 } +} + +/* Put a border around prettyprinted code snippets. */ +/*pre.prettyprint { padding: 2px; }*/ + +/* Specify class=linenums on a pre to get line numbering */ +ol.linenums { margin-top: 0; margin-bottom: 0 } /* IE indents via margin-left */` +li.L0, +li.L1, +li.L2, +li.L3, +li.L5, +li.L6, +li.L7, +li.L8 { list-style-type: none } +/* Alternate shading for lines */ +li.L1, +li.L3, +li.L5, +li.L7, +li.L9 { background: #eee } diff --git a/api/resources/font/fontawesome-webfont.eot b/api/resources/font/fontawesome-webfont.eot deleted file mode 100644 index 89070c1e..00000000 Binary files a/api/resources/font/fontawesome-webfont.eot and /dev/null differ diff --git a/api/resources/font/fontawesome-webfont.svg b/api/resources/font/fontawesome-webfont.svg deleted file mode 100644 index 1245f92c..00000000 --- a/api/resources/font/fontawesome-webfont.svg +++ /dev/null @@ -1,255 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/api/resources/font/fontawesome-webfont.ttf b/api/resources/font/fontawesome-webfont.ttf deleted file mode 100644 index c17e9f8d..00000000 Binary files a/api/resources/font/fontawesome-webfont.ttf and /dev/null differ diff --git a/api/resources/font/fontawesome-webfont.woff b/api/resources/font/fontawesome-webfont.woff deleted file mode 100644 index 09f2469a..00000000 Binary files a/api/resources/font/fontawesome-webfont.woff and /dev/null differ diff --git a/api/resources/images/Ace_ERD.png b/api/resources/images/Ace_ERD.png deleted file mode 100644 index 78fb8dab..00000000 Binary files a/api/resources/images/Ace_ERD.png and /dev/null differ diff --git a/api/resources/images/Ace_ERD.svg b/api/resources/images/Ace_ERD.svg new file mode 100644 index 00000000..ba386287 --- /dev/null +++ b/api/resources/images/Ace_ERD.svg @@ -0,0 +1,4 @@ + + + + diff --git a/doc/site/images/favicon.ico b/api/resources/images/favicon.ico similarity index 100% rename from doc/site/images/favicon.ico rename to api/resources/images/favicon.ico diff --git a/api/resources/javascripts/bbq.js b/api/resources/javascripts/bbq.js deleted file mode 100644 index bcbf2483..00000000 --- a/api/resources/javascripts/bbq.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * jQuery BBQ: Back Button & Query Library - v1.2.1 - 2/17/2010 - * http://benalman.com/projects/jquery-bbq-plugin/ - * - * Copyright (c) 2010 "Cowboy" Ben Alman - * Dual licensed under the MIT and GPL licenses. - * http://benalman.com/about/license/ - */ -(function($,p){var i,m=Array.prototype.slice,r=decodeURIComponent,a=$.param,c,l,v,b=$.bbq=$.bbq||{},q,u,j,e=$.event.special,d="hashchange",A="querystring",D="fragment",y="elemUrlAttr",g="location",k="href",t="src",x=/^.*\?|#.*$/g,w=/^.*\#/,h,C={};function E(F){return typeof F==="string"}function B(G){var F=m.call(arguments,1);return function(){return G.apply(this,F.concat(m.call(arguments)))}}function n(F){return F.replace(/^[^#]*#?(.*)$/,"$1")}function o(F){return F.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")}function f(H,M,F,I,G){var O,L,K,N,J;if(I!==i){K=F.match(H?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);J=K[3]||"";if(G===2&&E(I)){L=I.replace(H?w:x,"")}else{N=l(K[2]);I=E(I)?l[H?D:A](I):I;L=G===2?I:G===1?$.extend({},I,N):$.extend({},N,I);L=a(L);if(H){L=L.replace(h,r)}}O=K[1]+(H?"#":L||!K[1]?"?":"")+L+J}else{O=M(F!==i?F:p[g][k])}return O}a[A]=B(f,0,o);a[D]=c=B(f,1,n);c.noEscape=function(G){G=G||"";var F=$.map(G.split(""),encodeURIComponent);h=new RegExp(F.join("|"),"g")};c.noEscape(",/");$.deparam=l=function(I,F){var H={},G={"true":!0,"false":!1,"null":null};$.each(I.replace(/\+/g," ").split("&"),function(L,Q){var K=Q.split("="),P=r(K[0]),J,O=H,M=0,R=P.split("]["),N=R.length-1;if(/\[/.test(R[0])&&/\]$/.test(R[N])){R[N]=R[N].replace(/\]$/,"");R=R.shift().split("[").concat(R);N=R.length-1}else{N=0}if(K.length===2){J=r(K[1]);if(F){J=J&&!isNaN(J)?+J:J==="undefined"?i:G[J]!==i?G[J]:J}if(N){for(;M<=N;M++){P=R[M]===""?O.length:R[M];O=O[P]=M').hide().insertAfter("body")[0].contentWindow;q=function(){return a(n.document[c][l])};o=function(u,s){if(u!==s){var t=n.document;t.open().close();t[c].hash="#"+u}};o(a())}}m.start=function(){if(r){return}var t=a();o||p();(function s(){var v=a(),u=q(t);if(v!==t){o(t=v,u);$(i).trigger(d)}else{if(u!==t){i[c][l]=i[c][l].replace(/#.*/,"")+"#"+u}}r=setTimeout(s,$[d+"Delay"])})()};m.stop=function(){if(!n){r&&clearTimeout(r);r=0}};return m})()})(jQuery,this); \ No newline at end of file diff --git a/api/resources/javascripts/bootstrap-dropdown.js b/api/resources/javascripts/bootstrap-dropdown.js new file mode 100644 index 00000000..54b61c5e --- /dev/null +++ b/api/resources/javascripts/bootstrap-dropdown.js @@ -0,0 +1,92 @@ +/* ============================================================ + * bootstrap-dropdown.js v2.0.2 + * http://twitter.github.com/bootstrap/javascript.html#dropdowns + * ============================================================ + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================ */ + + +!function( $ ){ + + "use strict" + + /* DROPDOWN CLASS DEFINITION + * ========================= */ + + var toggle = '[data-toggle="dropdown"]' + , Dropdown = function ( element ) { + var $el = $(element).on('click.dropdown.data-api', this.toggle) + $('html').on('click.dropdown.data-api', function () { + $el.parent().removeClass('open') + }) + } + + Dropdown.prototype = { + + constructor: Dropdown + + , toggle: function ( e ) { + var $this = $(this) + , selector = $this.attr('data-target') + , $parent + , isActive + + if (!selector) { + selector = $this.attr('href') + selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 + } + + $parent = $(selector) + $parent.length || ($parent = $this.parent()) + + isActive = $parent.hasClass('open') + + clearMenus() + !isActive && $parent.toggleClass('open') + + return false + } + + } + + function clearMenus() { + $(toggle).parent().removeClass('open') + } + + + /* DROPDOWN PLUGIN DEFINITION + * ========================== */ + + $.fn.dropdown = function ( option ) { + return this.each(function () { + var $this = $(this) + , data = $this.data('dropdown') + if (!data) $this.data('dropdown', (data = new Dropdown(this))) + if (typeof option == 'string') data[option].call($this) + }) + } + + $.fn.dropdown.Constructor = Dropdown + + + /* APPLY TO STANDARD DROPDOWN ELEMENTS + * =================================== */ + + $(function () { + $('html').on('click.dropdown.data-api', clearMenus) + $('body').on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle) + }) + +}( window.jQuery ); \ No newline at end of file diff --git a/api/resources/javascripts/bootstrap.js b/api/resources/javascripts/bootstrap.js deleted file mode 100644 index 79241e74..00000000 --- a/api/resources/javascripts/bootstrap.js +++ /dev/null @@ -1,389 +0,0 @@ -/* ============================================================ - * bootstrap-dropdown.js v2.1.1 - * http://twitter.github.com/bootstrap/javascript.html#dropdowns - * ============================================================ - * Copyright 2012 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================ */ - - -!function ($) { - - "use strict"; // jshint ;_; - - - /* DROPDOWN CLASS DEFINITION - * ========================= */ - - var toggle = '[data-toggle=dropdown]' - , Dropdown = function (element) { - var $el = $(element).on('click.dropdown.data-api', this.toggle) - $('html').on('click.dropdown.data-api', function () { - $el.parent().removeClass('open') - }) - } - - Dropdown.prototype = { - - constructor: Dropdown - - , toggle: function (e) { - var $this = $(this) - , $parent - , isActive - - if ($this.is('.disabled, :disabled')) return - - $parent = getParent($this) - - isActive = $parent.hasClass('open') - - clearMenus() - - if (!isActive) { - $parent.toggleClass('open') - $this.focus() - } - - return false - } - - , keydown: function (e) { - var $this - , $items - , $active - , $parent - , isActive - , index - - if (!/(38|40|27)/.test(e.keyCode)) return - - $this = $(this) - - e.preventDefault() - e.stopPropagation() - - if ($this.is('.disabled, :disabled')) return - - $parent = getParent($this) - - isActive = $parent.hasClass('open') - - if (!isActive || (isActive && e.keyCode == 27)) return $this.click() - - $items = $('[role=menu] li:not(.divider) a', $parent) - - if (!$items.length) return - - index = $items.index($items.filter(':focus')) - - if (e.keyCode == 38 && index > 0) index-- // up - if (e.keyCode == 40 && index < $items.length - 1) index++ // down - if (!~index) index = 0 - - $items - .eq(index) - .focus() - } - - } - - function clearMenus() { - getParent($(toggle)) - .removeClass('open') - } - - function getParent($this) { - var selector = $this.attr('data-target') - , $parent - - if (!selector) { - selector = $this.attr('href') - selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 - } - - $parent = $(selector) - $parent.length || ($parent = $this.parent()) - - return $parent - } - - - /* DROPDOWN PLUGIN DEFINITION - * ========================== */ - - $.fn.dropdown = function (option) { - return this.each(function () { - var $this = $(this) - , data = $this.data('dropdown') - if (!data) $this.data('dropdown', (data = new Dropdown(this))) - if (typeof option == 'string') data[option].call($this) - }) - } - - $.fn.dropdown.Constructor = Dropdown - - - /* APPLY TO STANDARD DROPDOWN ELEMENTS - * =================================== */ - - $(function () { - $('html') - .on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus) - $('body') - .on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) - .on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle) - .on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown) - }) - -}(window.jQuery); -/* ======================================================== - * bootstrap-tab.js v2.1.1 - * http://twitter.github.com/bootstrap/javascript.html#tabs - * ======================================================== - * Copyright 2012 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ======================================================== */ - - -!function ($) { - - "use strict"; // jshint ;_; - - - /* TAB CLASS DEFINITION - * ==================== */ - - var Tab = function (element) { - this.element = $(element) - } - - Tab.prototype = { - - constructor: Tab - - , show: function () { - var $this = this.element - , $ul = $this.closest('ul:not(.dropdown-menu)') - , selector = $this.attr('data-target') - , previous - , $target - , e - - if (!selector) { - selector = $this.attr('href') - selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 - } - - if ( $this.parent('li').hasClass('active') ) return - - previous = $ul.find('.active a').last()[0] - - e = $.Event('show', { - relatedTarget: previous - }) - - $this.trigger(e) - - if (e.isDefaultPrevented()) return - - $target = $(selector) - - this.activate($this.parent('li'), $ul) - this.activate($target, $target.parent(), function () { - $this.trigger({ - type: 'shown' - , relatedTarget: previous - }) - }) - } - - , activate: function ( element, container, callback) { - var $active = container.find('> .active') - , transition = callback - && $.support.transition - && $active.hasClass('fade') - - function next() { - $active - .removeClass('active') - .find('> .dropdown-menu > .active') - .removeClass('active') - - element.addClass('active') - - if (transition) { - element[0].offsetWidth // reflow for transition - element.addClass('in') - } else { - element.removeClass('fade') - } - - if ( element.parent('.dropdown-menu') ) { - element.closest('li.dropdown').addClass('active') - } - - callback && callback() - } - - transition ? - $active.one($.support.transition.end, next) : - next() - - $active.removeClass('in') - } - } - - - /* TAB PLUGIN DEFINITION - * ===================== */ - - $.fn.tab = function ( option ) { - return this.each(function () { - var $this = $(this) - , data = $this.data('tab') - if (!data) $this.data('tab', (data = new Tab(this))) - if (typeof option == 'string') data[option]() - }) - } - - $.fn.tab.Constructor = Tab - - - /* TAB DATA-API - * ============ */ - - $(function () { - $('body').on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) { - e.preventDefault() - $(this).tab('show') - }) - }) - -}(window.jQuery); -/* ========================================================== - * bootstrap-affix.js v2.1.1 - * http://twitter.github.com/bootstrap/javascript.html#affix - * ========================================================== - * Copyright 2012 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ========================================================== */ - - -!function ($) { - - "use strict"; // jshint ;_; - - - /* AFFIX CLASS DEFINITION - * ====================== */ - - var Affix = function (element, options) { - this.options = $.extend({}, $.fn.affix.defaults, options) - this.$window = $(window).on('scroll.affix.data-api', $.proxy(this.checkPosition, this)) - this.$element = $(element) - this.checkPosition() - } - - Affix.prototype.checkPosition = function () { - if (!this.$element.is(':visible')) return - - var scrollHeight = $(document).height() - , scrollTop = this.$window.scrollTop() - , position = this.$element.offset() - , offset = this.options.offset - , offsetBottom = offset.bottom - , offsetTop = offset.top - , reset = 'affix affix-top affix-bottom' - , affix - - if (typeof offset != 'object') offsetBottom = offsetTop = offset - if (typeof offsetTop == 'function') offsetTop = offset.top() - if (typeof offsetBottom == 'function') offsetBottom = offset.bottom() - - affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? - false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? - 'bottom' : offsetTop != null && scrollTop <= offsetTop ? - 'top' : false - - if (this.affixed === affix) return - - this.affixed = affix - this.unpin = affix == 'bottom' ? position.top - scrollTop : null - - this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : '')) - } - - - /* AFFIX PLUGIN DEFINITION - * ======================= */ - - $.fn.affix = function (option) { - return this.each(function () { - var $this = $(this) - , data = $this.data('affix') - , options = typeof option == 'object' && option - if (!data) $this.data('affix', (data = new Affix(this, options))) - if (typeof option == 'string') data[option]() - }) - } - - $.fn.affix.Constructor = Affix - - $.fn.affix.defaults = { - offset: 0 - } - - - /* AFFIX DATA-API - * ============== */ - - $(window).on('load', function () { - $('[data-spy="affix"]').each(function () { - var $spy = $(this) - , data = $spy.data() - - data.offset = data.offset || {} - - data.offsetBottom && (data.offset.bottom = data.offsetBottom) - data.offsetTop && (data.offset.top = data.offsetTop) - - $spy.affix(data) - }) - }) - - -}(window.jQuery); \ No newline at end of file diff --git a/api/resources/javascripts/clicker.js b/api/resources/javascripts/clicker.js index 90e7e12c..5fe3dca2 100644 --- a/api/resources/javascripts/clicker.js +++ b/api/resources/javascripts/clicker.js @@ -1,7 +1,7 @@ -function setupClicker() { +$(function() { // when hovering over arrow, add highlight (only if inactive) - $("i.methodToggle").hover(function () { - if (!$("i.methodToggle").hasClass('active')) + $("h3.methodToggle").hover(function () { + if (!$("h3.methodToggle").hasClass('active')) $(this).addClass("methodToggleHover"); }, function () { @@ -9,61 +9,27 @@ function setupClicker() { } ); - function handleClick(e, linkHref) { - //if (linkHref.indexOf("nav=api&api=") >= 0) - // return; - if (linkHref == "api") - return; - - e.preventDefault(); - - var dstElem; - if (linkHref) { - dstElem = $("article[id='" + linkHref + "']"); - } - - var $article = (dstElem || $(this)).closest('.article'), - $arrow = $('i.methodClicker', $article); + // after expanding the hidden description, hide the ellipsis + $('.signature-call, .signature-returns', '.signature').click(function() { + var $article = $(this).closest('.article'), + $arrow = $('h3.methodClicker', $article); if (!$article.hasClass('methodToggleOpen') || this.force) { $article.addClass('methodToggleOpen'); $arrow.removeClass('inactive').addClass('active'); - - if (!$arrow[0]) - return; - - var data = $arrow[0].id.replace(/^js_/, ""); - //var state = {}; - //state.section = data; - //$.bbq.pushState(state); + var data = location.hash = $arrow[0].id.replace(/^js_/, ""); scrollTo(null, data); } else { $article.removeClass('methodToggleOpen'); $arrow.removeClass('active').addClass('inactive'); } - } - - function transformHash(e) { - // some bs to figure out link hash - var hashId = (e.srcElement ? e.srcElement.href : (e.hash || e.target.href)) || e.currentTarget.hash; - handleClick(e, hashId.substring(hashId.indexOf("#") + 1)); - } - - // for the arrow - $("i.methodToggle").click(handleClick); - - // for the signature - $('.member-name').click(handleClick); - - // for the top dropdown - $('li.memberLink a').click(transformHash); - - //$('a[href^="#"]').click(transformHash); + }); $('.related-to', '.metaInfo').click(function(){ location.hash = $(this).find('a').attr('href').split('#')[1]; }); -} \ No newline at end of file +}); + diff --git a/api/resources/javascripts/disqus-ext.js b/api/resources/javascripts/disqus-ext.js index 6bb7ff4e..6f966cc6 100644 --- a/api/resources/javascripts/disqus-ext.js +++ b/api/resources/javascripts/disqus-ext.js @@ -1,17 +1,12 @@ -function setupDisqus(href) { - var disqus_shortname = 'aceapi'; - - //var paths = window.location.pathname.split("/"); - //var fileName = paths[paths.length - 2] + "/" + paths[paths.length - 1]; - - //var disqus_identifier = fileName; - var disqus_identifier = href.substring(2); - +var disqus_shortname = 'aceapi'; + +var paths = window.location.pathname.split("/"); +var fileName = paths[paths.length - 2] + "/" + paths[paths.length - 1]; + +var disqus_identifier = fileName; + (function() { - if (document.getElementById("disqusScript") === null) { - var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; - dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js'; - (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); - } - })(); -} \ No newline at end of file + var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; + dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js'; + (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); + })(); \ No newline at end of file diff --git a/doc/site/js/ga.js b/api/resources/javascripts/ga.js similarity index 100% rename from doc/site/js/ga.js rename to api/resources/javascripts/ga.js diff --git a/api/resources/javascripts/jquery.js b/api/resources/javascripts/jquery.js new file mode 100644 index 00000000..3ca5e0f5 --- /dev/null +++ b/api/resources/javascripts/jquery.js @@ -0,0 +1,4 @@ +/*! jQuery v1.7 jquery.com | jquery.org/license */ +(function(a,b){function cA(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cx(a){if(!cm[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cn||(cn=c.createElement("iframe"),cn.frameBorder=cn.width=cn.height=0),b.appendChild(cn);if(!co||!cn.createElement)co=(cn.contentWindow||cn.contentDocument).document,co.write((c.compatMode==="CSS1Compat"?"":"")+""),co.close();d=co.createElement(a),co.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cn)}cm[a]=e}return cm[a]}function cw(a,b){var c={};f.each(cs.concat.apply([],cs.slice(0,b)),function(){c[this]=a});return c}function cv(){ct=b}function cu(){setTimeout(cv,0);return ct=f.now()}function cl(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ck(){try{return new a.XMLHttpRequest}catch(b){}}function ce(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bB(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function br(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bi,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bq(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bp(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bp)}function bp(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bo(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bn(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bm(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d=0===c})}function V(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function N(){return!0}function M(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z]|[0-9])/ig,x=/^-ms-/,y=function(a,b){return(b+"").toUpperCase()},z=d.userAgent,A,B,C,D=Object.prototype.toString,E=Object.prototype.hasOwnProperty,F=Array.prototype.push,G=Array.prototype.slice,H=String.prototype.trim,I=Array.prototype.indexOf,J={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7",length:0,size:function(){return this.length},toArray:function(){return G.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?F.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),B.add(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(G.apply(this,arguments),"slice",G.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:F,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;B.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!B){B=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",C,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",C),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&K()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return a!=null&&m.test(a)&&!isNaN(a)},type:function(a){return a==null?String(a):J[D.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!E.call(a,"constructor")&&!E.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||E.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(x,"ms-").replace(w,y)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
                                                                                                                                                                                                                                                                            a",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,unknownElems:!!a.getElementsByTagName("nav").length,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",enctype:!!c.createElement("form").enctype,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.lastChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},m&&f.extend(p,{position:"absolute",left:"-999px",top:"-999px"});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
                                                                                                                                                                                                                                                                            ",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
                                                                                                                                                                                                                                                                            t
                                                                                                                                                                                                                                                                            ",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;f(function(){var a,b,d,e,g,h,i=1,j="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",l="visibility:hidden;border:0;",n="style='"+j+"border:5px solid #000;padding:0;'",p="
                                                                                                                                                                                                                                                                            "+""+"
                                                                                                                                                                                                                                                                            ";m=c.getElementsByTagName("body")[0];!m||(a=c.createElement("div"),a.style.cssText=l+"width:0;height:0;position:static;top:0;margin-top:"+i+"px",m.insertBefore(a,m.firstChild),o=c.createElement("div"),o.style.cssText=j+l,o.innerHTML=p,a.appendChild(o),b=o.firstChild,d=b.firstChild,g=b.nextSibling.firstChild.firstChild,h={doesNotAddBorder:d.offsetTop!==5,doesAddBorderForTableAndCells:g.offsetTop===5},d.style.position="fixed",d.style.top="20px",h.fixedPosition=d.offsetTop===20||d.offsetTop===15,d.style.position=d.style.top="",b.style.overflow="hidden",b.style.position="relative",h.subtractsBorderForOverflowNotVisible=d.offsetTop===-5,h.doesNotIncludeMarginInBodyOffset=m.offsetTop!==i,m.removeChild(a),o=a=null,f.extend(k,h))}),o.innerHTML="",n.removeChild(o),o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[f.expando]:a[f.expando]&&f.expando,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[f.expando]=n=++f.uuid:n=f.expando),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[f.expando]:f.expando;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)?b=b:b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" "));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];if(!arguments.length){if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}return b}e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!a||j===3||j===8||j===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g},removeAttr:function(a,b){var c,d,e,g,h=0;if(a.nodeType===1){d=(b||"").split(p),g=d.length;for(;h=0}})});var z=/\.(.*)$/,A=/^(?:textarea|input|select)$/i,B=/\./g,C=/ /g,D=/[^\w\s.|`]/g,E=/^([^\.]*)?(?:\.(.+))?$/,F=/\bhover(\.\S+)?/,G=/^key/,H=/^(?:mouse|contextmenu)|click/,I=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,J=function(a){var b=I.exec(a);b&& +(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},K=function(a,b){return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||a.id===b[2])&&(!b[3]||b[3].test(a.className))},L=function(a){return f.event.special.hover?a:a.replace(F,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=L(c).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"",(g||!e)&&c.preventDefault();if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,n=null;for(m=e.parentNode;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l=0:t===b&&(t=o[s]=r.quick?K(m,r.quick):f(m).is(s)),t&&q.push(r);q.length&&j.push({elem:m,matches:q})}d.length>e&&j.push({elem:this,matches:d.slice(e)});for(k=0;k0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),G.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),H.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

                                                                                                                                                                                                                                                                            ";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
                                                                                                                                                                                                                                                                            ";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(V(c[0])||V(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=S.call(arguments);O.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!U[a]?f.unique(e):e,(this.length>1||Q.test(d))&&P.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var Y="abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",Z=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,_=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,ba=/<([\w:]+)/,bb=/",""],legend:[1,"
                                                                                                                                                                                                                                                                            ","
                                                                                                                                                                                                                                                                            "],thead:[1,"","
                                                                                                                                                                                                                                                                            "],tr:[2,"","
                                                                                                                                                                                                                                                                            "],td:[3,"","
                                                                                                                                                                                                                                                                            "],col:[2,"","
                                                                                                                                                                                                                                                                            "],area:[1,"",""],_default:[0,"",""]},bk=X(c);bj.optgroup=bj.option,bj.tbody=bj.tfoot=bj.colgroup=bj.caption=bj.thead,bj.th=bj.td,f.support.htmlSerialize||(bj._default=[1,"div
                                                                                                                                                                                                                                                                            ","
                                                                                                                                                                                                                                                                            "]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after" +,arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Z,""):null;if(typeof a=="string"&&!bd.test(a)&&(f.support.leadingWhitespace||!$.test(a))&&!bj[(ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(_,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bn(a,d),e=bo(a),g=bo(d);for(h=0;e[h];++h)g[h]&&bn(e[h],g[h])}if(b){bm(a,d);if(c){e=bo(a),g=bo(d);for(h=0;e[h];++h)bm(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!bc.test(k))k=b.createTextNode(k);else{k=k.replace(_,"<$1>");var l=(ba.exec(k)||["",""])[1].toLowerCase(),m=bj[l]||bj._default,n=m[0],o=b.createElement("div");b===c?bk.appendChild(o):X(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=bb.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&$.test(k)&&o.insertBefore(b.createTextNode($.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bt.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bs,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bs.test(g)?g.replace(bs,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bB(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bC=function(a,c){var d,e,g;c=c.replace(bu,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bD=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bv.test(f)&&bw.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bB=bC||bD,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bF=/%20/g,bG=/\[\]$/,bH=/\r?\n/g,bI=/#.*$/,bJ=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bK=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bL=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bM=/^(?:GET|HEAD)$/,bN=/^\/\//,bO=/\?/,bP=/)<[^<]*)*<\/script>/gi,bQ=/^(?:select|textarea)/i,bR=/\s+/,bS=/([?&])_=[^&]*/,bT=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bU=f.fn.load,bV={},bW={},bX,bY,bZ=["*/"]+["*"];try{bX=e.href}catch(b$){bX=c.createElement("a"),bX.href="",bX=bX.href}bY=bT.exec(bX.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bU)return bU.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
                                                                                                                                                                                                                                                                            ").append(c.replace(bP,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bQ.test(this.nodeName)||bK.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bH,"\r\n")}}):{name:b.name,value:c.replace(bH,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?cb(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),cb(a,b);return a},ajaxSettings:{url:bX,isLocal:bL.test(bY[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bZ},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:b_(bV),ajaxTransport:b_(bW),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cd(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=ce(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bJ.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bI,"").replace(bN,bY[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bR),d.crossDomain==null&&(r=bT.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bY[1]&&r[2]==bY[2]&&(r[3]||(r[1]==="http:"?80:443))==(bY[3]||(bY[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),ca(bV,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bM.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bO.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bS,"$1_="+x);d.url=y+(y===d.url?(bO.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bZ+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=ca(bW,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){s<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)cc(g,a[g],c,e);return d.join("&").replace(bF,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cf=f.now(),cg=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cf++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cg.test(b.url)||e&&cg.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cg,l),b.url===j&&(e&&(k=k.replace(cg,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ch=a.ActiveXObject?function(){for(var a in cj)cj[a](0,1)}:!1,ci=0,cj;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ck()||cl()}:ck,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ch&&delete cj[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++ci,ch&&(cj||(cj={},f(a).unload(ch)),cj[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cm={},cn,co,cp=/^(?:toggle|show|hide)$/,cq=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cr,cs=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],ct;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cw("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cz.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cz.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cA(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cA(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window); \ No newline at end of file diff --git a/api/resources/javascripts/ux.js b/api/resources/javascripts/ux.js index 3bb07cf4..1d03e091 100644 --- a/api/resources/javascripts/ux.js +++ b/api/resources/javascripts/ux.js @@ -1,46 +1,52 @@ $(function () { 'use strict'; - var pagePath = document.location.pathname.substring(document.location.pathname.lastIndexOf("/") + 1); - - // select current page in sidenav and set up prev/next links if they exist - var $selNavLink = $('#sidebar').find('a[href="' + pagePath + '"]'); - if ($selNavLink.length) { - //$selListItem = $selNavLink.closest('li'); - - $selNavLink.addClass('currentItem'); - } + var baseTitle = document.title, + // base (general) part of title + pathName = window.location.pathname, + fileName = pathName.substring(window.location.pathname.lastIndexOf("/") + 1); if (window.addEventListener) window.addEventListener('load', loadCallback, true); else window.attachEvent('load', loadCallback, true); function loadCallback(evt) { var form = document.getElementById("searchbox"); - - if (form) { - var input = form.query; - form.onsubmit = function (evt) { - var query = input.value; - if (query) { - input.value = ""; - input.blur(); - var url = "https://www.google.com/search?q=" + encodeURIComponent("site:ace.ajax.org" + " " + query); - window.open(url); - } - return false; - }; - } + var input = form.query; + form.onsubmit = function (evt) { + var query = input.value; + if (query) { + input.value = ""; + input.blur(); + var currentVersion = $('#currentVersion').text(); + var url = "https://www.google.com/search?q=" + encodeURIComponent("site:ace.ajax.org/api" + " " + query); + window.open(url); + } + return false; + }; } + var fileNameRE = new RegExp("^" + fileName, "i"); + + $('a.menuLink').each(function (index) { + if ($(this).attr("href").match(fileNameRE)) { + $(this).addClass("currentItem"); + return false; + } + }); + // init search $('#search') // prevent from form submit .on('submit', function () { return false; }).find('input'); + + // init prettyprint + $('pre > code').addClass('prettyprint'); + prettyPrint(); }); -function ux() { +$(document).ready(function () { var d = 'a.menu, .dropdown-toggle' function clearMenus() { @@ -71,7 +77,62 @@ function ux() { } else sx = 0; - $('span.methodClicker, article.article, i.methodClicker').each(function () { + $('.members').each(function (i) { + var position = $(this).position(); + var $classContent = $(this).closest('.classContent'); + + $(this).scrollspy({ + min: $classContent.position().top - 35, + max: $classContent.position().top + $classContent.height(), + onEnter: function (element, position) { + var $pagination = $(element); + var $paginationContent = $('.membersContent pos' + i); + var $tabs = $('.tabs pos' + i); + + $paginationContent.css('left', -1 * sx); + $paginationContent.css('top', 0); + + $pagination.addClass('shadow').stop().css({ + height: 31, + 'top': 33 + }).closest('.classContent').addClass('srolled'); + + $tabs.addClass('tabsSansBorder'); + }, + onLeave: function (element, position) { + var $pagination = $(element); + var $paginationContent = $('.membersContent pos' + i); + var $tabs = $('.tabs pos' + i); + + $paginationContent.stop().css({ + top: 11 + }); + $pagination.css({ + 'position': 'absolute', + 'top': 193 + }); + $pagination.stop().removeClass('shadow').css({ + height: 42 + }); + + $paginationContent.css('left', 0); + // setTimeout(function () { + $paginationContent.css({ + 'top': '' + }); + $pagination.css({ + 'position': '', + 'top': '' + }); + $paginationContent.css('left', 0); + $pagination.closest('.classContent').removeClass('srolled') + $tabs.removeClass('tabsSansBorder'); + // }, 300); + } + }); + }); + + $('span.methodClicker, article.article, h3.methodClicker').each(function () { var a = $(this); var constructorPos = a.attr("id").indexOf("new "); @@ -83,16 +144,27 @@ function ux() { a.attr("id", objName); }); - + + $('.brand').parent('.dropdown').hover( + + function () { + $(this).addClass('open'); + }, function () { + clearMenus(); + }); + + $('.versions').hover( + + function () { + $(this).addClass('open'); + }, function () { + clearMenus(); + }); + function showMethodContent() { - var locationHash = location.hash.replace(/^#/, '').replace(/\./g, '\\.'); - var equalsPos = location.hash.indexOf("="); - - if (equalsPos >=0) { - locationHash = locationHash.substring(0, location.hash.indexOf("=")); - } - - var $clickerEl = $('span#' + locationHash); + if (!location.hash) return; + + var $clickerEl = $('span#' + location.hash.replace(/^#/, '').replace(/\./g, '\\.')); if ($clickerEl.length > 0 && $clickerEl.hasClass('methodClicker')) { var p = $clickerEl.parent(); p[0].force = true; @@ -101,7 +173,7 @@ function ux() { } } - if (location.hash.indexOf("section") >= 1) { + if (location.hash) { showMethodContent(); var data = location.hash; scrollTo(null, data.substr(1)); @@ -110,12 +182,12 @@ function ux() { window.onhashchange = function () { showMethodContent(); } -}; +}); function scrollTo(el, data) { if (!data) { data = el.getAttribute("data-id"); - //location.hash = data; + location.hash = data; } var el = $("span#" + data.replace(/\./g, "\\."))[0]; if (!el) return; diff --git a/api/scrollbar.html b/api/scrollbar.html index 5f311060..1ea2683c 100644 --- a/api/scrollbar.html +++ b/api/scrollbar.html @@ -1,261 +1,24 @@ + + + + ScrollBar - Ace API

                                                                                                                                                                                                                                                                            A set of methods for setting and retrieving the editor's scrollbar.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Constructors

                                                                                                                                                                                                                                                                            Creates a new ScrollBar. parent is the owner of the scroll bar.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                            Creates a new ScrollBar. parent is the owner of the scroll bar.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Arguments

                                                                                                                                                                                                                                                                            parentDOMElementRequired. A DOM element

                                                                                                                                                                                                                                                                            Events

                                                                                                                                                                                                                                                                              • ScrollBar.on("onScroll", function())

                                                                                                                                                                                                                                                                              Emitted when the scroll bar, well, scrolls.

                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                 

                                                                                                                                                                                                                                                                              Emitted when the scroll bar, well, scrolls.

                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                              Methods

                                                                                                                                                                                                                                                                              Returns the width of the scroll bar.

                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                 

                                                                                                                                                                                                                                                                              Returns the width of the scroll bar.

                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                • ScrollBar.setHeight(Number height)

                                                                                                                                                                                                                                                                                Sets the height of the scroll bar, in pixels.

                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                   

                                                                                                                                                                                                                                                                                Sets the height of the scroll bar, in pixels.

                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                Arguments

                                                                                                                                                                                                                                                                                heightNumberRequired. The new height
                                                                                                                                                                                                                                                                                  • ScrollBar.setInnerHeight(Number height)

                                                                                                                                                                                                                                                                                  Sets the inner height of the scroll bar, in pixels.

                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                     

                                                                                                                                                                                                                                                                                  Sets the inner height of the scroll bar, in pixels.

                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                  Arguments

                                                                                                                                                                                                                                                                                  heightNumberRequired. The new inner height
                                                                                                                                                                                                                                                                                    • ScrollBar.setScrollTop(Number scrollTop)

                                                                                                                                                                                                                                                                                    Sets the scroll top of the scroll bar.

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                       

                                                                                                                                                                                                                                                                                    Sets the scroll top of the scroll bar.

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    Arguments

                                                                                                                                                                                                                                                                                    scrollTopNumberRequired. The new scroll top
                                                                                                                                                                                                                                                                                    + + + + + \ No newline at end of file diff --git a/api/search.html b/api/search.html index 61616063..58022ef1 100644 --- a/api/search.html +++ b/api/search.html @@ -1,295 +1,35 @@ - -
                                                                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                                                                    -

                                                                                                                                                                                                                                                                                    Search -

                                                                                                                                                                                                                                                                                    - -
                                                                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                                                                    -

                                                                                                                                                                                                                                                                                    A class designed to handle all sorts of text searches within a Document.

                                                                                                                                                                                                                                                                                    - -
                                                                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                                                                    -

                                                                                                                                                                                                                                                                                    Constructors

                                                                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • new Search()
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                                                                    -

                                                                                                                                                                                                                                                                                    Creates a new Search object. The following search options are avaliable:

                                                                                                                                                                                                                                                                                    - -
                                                                                                                                                                                                                                                                                    -

                                                                                                                                                                                                                                                                                    Creates a new Search object. The following search options are avaliable:

                                                                                                                                                                                                                                                                                    + + + + Search - Ace API

                                                                                                                                                                                                                                                                                    A class designed to handle all sorts of text searches within a Document.

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    Constructors

                                                                                                                                                                                                                                                                                      • new Search()

                                                                                                                                                                                                                                                                                      Creates a new Search object. The following search options are avaliable:

                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                         

                                                                                                                                                                                                                                                                                      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
                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                      • 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
                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                      • 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.
                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                      Methods

                                                                                                                                                                                                                                                                                      Searches for options.needle. If found, this method returns the Range where the text first occurs. If options.backwards is true, the search goes backwards in the session.

                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                         

                                                                                                                                                                                                                                                                                      Searches for options.needle. If found, this method returns the Range where the text first occurs. If options.backwards is true, the search goes backwards in the session.

                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                      sessionEditSessionRequired. The session to search with

                                                                                                                                                                                                                                                                                      Searches for all occurances options.needle. If found, this method returns an array of Range where the text first occurs. If options.backwards is true, the search goes backwards in the session.

                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                         

                                                                                                                                                                                                                                                                                      Searches for all occurances options.needle. If found, this method returns an array of Range where the text first occurs. If options.backwards is true, the search goes backwards in the session.

                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                      sessionEditSessionRequired. The session to search with

                                                                                                                                                                                                                                                                                      Returns an object containing all the search options.

                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                         

                                                                                                                                                                                                                                                                                      Returns an object containing all the search options.

                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                      Searches for options.needle in input, and, if found, replaces it with replacement.

                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                         

                                                                                                                                                                                                                                                                                      Searches for options.needle in input, and, if found, replaces it with replacement.

                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                      inputStringRequired. The text to search in
                                                                                                                                                                                                                                                                                      replacementStringRequired. The replacing text

                                                                                                                                                                                                                                                                                      Sets the search options via the options parameter.

                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                         

                                                                                                                                                                                                                                                                                      Sets the search options via the options parameter.

                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                      optionsObjectRequired. An object containing all the new search properties
                                                                                                                                                                                                                                                                                      + + + + + \ No newline at end of file diff --git a/api/selection.html b/api/selection.html index 4da8f771..788bfd65 100644 --- a/api/selection.html +++ b/api/selection.html @@ -1,1781 +1,105 @@ - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Contains the cursor position and the text selection of an edit session.

                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      The row/columns used in the selection are in document coordinates representing the coordinates as they appear in the document before applying soft wrap and folding.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Constructors

                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Creates a new Selection object.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Creates a new Selection object.

                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                      sessionEditSession

                                                                                                                                                                                                                                                                                      Required. The session to use

                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Events

                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.on("changeCursor", function())
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Emitted when the cursor position changes.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Emitted when the cursor position changes.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.on("changeSelection", function())
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Emitted when the cursor selection changes.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Emitted when the cursor selection changes.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Methods

                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.addRange(Range range, Boolean $blockChangeEvents)
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Adds a range to a selection by entering multiselect mode, if necessary.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Adds a range to a selection by entering multiselect mode, if necessary.

                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                      rangeRange

                                                                                                                                                                                                                                                                                      Required. The new range to add

                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      $blockChangeEventsBoolean

                                                                                                                                                                                                                                                                                      Required. Whether or not to block changing events

                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.clearSelection()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Empties the selection (by de-selecting it). This function also emits the 'changeSelection' event.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Empties the selection (by de-selecting it). This function also emits the 'changeSelection' event.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.detach()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.fromOrientedRange()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.getAllRanges() -
                                                                                                                                                                                                                                                                                        • - -
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Returns a concatenation of all the ranges.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Returns a concatenation of all the ranges.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.getCursor() -
                                                                                                                                                                                                                                                                                        • - -
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Gets the current position of the cursor.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Gets the current position of the cursor.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.getLineRange()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.getRange() -
                                                                                                                                                                                                                                                                                        • - -
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Returns the Range for the selected text.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Returns the Range for the selected text.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.getSelectionAnchor() -
                                                                                                                                                                                                                                                                                        • - -
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Returns an object containing the row and column of the calling selection anchor.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Returns an object containing the row and column of the calling selection anchor.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.getSelectionLead() -
                                                                                                                                                                                                                                                                                        • - -
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Returns an object containing the row and column of the calling selection lead.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Returns an object containing the row and column of the calling selection lead.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • - -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the selection to highlight the entire word.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the selection to highlight the entire word.

                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                      rowObject

                                                                                                                                                                                                                                                                                      Required.

                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      columnObject

                                                                                                                                                                                                                                                                                      Required.

                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.isBackwards() -
                                                                                                                                                                                                                                                                                        • - -
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Returns true if the selection is going backwards in the document.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Returns true if the selection is going backwards in the document.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.isEmpty() -
                                                                                                                                                                                                                                                                                        • - -
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Returns true if the selection is empty.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Returns true if the selection is empty.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.isMultiLine() -
                                                                                                                                                                                                                                                                                        • - -
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Returns true if the selection is a multi-line.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Returns true if the selection is a multi-line.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.mergeOverlappingRanges()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Merges overlapping ranges ensuring consistency after changes

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Merges overlapping ranges ensuring consistency after changes

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • - -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the cursor to position indicated by the parameters. Negative numbers move the cursor backwards in the document.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the cursor to position indicated by the parameters. Negative numbers move the cursor backwards in the document.

                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                      rowsNumber

                                                                                                                                                                                                                                                                                      Required. The number of rows to move by

                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      charsNumber

                                                                                                                                                                                                                                                                                      Required. The number of characters to move by

                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.moveCursorDown()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the cursor down one row.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the cursor down one row.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.moveCursorFileEnd()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the cursor to the end of the file.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the cursor to the end of the file.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.moveCursorFileStart()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the cursor to the start of the file.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the cursor to the start of the file.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.moveCursorLeft()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the cursor left one column.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the cursor left one column.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.moveCursorLineEnd()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the cursor to the end of the line.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the cursor to the end of the line.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.moveCursorLineStart()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the cursor to the start of the line.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the cursor to the start of the line.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.moveCursorLongWordLeft()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the cursor to the word on the left.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the cursor to the word on the left.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.moveCursorLongWordRight()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the cursor to the word on the right.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the cursor to the word on the right.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.moveCursorRight()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the cursor right one column.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the cursor right one column.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.moveCursorShortWordLeft()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.moveCursorShortWordRight()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the cursor to the row and column provided. If preventUpdateDesiredColumn is true, then the cursor stays in the same column position as its original point.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the cursor to the row and column provided. If preventUpdateDesiredColumn is true, then the cursor stays in the same column position as its original point.

                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                      rowNumber

                                                                                                                                                                                                                                                                                      Required. The row to move to

                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      columnNumber

                                                                                                                                                                                                                                                                                      Required. The column to move to

                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      keepDesiredColumnBoolean

                                                                                                                                                                                                                                                                                      Required. If true, the cursor move does not respect the previous column

                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.moveCursorToPosition(Object position)
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the selection to the position indicated by its row and column.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the selection to the position indicated by its row and column.

                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                      positionObject

                                                                                                                                                                                                                                                                                      Required. The position to move to

                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • - -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the cursor to the screen position indicated by row and column. If preventUpdateDesiredColumn is true, then the cursor stays in the same column position as its original point.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the cursor to the screen position indicated by row and column. If preventUpdateDesiredColumn is true, then the cursor stays in the same column position as its original point.

                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                      rowNumber

                                                                                                                                                                                                                                                                                      Required. The row to move to

                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      columnNumber

                                                                                                                                                                                                                                                                                      Required. The column to move to

                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      keepDesiredColumnBoolean

                                                                                                                                                                                                                                                                                      Required. If true, the cursor move does not respect the previous column

                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.moveCursorUp()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the cursor up one row.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the cursor up one row.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.moveCursorWordLeft()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.moveCursorWordRight()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.rectangularRangeBlock(Cursor screenCursor, Anchor screenAnchor, Boolean includeEmptyLines) -
                                                                                                                                                                                                                                                                                        • - -
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Gets list of ranges composing rectangular block on the screen

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Gets list of ranges composing rectangular block on the screen

                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                      screenCursorCursor

                                                                                                                                                                                                                                                                                      Required. The cursor to use

                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      screenAnchorAnchor

                                                                                                                                                                                                                                                                                      Required. The anchor to use

                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      includeEmptyLinesBoolean

                                                                                                                                                                                                                                                                                      Required. If true, this includes ranges inside the block which are empty due to clipping

                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.selectAll()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Selects all the text in the document.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Selects all the text in the document.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.selectAWord()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Selects a word, including its right whitespace.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Selects a word, including its right whitespace.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.selectDown()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the selection down one row.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the selection down one row.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.selectFileEnd()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the selection to the end of the file.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the selection to the end of the file.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.selectFileStart()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the selection to the start of the file.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the selection to the start of the file.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.selectLeft()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the selection left one column.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the selection left one column.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.selectLine()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Selects the entire line.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Selects the entire line.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.selectLineEnd()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the selection to the end of the current line.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the selection to the end of the current line.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.selectLineStart()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the selection to the beginning of the current line.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the selection to the beginning of the current line.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.selectRight()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the selection right one column.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the selection right one column.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • - -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the selection cursor to the indicated row and column.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the selection cursor to the indicated row and column.

                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                      rowNumber

                                                                                                                                                                                                                                                                                      Required. The row to select to

                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      columnNumber

                                                                                                                                                                                                                                                                                      Required. The column to select to

                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.selectToPosition(Object pos)
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the selection cursor to the row and column indicated by pos.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the selection cursor to the row and column indicated by pos.

                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                      posObject

                                                                                                                                                                                                                                                                                      Required. An object containing the row and column

                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.selectUp()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the selection up one row.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the selection up one row.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.selectWord()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Selects an entire word boundary.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Selects an entire word boundary.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.selectWordLeft()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the selection to the first word on the left.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the selection to the first word on the left.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.selectWordRight()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the selection to the first word on the right.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Moves the selection to the first word on the right.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.setSelectionAnchor(Number row, Number column)
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Sets the row and column position of the anchor. This function also emits the 'changeSelection' event.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Sets the row and column position of the anchor. This function also emits the 'changeSelection' event.

                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                      rowNumber

                                                                                                                                                                                                                                                                                      Required. The new row

                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      columnNumber

                                                                                                                                                                                                                                                                                      Required. The new column

                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.setSelectionRange(Range range, Boolean reverse)
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Sets the selection to the provided range.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Sets the selection to the provided range.

                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                      rangeRange

                                                                                                                                                                                                                                                                                      Required. The range of text to select

                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      reverseBoolean

                                                                                                                                                                                                                                                                                      Required. Indicates if the range should go backwards (true) or not

                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.shiftSelection(Number columns)
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Shifts the selection up (or down, if isBackwards() is true) the given number of columns.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Shifts the selection up (or down, if isBackwards() is true) the given number of columns.

                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                      columnsNumber

                                                                                                                                                                                                                                                                                      Required. The number of columns to shift by

                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.splitIntoLines()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Splits all the ranges into lines.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Splits all the ranges into lines.

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.substractPoint(Range pos)
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Removes a Range containing pos (if it exists).

                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                      Removes a Range containing pos (if it exists).

                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                      posRange

                                                                                                                                                                                                                                                                                      Required. The position to remove, as a {row, column} object

                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.toggleBlockSelection()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.toOrientedRange()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Selection.toSingleRange()
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      - - - - - -
                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                      + + + + Selection - Ace API

                                                                                                                                                                                                                                                                                      Contains the cursor position and the text selection of an edit session.

                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                      The row/columns used in the selection are in document coordinates representing ths coordinates as thez appear in the document before applying soft wrap and folding.

                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                      Constructors

                                                                                                                                                                                                                                                                                      Creates a new Selection object.

                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                         

                                                                                                                                                                                                                                                                                      Creates a new Selection object.

                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                      sessionEditSessionRequired. The session to use

                                                                                                                                                                                                                                                                                      Methods

                                                                                                                                                                                                                                                                                      Adds a range to a selection by entering multiselect mode, if necessary.

                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                         

                                                                                                                                                                                                                                                                                      Adds a range to a selection by entering multiselect mode, if necessary.

                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                      rangeRangeRequired. The new range to add
                                                                                                                                                                                                                                                                                      $blockChangeEventsBooleanRequired. Whether or not to block changing events
                                                                                                                                                                                                                                                                                        • Selection.clearSelection()

                                                                                                                                                                                                                                                                                        Empties the selection (by de-selecting it). This function also emits the 'changeSelection' event.

                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                           

                                                                                                                                                                                                                                                                                        Empties the selection (by de-selecting it). This function also emits the 'changeSelection' event.

                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                        Gets the current position of the cursor.

                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                           

                                                                                                                                                                                                                                                                                        Gets the current position of the cursor.

                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                          • Selection.getRange()

                                                                                                                                                                                                                                                                                          Returns the Range for the selected text.

                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                             

                                                                                                                                                                                                                                                                                          Returns the Range for the selected text.

                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                          Returns an object containing the row and column of the calling selection anchor.

                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                             

                                                                                                                                                                                                                                                                                          Returns an object containing the row and column of the calling selection anchor.

                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                            • Selection.getSelectionLead()

                                                                                                                                                                                                                                                                                            Returns an object containing the row and column of the calling selection lead.

                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                                            Returns an object containing the row and column of the calling selection lead.

                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                            Returns true if the selection is going backwards in the document.

                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                                            Returns true if the selection is going backwards in the document.

                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                            Returns true if the selection is empty.

                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                                            Returns true if the selection is empty.

                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                            Returns true if the selection is a multi-line.

                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                                            Returns true if the selection is a multi-line.

                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                              • Selection.mergeOverlappingRanges()

                                                                                                                                                                                                                                                                                              Merges overlapping ranges ensuring consistency after changes

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                 

                                                                                                                                                                                                                                                                                              Merges overlapping ranges ensuring consistency after changes

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              Moves the cursor to position indicated by the parameters. Negative numbers move the cursor backwards in the document.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                 

                                                                                                                                                                                                                                                                                              Moves the cursor to position indicated by the parameters. Negative numbers move the cursor backwards in the document.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              Arguments

                                                                                                                                                                                                                                                                                              rowsNumberRequired. The number of rows to move by
                                                                                                                                                                                                                                                                                              charsNumberRequired. The number of characters to move by
                                                                                                                                                                                                                                                                                                • Selection.moveCursorDown()

                                                                                                                                                                                                                                                                                                Moves the cursor down one row.

                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                   

                                                                                                                                                                                                                                                                                                Moves the cursor down one row.

                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                  • Selection.moveCursorFileEnd()

                                                                                                                                                                                                                                                                                                  Moves the cursor to the end of the file.

                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                     

                                                                                                                                                                                                                                                                                                  Moves the cursor to the end of the file.

                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                    • Selection.moveCursorFileStart()

                                                                                                                                                                                                                                                                                                    Moves the cursor to the start of the file.

                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                       

                                                                                                                                                                                                                                                                                                    Moves the cursor to the start of the file.

                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                      • Selection.moveCursorLeft()

                                                                                                                                                                                                                                                                                                      Moves the cursor left one column.

                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                         

                                                                                                                                                                                                                                                                                                      Moves the cursor left one column.

                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                        • Selection.moveCursorLineEnd()

                                                                                                                                                                                                                                                                                                        Moves the cursor to the end of the line.

                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                           

                                                                                                                                                                                                                                                                                                        Moves the cursor to the end of the line.

                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                          • Selection.moveCursorLineStart()

                                                                                                                                                                                                                                                                                                          Moves the cursor to the start of the line.

                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                             

                                                                                                                                                                                                                                                                                                          Moves the cursor to the start of the line.

                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                            • Selection.moveCursorLongWordLeft()

                                                                                                                                                                                                                                                                                                            Moves the cursor to the word on the left.

                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                                                            Moves the cursor to the word on the left.

                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                              • Selection.moveCursorLongWordRight()

                                                                                                                                                                                                                                                                                                              Moves the cursor to the word on the right.

                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                 

                                                                                                                                                                                                                                                                                                              Moves the cursor to the word on the right.

                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                • Selection.moveCursorRight()

                                                                                                                                                                                                                                                                                                                Moves the cursor right one column.

                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                   

                                                                                                                                                                                                                                                                                                                Moves the cursor right one column.

                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                Moves the cursor to the row and column provided. If preventUpdateDesiredColumn is true, then the cursor stays in the same column position as its original point.

                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                   

                                                                                                                                                                                                                                                                                                                Moves the cursor to the row and column provided. If preventUpdateDesiredColumn is true, then the cursor stays in the same column position as its original point.

                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                Arguments

                                                                                                                                                                                                                                                                                                                rowNumberRequired. The row to move to
                                                                                                                                                                                                                                                                                                                columnNumberRequired. The column to move to
                                                                                                                                                                                                                                                                                                                keepDesiredColumnBooleanRequired. If true, the cursor move does not respect the previous column
                                                                                                                                                                                                                                                                                                                  • Selection.moveCursorToPosition(Object position)

                                                                                                                                                                                                                                                                                                                  Moves the selection to the position indicated by its row and column.

                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                     

                                                                                                                                                                                                                                                                                                                  Moves the selection to the position indicated by its row and column.

                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                  Arguments

                                                                                                                                                                                                                                                                                                                  positionObjectRequired. The position to move to

                                                                                                                                                                                                                                                                                                                  Moves the cursor to the screen position indicated by row and column. If preventUpdateDesiredColumn is true, then the cursor stays in the same column position as its original point.

                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                     

                                                                                                                                                                                                                                                                                                                  Moves the cursor to the screen position indicated by row and column. If preventUpdateDesiredColumn is true, then the cursor stays in the same column position as its original point.

                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                  Arguments

                                                                                                                                                                                                                                                                                                                  rowNumberRequired. The row to move to
                                                                                                                                                                                                                                                                                                                  columnNumberRequired. The column to move to
                                                                                                                                                                                                                                                                                                                  keepDesiredColumnBooleanRequired. If true, the cursor move does not respect the previous column
                                                                                                                                                                                                                                                                                                                    • Selection.moveCursorUp()

                                                                                                                                                                                                                                                                                                                    Moves the cursor up one row.

                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                       

                                                                                                                                                                                                                                                                                                                    Moves the cursor up one row.

                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                    Gets list of ranges composing rectangular block on the screen

                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                       

                                                                                                                                                                                                                                                                                                                    Gets list of ranges composing rectangular block on the screen

                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                    Arguments

                                                                                                                                                                                                                                                                                                                    screenCursorCursorRequired. The cursor to use
                                                                                                                                                                                                                                                                                                                    screenAnchorAnchorRequired. The anchor to use
                                                                                                                                                                                                                                                                                                                    includeEmptyLinesBooleanRequired. If true, this includes ranges inside the block which are empty due to clipping
                                                                                                                                                                                                                                                                                                                      • Selection.selectAll()

                                                                                                                                                                                                                                                                                                                      Selects all the text in the document.

                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                         

                                                                                                                                                                                                                                                                                                                      Selects all the text in the document.

                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                      Selects a word, including its right whitespace.

                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                         

                                                                                                                                                                                                                                                                                                                      Selects a word, including its right whitespace.

                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                        • Selection.selectDown()

                                                                                                                                                                                                                                                                                                                        Moves the selection down one row.

                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                           

                                                                                                                                                                                                                                                                                                                        Moves the selection down one row.

                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                          • Selection.selectFileEnd()

                                                                                                                                                                                                                                                                                                                          Moves the selection to the end of the file.

                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                             

                                                                                                                                                                                                                                                                                                                          Moves the selection to the end of the file.

                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                            • Selection.selectFileStart()

                                                                                                                                                                                                                                                                                                                            Moves the selection to the start of the file.

                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                                                                            Moves the selection to the start of the file.

                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                              • Selection.selectLeft()

                                                                                                                                                                                                                                                                                                                              Moves the selection left one column.

                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                 

                                                                                                                                                                                                                                                                                                                              Moves the selection left one column.

                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                • Selection.selectLine()

                                                                                                                                                                                                                                                                                                                                Selects the entire line.

                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                   

                                                                                                                                                                                                                                                                                                                                Selects the entire line.

                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                  • Selection.selectLineEnd()

                                                                                                                                                                                                                                                                                                                                  Moves the selection to the end of the current line.

                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                     

                                                                                                                                                                                                                                                                                                                                  Moves the selection to the end of the current line.

                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                    • Selection.selectLineStart()

                                                                                                                                                                                                                                                                                                                                    Moves the selection to the beginning of the current line.

                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                       

                                                                                                                                                                                                                                                                                                                                    Moves the selection to the beginning of the current line.

                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                      • Selection.selectRight()

                                                                                                                                                                                                                                                                                                                                      Moves the selection right one column.

                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                         

                                                                                                                                                                                                                                                                                                                                      Moves the selection right one column.

                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                      Moves the selection cursor to the indicated row and column.

                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                         

                                                                                                                                                                                                                                                                                                                                      Moves the selection cursor to the indicated row and column.

                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                      rowNumberRequired. The row to select to
                                                                                                                                                                                                                                                                                                                                      columnNumberRequired. The column to select to
                                                                                                                                                                                                                                                                                                                                        • Selection.selectToPosition(Object pos)

                                                                                                                                                                                                                                                                                                                                        Moves the selection cursor to the row and column indicated by pos.

                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                           

                                                                                                                                                                                                                                                                                                                                        Moves the selection cursor to the row and column indicated by pos.

                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                        Arguments

                                                                                                                                                                                                                                                                                                                                        posObjectRequired. An object containing the row and column
                                                                                                                                                                                                                                                                                                                                          • Selection.selectUp()

                                                                                                                                                                                                                                                                                                                                          Moves the selection up one row.

                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                             

                                                                                                                                                                                                                                                                                                                                          Moves the selection up one row.

                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                          Moves the selection to highlight the entire word.

                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                             

                                                                                                                                                                                                                                                                                                                                          Moves the selection to highlight the entire word.

                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                            • Selection.selectWordLeft()

                                                                                                                                                                                                                                                                                                                                            Moves the selection to the first word on the left.

                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                                                                                            Moves the selection to the first word on the left.

                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                              • Selection.selectWordRight()

                                                                                                                                                                                                                                                                                                                                              Moves the selection to the first word on the right.

                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                 

                                                                                                                                                                                                                                                                                                                                              Moves the selection to the first word on the right.

                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                              Sets the row and column position of the anchor. This function also emits the 'changeSelection' event.

                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                 

                                                                                                                                                                                                                                                                                                                                              Sets the row and column position of the anchor. This function also emits the 'changeSelection' event.

                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                              Arguments

                                                                                                                                                                                                                                                                                                                                              rowNumberRequired. The new row
                                                                                                                                                                                                                                                                                                                                              columnNumberRequired. The new column

                                                                                                                                                                                                                                                                                                                                              Sets the selection to the provided range.

                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                 

                                                                                                                                                                                                                                                                                                                                              Sets the selection to the provided range.

                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                              Arguments

                                                                                                                                                                                                                                                                                                                                              rangeRangeRequired. The range of text to select
                                                                                                                                                                                                                                                                                                                                              reverseBooleanRequired. Indicates if the range should go backwards (true) or not
                                                                                                                                                                                                                                                                                                                                                • Selection.shiftSelection(Number columns)

                                                                                                                                                                                                                                                                                                                                                Shifts the selection up (or down, if isBackwards is true) the given number of columns.

                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                   

                                                                                                                                                                                                                                                                                                                                                Shifts the selection up (or down, if isBackwards is true) the given number of columns.

                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                Arguments

                                                                                                                                                                                                                                                                                                                                                columnsNumberRequired. The number of columns to shift by

                                                                                                                                                                                                                                                                                                                                                Removes a Range containing pos (if it exists).

                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                   

                                                                                                                                                                                                                                                                                                                                                Removes a Range containing pos (if it exists).

                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                Arguments

                                                                                                                                                                                                                                                                                                                                                posRangeRequired. The position to remove, as a {row, column} object
                                                                                                                                                                                                                                                                                                                                                + + + + + \ No newline at end of file diff --git a/api/split.html b/api/split.html index fd75edce..cdad4071 100644 --- a/api/split.html +++ b/api/split.html @@ -1,640 +1,33 @@ + + + + Split - Ace API

                                                                                                                                                                                                                                                                                                                                                Constructors

                                                                                                                                                                                                                                                                                                                                                   

                                                                                                                                                                                                                                                                                                                                                Arguments

                                                                                                                                                                                                                                                                                                                                                containerDocumentRequired. The document to associate with the split
                                                                                                                                                                                                                                                                                                                                                themeStringRequired. The name of the initial theme
                                                                                                                                                                                                                                                                                                                                                splitsNumberRequired. The number of initial splits

                                                                                                                                                                                                                                                                                                                                                Methods

                                                                                                                                                                                                                                                                                                                                                Blurs the current editor.

                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                   

                                                                                                                                                                                                                                                                                                                                                Blurs the current editor.

                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                Focuses the current editor.

                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                   

                                                                                                                                                                                                                                                                                                                                                Focuses the current editor.

                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                Executes callback on all of the available editors.

                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                   

                                                                                                                                                                                                                                                                                                                                                Executes callback on all of the available editors.

                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                Arguments

                                                                                                                                                                                                                                                                                                                                                callbackFunctionRequired. A callback function to execute
                                                                                                                                                                                                                                                                                                                                                scopeStringRequired.
                                                                                                                                                                                                                                                                                                                                                  • Split.getCurrentEditor()

                                                                                                                                                                                                                                                                                                                                                  Returns the current editor.

                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                     

                                                                                                                                                                                                                                                                                                                                                  Returns the current editor.

                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                  Returns the editor identified by the index idx.

                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                     

                                                                                                                                                                                                                                                                                                                                                  Returns the editor identified by the index idx.

                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                  Arguments

                                                                                                                                                                                                                                                                                                                                                  idxNumberRequired. The index of the editor you want
                                                                                                                                                                                                                                                                                                                                                    • Internal

                                                                                                                                                                                                                                                                                                                                                  Returns the orientation.

                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                     

                                                                                                                                                                                                                                                                                                                                                  Returns the orientation.

                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                  Returns the number of splits.

                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                     

                                                                                                                                                                                                                                                                                                                                                  Returns the number of splits.

                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                    • Split.resize()
                                                                                                                                                                                                                                                                                                                                                      • Void
                                                                                                                                                                                                                                                                                                                                                    • Internal

                                                                                                                                                                                                                                                                                                                                                     

                                                                                                                                                                                                                                                                                                                                                  Sets the font size, in pixels, for all the available editors.

                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                     

                                                                                                                                                                                                                                                                                                                                                  Sets the font size, in pixels, for all the available editors.

                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                  Arguments

                                                                                                                                                                                                                                                                                                                                                  sizeNumberRequired. The new font size
                                                                                                                                                                                                                                                                                                                                                    • Split.setKeyboardHandler(String keybinding)
                                                                                                                                                                                                                                                                                                                                                      • Void
                                                                                                                                                                                                                                                                                                                                                    • Internal

                                                                                                                                                                                                                                                                                                                                                     

                                                                                                                                                                                                                                                                                                                                                  Arguments

                                                                                                                                                                                                                                                                                                                                                  keybindingStringRequired.
                                                                                                                                                                                                                                                                                                                                                    • Split.setOrientation(Number oriantation)
                                                                                                                                                                                                                                                                                                                                                      • Void
                                                                                                                                                                                                                                                                                                                                                    • Internal

                                                                                                                                                                                                                                                                                                                                                  Sets the orientation.

                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                     

                                                                                                                                                                                                                                                                                                                                                  Sets the orientation.

                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                  Arguments

                                                                                                                                                                                                                                                                                                                                                  oriantationNumberRequired.
                                                                                                                                                                                                                                                                                                                                                    • Split.setSplits(Number splits)
                                                                                                                                                                                                                                                                                                                                                      • Void
                                                                                                                                                                                                                                                                                                                                                    • Internal

                                                                                                                                                                                                                                                                                                                                                     

                                                                                                                                                                                                                                                                                                                                                  Arguments

                                                                                                                                                                                                                                                                                                                                                  splitsNumberRequired. The new number of splits

                                                                                                                                                                                                                                                                                                                                                  Sets a theme for each of the available editors.

                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                     

                                                                                                                                                                                                                                                                                                                                                  Sets a theme for each of the available editors.

                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                  Arguments

                                                                                                                                                                                                                                                                                                                                                  themeStringRequired. The name of the theme to set
                                                                                                                                                                                                                                                                                                                                                    • Split.UndoManagerProxy()
                                                                                                                                                                                                                                                                                                                                                      • Void
                                                                                                                                                                                                                                                                                                                                                    • Internal

                                                                                                                                                                                                                                                                                                                                                     

                                                                                                                                                                                                                                                                                                                                                  + + + + + \ No newline at end of file diff --git a/api/token_iterator.html b/api/token_iterator.html index 7c025da0..ef9d2a2a 100644 --- a/api/token_iterator.html +++ b/api/token_iterator.html @@ -1,248 +1,24 @@ + + + + TokenIterator - Ace API

                                                                                                                                                                                                                                                                                                                                                  This class provides an essay way to treat the document as a stream of tokens, and provides methods to iterate over these tokens.

                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                  Constructors

                                                                                                                                                                                                                                                                                                                                                  Creates a new token iterator object. The inital token index is set to the provided row and column coordinates.

                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                     

                                                                                                                                                                                                                                                                                                                                                  Creates a new token iterator object. The inital token index is set to the provided row and column coordinates.

                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                  Arguments

                                                                                                                                                                                                                                                                                                                                                  sessionEditSessionRequired. The session to associate with
                                                                                                                                                                                                                                                                                                                                                  initialRowNumberRequired. The row to start the tokenizing at
                                                                                                                                                                                                                                                                                                                                                  initialColumnNumberRequired. The column to start the tokenizing at

                                                                                                                                                                                                                                                                                                                                                  Methods

                                                                                                                                                                                                                                                                                                                                                    • TokenIterator.getCurrentToken()

                                                                                                                                                                                                                                                                                                                                                    Returns the current tokenized string.

                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                       

                                                                                                                                                                                                                                                                                                                                                    Returns the current tokenized string.

                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                      • TokenIterator.getCurrentTokenColumn()

                                                                                                                                                                                                                                                                                                                                                      Returns the current column.

                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                         

                                                                                                                                                                                                                                                                                                                                                      Returns the current column.

                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                        • TokenIterator.getCurrentTokenRow()

                                                                                                                                                                                                                                                                                                                                                        Returns the current row.

                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                           

                                                                                                                                                                                                                                                                                                                                                        Returns the current row.

                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                          • TokenIterator.stepBackward()

                                                                                                                                                                                                                                                                                                                                                          Tokenizes all the items from the current point to the row prior in the document.

                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                             

                                                                                                                                                                                                                                                                                                                                                          Tokenizes all the items from the current point to the row prior in the document.

                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                            • TokenIterator.stepForward()

                                                                                                                                                                                                                                                                                                                                                            Tokenizes all the items from the current point until the next row in the document. If the current point is at the end of the file, this function returns null. Otherwise, it returns the tokenized string.

                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                                                                                                            Tokenizes all the items from the current point until the next row in the document. If the current point is at the end of the file, this function returns null. Otherwise, it returns the tokenized string.

                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                            + + + + + \ No newline at end of file diff --git a/api/tokenizer.html b/api/tokenizer.html index b45bd58d..de974f6b 100644 --- a/api/tokenizer.html +++ b/api/tokenizer.html @@ -1,122 +1,16 @@ + + + + Tokenizer - Ace API

                                                                                                                                                                                                                                                                                                                                                            Constructors

                                                                                                                                                                                                                                                                                                                                                            Constructs a new tokenizer based on the given rules and flags.

                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                                                                                                            Constructs a new tokenizer based on the given rules and flags.

                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                            Arguments

                                                                                                                                                                                                                                                                                                                                                            rulesObjectRequired. The highlighting rules
                                                                                                                                                                                                                                                                                                                                                            flagStringRequired. Any additional regular expression flags to pass (like "i" for case insensitive)

                                                                                                                                                                                                                                                                                                                                                            Methods

                                                                                                                                                                                                                                                                                                                                                              • Tokenizer.getLineTokens()

                                                                                                                                                                                                                                                                                                                                                              Returns an object containing two properties: tokens, which contains all the tokens; and state, the current state.

                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                 

                                                                                                                                                                                                                                                                                                                                                              Returns an object containing two properties: tokens, which contains all the tokens; and state, the current state.

                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              + + + + + \ No newline at end of file diff --git a/api/undomanager.html b/api/undomanager.html index fafd4131..a7d02245 100644 --- a/api/undomanager.html +++ b/api/undomanager.html @@ -1,271 +1,30 @@ - -
                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                              UndoManager -

                                                                                                                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                              This object maintains the undo stack for an EditSession.

                                                                                                                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                              Constructors

                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                                                                                                • new UndoManager()
                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                              Resets the current undo state and creates a new UndoManager.

                                                                                                                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                              Resets the current undo state and creates a new UndoManager.

                                                                                                                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                              Methods

                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                                                                                                • UndoManager.execute(Object options)
                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                              Provides a means for implementing your own undo manager. options has one property, args, an Array, with two elements:

                                                                                                                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                              Provides a means for implementing your own undo manager. options has one property, args, an Array, with two elements:

                                                                                                                                                                                                                                                                                                                                                              + + + + UndoManager - Ace API

                                                                                                                                                                                                                                                                                                                                                              This object maintains the undo stack for an EditSession.

                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              Constructors

                                                                                                                                                                                                                                                                                                                                                                • new UndoManager()

                                                                                                                                                                                                                                                                                                                                                                Resets the current undo state and creates a new UndoManager.

                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                   

                                                                                                                                                                                                                                                                                                                                                                Resets the current undo state and creates a new UndoManager.

                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                Methods

                                                                                                                                                                                                                                                                                                                                                                  • UndoManager.execute(Object options)
                                                                                                                                                                                                                                                                                                                                                                    • Void

                                                                                                                                                                                                                                                                                                                                                                  Provides a means for implementing your own undo manager. options has one property, args, an Array, with two elements:

                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                     

                                                                                                                                                                                                                                                                                                                                                                  Provides a means for implementing your own undo manager. options has one property, args, an Array, with two elements:

                                                                                                                                                                                                                                                                                                                                                                  • args[0] is an array of deltas
                                                                                                                                                                                                                                                                                                                                                                  • args[1] is the document to associate with
                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                  Arguments

                                                                                                                                                                                                                                                                                                                                                                  optionsObjectRequired. Contains additional properties

                                                                                                                                                                                                                                                                                                                                                                  Returns true if there are redo operations left to perform.

                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                     

                                                                                                                                                                                                                                                                                                                                                                  Returns true if there are redo operations left to perform.

                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                  Returns true if there are undo operations left to perform.

                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                     

                                                                                                                                                                                                                                                                                                                                                                  Returns true if there are undo operations left to perform.

                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                    • UndoManager.redo(Boolean dontSelect)
                                                                                                                                                                                                                                                                                                                                                                      • Void

                                                                                                                                                                                                                                                                                                                                                                    Perform a redo operation on the document, reimplementing the last change.

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                       

                                                                                                                                                                                                                                                                                                                                                                    Perform a redo operation on the document, reimplementing the last change.

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Arguments

                                                                                                                                                                                                                                                                                                                                                                    dontSelectBooleanRequired. If true, doesn't select the range of where the change occured
                                                                                                                                                                                                                                                                                                                                                                      • UndoManager.reset()
                                                                                                                                                                                                                                                                                                                                                                        • Void

                                                                                                                                                                                                                                                                                                                                                                      Destroys the stack of undo and redo redo operations.

                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                         

                                                                                                                                                                                                                                                                                                                                                                      Destroys the stack of undo and redo redo operations.

                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                      Perform an undo operation on the document, reverting the last change. Returns the range of the undo.

                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                         

                                                                                                                                                                                                                                                                                                                                                                      Perform an undo operation on the document, reverting the last change. Returns the range of the undo.

                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                                      dontSelectBooleanRequired. If true, doesn't select the range of where the change occured
                                                                                                                                                                                                                                                                                                                                                                      + + + + + \ No newline at end of file diff --git a/api/virtual_renderer.html b/api/virtual_renderer.html index 952e6ae6..f8d4220e 100644 --- a/api/virtual_renderer.html +++ b/api/virtual_renderer.html @@ -1,2190 +1,128 @@ - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      VirtualRenderer -

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      The class that is responsible for drawing everything you see on the screen!

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Constructors

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Constructs a new VirtualRenderer within the container specified, applying the given theme.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Constructs a new VirtualRenderer within the container specified, applying the given theme.

                                                                                                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                                      containerDOMElement

                                                                                                                                                                                                                                                                                                                                                                      Required. The root element of the editor

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      themeString

                                                                                                                                                                                                                                                                                                                                                                      Required. The starting theme

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Methods

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer._loadTheme()
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.addGutterDecoration(Object row, Object className)
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Deprecated; (moved to EditSession)

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Deprecated; (moved to EditSession)

                                                                                                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                                      rowObject

                                                                                                                                                                                                                                                                                                                                                                      Required.

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      classNameObject

                                                                                                                                                                                                                                                                                                                                                                      Required.

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.adjustWrapLimit()
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Adjusts the wrap limit, which is the number of characters that can fit within the width of the edit area on screen.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Adjusts the wrap limit, which is the number of characters that can fit within the width of the edit area on screen.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.alignCursor()
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.animateScrolling()
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.destroy()
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Destroys the text and cursor layers for this renderer.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Destroys the text and cursor layers for this renderer.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.getAnimatedScroll() -
                                                                                                                                                                                                                                                                                                                                                                        • - -
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns whether an animated scroll happens or not.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns whether an animated scroll happens or not.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.getContainerElement() -
                                                                                                                                                                                                                                                                                                                                                                        • - -
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns the root element containing this renderer.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns the root element containing this renderer.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.getDisplayIndentGuides()
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.getFadeFoldWidgets()
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.getFirstFullyVisibleRow() -
                                                                                                                                                                                                                                                                                                                                                                        • - -
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns the index of the first fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns the index of the first fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.getFirstVisibleRow() -
                                                                                                                                                                                                                                                                                                                                                                        • - -
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns the index of the first visible row.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns the index of the first visible row.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.getHighlightGutterLine()
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.getHScrollBarAlwaysVisible() -
                                                                                                                                                                                                                                                                                                                                                                        • - -
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns whether the horizontal scrollbar is set to be always visible.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns whether the horizontal scrollbar is set to be always visible.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.getLastFullyVisibleRow() -
                                                                                                                                                                                                                                                                                                                                                                        • - -
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns the index of the last fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns the index of the last fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.getLastVisibleRow() -
                                                                                                                                                                                                                                                                                                                                                                        • - -
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns the index of the last visible row.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns the index of the last visible row.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.getMouseEventTarget() -
                                                                                                                                                                                                                                                                                                                                                                        • - -
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns the element that the mouse events are attached to

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns the element that the mouse events are attached to

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.getPrintMarginColumn() -
                                                                                                                                                                                                                                                                                                                                                                        • - -
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns whether the print margin column is being shown or not.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns whether the print margin column is being shown or not.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.getScrollBottomRow() -
                                                                                                                                                                                                                                                                                                                                                                        • - -
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns the last visible row, regardless of whether it's fully visible or not.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns the last visible row, regardless of whether it's fully visible or not.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.getScrollLeft() -
                                                                                                                                                                                                                                                                                                                                                                        • - -
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns the value of the distance between the left of the editor and the leftmost part of the visible content.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns the value of the distance between the left of the editor and the leftmost part of the visible content.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.getScrollTop() -
                                                                                                                                                                                                                                                                                                                                                                        • - -
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns the value of the distance between the top of the editor and the topmost part of the visible content.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns the value of the distance between the top of the editor and the topmost part of the visible content.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.getScrollTopRow() -
                                                                                                                                                                                                                                                                                                                                                                        • - -
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns the first visible row, regardless of whether it's fully visible or not.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns the first visible row, regardless of whether it's fully visible or not.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.getShowGutter() -
                                                                                                                                                                                                                                                                                                                                                                        • - -
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns true if the gutter is being shown.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns true if the gutter is being shown.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.getShowInvisibles() -
                                                                                                                                                                                                                                                                                                                                                                        • - -
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns whether invisible characters are being shown or not.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns whether invisible characters are being shown or not.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.getShowPrintMargin() -
                                                                                                                                                                                                                                                                                                                                                                        • - -
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns whether the print margin is being shown or not.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns whether the print margin is being shown or not.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.getTextAreaContainer() -
                                                                                                                                                                                                                                                                                                                                                                        • - -
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns the element to which the hidden text area is added.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns the element to which the hidden text area is added.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.getTheme() -
                                                                                                                                                                                                                                                                                                                                                                        • - -
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns the path of the current theme.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns the path of the current theme.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.hideComposition()
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Hides the current composition.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Hides the current composition.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.hideCursor()
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Hides the cursor icon.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Hides the cursor icon.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • - -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns true if you can still scroll by either parameter; in other words, you haven't reached the end of the file or line.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns true if you can still scroll by either parameter; in other words, you haven't reached the end of the file or line.

                                                                                                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                                      deltaXNumber

                                                                                                                                                                                                                                                                                                                                                                      Required. The x value to scroll by

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      deltaYNumber

                                                                                                                                                                                                                                                                                                                                                                      Required. The y value to scroll by

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.onChangeTabSize()
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.onGutterResize()
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Triggers a resize of the editor.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Triggers a resize of the editor.

                                                                                                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                                      forceBoolean

                                                                                                                                                                                                                                                                                                                                                                      Required. If true, recomputes the size, even if the height and width haven't changed

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      gutterWidthNumber

                                                                                                                                                                                                                                                                                                                                                                      Required. The width of the gutter in pixels

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      widthNumber

                                                                                                                                                                                                                                                                                                                                                                      Required. The width of the editor in pixels

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      heightNumber

                                                                                                                                                                                                                                                                                                                                                                      Required. The hiehgt of the editor, in pixels

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.pixelToScreenCoordinates()
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.removeGutterDecoration(Object row, Object className)
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Deprecated; (moved to EditSession)

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Deprecated; (moved to EditSession)

                                                                                                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                                      rowObject

                                                                                                                                                                                                                                                                                                                                                                      Required.

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      classNameObject

                                                                                                                                                                                                                                                                                                                                                                      Required.

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.screenToTextCoordinates()
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.scrollBy(Number deltaX, Number deltaY)
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Scrolls the editor across both x- and y-axes.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Scrolls the editor across both x- and y-axes.

                                                                                                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                                      deltaXNumber

                                                                                                                                                                                                                                                                                                                                                                      Required. The x value to scroll by

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      deltaYNumber

                                                                                                                                                                                                                                                                                                                                                                      Required. The y value to scroll by

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.scrollCursorIntoView(Object cursor, Object offset)
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Scrolls the cursor into the first visibile area of the editor

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Scrolls the cursor into the first visibile area of the editor

                                                                                                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                                      cursorObject

                                                                                                                                                                                                                                                                                                                                                                      Required.

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      offsetObject

                                                                                                                                                                                                                                                                                                                                                                      Required.

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.scrollSelectionIntoView()
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Gracefully scrolls the editor to the row indicated.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Gracefully scrolls the editor to the row indicated.

                                                                                                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                                      lineNumber

                                                                                                                                                                                                                                                                                                                                                                      Required. A line number

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      centerBoolean

                                                                                                                                                                                                                                                                                                                                                                      Required. If true, centers the editor the to indicated line

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      animateBoolean

                                                                                                                                                                                                                                                                                                                                                                      Required. If true animates scrolling

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      callbackFunction

                                                                                                                                                                                                                                                                                                                                                                      Required. Function to be called after the animation has finished

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.scrollToRow(Number row)
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Gracefully scrolls from the top of the editor to the row indicated.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Gracefully scrolls from the top of the editor to the row indicated.

                                                                                                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                                      rowNumber

                                                                                                                                                                                                                                                                                                                                                                      Required. A row id

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.scrollToX(Number scrollLeft) -
                                                                                                                                                                                                                                                                                                                                                                        • - -
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Scrolls the editor across the x-axis to the pixel indicated.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Scrolls the editor across the x-axis to the pixel indicated.

                                                                                                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                                      scrollLeftNumber

                                                                                                                                                                                                                                                                                                                                                                      Required. The position to scroll to

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.scrollToY(Number scrollTop) -
                                                                                                                                                                                                                                                                                                                                                                        • - -
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Scrolls the editor to the y pixel indicated.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Scrolls the editor to the y pixel indicated.

                                                                                                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                                      scrollTopNumber

                                                                                                                                                                                                                                                                                                                                                                      Required. The position to scroll to

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.setAnimatedScroll(Boolean shouldAnimate)
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Identifies whether you want to have an animated scroll or not.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Identifies whether you want to have an animated scroll or not.

                                                                                                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                                      shouldAnimateBoolean

                                                                                                                                                                                                                                                                                                                                                                      Required. Set to true to show animated scrolls

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.setAnnotations(Array annotations)
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Sets annotations for the gutter.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Sets annotations for the gutter.

                                                                                                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                                      annotationsArray

                                                                                                                                                                                                                                                                                                                                                                      Required. An array containing annotations

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.setCompositionText(String text)
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                                      textString

                                                                                                                                                                                                                                                                                                                                                                      Required. A string of text to use

                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Sets the inner text of the current composition to text.

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.setDisplayIndentGuides()
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.setFadeFoldWidgets()
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.setHighlightGutterLine()
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.setHScrollBarAlwaysVisible(Boolean alwaysVisible)
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Identifies whether you want to show the horizontal scrollbar or not.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Identifies whether you want to show the horizontal scrollbar or not.

                                                                                                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                                      alwaysVisibleBoolean

                                                                                                                                                                                                                                                                                                                                                                      Required. Set to true to make the horizontal scroll bar visible

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.setPadding(Number padding)
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Sets the padding for all the layers.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Sets the padding for all the layers.

                                                                                                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                                      paddingNumber

                                                                                                                                                                                                                                                                                                                                                                      Required. A new padding value (in pixels)

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.setPrintMarginColumn(Boolean showPrintMargin)
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Identifies whether you want to show the print margin column or not.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Identifies whether you want to show the print margin column or not.

                                                                                                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                                      showPrintMarginBoolean

                                                                                                                                                                                                                                                                                                                                                                      Required. Set to true to show the print margin column

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.setSession(Object session)
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Associates the renderer with an EditSession.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Associates the renderer with an EditSession.

                                                                                                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                                      sessionObject

                                                                                                                                                                                                                                                                                                                                                                      Required.

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.setShowGutter(Boolean show)
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Identifies whether you want to show the gutter or not.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Identifies whether you want to show the gutter or not.

                                                                                                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                                      showBoolean

                                                                                                                                                                                                                                                                                                                                                                      Required. Set to true to show the gutter

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.setShowInvisibles(Boolean showInvisibles)
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Identifies whether you want to show invisible characters or not.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Identifies whether you want to show invisible characters or not.

                                                                                                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                                      showInvisiblesBoolean

                                                                                                                                                                                                                                                                                                                                                                      Required. Set to true to show invisibles

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.setShowPrintMargin(Boolean showPrintMargin)
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Identifies whether you want to show the print margin or not.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Identifies whether you want to show the print margin or not.

                                                                                                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                                      showPrintMarginBoolean

                                                                                                                                                                                                                                                                                                                                                                      Required. Set to true to show the print margin

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.setStyle()
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.setTheme(String theme)
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Sets a new theme for the editor. theme should exist, and be a directory path, like ace/theme/textmate.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Sets a new theme for the editor. theme should exist, and be a directory path, like ace/theme/textmate.

                                                                                                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                                      themeString

                                                                                                                                                                                                                                                                                                                                                                      Required. The path to a theme

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.showCursor()
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Shows the cursor icon.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Shows the cursor icon.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • - -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns an object containing the pageX and pageY coordinates of the document position.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Returns an object containing the pageX and pageY coordinates of the document position.

                                                                                                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                                      rowNumber

                                                                                                                                                                                                                                                                                                                                                                      Required. The document row position

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      columnNumber

                                                                                                                                                                                                                                                                                                                                                                      Required. The document column position

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.unsetStyle(String style)
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Removes the class style from the editor.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Removes the class style from the editor.

                                                                                                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                                      styleString

                                                                                                                                                                                                                                                                                                                                                                      Required. A class name

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.updateBackMarkers()
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Schedules an update to all the back markers in the document.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Schedules an update to all the back markers in the document.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.updateBreakpoints(Object rows)
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Redraw breakpoints.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Redraw breakpoints.

                                                                                                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                                      rowsObject

                                                                                                                                                                                                                                                                                                                                                                      Required.

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.updateCharacterSize()
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • Undocumented
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.updateCursor()
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Updates the cursor icon.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Updates the cursor icon.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.updateFontSize()
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Updates the font size.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Updates the font size.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.updateFrontMarkers()
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Schedules an update to all the front markers in the document.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Schedules an update to all the front markers in the document.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.updateFull(Boolean force)
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Triggers a full update of all the layers, for all the rows.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Triggers a full update of all the layers, for all the rows.

                                                                                                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                                      forceBoolean

                                                                                                                                                                                                                                                                                                                                                                      Required. If true, forces the changes through

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.updateLines(Number firstRow, Number lastRow)
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Triggers a partial update of the text, from the range given by the two parameters.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Triggers a partial update of the text, from the range given by the two parameters.

                                                                                                                                                                                                                                                                                                                                                                      - -

                                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                                      firstRowNumber

                                                                                                                                                                                                                                                                                                                                                                      Required. The first row to update

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      lastRowNumber

                                                                                                                                                                                                                                                                                                                                                                      Required. The last row to update

                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.updateText()
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Triggers a full update of the text, for all the rows.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Triggers a full update of the text, for all the rows.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.visualizeBlur()
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Blurs the current container.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Blurs the current container.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.visualizeFocus()
                                                                                                                                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Focuses the current container.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -

                                                                                                                                                                                                                                                                                                                                                                      Focuses the current container.

                                                                                                                                                                                                                                                                                                                                                                      - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      - - - - - -
                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                      \ No newline at end of file + + + + VirtualRenderer - Ace API

                                                                                                                                                                                                                                                                                                                                                                      The class that is responsible for drawing everything you see on the screen!

                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                      Constructors

                                                                                                                                                                                                                                                                                                                                                                      Constructs a new VirtualRenderer within the container specified, applying the given theme.

                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                         

                                                                                                                                                                                                                                                                                                                                                                      Constructs a new VirtualRenderer within the container specified, applying the given theme.

                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                                      containerDOMElementRequired. The root element of the editor
                                                                                                                                                                                                                                                                                                                                                                      themeStringRequired. The starting theme

                                                                                                                                                                                                                                                                                                                                                                      Methods

                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.addGutterDecoration(row, className)
                                                                                                                                                                                                                                                                                                                                                                          • Void

                                                                                                                                                                                                                                                                                                                                                                        Deprecated (moved to EditSession)

                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                           

                                                                                                                                                                                                                                                                                                                                                                        Deprecated (moved to EditSession)

                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                          • VirtualRenderer.adjustWrapLimit()
                                                                                                                                                                                                                                                                                                                                                                            • Void

                                                                                                                                                                                                                                                                                                                                                                          Adjusts the wrap limit, which is the number of characters that can fit within the width of the edit area on screen.

                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                             

                                                                                                                                                                                                                                                                                                                                                                          Adjusts the wrap limit, which is the number of characters that can fit within the width of the edit area on screen.

                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                            • VirtualRenderer.destroy()

                                                                                                                                                                                                                                                                                                                                                                            Destroys the text and cursor layers for this renderer.

                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                                                                                                                            Destroys the text and cursor layers for this renderer.

                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                              • VirtualRenderer.getAnimatedScroll()

                                                                                                                                                                                                                                                                                                                                                                              Returns whether an animated scroll happens or not.

                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                 

                                                                                                                                                                                                                                                                                                                                                                              Returns whether an animated scroll happens or not.

                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                              Returns the root element containing this renderer.

                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                 

                                                                                                                                                                                                                                                                                                                                                                              Returns the root element containing this renderer.

                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                • VirtualRenderer.getFirstFullyVisibleRow()

                                                                                                                                                                                                                                                                                                                                                                                Returns the index of the first fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen.

                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                   

                                                                                                                                                                                                                                                                                                                                                                                Returns the index of the first fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen.

                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                  • VirtualRenderer.getFirstVisibleRow()

                                                                                                                                                                                                                                                                                                                                                                                  Returns the index of the first visible row.

                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                     

                                                                                                                                                                                                                                                                                                                                                                                  Returns the index of the first visible row.

                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                    • VirtualRenderer.getHScrollBarAlwaysVisible()

                                                                                                                                                                                                                                                                                                                                                                                    Returns whether the horizontal scrollbar is set to be always visible.

                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                       

                                                                                                                                                                                                                                                                                                                                                                                    Returns whether the horizontal scrollbar is set to be always visible.

                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                      • VirtualRenderer.getLastFullyVisibleRow()

                                                                                                                                                                                                                                                                                                                                                                                      Returns the index of the last fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen.

                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                         

                                                                                                                                                                                                                                                                                                                                                                                      Returns the index of the last fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen.

                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.getLastVisibleRow()

                                                                                                                                                                                                                                                                                                                                                                                        Returns the index of the last visible row.

                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                           

                                                                                                                                                                                                                                                                                                                                                                                        Returns the index of the last visible row.

                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                        Returns the element that the mouse events are attached to

                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                           

                                                                                                                                                                                                                                                                                                                                                                                        Returns the element that the mouse events are attached to

                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                          • VirtualRenderer.getPrintMarginColumn()

                                                                                                                                                                                                                                                                                                                                                                                          Returns whether the print margin column is being shown or not.

                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                             

                                                                                                                                                                                                                                                                                                                                                                                          Returns whether the print margin column is being shown or not.

                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                            • VirtualRenderer.getScrollBottomRow()

                                                                                                                                                                                                                                                                                                                                                                                            Returns the last visible row, regardless of whether it's fully visible or not.

                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                                                                                                                                            Returns the last visible row, regardless of whether it's fully visible or not.

                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                            Returns the value of the distance between the left of the editor and the leftmost part of the visible content.

                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                                                                                                                                            Returns the value of the distance between the left of the editor and the leftmost part of the visible content.

                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                            Returns the value of the distance between the top of the editor and the topmost part of the visible content.

                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                                                                                                                                            Returns the value of the distance between the top of the editor and the topmost part of the visible content.

                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                              • VirtualRenderer.getScrollTopRow()

                                                                                                                                                                                                                                                                                                                                                                                              Returns the first visible row, regardless of whether it's fully visible or not.

                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                 

                                                                                                                                                                                                                                                                                                                                                                                              Returns the first visible row, regardless of whether it's fully visible or not.

                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                • VirtualRenderer.getShowGutter()

                                                                                                                                                                                                                                                                                                                                                                                                Returns true if the gutter is being shown.

                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                   

                                                                                                                                                                                                                                                                                                                                                                                                Returns true if the gutter is being shown.

                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                  • VirtualRenderer.getShowInvisibles()

                                                                                                                                                                                                                                                                                                                                                                                                  Returns whether invisible characters are being shown or not.

                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                     

                                                                                                                                                                                                                                                                                                                                                                                                  Returns whether invisible characters are being shown or not.

                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                    • VirtualRenderer.getShowPrintMargin()

                                                                                                                                                                                                                                                                                                                                                                                                    Returns whetherthe print margin is being shown or not.

                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                       

                                                                                                                                                                                                                                                                                                                                                                                                    Returns whetherthe print margin is being shown or not.

                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                    Returns the element to which the hidden text area is added.

                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                       

                                                                                                                                                                                                                                                                                                                                                                                                    Returns the element to which the hidden text area is added.

                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                      • VirtualRenderer.getTheme()

                                                                                                                                                                                                                                                                                                                                                                                                      Returns the path of the current theme.

                                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                                         

                                                                                                                                                                                                                                                                                                                                                                                                      Returns the path of the current theme.

                                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.hideComposition()
                                                                                                                                                                                                                                                                                                                                                                                                          • Void

                                                                                                                                                                                                                                                                                                                                                                                                        Hides the current composition.

                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                           

                                                                                                                                                                                                                                                                                                                                                                                                        Hides the current composition.

                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                          • VirtualRenderer.hideCursor()
                                                                                                                                                                                                                                                                                                                                                                                                            • Void

                                                                                                                                                                                                                                                                                                                                                                                                          Hides the cursor icon.

                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                             

                                                                                                                                                                                                                                                                                                                                                                                                          Hides the cursor icon.

                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                          Returns true if you can still scroll by either parameter; in other words, you haven't reached the end of the file or line.

                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                             

                                                                                                                                                                                                                                                                                                                                                                                                          Returns true if you can still scroll by either parameter; in other words, you haven't reached the end of the file or line.

                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                          Arguments

                                                                                                                                                                                                                                                                                                                                                                                                          deltaXNumberRequired. The x value to scroll by
                                                                                                                                                                                                                                                                                                                                                                                                          deltaYNumberRequired. The y value to scroll by
                                                                                                                                                                                                                                                                                                                                                                                                            • VirtualRenderer.onResize(Boolean force)
                                                                                                                                                                                                                                                                                                                                                                                                              • Void

                                                                                                                                                                                                                                                                                                                                                                                                            Triggers a resize of the editor.

                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                                                                                                                                                            Triggers a resize of the editor.

                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                            Arguments

                                                                                                                                                                                                                                                                                                                                                                                                            forceBooleanRequired. If true, recomputes the size, even if the height and width haven't changed
                                                                                                                                                                                                                                                                                                                                                                                                              • VirtualRenderer.removeGutterDecoration(row, className)
                                                                                                                                                                                                                                                                                                                                                                                                                • Void

                                                                                                                                                                                                                                                                                                                                                                                                              Deprecated (moved to EditSession)

                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                 

                                                                                                                                                                                                                                                                                                                                                                                                              Deprecated (moved to EditSession)

                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                              Scrolls the editor across both x- and y-axes.

                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                 

                                                                                                                                                                                                                                                                                                                                                                                                              Scrolls the editor across both x- and y-axes.

                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                              Arguments

                                                                                                                                                                                                                                                                                                                                                                                                              deltaXNumberRequired. The x value to scroll by
                                                                                                                                                                                                                                                                                                                                                                                                              deltaYNumberRequired. The y value to scroll by
                                                                                                                                                                                                                                                                                                                                                                                                                • VirtualRenderer.scrollCursorIntoView(cursor, offset)
                                                                                                                                                                                                                                                                                                                                                                                                                  • Void

                                                                                                                                                                                                                                                                                                                                                                                                                Scrolls the cursor into the first visibile area of the editor

                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                   

                                                                                                                                                                                                                                                                                                                                                                                                                Scrolls the cursor into the first visibile area of the editor

                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                Gracefully scrolls the editor to the row indicated.

                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                   

                                                                                                                                                                                                                                                                                                                                                                                                                Gracefully scrolls the editor to the row indicated.

                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                Arguments

                                                                                                                                                                                                                                                                                                                                                                                                                lineNumberRequired. A line number
                                                                                                                                                                                                                                                                                                                                                                                                                centerBooleanRequired. If true, centers the editor the to indicated line
                                                                                                                                                                                                                                                                                                                                                                                                                animateBooleanRequired. If true animates scrolling
                                                                                                                                                                                                                                                                                                                                                                                                                callbackFunctionRequired. Function to be called after the animation has finished

                                                                                                                                                                                                                                                                                                                                                                                                                Gracefully scrolls the top of the editor to the row indicated.

                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                   

                                                                                                                                                                                                                                                                                                                                                                                                                Gracefully scrolls the top of the editor to the row indicated.

                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                Arguments

                                                                                                                                                                                                                                                                                                                                                                                                                rowNumberRequired. A row id

                                                                                                                                                                                                                                                                                                                                                                                                                Scrolls the editor to the x pixel indicated.

                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                   

                                                                                                                                                                                                                                                                                                                                                                                                                Scrolls the editor to the x pixel indicated.

                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                Arguments

                                                                                                                                                                                                                                                                                                                                                                                                                scrollLeftNumberRequired. The position to scroll to

                                                                                                                                                                                                                                                                                                                                                                                                                Scrolls the editor to the y pixel indicated.

                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                   

                                                                                                                                                                                                                                                                                                                                                                                                                Scrolls the editor to the y pixel indicated.

                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                Arguments

                                                                                                                                                                                                                                                                                                                                                                                                                scrollTopNumberRequired. The position to scroll to
                                                                                                                                                                                                                                                                                                                                                                                                                  • VirtualRenderer.setAnimatedScroll(Boolean shouldAnimate)
                                                                                                                                                                                                                                                                                                                                                                                                                    • Void

                                                                                                                                                                                                                                                                                                                                                                                                                  Identifies whether you want to have an animated scroll or not.

                                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                                     

                                                                                                                                                                                                                                                                                                                                                                                                                  Identifies whether you want to have an animated scroll or not.

                                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                                  Arguments

                                                                                                                                                                                                                                                                                                                                                                                                                  shouldAnimateBooleanRequired. Set to true to show animated scrolls
                                                                                                                                                                                                                                                                                                                                                                                                                    • VirtualRenderer.setAnnotations(Array annotations)
                                                                                                                                                                                                                                                                                                                                                                                                                      • Void

                                                                                                                                                                                                                                                                                                                                                                                                                    Sets annotations for the gutter.

                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                       

                                                                                                                                                                                                                                                                                                                                                                                                                    Sets annotations for the gutter.

                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                    Arguments

                                                                                                                                                                                                                                                                                                                                                                                                                    annotationsArrayRequired. An array containing annotations
                                                                                                                                                                                                                                                                                                                                                                                                                      • VirtualRenderer.setCompositionText(String text)
                                                                                                                                                                                                                                                                                                                                                                                                                        • Void

                                                                                                                                                                                                                                                                                                                                                                                                                      Sets the inner text of the current composition to text.

                                                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                                                         

                                                                                                                                                                                                                                                                                                                                                                                                                      Sets the inner text of the current composition to text.

                                                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                                                                                      textStringRequired. A string of text to use
                                                                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.setHScrollBarAlwaysVisible(Boolean alwaysVisible)
                                                                                                                                                                                                                                                                                                                                                                                                                          • Void

                                                                                                                                                                                                                                                                                                                                                                                                                        Identifies whether you want to show the horizontal scrollbar or not.

                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                           

                                                                                                                                                                                                                                                                                                                                                                                                                        Identifies whether you want to show the horizontal scrollbar or not.

                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                        Arguments

                                                                                                                                                                                                                                                                                                                                                                                                                        alwaysVisibleBooleanRequired. Set to true to make the horizontal scroll bar visible
                                                                                                                                                                                                                                                                                                                                                                                                                          • VirtualRenderer.setPadding(Number padding)
                                                                                                                                                                                                                                                                                                                                                                                                                            • Void

                                                                                                                                                                                                                                                                                                                                                                                                                          Sets the padding for all the layers.

                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                             

                                                                                                                                                                                                                                                                                                                                                                                                                          Sets the padding for all the layers.

                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                          Arguments

                                                                                                                                                                                                                                                                                                                                                                                                                          paddingNumberRequired. A new padding value (in pixels)
                                                                                                                                                                                                                                                                                                                                                                                                                            • VirtualRenderer.setPrintMarginColumn(Boolean showPrintMargin)

                                                                                                                                                                                                                                                                                                                                                                                                                            Identifies whether you want to show the print margin column or not.

                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                                                                                                                                                                            Identifies whether you want to show the print margin column or not.

                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                            Arguments

                                                                                                                                                                                                                                                                                                                                                                                                                            showPrintMarginBooleanRequired. Set to true to show the print margin column
                                                                                                                                                                                                                                                                                                                                                                                                                              • VirtualRenderer.setShowGutter(Boolean show)
                                                                                                                                                                                                                                                                                                                                                                                                                                • Void

                                                                                                                                                                                                                                                                                                                                                                                                                              Identifies whether you want to show the gutter or not.

                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                 

                                                                                                                                                                                                                                                                                                                                                                                                                              Identifies whether you want to show the gutter or not.

                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                              Arguments

                                                                                                                                                                                                                                                                                                                                                                                                                              showBooleanRequired. Set to true to show the gutter
                                                                                                                                                                                                                                                                                                                                                                                                                                • VirtualRenderer.setShowInvisibles(Boolean showInvisibles)
                                                                                                                                                                                                                                                                                                                                                                                                                                  • Void

                                                                                                                                                                                                                                                                                                                                                                                                                                Identifies whether you want to show invisible characters or not.

                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                   

                                                                                                                                                                                                                                                                                                                                                                                                                                Identifies whether you want to show invisible characters or not.

                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                Arguments

                                                                                                                                                                                                                                                                                                                                                                                                                                showInvisiblesBooleanRequired. Set to true to show invisibles
                                                                                                                                                                                                                                                                                                                                                                                                                                  • VirtualRenderer.setShowPrintMargin(Boolean showPrintMargin)

                                                                                                                                                                                                                                                                                                                                                                                                                                  Identifies whether you want to show the print margin or not.

                                                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                                                     

                                                                                                                                                                                                                                                                                                                                                                                                                                  Identifies whether you want to show the print margin or not.

                                                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                                                  Arguments

                                                                                                                                                                                                                                                                                                                                                                                                                                  showPrintMarginBooleanRequired. Set to true to show the print margin
                                                                                                                                                                                                                                                                                                                                                                                                                                    • VirtualRenderer.setStyle(String style)
                                                                                                                                                                                                                                                                                                                                                                                                                                      • Void

                                                                                                                                                                                                                                                                                                                                                                                                                                    Adds a new class, style, to the editor.

                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                       

                                                                                                                                                                                                                                                                                                                                                                                                                                    Adds a new class, style, to the editor.

                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                    Arguments

                                                                                                                                                                                                                                                                                                                                                                                                                                    styleStringRequired. A class name
                                                                                                                                                                                                                                                                                                                                                                                                                                      • VirtualRenderer.setTheme(String theme)
                                                                                                                                                                                                                                                                                                                                                                                                                                        • Void

                                                                                                                                                                                                                                                                                                                                                                                                                                      Sets a new theme for the editor. theme should exist, and be a directory path, like ace/theme/textmate.

                                                                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                                                                         

                                                                                                                                                                                                                                                                                                                                                                                                                                      Sets a new theme for the editor. theme should exist, and be a directory path, like ace/theme/textmate.

                                                                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                                                                                                      themeStringRequired. The path to a theme
                                                                                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.showComposition(Number position)
                                                                                                                                                                                                                                                                                                                                                                                                                                          • Void
                                                                                                                                                                                                                                                                                                                                                                                                                                        • Internal

                                                                                                                                                                                                                                                                                                                                                                                                                                         

                                                                                                                                                                                                                                                                                                                                                                                                                                      Arguments

                                                                                                                                                                                                                                                                                                                                                                                                                                      positionNumberRequired.
                                                                                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.showCursor()
                                                                                                                                                                                                                                                                                                                                                                                                                                          • Void

                                                                                                                                                                                                                                                                                                                                                                                                                                        Shows the cursor icon.

                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                           

                                                                                                                                                                                                                                                                                                                                                                                                                                        Shows the cursor icon.

                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                        Returns an object containing the pageX and pageY coordinates of the document position.

                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                           

                                                                                                                                                                                                                                                                                                                                                                                                                                        Returns an object containing the pageX and pageY coordinates of the document position.

                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                        Arguments

                                                                                                                                                                                                                                                                                                                                                                                                                                        rowNumberRequired. The document row position
                                                                                                                                                                                                                                                                                                                                                                                                                                        columnNumberRequired. The document column position
                                                                                                                                                                                                                                                                                                                                                                                                                                          • VirtualRenderer.unsetStyle(String style)
                                                                                                                                                                                                                                                                                                                                                                                                                                            • Void

                                                                                                                                                                                                                                                                                                                                                                                                                                          Removes the class style from the editor.

                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                             

                                                                                                                                                                                                                                                                                                                                                                                                                                          Removes the class style from the editor.

                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                          Arguments

                                                                                                                                                                                                                                                                                                                                                                                                                                          styleStringRequired. A class name
                                                                                                                                                                                                                                                                                                                                                                                                                                            • VirtualRenderer.updateBackMarkers()
                                                                                                                                                                                                                                                                                                                                                                                                                                              • Void

                                                                                                                                                                                                                                                                                                                                                                                                                                            Schedules an update to all the back markers in the document.

                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                                                                                                                                                                                            Schedules an update to all the back markers in the document.

                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                              • VirtualRenderer.updateBreakpoints()
                                                                                                                                                                                                                                                                                                                                                                                                                                                • Void

                                                                                                                                                                                                                                                                                                                                                                                                                                              Redraw breakpoints.

                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                 

                                                                                                                                                                                                                                                                                                                                                                                                                                              Redraw breakpoints.

                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                • VirtualRenderer.updateCursor()
                                                                                                                                                                                                                                                                                                                                                                                                                                                  • Void

                                                                                                                                                                                                                                                                                                                                                                                                                                                Updates the cursor icon.

                                                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                                                   

                                                                                                                                                                                                                                                                                                                                                                                                                                                Updates the cursor icon.

                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                  • VirtualRenderer.updateFontSize()
                                                                                                                                                                                                                                                                                                                                                                                                                                                    • Void

                                                                                                                                                                                                                                                                                                                                                                                                                                                  Updates the font size.

                                                                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                                                                     

                                                                                                                                                                                                                                                                                                                                                                                                                                                  Updates the font size.

                                                                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                                                                    • VirtualRenderer.updateFrontMarkers()
                                                                                                                                                                                                                                                                                                                                                                                                                                                      • Void

                                                                                                                                                                                                                                                                                                                                                                                                                                                    Schedules an update to all the front markers in the document.

                                                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                                                       

                                                                                                                                                                                                                                                                                                                                                                                                                                                    Schedules an update to all the front markers in the document.

                                                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                                                      • VirtualRenderer.updateFull()
                                                                                                                                                                                                                                                                                                                                                                                                                                                        • Void

                                                                                                                                                                                                                                                                                                                                                                                                                                                      Triggers a full update of all the layers, for all the rows.

                                                                                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                                                                                         

                                                                                                                                                                                                                                                                                                                                                                                                                                                      Triggers a full update of all the layers, for all the rows.

                                                                                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                                                                                        • VirtualRenderer.updateLines(Number firstRow, Number lastRow)
                                                                                                                                                                                                                                                                                                                                                                                                                                                          • Void

                                                                                                                                                                                                                                                                                                                                                                                                                                                        Triggers a partial update of the text, from the range given by the two parameters.

                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                           

                                                                                                                                                                                                                                                                                                                                                                                                                                                        Triggers a partial update of the text, from the range given by the two parameters.

                                                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                                                        Arguments

                                                                                                                                                                                                                                                                                                                                                                                                                                                        firstRowNumberRequired. The first row to update
                                                                                                                                                                                                                                                                                                                                                                                                                                                        lastRowNumberRequired. The last row to update
                                                                                                                                                                                                                                                                                                                                                                                                                                                          • VirtualRenderer.updateText()
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • Void

                                                                                                                                                                                                                                                                                                                                                                                                                                                          Triggers a full update of the text, for all the rows.

                                                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                                                             

                                                                                                                                                                                                                                                                                                                                                                                                                                                          Triggers a full update of the text, for all the rows.

                                                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • VirtualRenderer.visualizeBlur()
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • Void

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Blurs the current container.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                                                               

                                                                                                                                                                                                                                                                                                                                                                                                                                                            Blurs the current container.

                                                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • VirtualRenderer.visualizeFocus()
                                                                                                                                                                                                                                                                                                                                                                                                                                                                • Void

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Focuses the current container.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                                 

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Focuses the current container.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + + + + + \ No newline at end of file diff --git a/build b/build index a4e495d8..b5354412 160000 --- a/build +++ b/build @@ -1 +1 @@ -Subproject commit a4e495d8901876c6bafe3870a35cb8e32c827e97 +Subproject commit b5354412bfeb461b7d8020423562451a81da2c85 diff --git a/build_support/editor.html b/build_support/editor.html index 1d972cf9..06a4651b 100644 --- a/build_support/editor.html +++ b/build_support/editor.html @@ -8,8 +8,8 @@ body { overflow: hidden; } - - #editor { + + #editor { margin: 0; position: absolute; top: 0; @@ -27,7 +27,7 @@ alert("Ace Rocks " + items[i]); } } - + - - - - - - - diff --git a/demo/autoresize.html b/demo/autoresize.html deleted file mode 100644 index b0464ecd..00000000 --- a/demo/autoresize.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - Editor - - - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              autoresizing editor
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              minHeight = 2 lines
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/demo/chromevox.html b/demo/chromevox.html
                                                                                                                                                                                                                                                                                                                                                                                                                                                              deleted file mode 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                              index 9aa65bae..00000000
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- a/demo/chromevox.html
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +++ /dev/null
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -1,39 +0,0 @@
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ACE ChromeVox demo
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/demo/emmet.html b/demo/emmet.html
                                                                                                                                                                                                                                                                                                                                                                                                                                                              deleted file mode 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                              index bd0d4abe..00000000
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- a/demo/emmet.html
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +++ /dev/null
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -1,43 +0,0 @@
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ACE Emmet demo
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/demo/ie7.html b/demo/ie7.html
                                                                                                                                                                                                                                                                                                                                                                                                                                                              deleted file mode 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                              index f5db8667..00000000
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- a/demo/ie7.html
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +++ /dev/null
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -1,44 +0,0 @@
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ACE Editor StatusBar Demo
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -require("ace/ext/old_ie");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -// now ace will work even on ie7!
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var editor = ace.edit("editor");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - - - - - - - - diff --git a/demo/ipad.html b/demo/ipad.html new file mode 100644 index 00000000..9e8742f5 --- /dev/null +++ b/demo/ipad.html @@ -0,0 +1,57 @@ + + + + + + + + + + Ace on iPad + + + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +ani + + + + diff --git a/demo/ipad.js b/demo/ipad.js new file mode 100644 index 00000000..45da8861 --- /dev/null +++ b/demo/ipad.js @@ -0,0 +1,72 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Mozilla Skywriter. + * + * The Initial Developer of the Original Code is + * Mozilla. + * Portions created by the Initial Developer are Copyright (C) 2009 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + + +define(function(require, exports, module) { + +var Dom = require("ace/lib/dom"); +var Event = require("ace/lib/event"); + +var Editor = require("ace/editor").Editor; +var EditSession = require("ace/edit_session").EditSession; +var UndoManager = require("ace/undomanager").UndoManager; +var Renderer = require("ace/virtual_renderer").VirtualRenderer; +var JavaScriptMode = require("ace/mode/javascript").Mode; + +exports.launch = function(el, text) { + if (typeof(el) == "string") { + el = document.getElementById(el); + } + + editor = new Editor(new Renderer(el, "ace/theme/twilight")); + + var doc = new EditSession(text); + doc.setMode(new JavaScriptMode()); + doc.setUndoManager(new UndoManager()); + editor.setSession(doc); + + editor.resize(); + + /* setTimeout(function(){ + editor.setAnimatedScroll(true) + editor.renderer.scrollToLine(editor.renderer.scrollTop == 0 ? 200 :0 ,0,true) + }, 2000);*/ + + return editor; +}; + +}); \ No newline at end of file diff --git a/demo/keyboard_shortcuts.html b/demo/keyboard_shortcuts.html deleted file mode 100644 index 3d01f559..00000000 --- a/demo/keyboard_shortcuts.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - Editor - - - - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/demo/kitchen-sink/demo.js b/demo/kitchen-sink/demo.js
                                                                                                                                                                                                                                                                                                                                                                                                                                                              index 33b2dbc0..88a2ca25 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- a/demo/kitchen-sink/demo.js
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +++ b/demo/kitchen-sink/demo.js
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -1,30 +1,39 @@
                                                                                                                                                                                                                                                                                                                                                                                                                                                               /* ***** BEGIN LICENSE BLOCK *****
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * Distributed under the BSD license:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * Version: MPL 1.1/GPL 2.0/LGPL 2.1
                                                                                                                                                                                                                                                                                                                                                                                                                                                                *
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * Copyright (c) 2010, Ajax.org B.V.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * All rights reserved.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * The contents of this file are subject to the Mozilla Public License Version
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * 1.1 (the "License"); you may not use this file except in compliance with
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * the License. You may obtain a copy of the License at
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * http://www.mozilla.org/MPL/
                                                                                                                                                                                                                                                                                                                                                                                                                                                                *
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * 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.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * Software distributed under the License is distributed on an "AS IS" basis,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * for the specific language governing rights and limitations under the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * License.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                *
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * 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.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * The Original Code is Mozilla Skywriter.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + *
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * The Initial Developer of the Original Code is
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * Mozilla.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * Portions created by the Initial Developer are Copyright (C) 2009
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * the Initial Developer. All Rights Reserved.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + *
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * Contributor(s):
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + *      Fabian Jakobs 
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + *      Kevin Dangoor (kdangoor@mozilla.com)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + *      Julian Viereck 
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + *
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * Alternatively, the contents of this file may be used under the terms of
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * either the GNU General Public License Version 2 or later (the "GPL"), or
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * in which case the provisions of the GPL or the LGPL are applicable instead
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * of those above. If you wish to allow use of your version of this file only
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * under the terms of either the GPL or the LGPL, and not to allow others to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * use your version of this file under the terms of the MPL, indicate your
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * decision by deleting the provisions above and replace them with the notice
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * and other provisions required by the GPL or the LGPL. If you do not delete
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * the provisions above, a recipient may use your version of this file under
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * the terms of any one of the MPL, the GPL or the LGPL.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                *
                                                                                                                                                                                                                                                                                                                                                                                                                                                                * ***** END LICENSE BLOCK ***** */
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -33,15 +42,7 @@ define(function(require, exports, module) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                               "use strict";
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               require("ace/lib/fixoldbrowsers");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -require("ace/multi_select");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -require("ace/ext/spellcheck");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -require("./inline_editor");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -require("./dev_util");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -require("./file_drop");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var config = require("ace/config");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -config.init();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +require("ace/config").init();
                                                                                                                                                                                                                                                                                                                                                                                                                                                               var env = {};
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               var dom = require("ace/lib/dom");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -54,38 +55,211 @@ var theme = require("ace/theme/textmate");
                                                                                                                                                                                                                                                                                                                                                                                                                                                               var EditSession = require("ace/edit_session").EditSession;
                                                                                                                                                                                                                                                                                                                                                                                                                                                               var UndoManager = require("ace/undomanager").UndoManager;
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var vim = require("ace/keyboard/vim").handler;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var emacs = require("ace/keyboard/emacs").handler;
                                                                                                                                                                                                                                                                                                                                                                                                                                                               var HashHandler = require("ace/keyboard/hash_handler").HashHandler;
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               var Renderer = require("ace/virtual_renderer").VirtualRenderer;
                                                                                                                                                                                                                                                                                                                                                                                                                                                               var Editor = require("ace/editor").Editor;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var MultiSelect = require("ace/multi_select").MultiSelect;
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var whitespace = require("ace/ext/whitespace");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +// workers do not work for file:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +if (location.protocol == "file:")
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    EditSession.prototype.$useWorker = false;
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +/************** modes ***********************/
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var modes = [];
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +function getModeFromPath(path) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    var mode = modesByName.text;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    for (var i = 0; i < modes.length; i++) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        if (modes[i].supportsFile(path)) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            mode = modes[i];
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            break;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    return mode;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +};
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var Mode = function(name, desc, extensions) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    this.name = name;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    this.desc = desc;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    this.mode = "ace/mode/" + name;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    this.extRe = new RegExp("^.*\\.(" + extensions + ")$", "g");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +};
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var doclist = require("./doclist");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var modelist = require("ace/ext/modelist");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var themelist = require("ace/ext/themelist");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var layout = require("./layout");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var TokenTooltip = require("./token_tooltip").TokenTooltip;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var util = require("./util");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var saveOption = util.saveOption;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var fillDropdown = util.fillDropdown;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var bindCheckbox = util.bindCheckbox;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var bindDropdown = util.bindDropdown;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +Mode.prototype.supportsFile = function(filename) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    return filename.match(this.extRe);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +};
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var ElasticTabstopsLite = require("ace/ext/elastic_tabstops_lite").ElasticTabstopsLite;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var modesByName = {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    c9search:   ["C9Search"     , "c9search_results"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    coffee:     ["CoffeeScript" , "coffee|^Cakefile"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    coldfusion: ["ColdFusion"   , "cfm"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    csharp:     ["C#"           , "cs"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    css:        ["CSS"          , "css"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    diff:       ["Diff"         , "diff|patch"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    glsl:       ["Glsl"         , "glsl|frag|vert"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    golang:     ["Go"           , "go"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    groovy:     ["Groovy"       , "groovy"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    haxe:       ["haXe"         , "hx"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    html:       ["HTML"         , "htm|html|xhtml"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    c_cpp:      ["C/C++"        , "c|cc|cpp|cxx|h|hh|hpp"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    clojure:    ["Clojure"      , "clj"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    java:       ["Java"         , "java"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    javascript: ["JavaScript"   , "js"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    json:       ["JSON"         , "json"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    jsx:        ["JSX"          , "jsx"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    latex:      ["LaTeX"        , "latex|tex|ltx|bib"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    less:       ["LESS"         , "less"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    liquid:     ["Liquid"       , "liquid"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    lua:        ["Lua"          , "lua"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    luapage:    ["LuaPage"      , "lp"], // http://keplerproject.github.com/cgilua/manual.html#templates
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    markdown:   ["Markdown"     , "md|markdown"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    ocaml:      ["OCaml"        , "ml|mli"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    perl:       ["Perl"         , "pl|pm"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    pgsql:      ["pgSQL"        , "pgsql"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    php:        ["PHP"          , "php|phtml"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    powershell: ["Powershell"   , "ps1"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    python:     ["Python"       , "py"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    ruby:       ["Ruby"         , "ru|gemspec|rake|rb"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    scad:       ["OpenSCAD"     , "scad"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    scala:      ["Scala"        , "scala"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    scss:       ["SCSS"         , "scss|sass"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    sh:         ["SH"           , "sh|bash|bat"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    sql:        ["SQL"          , "sql"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    svg:        ["SVG"          , "svg"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    tcl:        ["Tcl"          , "tcl"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    text:       ["Text"         , "txt"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    textile:    ["Textile"      , "textile"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    xml:        ["XML"          , "xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    xquery:     ["XQuery"       , "xq"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    yaml:       ["YAML"         , "yaml"]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +};
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var IncrementalSearch = require("ace/incremental_search").IncrementalSearch;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var workerModule = require("ace/worker/worker_client");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -if (location.href.indexOf("noworker") !== -1) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    workerModule.WorkerClient = workerModule.UIWorkerClient;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +for (var name in modesByName) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    var mode = modesByName[name];
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    mode = new Mode(name, mode[0], mode[1])
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    modesByName[name] = mode;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    modes.push(mode);
                                                                                                                                                                                                                                                                                                                                                                                                                                                               }
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +/*********** demo documents ***************************/
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var fileCache = {};
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +function initDoc(file, path, doc) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    if (doc.prepare)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        file = doc.prepare(file);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    var session = new EditSession(file);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    session.setUndoManager(new UndoManager());
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    doc.session = session;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    doc.path = path;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    if (doc.wrapped) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        session.setUseWrapMode(true);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        session.setWrapLimitRange(80, 80);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    var mode = getModeFromPath(path)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    session.modeName = mode.name;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    session.setMode(mode.mode);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +function makeHuge(txt) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    for (var i = 0; i < 5; i++)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        txt += txt;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    return txt
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var docs = {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/javascript.js": "JavaScript",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/clojure.clj": "Clojure",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/coffeescript.coffee": "Coffeescript",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/coldfusion.cfm": "ColdFusion",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/cpp.cpp": "C/C++",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/csharp.cs": "C#",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/css.css": "CSS",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/diff.diff": "Diff",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/glsl.glsl": "Glsl",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/golang.go": "Go",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/groovy.groovy": "Groovy",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/Haxe.hx": "haXe",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/html.html": "HTML",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/java.java": "Java",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/json.json": "JSON",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/jsx.jsx": "JSX",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/latex.tex": {name: "LaTeX", wrapped: true},
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/less.less": "LESS",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/liquid.liquid": "Liquid",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/lua.lua": "Lua",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/luapage.lp": "LuaPage",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/markdown.md": {name: "Markdown", wrapped: true},
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/ocaml.ml": "OCaml",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/OpenSCAD.scad": "OpenSCAD",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/perl.pl": "Perl",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/pgsql.pgsql": {name: "pgSQL", wrapped: true},
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/php.php": "PHP",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/plaintext.txt": {name: "Plain Text", prepare: makeHuge, wrapped: true},
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/powershell.ps1": "Powershell",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/python.py": "Python",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/ruby.rb": "Ruby",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/scala.scala": "Scala",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/scss.scss": "SCSS",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/sh.sh": "SH",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/sql.sql": {name: "SQL", wrapped: true},
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/svg.svg": "SVG",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/tcl.tcl": "Tcl",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/textile.textile": {name: "Textile", wrapped: true},
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/xml.xml": "XML",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/xquery.xq": "XQuery",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/yaml.yaml": "YAML",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "docs/c9search.c9search_results": "C9 Search Results"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var ownSource = {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    /* filled from require*/
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +};
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var hugeDocs = {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "build/src/ace.js": "",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "build/src-min/ace.js": ""
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +};
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +if (window.require && window.require.s) try {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    for (var path in window.require.s.contexts._.loaded) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        if (path.indexOf("!") != -1)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            path = path.split("!").pop();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        else
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            path = path + ".js";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        ownSource[path] = ""
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +} catch(e) {}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +function prepareDocList(docs) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    var list = []
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    for (var path in docs) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        var doc = docs[path];
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        if (typeof doc != "object")
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            doc = {name: doc || path};
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        doc.path = path;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        doc.desc = doc.name.replace(/^(ace|docs|demo|build)\//, "");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        if (doc.desc.length > 18)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            doc.desc = doc.desc.slice(0, 7) + ".." + doc.desc.slice(-9)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        fileCache[doc.name] = doc;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        list.push(doc);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    };
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    return list;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +docs = prepareDocList(docs);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +ownSource = prepareDocList(ownSource);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +hugeDocs = prepareDocList(hugeDocs);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                               /*********** create editor ***************************/
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var container = document.getElementById("editor-container");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var container = document.getElementById("editor");
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               // Splitting.
                                                                                                                                                                                                                                                                                                                                                                                                                                                               var Split = require("ace/split").Split;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -97,35 +271,30 @@ split.on("focus", function(editor) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                               });
                                                                                                                                                                                                                                                                                                                                                                                                                                                               env.split = split;
                                                                                                                                                                                                                                                                                                                                                                                                                                                               window.env = env;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +window.ace = env.editor;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +env.editor.setAnimatedScroll(true);
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               var consoleEl = dom.createElement("div");
                                                                                                                                                                                                                                                                                                                                                                                                                                                               container.parentNode.appendChild(consoleEl);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -consoleEl.style.cssText = "position:fixed; bottom:1px; right:0;\
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -border:1px solid #baf; z-index:100";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var cmdLine = new layout.singleLineEditor(consoleEl);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +consoleEl.style.position="fixed"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +consoleEl.style.bottom = "1px"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +consoleEl.style.right = 0
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +consoleEl.style.background = "white"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +consoleEl.style.border = "1px solid #baf"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +consoleEl.style.zIndex = "100"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var cmdLine = new singleLineEditor(consoleEl);
                                                                                                                                                                                                                                                                                                                                                                                                                                                               cmdLine.editor = env.editor;
                                                                                                                                                                                                                                                                                                                                                                                                                                                               env.editor.cmdLine = cmdLine;
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -env.editor.showCommandLine = function(val) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    this.cmdLine.focus();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    if (typeof val == "string")
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        this.cmdLine.setValue(val, 1);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -};
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -/**
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * This demonstrates how you can define commands and bind shortcuts to them.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - */
                                                                                                                                                                                                                                                                                                                                                                                                                                                               env.editor.commands.addCommands([{
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   name: "gotoline",
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   bindKey: {win: "Ctrl-L", mac: "Command-L"},
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   exec: function(editor, line) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       if (typeof line == "object") {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                           var arg = this.name + " " + editor.getCursorPosition().row;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            editor.cmdLine.setValue(arg, 1);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            editor.cmdLine.focus();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            return;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            editor.cmdLine.setValue(arg, 1)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            editor.cmdLine.focus()
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            return
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       line = parseInt(line, 10);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       if (!isNaN(line))
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -133,128 +302,54 @@ env.editor.commands.addCommands([{
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   },
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   readOnly: true
                                                                                                                                                                                                                                                                                                                                                                                                                                                               }, {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    name: "snippet",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    bindKey: {win: "Alt-C", mac: "Command-Alt-C"},
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    name: "find",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    bindKey: {win: "Ctrl-F", mac: "Command-F"},
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   exec: function(editor, needle) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       if (typeof needle == "object") {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            editor.cmdLine.setValue("snippet ", 1);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            editor.cmdLine.focus();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            return;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            var arg = this.name + " " + editor.getCopyText()
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            editor.cmdLine.setValue(arg, 1)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            editor.cmdLine.focus()
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            return
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        var s = snippetManager.getSnippetByName(needle, editor);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        if (s)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            snippetManager.insertSnippet(editor, s.content);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        editor.find(needle);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   },
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   readOnly: true
                                                                                                                                                                                                                                                                                                                                                                                                                                                               }, {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   name: "focusCommandLine",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    bindKey: "shift-esc|ctrl-`",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    bindKey: "shift-esc",
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   exec: function(editor, needle) { editor.cmdLine.focus(); },
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   readOnly: true
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}, {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    name: "nextFile",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    bindKey: "Ctrl-tab",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    exec: function(editor) { doclist.cycleOpen(editor, 1); },
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    readOnly: true
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}, {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    name: "previousFile",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    bindKey: "Ctrl-shift-tab",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    exec: function(editor) { doclist.cycleOpen(editor, -1); },
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    readOnly: true
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}, {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    name: "execute",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    bindKey: "ctrl+enter",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    exec: function(editor) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        try {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            var r = window.eval(editor.getCopyText() || editor.getValue());
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        } catch(e) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            r = e;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        editor.cmdLine.setValue(r + "");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    },
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    readOnly: true
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}, {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    name: "showKeyboardShortcuts",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    bindKey: {win: "Ctrl-Alt-h", mac: "Command-Alt-h"},
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    exec: function(editor) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        config.loadModule("ace/ext/keybinding_menu", function(module) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            module.init(editor);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            editor.showKeyboardShortcuts();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        });
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}, {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    name: "increaseFontSize",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    bindKey: "Ctrl-=|Ctrl-+",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    exec: function(editor) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        var size = parseInt(editor.getFontSize(), 10) || 12;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        editor.setFontSize(size + 1);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}, {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    name: "decreaseFontSize",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    bindKey: "Ctrl+-|Ctrl-_",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    exec: function(editor) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        var size = parseInt(editor.getFontSize(), 10) || 12;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        editor.setFontSize(Math.max(size - 1 || 1));
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}, {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    name: "resetFontSize",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    bindKey: "Ctrl+0|Ctrl-Numpad0",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    exec: function(editor) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        editor.setFontSize(12);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}]);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -env.editor.commands.addCommands(whitespace.commands);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +}])
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               cmdLine.commands.bindKeys({
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    "Shift-Return|Ctrl-Return|Alt-Return": function(cmdLine) { cmdLine.insert("\n"); },
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    "Shift-Return|Ctrl-Return|Alt-Return": function(cmdLine) { cmdLine.insert("\n")},
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "Esc|Shift-Esc": function(cmdLine){ cmdLine.editor.focus(); },
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   "Return": function(cmdLine){
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       var command = cmdLine.getValue().split(/\s+/);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       var editor = cmdLine.editor;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       editor.commands.exec(command[0], editor, command[1]);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       editor.focus();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    },
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +})
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -cmdLine.commands.removeCommands(["find", "gotoline", "findall", "replace", "replaceall"]);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +cmdLine.commands.removeCommands(["find", "gotoline", "findall", "replace", "replaceall"])
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +/**
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * This demonstrates how you can define commands and bind shortcuts to them.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + */
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               var commands = env.editor.commands;
                                                                                                                                                                                                                                                                                                                                                                                                                                                               commands.addCommand({
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   name: "save",
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   bindKey: {win: "Ctrl-S", mac: "Command-S"},
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    exec: function(arg) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        var session = env.editor.session;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        var name = session.name.match(/[^\/]+$/);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        localStorage.setItem(
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            "saved_file:" + name,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            session.getValue()
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        );
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        env.editor.cmdLine.setValue("saved "+ name);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -commands.addCommand({
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    name: "load",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    bindKey: {win: "Ctrl-O", mac: "Command-O"},
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    exec: function(arg) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        var session = env.editor.session;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        var name = session.name.match(/[^\/]+$/);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        var value = localStorage.getItem("saved_file:" + name);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        if (typeof value == "string") {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            session.setValue(value);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            env.editor.cmdLine.setValue("loaded "+ name);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        } else {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            env.editor.cmdLine.setValue("no previuos value saved for "+ name);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    exec: function() {alert("Fake Save File");}
                                                                                                                                                                                                                                                                                                                                                                                                                                                               });
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               var keybindings = {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    ace: null, // Null = use "default" keymapping
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    vim: require("ace/keyboard/vim").handler,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    emacs: "ace/keyboard/emacs",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    // Null = use "default" keymapping
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    ace: null,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    vim: vim,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    emacs: emacs,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   // This is a way to define simple keyboard remappings
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   custom: new HashHandler({
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       "gotoright":      "Tab",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -262,28 +357,28 @@ var keybindings = {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       "outdent":        "[",
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       "gotolinestart":  "^",
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       "gotolineend":    "$"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    })
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +     })
                                                                                                                                                                                                                                                                                                                                                                                                                                                               };
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               /*********** manage layout ***************************/
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var consoleHeight = 20;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var consoleHight = 20;
                                                                                                                                                                                                                                                                                                                                                                                                                                                               function onResize() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   var left = env.split.$container.offsetLeft;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   var width = document.documentElement.clientWidth - left;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   container.style.width = width + "px";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    container.style.height = document.documentElement.clientHeight - consoleHeight + "px";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    container.style.height = document.documentElement.clientHeight - consoleHight + "px";
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   env.split.resize();
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   consoleEl.style.width = width + "px";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    cmdLine.resize();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    cmdLine.resize()
                                                                                                                                                                                                                                                                                                                                                                                                                                                               }
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               window.onresize = onResize;
                                                                                                                                                                                                                                                                                                                                                                                                                                                               onResize();
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -/*********** options panel ***************************/
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +/*********** options pane ***************************/
                                                                                                                                                                                                                                                                                                                                                                                                                                                               var docEl = document.getElementById("doc");
                                                                                                                                                                                                                                                                                                                                                                                                                                                               var modeEl = document.getElementById("mode");
                                                                                                                                                                                                                                                                                                                                                                                                                                                               var wrapModeEl = document.getElementById("soft_wrap");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -296,58 +391,60 @@ var showGutterEl = document.getElementById("show_gutter");
                                                                                                                                                                                                                                                                                                                                                                                                                                                               var showPrintMarginEl = document.getElementById("show_print_margin");
                                                                                                                                                                                                                                                                                                                                                                                                                                                               var highlightSelectedWordE = document.getElementById("highlight_selected_word");
                                                                                                                                                                                                                                                                                                                                                                                                                                                               var showHScrollEl = document.getElementById("show_hscroll");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var showVScrollEl = document.getElementById("show_vscroll");
                                                                                                                                                                                                                                                                                                                                                                                                                                                               var animateScrollEl = document.getElementById("animate_scroll");
                                                                                                                                                                                                                                                                                                                                                                                                                                                               var softTabEl = document.getElementById("soft_tab");
                                                                                                                                                                                                                                                                                                                                                                                                                                                               var behavioursEl = document.getElementById("enable_behaviours");
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -fillDropdown(docEl, doclist.all);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var group = document.createElement("optgroup");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +group.setAttribute("label", "Mode Examples");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +fillDropdown(docs, group);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +docEl.appendChild(group);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var group = document.createElement("optgroup");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +group.setAttribute("label", "Huge documents");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +fillDropdown(hugeDocs, group);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +docEl.appendChild(group);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var group = document.createElement("optgroup");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +group.setAttribute("label", "own source");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +fillDropdown(ownSource, group);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +docEl.appendChild(group);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +fillDropdown(modes, modeEl);
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -fillDropdown(modeEl, modelist.modes);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var modesByName = modelist.modesByName;
                                                                                                                                                                                                                                                                                                                                                                                                                                                               bindDropdown("mode", function(value) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    env.editor.session.setMode(modesByName[value].mode || modesByName.text.mode);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    env.editor.session.modeName = value;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    env.editor.getSession().setMode(modesByName[value].mode || modesByName.text.mode);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    env.editor.getSession().modeName = value;
                                                                                                                                                                                                                                                                                                                                                                                                                                                               });
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -doclist.history = doclist.docs.map(function(doc) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    return doc.name;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -doclist.history.index = 0;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -doclist.cycleOpen = function(editor, dir) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    var h = this.history;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    h.index += dir;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    if (h.index >= h.length)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        h.index = 0;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    else if (h.index <= 0)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        h.index = h.length - 1;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    var s = h[h.index];
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    docEl.value = s;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    docEl.onchange();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -};
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -doclist.addToHistory = function(name) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    var h = this.history;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    var i = h.indexOf(name);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    if (i != h.index) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        if (i != -1)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            h.splice(i, 1);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        h.index = h.push(name);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -};
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                               bindDropdown("doc", function(name) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    doclist.loadDoc(name, function(session) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        if (!session)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            return;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        doclist.addToHistory(session.name);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        session = env.split.setSession(session);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        whitespace.detectIndentation(session);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    var doc = fileCache[name];
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    if (!doc)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        return;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    if (doc.session)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        return setSession(doc.session)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    //@todo do something while waiting
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    // env.editor.setSession(emptySession || (emptySession = new EditSession("")))
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    var path = doc.path;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    var parts = path.split("/");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    if (parts[0] == "docs")
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        path = "demo/kitchen-sink/" + path;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    else if (parts[0] == "ace")
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        path = "lib/" + path;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    net.get(path, function(x) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        initDoc(x, path, doc);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        setSession(doc.session)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    })
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    function setSession(session) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        var session = env.split.setSession(session);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       updateUIEditorOptions();
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       env.editor.focus();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    });
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                               });
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                               function updateUIEditorOptions() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   var editor = env.editor;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   var session = editor.session;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -371,28 +468,40 @@ function updateUIEditorOptions() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   saveOption(behavioursEl, editor.getBehavioursEnabled());
                                                                                                                                                                                                                                                                                                                                                                                                                                                               }
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -themelist.themes.forEach(function(x){ x.value = x.theme });
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -fillDropdown(themeEl, {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    Bright: themelist.themes.filter(function(x){return !x.isDark}),
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    Dark: themelist.themes.filter(function(x){return x.isDark}),
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +function saveOption(el, val) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    if (!el.onchange && !el.onclick)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        return;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    if ("checked" in el) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        if (val !== undefined)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            el.checked = val;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        localStorage && localStorage.setItem(el.id, el.checked ? 1 : 0);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    else {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        if (val !== undefined)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            el.value = val;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        localStorage && localStorage.setItem(el.id, el.value);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +}
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               event.addListener(themeEl, "mouseover", function(e){
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    themeEl.desiredValue = e.target.value;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    if (!themeEl.$timer)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        themeEl.$timer = setTimeout(themeEl.updateTheme);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    this.desiredValue = e.target.value;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    if (!this.$timer)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        this.$timer = setTimeout(this.updateTheme);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +})
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               event.addListener(themeEl, "mouseout", function(e){
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    themeEl.desiredValue = null;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    if (!themeEl.$timer)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        themeEl.$timer = setTimeout(themeEl.updateTheme, 20);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    this.desiredValue = null;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    if (!this.$timer)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        this.$timer = setTimeout(this.updateTheme, 20);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +})
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               themeEl.updateTheme = function(){
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    env.split.setTheme((themeEl.desiredValue || themeEl.selectedValue));
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    env.split.setTheme(themeEl.desiredValue || themeEl.selectedValue);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   themeEl.$timer = null;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -};
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +}
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               bindDropdown("theme", function(value) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   if (!value)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -410,16 +519,38 @@ bindDropdown("fontsize", function(value) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                               });
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               bindDropdown("folding", function(value) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    env.editor.session.setFoldStyle(value);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    env.editor.getSession().setFoldStyle(value);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   env.editor.setShowFoldWidgets(value !== "manual");
                                                                                                                                                                                                                                                                                                                                                                                                                                                               });
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               bindDropdown("soft_wrap", function(value) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    env.editor.setOption("wrap", value);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    var session = env.editor.getSession();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    var renderer = env.editor.renderer;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    switch (value) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        case "off":
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            session.setUseWrapMode(false);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            renderer.setPrintMarginColumn(80);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            break;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        case "40":
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            session.setUseWrapMode(true);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            session.setWrapLimitRange(40, 40);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            renderer.setPrintMarginColumn(40);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            break;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        case "80":
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            session.setUseWrapMode(true);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            session.setWrapLimitRange(80, 80);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            renderer.setPrintMarginColumn(80);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            break;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        case "free":
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            session.setUseWrapMode(true);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            session.setWrapLimitRange(null, null);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            renderer.setPrintMarginColumn(80);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            break;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                               });
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               bindCheckbox("select_style", function(checked) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    env.editor.setOption("selectionStyle", checked ? "line" : "text");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    env.editor.setSelectionStyle(checked ? "line" : "text");
                                                                                                                                                                                                                                                                                                                                                                                                                                                               });
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               bindCheckbox("highlight_active", function(checked) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -447,11 +578,7 @@ bindCheckbox("highlight_selected_word", function(checked) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                               });
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               bindCheckbox("show_hscroll", function(checked) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    env.editor.setOption("hScrollBarAlwaysVisible", checked);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -bindCheckbox("show_vscroll", function(checked) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    env.editor.setOption("vScrollBarAlwaysVisible", checked);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    env.editor.renderer.setHScrollBarAlwaysVisible(checked);
                                                                                                                                                                                                                                                                                                                                                                                                                                                               });
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               bindCheckbox("animate_scroll", function(checked) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -459,7 +586,7 @@ bindCheckbox("animate_scroll", function(checked) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                               });
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               bindCheckbox("soft_tab", function(checked) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    env.editor.session.setUseSoftTabs(checked);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    env.editor.getSession().setUseSoftTabs(checked);
                                                                                                                                                                                                                                                                                                                                                                                                                                                               });
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               bindCheckbox("enable_behaviours", function(checked) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -469,117 +596,186 @@ bindCheckbox("enable_behaviours", function(checked) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                               bindCheckbox("fade_fold_widgets", function(checked) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   env.editor.setFadeFoldWidgets(checked);
                                                                                                                                                                                                                                                                                                                                                                                                                                                               });
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -bindCheckbox("read_only", function(checked) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    env.editor.setReadOnly(checked);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -bindCheckbox("scrollPastEnd", function(checked) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    env.editor.setOption("scrollPastEnd", checked);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -});
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var secondSession = null;
                                                                                                                                                                                                                                                                                                                                                                                                                                                               bindDropdown("split", function(value) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   var sp = env.split;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   if (value == "none") {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        if (sp.getSplits() == 2) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            secondSession = sp.getEditor(1).session;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       sp.setSplits(1);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   } else {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       var newEditor = (sp.getSplits() == 1);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        sp.setOrientation(value == "below" ? sp.BELOW : sp.BESIDE);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        if (value == "below") {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            sp.setOrientation(sp.BELOW);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        } else {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            sp.setOrientation(sp.BESIDE);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       sp.setSplits(2);
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       if (newEditor) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            var session = sp.getEditor(0).session;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            var session = secondSession || sp.getEditor(0).session;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                           var newSession = sp.setSession(session, 1);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                           newSession.name = session.name;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   }
                                                                                                                                                                                                                                                                                                                                                                                                                                                               });
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +function bindCheckbox(id, callback) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    var el = document.getElementById(id);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    if (localStorage && localStorage.getItem(id))
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        el.checked = localStorage.getItem(id) == "1";
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -bindCheckbox("elastic_tabstops", function(checked) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    env.editor.setOption("useElasticTabstops", checked);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var iSearchCheckbox = bindCheckbox("isearch", function(checked) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    env.editor.setOption("useIncrementalSearch", checked);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -env.editor.addEventListener('incrementalSearchSettingChanged', function(event) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    iSearchCheckbox.checked = event.isEnabled;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -function synchroniseScrolling() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    var s1 = env.split.$editors[0].session;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    var s2 = env.split.$editors[1].session;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    s1.on('changeScrollTop', function(pos) {s2.setScrollTop(pos)});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    s2.on('changeScrollTop', function(pos) {s1.setScrollTop(pos)});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    s1.on('changeScrollLeft', function(pos) {s2.setScrollLeft(pos)});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    s2.on('changeScrollLeft', function(pos) {s1.setScrollLeft(pos)});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    var onCheck = function() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        callback(!!el.checked);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        saveOption(el);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    };
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    el.onclick = onCheck;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    onCheck();
                                                                                                                                                                                                                                                                                                                                                                                                                                                               }
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -bindCheckbox("highlight_token", function(checked) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    var editor = env.editor;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    if (editor.tokenTooltip && !checked) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        editor.tokenTooltip.destroy();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        delete editor.tokenTooltip;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    } else if (checked) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        editor.tokenTooltip = new TokenTooltip(editor);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +function bindDropdown(id, callback) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    var el = document.getElementById(id);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    if (localStorage && localStorage.getItem(id))
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        el.value = localStorage.getItem(id);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    var onChange = function() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        callback(el.value);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        saveOption(el);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    };
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    el.onchange = onChange;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    onChange();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +function fillDropdown(list, el) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    list.forEach(function(item) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        var option = document.createElement("option");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        option.setAttribute("value", item.name);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        option.innerHTML = item.desc;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        el.appendChild(option);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    });
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +/************** dragover ***************************/
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +event.addListener(container, "dragover", function(e) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    return event.preventDefault(e);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +event.addListener(container, "drop", function(e) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    var file;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    try {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        file = e.dataTransfer.files[0];
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        if (window.FileReader) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            var reader = new FileReader();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            reader.onload = function() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                var mode = getModeFromPath(file.name);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                env.editor.session.doc.setValue(reader.result);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                modeEl.value = mode.name;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                env.editor.session.setMode(mode.mode);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +                env.editor.session.modeName = mode.name;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            };
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            reader.readAsText(file);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        return event.preventDefault(e);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    } catch(err) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        return event.stopEvent(e);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   }
                                                                                                                                                                                                                                                                                                                                                                                                                                                               });
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var StatusBar = require("ace/ext/statusbar").StatusBar;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -new StatusBar(env.editor, cmdLine.container);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +// add multiple cursor support to editor
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +require("ace/multi_select").MultiSelect(env.editor);
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var Emmet = require("ace/ext/emmet");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -net.loadScript("https://cloud9ide.github.io/emmet-core/emmet.js", function() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    Emmet.setCore(window.emmet);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    env.editor.setOption("enableEmmet", true);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -});
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +function singleLineEditor(el) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    var renderer = new Renderer(el);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    renderer.scrollBar.element.style.display = "none";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    renderer.scrollBar.width = 0;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    renderer.content.style.height = "auto";
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -// require("ace/placeholder").PlaceHolder;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    renderer.screenToTextCoordinates = function(x, y) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        var pos = this.pixelToScreenCoordinates(x, y);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        return this.session.screenToDocumentPosition(
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            Math.min(this.session.getScreenLength() - 1, Math.max(pos.row, 0)),
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +            Math.max(pos.column, 0)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        );
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    };
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    // todo size change event
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    renderer.$computeLayerConfig = function() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        var longestLine = this.$getLongestLine();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        var firstRow = 0;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        var lastRow = this.session.getLength();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        var height = this.session.getScreenLength() * this.lineHeight;
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var snippetManager = require("ace/snippets").snippetManager;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        this.scrollTop = 0;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        var config = this.layerConfig;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        config.width = longestLine;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        config.padding = this.$padding;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        config.firstRow = 0;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        config.firstRowScreen = 0;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        config.lastRow = lastRow;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        config.lineHeight = this.lineHeight;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        config.characterWidth = this.characterWidth;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        config.minHeight = height;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        config.maxHeight = height;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        config.offset = 0;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        config.height = height;
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -env.editSnippets = function() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    var sp = env.split;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    if (sp.getSplits() == 2) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        sp.setSplits(1);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        return;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    sp.setSplits(1);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    sp.setSplits(2);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    sp.setOrientation(sp.BESIDE);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    var editor = sp.$editors[1];
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    var id = sp.$editors[0].session.$mode.$id || "";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    var m = snippetManager.files[id];
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    if (!doclist["snippets/" + id]) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        var text = m.snippetText;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        var s = doclist.initDoc(text, "", {});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        s.setMode("ace/mode/snippets");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        doclist["snippets/" + id] = s;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    editor.on("blur", function() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        m.snippetText = editor.getValue();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        snippetManager.unregister(m.snippets);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        m.snippets = snippetManager.parseSnippetFile(m.snippetText, m.scope);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        snippetManager.register(m.snippets);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    });
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    sp.$editors[0].once("changeMode", function() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        sp.setSplits(1);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    });
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    editor.setSession(doclist["snippets/" + id], 1);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    editor.focus();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        this.$gutterLayer.element.style.marginTop = 0 + "px";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        this.content.style.marginTop = 0 + "px";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        this.content.style.width = longestLine + 2 * this.$padding + "px";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        this.content.style.height = height + "px";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        this.scroller.style.height = height + "px";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        this.container.style.height = height + "px";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    };
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    renderer.isScrollableBy=function(){return false};
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    var editor = new Editor(renderer);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    new MultiSelect(editor);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    editor.session.setUndoManager(new UndoManager());
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    editor.setHighlightActiveLine(false);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    editor.setShowPrintMargin(false);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    editor.renderer.setShowGutter(false);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    editor.renderer.setHighlightGutterLine(false);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    return editor;
                                                                                                                                                                                                                                                                                                                                                                                                                                                               };
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -require("ace/ext/language_tools");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -env.editor.setOptions({
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    enableBasicAutocompletion: true,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    enableLiveAutocompletion: false,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    enableSnippets: true
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +/** simple statusbar **/
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var editor = env.editor;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var statusBarEl = dom.createElement("div");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +statusBarEl.style.cssText = "color:gray;position:absolute;right:0;border-left:1px solid";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +cmdLine.container.appendChild(statusBarEl);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +var statusUpdate = lang.deferredCall(function() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    var status = [];
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    function add(s, sep) {s && status.push(s, sep || "|")}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    if (editor.$vimModeHandler)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        add(editor.$vimModeHandler.getStatusText());
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    else if (editor.commands.recording)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        add("REC");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    var c = editor.selection.lead;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    add(c.row + ":" + c.column, " ");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    if (!editor.selection.isEmpty()) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        var r = editor.getSelectionRange()
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        add("(" + (r.end.row - r.start.row) + ":"  +(r.end.column - r.start.column) + ")");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    status.pop();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    statusBarEl.textContent = status.join("");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +env.editor.on("changeStatus", function() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    statusUpdate.schedule(50);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +env.editor.on("changeSelection", function() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    statusUpdate.schedule(50);
                                                                                                                                                                                                                                                                                                                                                                                                                                                               });
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var beautify = require("ace/ext/beautify");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -env.editor.commands.addCommands(beautify.commands);
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               });
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/demo/kitchen-sink/dev_util.js b/demo/kitchen-sink/dev_util.js
                                                                                                                                                                                                                                                                                                                                                                                                                                                              deleted file mode 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                              index f466285d..00000000
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- a/demo/kitchen-sink/dev_util.js
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +++ /dev/null
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -1,217 +0,0 @@
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -/* ***** BEGIN LICENSE BLOCK *****
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * Distributed under the BSD license:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - *
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * Copyright (c) 2010, Ajax.org B.V.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * All rights reserved.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - *
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * Redistribution and use in source and binary forms, with or without
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * modification, are permitted provided that the following conditions are met:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - *     * Redistributions of source code must retain the above copyright
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - *       notice, this list of conditions and the following disclaimer.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - *     * Redistributions in binary form must reproduce the above copyright
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - *       notice, this list of conditions and the following disclaimer in the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - *       documentation and/or other materials provided with the distribution.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - *     * Neither the name of Ajax.org B.V. nor the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - *       names of its contributors may be used to endorse or promote products
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - *       derived from this software without specific prior written permission.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - *
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - *
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ***** END LICENSE BLOCK ***** */
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -define(function(require, exports, module) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var dom = require("ace/lib/dom");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var Range = require("ace/range").Range;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -function warn() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    var s = (new Error()).stack || "";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    s = s.split("\n");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    if (s[1] == "Error") s.shift(); // remove error description on chrome
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    s.shift(); // remove warn
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    s.shift(); // remove the getter
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    s = s.join("\n");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    // allow easy access to ace in console, but not in ace code
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    if (!/at Object.InjectedScript.|@debugger eval|snippets:\/{3}|\(:\d+:\d+\)/.test(s)) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        console.error("trying to access to global variable");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -function def(o, key, get) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    try {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Object.defineProperty(o, key, {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            configurable: true, 
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            get: get,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            set: function(val) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                delete o[key];
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                o[key] = val;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        });
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    } catch(e) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        console.error(e);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -def(window, "ace", function(){ warn(); return window.env.editor });
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -def(window, "editor", function(){ warn(); return window.env.editor });
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -def(window, "session", function(){ warn(); return window.env.editor.session });
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -def(window, "split", function(){ warn(); return window.env.split });
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -def(window, "devUtil", function(){ warn(); return exports });
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -exports.showTextArea = function(argument) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    dom.importCssString("\
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      .ace_text-input {\
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        position: absolute;\
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        z-index: 10!important;\
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        width: 6em!important;\
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        height: 1em;\
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        opacity: 1!important;\
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        background: rgba(0, 92, 255, 0.11);\
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        border: none;\
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        font: inherit;\
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        padding: 0 1px;\
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        margin: 0 -1px;\
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        text-indent: 0em;\
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    }\
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    ");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -};
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -exports.addGlobals = function() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    window.oop = require("ace/lib/oop");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    window.dom = require("ace/lib/dom");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    window.Range = require("ace/range").Range;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    window.Editor = require("ace/editor").Editor;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    window.assert = require("ace/test/asyncjs/assert");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    window.asyncjs = require("ace/test/asyncjs/async");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    window.UndoManager = require("ace/undomanager").UndoManager;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    window.EditSession = require("ace/edit_session").EditSession;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    window.MockRenderer = require("ace/test/mockrenderer").MockRenderer;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    window.EventEmitter = require("ace/lib/event_emitter").EventEmitter;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    window.getSelection = getSelection;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    window.setSelection = setSelection;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    window.testSelection = testSelection;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -};
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -function getSelection(editor) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    var data = editor.multiSelect.toJSON();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    if (!data.length) data = [data];
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    data = data.map(function(x) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        var a, c;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        if (x.isBackwards) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            a = x.end;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            c = x.start;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        } else {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            c = x.end;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            a = x.start;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        return Range.comparePoints(a, c) 
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            ? [a.row, a.column, c.row, c.column]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            : [a.row, a.column];
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    });
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    return data.length > 1 ? data : data[0];
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -function setSelection(editor, data) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    if (typeof data[0] == "number")
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        data = [data];
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    editor.selection.fromJSON(data.map(function(x) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        var start = {row: x[0], column: x[1]};
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        var end = x.length == 2 ? start : {row: x[2], column: x[3]};
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        var isBackwards = Range.comparePoints(start, end) > 0;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        return isBackwards ? {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            start: end,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            end: start,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            isBackwards: true
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        } : {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            start: start,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            end: end,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            isBackwards: true
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        };
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    }));
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -function testSelection(editor, data) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    assert.equal(getSelection(editor) + "", data + "");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -exports.recordTestCase = function() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    exports.addGlobals();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    var editor = window.editor;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    var testcase = window.testcase = [];
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    var assert;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    testcase.push({
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        type: "setValue",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        data: editor.getValue()
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    }, {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        type: "setSelection",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        data: getSelection(editor)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    });
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    editor.commands.on("afterExec", function(e) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        testcase.push({
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            type: "exec",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            data: e
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        });
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        testcase.push({
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            type: "value",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            data: editor.getValue()
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        });
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        testcase.push({
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            type: "selection",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            data: getSelection(editor)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        });
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    });
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    editor.on("mouseup", function() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        testcase.push({
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            type: "setSelection",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            data: getSelection(editor)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        });
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    });
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    testcase.toString = function() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        var lastValue = "";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        // var lastSelection = ""
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        var str = this.map(function(x) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            var data = x.data;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            switch (x.type) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                case "exec": 
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                    return 'editor.execCommand("' 
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                        + data.command.name
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                        + (data.args ? '", ' + JSON.stringify(data.args) : '"')
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                    + ')';
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                case "setSelection":
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                    return 'setSelection(editor, ' + JSON.stringify(data)  + ')';
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                case "setValue":
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                    if (lastValue != data) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                        lastValue = data;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                        return 'editor.setValue(' + JSON.stringify(data) + ', -1)';
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                    return;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                case "selection":
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                    return 'testSelection(editor, ' + JSON.stringify(data) + ')';
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                case "value":
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                    if (lastValue != data) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                        lastValue = data;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                        return 'assert.equal('
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                            + 'editor.getValue(),'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                            + JSON.stringify(data)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                        + ')';
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                    return;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        }).filter(Boolean).join("\n");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        return getSelection + "\n"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            + testSelection + "\n"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            + setSelection + "\n"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            + "\n" + str + "\n";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    };
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -};
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/demo/kitchen-sink/doclist.js b/demo/kitchen-sink/doclist.js
                                                                                                                                                                                                                                                                                                                                                                                                                                                              deleted file mode 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                              index a4848d50..00000000
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- a/demo/kitchen-sink/doclist.js
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +++ /dev/null
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -1,218 +0,0 @@
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -/* ***** BEGIN LICENSE BLOCK *****
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * Distributed under the BSD license:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - *
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * Copyright (c) 2010, Ajax.org B.V.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * All rights reserved.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - *
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * Redistribution and use in source and binary forms, with or without
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * modification, are permitted provided that the following conditions are met:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - *     * Redistributions of source code must retain the above copyright
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - *       notice, this list of conditions and the following disclaimer.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - *     * Redistributions in binary form must reproduce the above copyright
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - *       notice, this list of conditions and the following disclaimer in the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - *       documentation and/or other materials provided with the distribution.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - *     * Neither the name of Ajax.org B.V. nor the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - *       names of its contributors may be used to endorse or promote products
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - *       derived from this software without specific prior written permission.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - *
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - *
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ***** END LICENSE BLOCK ***** */
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - define(function(require, exports, module) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -"use strict";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var EditSession = require("ace/edit_session").EditSession;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var UndoManager = require("ace/undomanager").UndoManager;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var net = require("ace/lib/net");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var modelist = require("ace/ext/modelist");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -/*********** demo documents ***************************/
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var fileCache = {};
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -function initDoc(file, path, doc) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    if (doc.prepare)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        file = doc.prepare(file);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    var session = new EditSession(file);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    session.setUndoManager(new UndoManager());
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    doc.session = session;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    doc.path = path;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    session.name = doc.name;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    if (doc.wrapped) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        session.setUseWrapMode(true);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        session.setWrapLimitRange(80, 80);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    var mode = modelist.getModeForPath(path);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    session.modeName = mode.name;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    session.setMode(mode.mode);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    return session;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -function makeHuge(txt) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    for (var i = 0; i < 5; i++)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        txt += txt;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    return txt;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var docs = {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    "docs/javascript.js": {order: 1, name: "JavaScript"},
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    "docs/latex.tex": {name: "LaTeX", wrapped: true},
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    "docs/markdown.md": {name: "Markdown", wrapped: true},
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    "docs/mushcode.mc": {name: "MUSHCode", wrapped: true},
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    "docs/pgsql.pgsql": {name: "pgSQL", wrapped: true},
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    "docs/plaintext.txt": {name: "Plain Text", prepare: makeHuge, wrapped: true},
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    "docs/sql.sql": {name: "SQL", wrapped: true},
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    "docs/textile.textile": {name: "Textile", wrapped: true},
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    "docs/c9search.c9search_results": "C9 Search Results",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    "docs/mel.mel": "MEL",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    "docs/Nix.nix": "Nix"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -};
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var ownSource = {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    /* filled from require*/
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -};
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var hugeDocs = require.toUrl ? {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    "build/src/ace.js": "",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    "build/src-min/ace.js": ""
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -} : {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    "src/ace.js": "",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    "src-min/ace.js": ""
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -};
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -modelist.modes.forEach(function(m) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    var ext = m.extensions.split("|")[0];
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    if (ext[0] === "^") {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        path = ext.substr(1);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    } else {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        var path = m.name + "." + ext;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    path = "docs/" + path;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    if (!docs[path]) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        docs[path] = {name: m.caption};
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    } else if (typeof docs[path] == "object" && !docs[path].name) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        docs[path].name = m.caption;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -if (window.require && window.require.s) try {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    for (var path in window.require.s.contexts._.defined) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        if (path.indexOf("!") != -1)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            path = path.split("!").pop();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        else
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            path = path + ".js";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        ownSource[path] = "";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -} catch(e) {}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -function sort(list) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    return list.sort(function(a, b) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        var cmp = (b.order || 0) - (a.order || 0);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        return cmp || a.name && a.name.localeCompare(b.name);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    });
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -function prepareDocList(docs) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    var list = [];
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    for (var path in docs) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        var doc = docs[path];
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        if (typeof doc != "object")
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            doc = {name: doc || path};
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        doc.path = path;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        doc.desc = doc.name.replace(/^(ace|docs|demo|build)\//, "");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        if (doc.desc.length > 18)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            doc.desc = doc.desc.slice(0, 7) + ".." + doc.desc.slice(-9);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        fileCache[doc.name] = doc;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        list.push(doc);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    return list;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -function loadDoc(name, callback) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    var doc = fileCache[name];
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    if (!doc)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        return callback(null);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    if (doc.session)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        return callback(doc.session);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    // TODO: show load screen while waiting
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    var path = doc.path;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    var parts = path.split("/");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    if (parts[0] == "docs")
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        path = "demo/kitchen-sink/" + path;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    else if (parts[0] == "ace")
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        path = "lib/" + path;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    net.get(path, function(x) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        initDoc(x, path, doc);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        callback(doc.session);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    });
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -function saveDoc(name, callback) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    var doc = fileCache[name] || name;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    if (!doc || !doc.session)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        return callback("Unknown document: " + name);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    var path = doc.path;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    var parts = path.split("/");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    if (parts[0] == "docs")
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        path = "demo/kitchen-sink/" + path;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    else if (parts[0] == "ace")
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        path = "lib/" + path;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    upload(path, doc.session.getValue(), callback);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -function upload(url, data, callback) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    url = net.qualifyURL(url);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    if (!/https?:/.test(url))
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        return callback(new Error("Unsupported url scheme"));
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    var xhr = new XMLHttpRequest();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    xhr.open("PUT", url, true);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    xhr.onreadystatechange = function () {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        if (xhr.readyState === 4) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            callback(!/^2../.test(xhr.status));
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    };
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    xhr.send(data);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -};
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -module.exports = {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    fileCache: fileCache,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    docs: sort(prepareDocList(docs)),
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    ownSource: prepareDocList(ownSource),
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    hugeDocs: prepareDocList(hugeDocs),
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    initDoc: initDoc,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    loadDoc: loadDoc,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    saveDoc: saveDoc,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -};
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -module.exports.all = {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    "Mode Examples": module.exports.docs,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    "Huge documents": module.exports.hugeDocs,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    "own source": module.exports.ownSource
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -};
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/demo/kitchen-sink/docs/.gitignore b/demo/kitchen-sink/docs/.gitignore
                                                                                                                                                                                                                                                                                                                                                                                                                                                              deleted file mode 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                              index 56ec8fd9..00000000
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- a/demo/kitchen-sink/docs/.gitignore
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +++ /dev/null
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -1,11 +0,0 @@
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -# A sample .gitignore file.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.buildlog
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.DS_Store
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.svn
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -# Negated patterns:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -!foo.bar
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -# Also ignore user settings...
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -/.settings
                                                                                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/demo/kitchen-sink/docs/Dockerfile b/demo/kitchen-sink/docs/Dockerfile
                                                                                                                                                                                                                                                                                                                                                                                                                                                              deleted file mode 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                              index 70270cbf..00000000
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- a/demo/kitchen-sink/docs/Dockerfile
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +++ /dev/null
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -1,53 +0,0 @@
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -#
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -# example Dockerfile for http://docs.docker.io/en/latest/examples/postgresql_service/
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -#
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -FROM ubuntu
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -MAINTAINER SvenDowideit@docker.com
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -# Add the PostgreSQL PGP key to verify their Debian packages.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -# It should be the same key as https://www.postgresql.org/media/keys/ACCC4CF8.asc 
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -# Add PostgreSQL's repository. It contains the most recent stable release
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -#     of PostgreSQL, ``9.3``.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -# Update the Ubuntu and PostgreSQL repository indexes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -RUN apt-get update
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -# Install ``python-software-properties``, ``software-properties-common`` and PostgreSQL 9.3
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -#  There are some warnings (in red) that show up during the build. You can hide
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -#  them by prefixing each apt-get statement with DEBIAN_FRONTEND=noninteractive
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -RUN apt-get -y -q install python-software-properties software-properties-common
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -RUN apt-get -y -q install postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -# Note: The official Debian and Ubuntu images automatically ``apt-get clean``
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -# after each ``apt-get`` 
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -# Run the rest of the commands as the ``postgres`` user created by the ``postgres-9.3`` package when it was ``apt-get installed``
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -USER postgres
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -# Create a PostgreSQL role named ``docker`` with ``docker`` as the password and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -# then create a database `docker` owned by the ``docker`` role.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -# Note: here we use ``&&\`` to run commands one after the other - the ``\``
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -#       allows the RUN command to span multiple lines.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -RUN    /etc/init.d/postgresql start &&\
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    psql --command "CREATE USER docker WITH SUPERUSER PASSWORD 'docker';" &&\
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    createdb -O docker docker
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -# Adjust PostgreSQL configuration so that remote connections to the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -# database are possible. 
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -RUN echo "host all  all    0.0.0.0/0  md5" >> /etc/postgresql/9.3/main/pg_hba.conf
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -# And add ``listen_addresses`` to ``/etc/postgresql/9.3/main/postgresql.conf``
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -RUN echo "listen_addresses='*'" >> /etc/postgresql/9.3/main/postgresql.conf
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -# Expose the PostgreSQL port
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -EXPOSE 5432
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -# Add VOLUMEs to allow backup of config, logs and databases
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -VOLUME	["/etc/postgresql", "/var/log/postgresql", "/var/lib/postgresql"]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -# Set the default command to run when starting the container
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -CMD ["/usr/lib/postgresql/9.3/bin/postgres", "-D", "/var/lib/postgresql/9.3/main", "-c", "config_file=/etc/postgresql/9.3/main/postgresql.conf"]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              \ No newline at end of file
                                                                                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/demo/kitchen-sink/docs/Jack.jack b/demo/kitchen-sink/docs/Jack.jack
                                                                                                                                                                                                                                                                                                                                                                                                                                                              deleted file mode 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                              index 15acf743..00000000
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- a/demo/kitchen-sink/docs/Jack.jack
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +++ /dev/null
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -1,247 +0,0 @@
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -vars it, p
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -p = {label, value|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  print("\n" + label)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  print(inspect(value))
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- Create an array from 0 to 15
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -p("range", i-collect(range(5)))
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- Create an array from 0 to 15 and break up in chunks of 4
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -p("chunked range", i-collect(i-chunk(4, range(16))))
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- Check if all or none items in stream pass test.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -p("all < 60 in range(60)", i-all?({i|i<60}, range(60)))
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -p("any < 60 in range(60)", i-any?({i|i>60}, range(60)))
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -p("all < 60 in range(70)", i-all?({i|i<60}, range(70)))
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -p("any < 60 in range(70)", i-any?({i|i>60}, range(70)))
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- Zip three different collections together
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -p("zipped", i-collect(i-zip(
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  range(10),
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  [1,2,3,4,5],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  i-map({i|i*i}, range(10))
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -)))
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -vars names, person, i, doubles, lengths, cubeRange
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -names = ["Thorin", "Dwalin", "Balin", "Bifur", "Bofur", "Bombur", "Oin",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -         "Gloin", "Ori", "Nori", "Dori", "Fili", "Kili", "Bilbo", "Gandalf"]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -for name in names {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  if name != "Bilbo" && name != "Gandalf" {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    print(name)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -person = {name: "Tim", age: 30}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -for key, value in person {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  print(key + " = " + value)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -i = 0
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -while i < 10 {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  i = i + 1
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  print(i)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -print("range")
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -for i in range(10) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  print(i + 1)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -for i in range(10) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  print(10 - i)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- Dynamic object that gives the first 10 doubles
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -doubles = {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  @len: {| 10 }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  @get: {key|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    if key is Integer { key * key }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -print("#doubles", #doubles)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -print("Doubles")
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -for k, v in doubles {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  print([k, v])
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- Dynamic object that has names list as keys and string lenth as values
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -lengths = {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  @keys: {| names }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  @get: {key|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    if key is String { #key }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -print ("Lengths")
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -for k, v in lengths {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  print([k, v])
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -cubeRange = {n|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  vars i, v
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  i = 0
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    @call: {|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      v = i
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      i = i + 1
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      if v < n { v * v * v }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -print("Cubes")
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -for k, v in cubeRange(5) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  print([k, v])
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -print("String")
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -for k, v in "Hello World" {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  print([k, v])
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -print([i for i in range(10)])
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -print([i for i in range(20) if i % 3])
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- Example showing how to do parallel work using split..and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -base = {bootstrap, target-dir|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  split {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    copy("res", target-dir)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  } and {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    if newer("src/*.less", target-dir + "/style.css") {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      lessc("src/" + bootstrap + ".less", target-dir + "/style.css")
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  } and {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    build("src/" + bootstrap + ".js", target-dir + "/app.js")
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -vars Dragon, pet
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Dragon = {name|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  vars asleep, stuff-in-belly, stuff-in-intestine,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -       feed, walk, put-to-bed, toss, rock,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -       hungry?, poopy?, passage-of-time
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  asleep = false
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  stuff-in-belly     = 10 -- He's full.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  stuff-in-intestine =  0 -- He doesn't need to go.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  print(name + ' is born.')
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  feed = {|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    print('You feed ' + name + '.')
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    stuff-in-belly = 10
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    passage-of-time()
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  walk = {|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    print('You walk ' + name + ".")
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    stuff-in-intestine = 0
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    passage-of-time
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  put-to-bed = {|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    print('You put ' + name + ' to bed.')
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    asleep = true
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    for i in range(3) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      if asleep {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        passage-of-time()
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      if asleep {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        print(name + ' snores, filling the room with smoke.')
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    if asleep {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      asleep = false
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      print(name + ' wakes up slowly.')
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  toss = {|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    print('You toss ' + name + ' up into the air.')
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    print('He giggles, which singes your eyebrows.')
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    passage-of-time()
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  rock = {|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    print('You rock ' + name + ' gently.')
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    asleep = true
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    print('He briefly dozes off...')
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    passage-of-time()
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    if asleep {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      asleep = false
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      print('...but wakes when you stop.')
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  hungry? = {|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    stuff-in-belly <= 2
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  poopy? = {|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    stuff-in-intestine >= 8
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  passage-of-time = {|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    if stuff-in-belly > 0 {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      -- Move food from belly to intestine
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      stuff-in-belly     = stuff-in-belly     - 1
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      stuff-in-intestine = stuff-in-intestine + 1
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    } else { -- Our dragon is starving!
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      if asleep {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        asleep = false
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        print('He wakes up suddenly!')
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      print(name + ' is starving! In desperation, he ate YOU!')
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      abort "died"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    if stuff-in-intestine >= 10 {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      stuff-in-intestine = 0
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      print('Whoops! ' + name + ' had an accident...')
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    if hungry?() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      if asleep {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        asleep = false
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        print('He wakes up suddenly!')
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      print(name + "'s stomach grumbles...")
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    if poopy?() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      if asleep {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        asleep = false
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        print('He wakes up suddenly!')
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      print(name + ' does the potty dance...')
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  -- Export the public interface to this closure object.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   feed: feed
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   walk: walk
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   put-to-bed: put-to-bed
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   toss: toss
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   rock: rock
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -pet = Dragon('Norbert')
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -pet.feed()
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -pet.toss()
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -pet.walk()
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -pet.put-to-bed()
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -pet.rock()
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -pet.put-to-bed()
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -pet.put-to-bed()
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -pet.put-to-bed()
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -pet.put-to-bed()
                                                                                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/demo/kitchen-sink/docs/Makefile b/demo/kitchen-sink/docs/Makefile
                                                                                                                                                                                                                                                                                                                                                                                                                                                              deleted file mode 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                              index 9b0b31ac..00000000
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- a/demo/kitchen-sink/docs/Makefile
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +++ /dev/null
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -1,122 +0,0 @@
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.PHONY:    apf ext worker mode theme package test
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -default: apf worker
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -update: worker
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -# packages apf
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -# This is the first line of a comment \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -and this is still part of the comment \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -as is this, since I keep ending each line \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -with a backslash character
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -apf:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    cd node_modules/packager; node package.js projects/apf_cloud9.apr
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	cd node_modules/packager; cat build/apf_release.js | sed 's/\(\/\*FILEHEAD(\).*//g' > ../../plugins-client/lib.apf/www/apf-packaged/apf_release.js
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -# package debug version of apf
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -apfdebug:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	cd node_modules/packager/projects; cat apf_cloud9.apr | sed 's///g' > apf_cloud9_debug2.apr
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	cd node_modules/packager/projects; cat apf_cloud9_debug2.apr | sed 's/apf_release/apf_debug/g' > apf_cloud9_debug.apr; rm apf_cloud9_debug2.apr
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	cd node_modules/packager; node package.js projects/apf_cloud9_debug.apr
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	cd node_modules/packager; cat build/apf_debug.js | sed 's/\(\/\*FILEHEAD(\).*\/apf\/\(.*\)/\1\2/g' > ../../plugins-client/lib.apf/www/apf-packaged/apf_debug.js
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -# package_apf--temporary fix for non-workering infra
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -pack_apf:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	mkdir -p build/src
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	mv plugins-client/lib.apf/www/apf-packaged/apf_release.js build/src/apf_release.js
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	node build/r.js -o name=./build/src/apf_release.js out=./plugins-client/lib.apf/www/apf-packaged/apf_release.js baseUrl=.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -# makes ace; at the moment, requires dryice@0.4.2
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -ace:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	cd node_modules/ace; make clean pre_build; ./Makefile.dryice.js minimal
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -# packages core
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -core: ace
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	mkdir -p build/src
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	node build/r.js -o build/core.build.js
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -# generates packed template
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -helper: 
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	node build/packed_helper.js
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -helper_clean:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	mkdir -p build/src
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	node build/packed_helper.js 1
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -# packages ext
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -ext: 
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	node build/r.js -o build/app.build.js
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -# calls dryice on worker & packages it
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -worker: plugins-client/lib.ace/www/worker/worker-language.js
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -plugins-client/lib.ace/www/worker/worker-language.js plugins-client/lib.ace/www/worker/worker-javascript.js : \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        $(wildcard node_modules/ace/*) $(wildcard node_modules/ace/*/*) $(wildcard node_modules/ace/*/*/mode/*) \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        $(wildcard plugins-client/ext.language/*) \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        $(wildcard plugins-client/ext.language/*/*) \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        $(wildcard plugins-client/ext.linereport/*) \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        $(wildcard plugins-client/ext.codecomplete/*) \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        $(wildcard plugins-client/ext.codecomplete/*/*) \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        $(wildcard plugins-client/ext.jslanguage/*) \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        $(wildcard plugins-client/ext.jslanguage/*/*) \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        $(wildcard plugins-client/ext.csslanguage/*) \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        $(wildcard plugins-client/ext.csslanguage/*/*) \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        $(wildcard plugins-client/ext.htmllanguage/*) \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        $(wildcard plugins-client/ext.htmllanguage/*/*) \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        $(wildcard plugins-client/ext.jsinfer/*) \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        $(wildcard plugins-client/ext.jsinfer/*/*) \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        $(wildcard node_modules/treehugger/lib/*) \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        $(wildcard node_modules/treehugger/lib/*/*) \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        $(wildcard node_modules/ace/lib/*) \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        $(wildcard node_modules/ace/*/*) \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Makefile.dryice.js
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	mkdir -p plugins-client/lib.ace/www/worker
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	rm -rf /tmp/c9_worker_build
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	mkdir -p /tmp/c9_worker_build/ext
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	ln -s `pwd`/plugins-client/ext.language /tmp/c9_worker_build/ext/language
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	ln -s `pwd`/plugins-client/ext.codecomplete /tmp/c9_worker_build/ext/codecomplete
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	ln -s `pwd`/plugins-client/ext.jslanguage /tmp/c9_worker_build/ext/jslanguage
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	ln -s `pwd`/plugins-client/ext.csslanguage /tmp/c9_worker_build/ext/csslanguage
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	ln -s `pwd`/plugins-client/ext.htmllanguage /tmp/c9_worker_build/ext/htmllanguage
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	ln -s `pwd`/plugins-client/ext.linereport /tmp/c9_worker_build/ext/linereport
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	ln -s `pwd`/plugins-client/ext.linereport_php /tmp/c9_worker_build/ext/linereport_php
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	node Makefile.dryice.js worker
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	cp node_modules/ace/build/src/worker* plugins-client/lib.ace/www/worker
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -define 
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -ifeq
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -override
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -# copies built ace modes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -mode:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	mkdir -p plugins-client/lib.ace/www/mode
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	cp `find node_modules/ace/build/src | grep -E "mode-[a-zA-Z_0-9]+.js"`  plugins-client/lib.ace/www/mode
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -# copies built ace themes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -theme:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	mkdir -p plugins-client/lib.ace/www/theme
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	cp `find node_modules/ace/build/src | grep -E "theme-[a-zA-Z_0-9]+.js"` plugins-client/lib.ace/www/theme
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -gzip_safe:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	for i in `ls ./plugins-client/lib.packed/www/*.js`; do \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -		gzip -9 -v -c -q -f $$i > $$i.gz ; \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	done
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -gzip:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	for i in `ls ./plugins-client/lib.packed/www/*.js`; do \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -		gzip -9 -v -q -f $$i ; \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	done
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -c9core: apf ace core worker mode theme
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -package_clean: helper_clean c9core ext
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -package: helper c9core ext
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -test check:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	test/run-tests.sh	
                                                                                                                                                                                                                                                                                                                                                                                                                                                              \ No newline at end of file
                                                                                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/demo/kitchen-sink/docs/Nix.nix b/demo/kitchen-sink/docs/Nix.nix
                                                                                                                                                                                                                                                                                                                                                                                                                                                              deleted file mode 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                              index 9476db3b..00000000
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- a/demo/kitchen-sink/docs/Nix.nix
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +++ /dev/null
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -1,57 +0,0 @@
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -{
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  # Name of our deployment
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  network.description = "HelloWorld";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  # Enable rolling back to previous versions of our infrastructure
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  network.enableRollback = true;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  # It consists of a single server named 'helloserver'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  helloserver =
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    # Every server gets passed a few arguments, including a reference
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    # to nixpkgs (pkgs)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    { config, pkgs, ... }:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    let
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      # We import our custom packages from ./default passing pkgs as argument
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      packages = import ./default.nix { pkgs = pkgs; };
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      # This is the nodejs version specified in default.nix
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      nodejs   = packages.nodejs;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      # And this is the application we'd like to deploy
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      app      = packages.app;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    in
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      # We'll be running our application on port 8080, because a regular
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      # user cannot bind to port 80
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      # Then, using some iptables magic we'll forward traffic designated to port 80 to 8080
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      networking.firewall.enable = true;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      # We will open up port 22 (SSH) as well otherwise we're locking ourselves out
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      networking.firewall.allowedTCPPorts = [ 80 8080 22 ];
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      networking.firewall.allowPing = true;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      # Port forwarding using iptables
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      networking.firewall.extraCommands = ''
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      '';
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      # To run our node.js program we're going to use a systemd service
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      # We can configure the service to automatically start on boot and to restart
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      # the process in case it crashes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      systemd.services.helloserver = {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        description = "Hello world application";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        # Start the service after the network is available
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        after = [ "network.target" ];
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        # We're going to run it on port 8080 in production
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        environment = { PORT = "8080"; };
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        serviceConfig = {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -          # The actual command to run
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -          ExecStart = "${nodejs}/bin/node ${app}/server.js";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -          # For security reasons we'll run this process as a special 'nodejs' user
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -          User = "nodejs";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -          Restart = "always";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        };
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      };
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      # And lastly we ensure the user we run our application as is created
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      users.extraUsers = {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        nodejs = { };
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -      };
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    };
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              \ No newline at end of file
                                                                                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/demo/kitchen-sink/docs/scad.scad b/demo/kitchen-sink/docs/OpenSCAD.scad
                                                                                                                                                                                                                                                                                                                                                                                                                                                              similarity index 100%
                                                                                                                                                                                                                                                                                                                                                                                                                                                              rename from demo/kitchen-sink/docs/scad.scad
                                                                                                                                                                                                                                                                                                                                                                                                                                                              rename to demo/kitchen-sink/docs/OpenSCAD.scad
                                                                                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/demo/kitchen-sink/docs/abap.abap b/demo/kitchen-sink/docs/abap.abap
                                                                                                                                                                                                                                                                                                                                                                                                                                                              deleted file mode 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                              index f66bfdfa..00000000
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- a/demo/kitchen-sink/docs/abap.abap
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +++ /dev/null
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -1,36 +0,0 @@
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -***************************************
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -** Program: EXAMPLE                  **
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -** Author: Joe Byte, 07-Jul-2007     **
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -***************************************
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - 
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -REPORT BOOKINGS.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - 
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -* Read flight bookings from the database
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -SELECT * FROM FLIGHTINFO
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  WHERE CLASS = 'Y'       "Y = economy
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  OR    CLASS = 'C'.      "C = business
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -(...)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -REPORT TEST.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -WRITE 'Hello World'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -USERPROMPT = 'Please double-click on a line in the output list ' &
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -             'to see the complete details of the transaction.'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -DATA LAST_EOM    TYPE D.  "last end-of-month date
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - 
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -* Start from today's date
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  LAST_EOM = SY-DATUM.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -* Set characters 6 and 7 (0-relative) of the YYYYMMDD string to "01",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -* giving the first day of the current month
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  LAST_EOM+6(2) = '01'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -* Subtract one day
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  LAST_EOM = LAST_EOM - 1.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - 
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  WRITE: 'Last day of previous month was', LAST_EOM.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -DATA : BEGIN OF I_VBRK OCCURS 0,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -         VBELN LIKE VBRK-VBELN,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -         ZUONR LIKE VBRK-ZUONR,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -       END OF I_VBRK.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              \ No newline at end of file
                                                                                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/demo/kitchen-sink/docs/abc.abc b/demo/kitchen-sink/docs/abc.abc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              deleted file mode 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                              index d8ac326e..00000000
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- a/demo/kitchen-sink/docs/abc.abc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +++ /dev/null
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -1,171 +0,0 @@
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -%abc-2.1
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -H:This file contains some example English tunes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -% note that the comments (like this one) are to highlight usages
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -%  and would not normally be included in such detail
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -O:England             % the origin of all tunes is England
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -X:1                   % tune no 1
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -T:Dusty Miller, The   % title
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -T:Binny's Jig         % an alternative title
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -C:Trad.               % traditional
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -R:DH                  % double hornpipe
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -M:3/4                 % meter
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -K:G                   % key
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -B>cd BAG|FA Ac BA|B>cd BAG|DG GB AG:|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Bdd gfg|aA Ac BA|Bdd gfa|gG GB AG:|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -BG G/2G/2G BG|FA Ac BA|BG G/2G/2G BG|DG GB AG:|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -W:Hey, the dusty miller, and his dusty coat;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -W:He will win a shilling, or he spend a groat.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -W:Dusty was the coat, dusty was the colour;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -W:Dusty was the kiss, that I got frae the miller.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -X:2
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -T:Old Sir Simon the King
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -C:Trad.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -S:Offord MSS          % from Offord manuscript
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -N:see also Playford   % reference note
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -M:9/8
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -R:SJ                  % slip jig
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -N:originally in C     % transcription note
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -K:G
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -D|GFG GAG G2D|GFG GAG F2D|EFE EFE EFG|A2G F2E D2:|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -D|GAG GAB d2D|GAG GAB c2D|[1 EFE EFE EFG|[A2G] F2E D2:|\ % no line-break in score
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -M:12/8                % change of meter
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[2 E2E EFE E2E EFG|\  % no line-break in score
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -M:9/8                 % change of meter
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -A2G F2E D2|]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -X:3
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -T:William and Nancy
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -T:New Mown Hay
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -T:Legacy, The
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -C:Trad.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -O:England; Gloucs; Bledington % place of origin
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -B:Sussex Tune Book            % can be found in these books
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -B:Mally's Cotswold Morris vol.1 2
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -D:Morris On                   % can be heard on this record
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -P:(AB)2(AC)2A                 % play the parts in this order
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -M:6/8
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -K:G                        
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[P:A] D|"G"G2G GBd|"C"e2e "G"dBG|"D7"A2d "G"BAG|"C"E2"D7"F "G"G2:|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[P:B] d|"G"e2d B2d|"C"gfe "G"d2d| "G"e2d    B2d|"C"gfe    "D7"d2c|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        "G"B2B Bcd|"C"e2e "G"dBG|"D7"A2d "G"BAG|"C"E2"D7"F "G"G2:|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -% changes of meter, using inline fields
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[T:Slows][M:4/4][L:1/4][P:C]"G"d2|"C"e2 "G"d2|B2 d2|"Em"gf "A7"e2|"D7"d2 "G"d2|\
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -       "C"e2 "G"d2|[M:3/8][L:1/8] "G"B2 d |[M:6/8] "C"gfe "D7"d2c|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        "G"B2B Bcd|"C"e2e "G"dBG|"D7"A2d "G"BAG|"C"E2"D7"F "G"G2:|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -X:4
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -T:South Downs Jig
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -R:jig
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -S:Robert Harbron
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -M:6/8
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -L:1/8
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -K:G
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|: d | dcA G3 | EFG AFE | DEF GAB | cde d2d |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -dcA G3 | EFG AFE | DEF GAB | cAF G2 :|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -B | Bcd e2c | d2B c2A | Bcd e2c | [M:9/8]d2B c2B A3 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[M:6/8]DGF E3 | cBA FED | DEF GAB |1 cAF G2 :|2 cAF G3 |]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -X:5
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -T:Atholl Brose
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -% in this example, which reproduces Highland Bagpipe gracing,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -%  the large number of grace notes mean that it is more convenient to be specific about
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -%  score line-breaks (using the $ symbol), rather than using code line breaks to indicate them
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -I:linebreak $
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -K:D
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -{gcd}c<{e}A {gAGAG}A2 {gef}e>A {gAGAG}Ad|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -{gcd}c<{e}A {gAGAG}A>e {ag}a>f {gef}e>d|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -{gcd}c<{e}A {gAGAG}A2 {gef}e>A {gAGAG}Ad|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -{g}c/d/e {g}G>{d}B {gf}gG {dc}d>B:|$
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -{g}ce {ag}a>e {gf}g>e|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -{g}ce {ag}a2 {GdG}a>d|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -{g}ce {ag}a>e {gf}g>f|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -{gef}e>d {gf}g>d {gBd}B<{e}G {dc}d>B|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -{g}ce {ag}a>e {gf}g>e|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -{g}ce {ag}a2 {GdG}ad|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -{g}c<{GdG}e {gf}ga {f}g>e {g}f>d|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -{g}e/f/g {Gdc}d>c {gBd}B<{e}G {dc}d2|]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -X:6
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -T:Untitled Reel
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -C:Trad.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -K:D
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -eg|a2ab ageg|agbg agef|g2g2 fgag|f2d2 d2:|\
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -ed|cecA B2ed|cAcA E2ed|cecA B2ed|c2A2 A2:|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -K:G
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AB|cdec BcdB|ABAF GFE2|cdec BcdB|c2A2 A2:|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -X:7
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -T:Kitchen Girl
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -C:Trad.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -K:D
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[c4a4] [B4g4]|efed c2cd|e2f2 gaba|g2e2 e2fg|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -a4 g4|efed cdef|g2d2 efed|c2A2 A4:|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -K:G
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -ABcA BAGB|ABAG EDEG|A2AB c2d2|e3f edcB|ABcA BAGB|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -ABAG EGAB|cBAc BAG2|A4 A4:|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -%abc-2.1
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -%%pagewidth      21cm
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -%%pageheight     29.7cm
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -%%topspace       0.5cm
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -%%topmargin      1cm
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -%%botmargin      0cm
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -%%leftmargin     1cm
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -%%rightmargin    1cm
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -%%titlespace     0cm
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -%%titlefont      Times-Bold 32
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -%%subtitlefont   Times-Bold 24
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -%%composerfont   Times 16
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -%%vocalfont      Times-Roman 14
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -%%staffsep       60pt
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -%%sysstaffsep    20pt
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -%%musicspace     1cm
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -%%vocalspace     5pt
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -%%measurenb      0
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -%%barsperstaff   5
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -%%scale          0.7
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -X: 1
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -T: Canzonetta a tre voci
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -C: Claudio Monteverdi (1567-1643)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -M: C
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -L: 1/4
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Q: "Andante mosso" 1/4 = 110
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -%%score [1 2 3]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -V: 1 clef=treble name="Soprano"sname="A"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -V: 2 clef=treble name="Alto"   sname="T"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -V: 3 clef=bass middle=d name="Tenor"  sname="B"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -%%MIDI program 1 75 % recorder
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -%%MIDI program 2 75
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -%%MIDI program 3 75
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -K: Eb
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -% 1 - 4
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[V: 1] |:z4  |z4  |f2ec         |_ddcc        |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -w: Son que-sti~i cre-spi cri-ni~e
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -w: Que-sti son gli~oc-chi che mi-
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[V: 2] |:c2BG|AAGc|(F/G/A/B/)c=A|B2AA         |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -w: Son que-sti~i cre-spi cri-ni~e que - - - - sto~il vi-so e
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -w: Que-sti son~gli oc-chi che mi-ran - - - - do fi-so mi-
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[V: 3] |:z4  |f2ec|_ddcf        |(B/c/_d/e/)ff|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -w: Son que-sti~i cre-spi cri-ni~e que - - - - sto~il
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -w: Que-sti son~gli oc-chi che mi-ran - - - - do
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -% 5 - 9
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[V: 1] cAB2     |cAAA |c3B|G2!fermata!Gz ::e4|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -w: que-sto~il vi-so ond' io ri-man-go~uc-ci-so. Deh,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -w: ran-do fi-so, tut-to re-stai con-qui-so.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[V: 2] AAG2     |AFFF |A3F|=E2!fermata!Ez::c4|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -w: que-sto~il vi-so ond' io ri-man-go~uc-ci-so. Deh,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -w: ran-do fi-so tut-to re-stai con-qui-so.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[V: 3] (ag/f/e2)|A_ddd|A3B|c2!fermata!cz ::A4|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -w: vi - - - so ond' io ti-man-go~uc-ci-so. Deh,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -w: fi - - - so tut-to re-stai con-qui-so.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -% 10 - 15
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[V: 1] f_dec |B2c2|zAGF  |\
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -w: dim-me-lo ben mi-o, che que-sto\
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -=EFG2          |1F2z2:|2F8|] % more notes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -w: sol de-si-o_. % more lyrics
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[V: 2] ABGA  |G2AA|GF=EF |(GF3/2=E//D//E)|1F2z2:|2F8|]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -w: dim-me-lo ben mi-o, che que-sto sol de-si - - - - o_.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[V: 3] _dBc>d|e2AF|=EFc_d|c4             |1F2z2:|2F8|]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -w: dim-me-lo ben mi-o, che que-sto sol de-si-o_.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              \ No newline at end of file
                                                                                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/demo/kitchen-sink/docs/actionscript.as b/demo/kitchen-sink/docs/actionscript.as
                                                                                                                                                                                                                                                                                                                                                                                                                                                              deleted file mode 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                              index ffe21fbf..00000000
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- a/demo/kitchen-sink/docs/actionscript.as
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +++ /dev/null
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -1,51 +0,0 @@
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -package code
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -{
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    /*****************************************
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	 * based on textmate actionscript bundle
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	 ****************************************/
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	 
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	import fl.events.SliderEvent;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	public class Foo extends MovieClip
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	{
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -		//*************************
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -		// Properties:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -		
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -		public var activeSwatch:MovieClip;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -		
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -		// Color offsets
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -		public var c1:Number = 0;	// R
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -		
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -		//*************************
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -		// Constructor:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -		
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -		public function Foo()
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -		{
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -			// Respond to mouse events
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -			swatch1_btn.addEventListener(MouseEvent.CLICK,swatchHandler,false,0,false);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -			previewBox_btn.addEventListener(MouseEvent.MOUSE_DOWN,dragPressHandler);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -			
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -			// Respond to drag events
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -			red_slider.addEventListener(SliderEvent.THUMB_DRAG,sliderHandler);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -			
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -			// Draw a frame later
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -			addEventListener(Event.ENTER_FRAME,draw);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -		}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -		protected function clickHandler(event:MouseEvent):void
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -		{
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -			car.transform.colorTransform = new ColorTransform(0,0,0,1,c1,c2,c3);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -		}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -		
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -		protected function changeRGBHandler(event:Event):void
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -		{
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -			c1 = Number(c1_txt.text);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -			if(!(c1>=0)){
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -				c1 = 0;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -			}			
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -			
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -			updateSliders();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -		}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              \ No newline at end of file
                                                                                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/demo/kitchen-sink/docs/ada.ada b/demo/kitchen-sink/docs/ada.ada
                                                                                                                                                                                                                                                                                                                                                                                                                                                              deleted file mode 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                              index 90e027f0..00000000
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- a/demo/kitchen-sink/docs/ada.ada
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +++ /dev/null
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -1,5 +0,0 @@
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -with Ada.Text_IO; use Ada.Text_IO;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -procedure Hello is
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -begin
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Put_Line("Hello, world!");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -end Hello;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              \ No newline at end of file
                                                                                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/demo/kitchen-sink/docs/asciidoc.asciidoc b/demo/kitchen-sink/docs/asciidoc.asciidoc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              deleted file mode 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                              index 8cddab5d..00000000
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- a/demo/kitchen-sink/docs/asciidoc.asciidoc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +++ /dev/null
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -1,6040 +0,0 @@
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc User Guide
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -===================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Stuart Rackham 
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -:Author Initials: SJR
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -:toc:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -:icons:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -:numbered:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -:website: http://www.methods.co.nz/asciidoc/
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc is a text document format for writing notes, documentation,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -articles, books, ebooks, slideshows, web pages, blogs and UNIX man
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -pages.  AsciiDoc files can be translated to many formats including
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -HTML, PDF, EPUB, man page.  AsciiDoc is highly configurable: both the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc source file syntax and the backend output markups (which can
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -be almost any type of SGML/XML markup) can be customized and extended
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -by the user.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.This document
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -**********************************************************************
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -This is an overly large document, it probably needs to be refactored
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -into a Tutorial, Quick Reference and Formal Reference.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -If you're new to AsciiDoc read this section and the <> section and take a look at the example AsciiDoc (`*.txt`)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -source files in the distribution `doc` directory.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -**********************************************************************
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Introduction
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc is a plain text human readable/writable document format that
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -can be translated to DocBook or HTML using the asciidoc(1) command.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -You can then either use asciidoc(1) generated HTML directly or run
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -asciidoc(1) DocBook output through your favorite DocBook toolchain or
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -use the AsciiDoc a2x(1) toolchain wrapper to produce PDF, EPUB, DVI,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -LaTeX, PostScript, man page, HTML and text formats.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The AsciiDoc format is a useful presentation format in its own right:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc markup is simple, intuitive and as such is easily proofed and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -edited.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc is light weight: it consists of a single Python script and a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -bunch of configuration files. Apart from asciidoc(1) and a Python
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -interpreter, no other programs are required to convert AsciiDoc text
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -files to DocBook or HTML. See <>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -below.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Text markup conventions tend to be a matter of (often strong) personal
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -preference: if the default syntax is not to your liking you can define
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -your own by editing the text based asciidoc(1) configuration files.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -You can also create configuration files to translate AsciiDoc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -documents to almost any SGML/XML markup.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -asciidoc(1) comes with a set of configuration files to translate
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc articles, books and man pages to HTML or DocBook backend
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -formats.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.My AsciiDoc Itch
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -**********************************************************************
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -DocBook has emerged as the de facto standard Open Source documentation
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -format. But DocBook is a complex language, the markup is difficult to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -read and even more difficult to write directly -- I found I was
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -spending more time typing markup tags, consulting reference manuals
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -and fixing syntax errors, than I was writing the documentation.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -**********************************************************************
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X6]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Getting Started
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Installing AsciiDoc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -See the `README` and `INSTALL` files for install prerequisites and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -procedures. Packagers take a look at <>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X11]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Example AsciiDoc Documents
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The best way to quickly get a feel for AsciiDoc is to view the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc web site and/or distributed examples:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Take a look at the linked examples on the AsciiDoc web site home
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  page {website}.  Press the 'Page Source' sidebar menu item to view
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  corresponding AsciiDoc source.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Read the `*.txt` source files in the distribution `./doc` directory
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  along with the corresponding HTML and DocBook XML files.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc Document Types
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -There are three types of AsciiDoc documents: article, book and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -manpage. All document types share the same AsciiDoc format with some
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -minor variations. If you are familiar with DocBook you will have
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -noticed that AsciiDoc document types correspond to the same-named
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -DocBook document types.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Use the asciidoc(1) `-d` (`--doctype`) option to specify the AsciiDoc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -document type -- the default document type is 'article'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -By convention the `.txt` file extension is used for AsciiDoc document
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -source files.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -article
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Used for short documents, articles and general documentation.  See the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc distribution `./doc/article.txt` example.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc defines standard DocBook article frontmatter and backmatter
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<> (appendix, abstract, bibliography,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -glossary, index).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -book
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Books share the same format as articles, with the following
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -differences:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The part titles in multi-part books are <>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  (same level as book title).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Some sections are book specific e.g. preface and colophon.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Book documents will normally be used to produce DocBook output since
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -DocBook processors can automatically generate footnotes, table of
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -contents, list of tables, list of figures, list of examples and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -indexes.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc defines standard DocBook book frontmatter and backmatter
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<> (appendix, dedication, preface,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -bibliography, glossary, index, colophon).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Example book documents
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Book::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  The `./doc/book.txt` file in the AsciiDoc distribution.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Multi-part book::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  The `./doc/book-multi.txt` file in the AsciiDoc distribution.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -manpage
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Used to generate roff format UNIX manual pages.  AsciiDoc manpage
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -documents observe special header title and section naming conventions
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- see the <> section for details.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc defines the 'synopsis' <> to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -generate the DocBook `refsynopsisdiv` section.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -See also the asciidoc(1) man page source (`./doc/asciidoc.1.txt`) from
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -the AsciiDoc distribution.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X5]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc Backends
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The asciidoc(1) command translates an AsciiDoc formatted file to the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -backend format specified by the `-b` (`--backend`) command-line
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -option. asciidoc(1) itself has little intrinsic knowledge of backend
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -formats, all translation rules are contained in customizable cascading
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -configuration files. Backend specific attributes are listed in the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<> section.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -docbook45::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Outputs DocBook XML 4.5 markup.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -html4::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  This backend generates plain HTML 4.01 Transitional markup.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -xhtml11::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  This backend generates XHTML 1.1 markup styled with CSS2. Output
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  files have an `.html` extension.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -html5::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  This backend generates HTML 5 markup, apart from the inclusion of
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  <> it is functionally identical to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  the 'xhtml11' backend.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -slidy::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Use this backend to generate self-contained
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  http://www.w3.org/Talks/Tools/Slidy2/[Slidy] HTML slideshows for
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  your web browser from AsciiDoc documents. The Slidy backend is
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  documented in the distribution `doc/slidy.txt` file and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {website}slidy.html[online].
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -wordpress::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  A minor variant of the 'html4' backend to support
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  http://srackham.wordpress.com/blogpost1/[blogpost].
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -latex::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Experimental LaTeX backend.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Backend Aliases
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Backend aliases are alternative names for AsciiDoc backends.  AsciiDoc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -comes with two backend aliases: 'html' (aliased to 'xhtml11') and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'docbook' (aliased to 'docbook45').
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -You can assign (or reassign) backend aliases by setting an AsciiDoc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -attribute named like `backend-alias-` to an AsciiDoc backend
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -name. For example, the following backend alias attribute definitions
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -appear in the `[attributes]` section of the global `asciidoc.conf`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -configuration file:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  backend-alias-html=xhtml11
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  backend-alias-docbook=docbook45
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X100]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Backend Plugins
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The asciidoc(1) `--backend` option is also used to install and manage
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -backend <>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- A backend plugin is used just like the built-in backends.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Backend plugins <> over built-in backends with
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  the same name.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- You can use the `{asciidoc-confdir}` <> to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  refer to the built-in backend configuration file location from
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  backend plugin configuration files.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- You can use the `{backend-confdir}` <> to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  refer to the backend plugin configuration file location.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- By default backends plugins are installed in
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  `$HOME/.asciidoc/backends/` where `` is the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  backend name.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -DocBook
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc generates 'article', 'book' and 'refentry'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -http://www.docbook.org/[DocBook] documents (corresponding to the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc 'article', 'book' and 'manpage' document types).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Most Linux distributions come with conversion tools (collectively
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -called a toolchain) for <> to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -presentation formats such as Postscript, HTML, PDF, EPUB, DVI,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -PostScript, LaTeX, roff (the native man page format), HTMLHelp,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -JavaHelp and text.  There are also programs that allow you to view
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -DocBook files directly, for example http://live.gnome.org/Yelp[Yelp]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -(the GNOME help viewer).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X12]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Converting DocBook to other file formats
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -DocBook files are validated, parsed and translated various
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -presentation file formats using a combination of applications
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -collectively called a DocBook 'tool chain'. The function of a tool
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -chain is to read the DocBook markup (produced by AsciiDoc) and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -transform it to a presentation format (for example HTML, PDF, HTML
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Help, EPUB, DVI, PostScript, LaTeX).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -A wide range of user output format requirements coupled with a choice
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -of available tools and stylesheets results in many valid tool chain
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -combinations.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X43]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -a2x Toolchain Wrapper
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -One of the biggest hurdles for new users is installing, configuring
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -and using a DocBook XML toolchain. `a2x(1)` can help -- it's a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -toolchain wrapper command that will generate XHTML (chunked and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -unchunked), PDF, EPUB, DVI, PS, LaTeX, man page, HTML Help and text
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -file outputs from an AsciiDoc text file.  `a2x(1)` does all the grunt
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -work associated with generating and sequencing the toolchain commands
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -and managing intermediate and output files.  `a2x(1)` also optionally
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -deploys admonition and navigation icons and a CSS stylesheet. See the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`a2x(1)` man page for more details. In addition to `asciidoc(1)` you
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -also need <>, <> and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -optionally: <> or <> (to generate PDF);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`w3m(1)` or `lynx(1)` (to generate text).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The following examples generate `doc/source-highlight-filter.pdf` from
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -the AsciiDoc `doc/source-highlight-filter.txt` source file. The first
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -example uses `dblatex(1)` (the default PDF generator) the second
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -example forces FOP to be used:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  $ a2x -f pdf doc/source-highlight-filter.txt
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  $ a2x -f pdf --fop doc/source-highlight-filter.txt
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -See the `a2x(1)` man page for details.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -TIP: Use the `--verbose` command-line option to view executed
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -toolchain commands.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -HTML generation
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc produces nicely styled HTML directly without requiring a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -DocBook toolchain but there are also advantages in going the DocBook
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -route:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- HTML from DocBook can optionally include automatically generated
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  indexes, tables of contents, footnotes, lists of figures and tables.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- DocBook toolchains can also (optionally) generate separate (chunked)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  linked HTML pages for each document section.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Toolchain processing performs link and document validity checks.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- If the DocBook 'lang' attribute is set then things like table of
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  contents, figure and table captions and admonition captions will be
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  output in the specified language (setting the AsciiDoc 'lang'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  attribute sets the DocBook 'lang' attribute).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -On the other hand, HTML output directly from AsciiDoc is much faster,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -is easily customized and can be used in situations where there is no
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -suitable DocBook toolchain (for example, see the {website}[AsciiDoc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -website]).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -PDF generation
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -There are two commonly used tools to generate PDFs from DocBook,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<> and <>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.dblatex or FOP?
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- 'dblatex' is easier to install, there's zero configuration
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  required and no Java VM to install -- it just works out of the box.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- 'dblatex' source code highlighting and numbering is superb.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- 'dblatex' is easier to use as it converts DocBook directly to PDF
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  whereas before using 'FOP' you have to convert DocBook to XML-FO
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  using <>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- 'FOP' is more feature complete (for example, callouts are processed
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  inside literal layouts) and arguably produces nicer looking output.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -HTML Help generation
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -. Convert DocBook XML documents to HTML Help compiler source files
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  using <> and <>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -. Convert the HTML Help source (`.hhp` and `.html`) files to HTML Help
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  (`.chm`) files using the <>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Toolchain components summary
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    Converts AsciiDoc (`.txt`) files to DocBook XML (`.xml`) files.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X13]]http://docbook.sourceforge.net/projects/xsl/[DocBook XSL Stylesheets]::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  These are a set of XSL stylesheets containing rules for converting
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  DocBook XML documents to HTML, XSL-FO, manpage and HTML Help files.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  The stylesheets are used in conjunction with an XML parser such as
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  <>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X40]]http://www.xmlsoft.org[xsltproc]::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  An XML parser for applying XSLT stylesheets (in our case the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  <>) to XML documents.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X31]]http://dblatex.sourceforge.net/[dblatex]::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Generates PDF, DVI, PostScript and LaTeX formats directly from
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  DocBook source via the intermediate LaTeX typesetting language --
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  uses <>, <> and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  `latex(1)`.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X14]]http://xml.apache.org/fop/[FOP]::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  The Apache Formatting Objects Processor converts XSL-FO (`.fo`)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  files to PDF files.  The XSL-FO files are generated from DocBook
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  source files using <> and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  <>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X67]]Microsoft Help Compiler::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  The Microsoft HTML Help Compiler (`hhc.exe`) is a command-line tool
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  that converts HTML Help source files to a single HTML Help (`.chm`)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  file. It runs on MS Windows platforms and can be downloaded from
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  http://www.microsoft.com.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc dblatex configuration files
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The AsciiDoc distribution `./dblatex` directory contains
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`asciidoc-dblatex.xsl` (customized XSL parameter settings) and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`asciidoc-dblatex.sty` (customized LaTeX settings). These are examples
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -of optional <> output customization and are used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc DocBook XSL Stylesheets drivers
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -You will have noticed that the distributed HTML and HTML Help
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -documentation files (for example `./doc/asciidoc.html`) are not the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -plain outputs produced using the default 'DocBook XSL Stylesheets'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -configuration.  This is because they have been processed using
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -customized DocBook XSL Stylesheets along with (in the case of HTML
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -outputs) the custom `./stylesheets/docbook-xsl.css` CSS stylesheet.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -You'll find the customized DocBook XSL drivers along with additional
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -documentation in the distribution `./docbook-xsl` directory. The
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -examples that follow are executed from the distribution documentation
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -(`./doc`) directory. These drivers are also used by <>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`common.xsl`::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    Shared driver parameters.  This file is not used directly but is
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    included in all the following drivers.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`chunked.xsl`::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    Generate chunked XHTML (separate HTML pages for each document
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    section) in the `./doc/chunked` directory. For example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    $ python ../asciidoc.py -b docbook asciidoc.txt
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    $ xsltproc --nonet ../docbook-xsl/chunked.xsl asciidoc.xml
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`epub.xsl`::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    Used by <> to generate EPUB formatted documents.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`fo.xsl`::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    Generate XSL Formatting Object (`.fo`) files for subsequent PDF
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    file generation using FOP. For example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    $ python ../asciidoc.py -b docbook article.txt
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    $ xsltproc --nonet ../docbook-xsl/fo.xsl article.xml > article.fo
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    $ fop article.fo article.pdf
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`htmlhelp.xsl`::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    Generate Microsoft HTML Help source files for the MS HTML Help
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    Compiler in the `./doc/htmlhelp` directory. This example is run on
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    MS Windows from a Cygwin shell prompt:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    $ python ../asciidoc.py -b docbook asciidoc.txt
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    $ xsltproc --nonet ../docbook-xsl/htmlhelp.xsl asciidoc.xml
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    $ c:/Program\ Files/HTML\ Help\ Workshop/hhc.exe htmlhelp.hhp
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`manpage.xsl`::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    Generate a `roff(1)` format UNIX man page from a DocBook XML
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    'refentry' document. This example generates an `asciidoc.1` man
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    page file:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    $ python ../asciidoc.py -d manpage -b docbook asciidoc.1.txt
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    $ xsltproc --nonet ../docbook-xsl/manpage.xsl asciidoc.1.xml
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`xhtml.xsl`::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    Convert a DocBook XML file to a single XHTML file. For example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    $ python ../asciidoc.py -b docbook asciidoc.txt
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    $ xsltproc --nonet ../docbook-xsl/xhtml.xsl asciidoc.xml > asciidoc.html
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -If you want to see how the complete documentation set is processed
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -take a look at the A-A-P script `./doc/main.aap`.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Generating Plain Text Files
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc does not have a text backend (for most purposes AsciiDoc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -source text is fine), however you can convert AsciiDoc text files to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -formatted text using the AsciiDoc <> toolchain wrapper
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -utility.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X35]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -HTML5 and XHTML 1.1
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The 'xhtml11' and 'html5' backends embed or link CSS and JavaScript
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -files in their outputs, there is also a <> plugin
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -framework.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- If the AsciiDoc 'linkcss' attribute is defined then CSS and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  JavaScript files are linked to the output document, otherwise they
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  are embedded (the default behavior).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The default locations for CSS and JavaScript files can be changed by
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  setting the AsciiDoc 'stylesdir' and 'scriptsdir' attributes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  respectively.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The default locations for embedded and linked files differ and are
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  calculated at different times -- embedded files are loaded when
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  asciidoc(1) generates the output document, linked files are loaded
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  by the browser when the user views the output document.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Embedded files are automatically inserted in the output files but
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  you need to manually copy linked CSS and Javascript files from
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  AsciiDoc <> to the correct location
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  relative to the output document.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Stylesheet file locations
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[cols="3*",frame="topbot",options="header"]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|'stylesdir' attribute
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|Linked location ('linkcss' attribute defined)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|Embedded location ('linkcss' attribute undefined)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|Undefined (default).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|Same directory as the output document.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|`stylesheets` subdirectory in the AsciiDoc configuration directory
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -(the directory containing the backend conf file).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|Absolute or relative directory name.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|Absolute or relative to the output document.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|Absolute or relative to the AsciiDoc configuration directory (the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -directory containing the backend conf file).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.JavaScript file locations
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[cols="3*",frame="topbot",options="header"]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|'scriptsdir' attribute
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|Linked location ('linkcss' attribute defined)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|Embedded location ('linkcss' attribute undefined)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|Undefined (default).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|Same directory as the output document.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|`javascripts` subdirectory in the AsciiDoc configuration directory
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -(the directory containing the backend conf file).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|Absolute or relative directory name.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|Absolute or relative to the output document.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|Absolute or relative to the AsciiDoc configuration directory (the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -directory containing the backend conf file).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X99]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Themes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The AsciiDoc 'theme' attribute is used to select an alternative CSS
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -stylesheet and to optionally include additional JavaScript code.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Theme files reside in an AsciiDoc <>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  named `themes//` (where `` is the the theme name set
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  by the 'theme' attribute). asciidoc(1) sets the 'themedir' attribute
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  to the theme directory path name.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The 'theme' attribute can also be set using the asciidoc(1)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  `--theme` option, the `--theme` option can also be used to manage
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  theme <>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- AsciiDoc ships with two themes: 'flask' and 'volnitsky'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The `.css` file replaces the default `asciidoc.css` CSS file.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The `.js` file is included in addition to the default
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  `asciidoc.js` JavaScript file.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- If the <> attribute is defined then icons are loaded
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  from the theme `icons` sub-directory if it exists (i.e.  the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  'iconsdir' attribute is set to theme `icons` sub-directory path).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Embedded theme files are automatically inserted in the output files
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  but you need to manually copy linked CSS and Javascript files to the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  location of the output documents.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Linked CSS and JavaScript theme files are linked to the same linked
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  locations as <>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -For example, the command-line option `--theme foo` (or `--attribute
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -theme=foo`) will cause asciidoc(1) to search <<"X27","configuration
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -file locations 1, 2 and 3">> for a sub-directory called `themes/foo`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -containing the stylesheet `foo.css` and optionally a JavaScript file
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -name `foo.js`.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Document Structure
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -An AsciiDoc document consists of a series of <>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -starting with an optional document Header, followed by an optional
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Preamble, followed by zero or more document Sections.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Almost any combination of zero or more elements constitutes a valid
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc document: documents can range from a single sentence to a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -multi-part book.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Block Elements
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Block elements consist of one or more lines of text and may contain
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -other block elements.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The AsciiDoc block structure can be informally summarized as follows
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -footnote:[This is a rough structural guide, not a rigorous syntax
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -definition]:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Document      ::= (Header?,Preamble?,Section*)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Header        ::= (Title,(AuthorInfo,RevisionInfo?)?)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  AuthorInfo    ::= (FirstName,(MiddleName?,LastName)?,EmailAddress?)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  RevisionInfo  ::= (RevisionNumber?,RevisionDate,RevisionRemark?)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Preamble      ::= (SectionBody)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Section       ::= (Title,SectionBody?,(Section)*)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  SectionBody   ::= ((BlockTitle?,Block)|BlockMacro)+
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Block         ::= (Paragraph|DelimitedBlock|List|Table)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  List          ::= (BulletedList|NumberedList|LabeledList|CalloutList)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  BulletedList  ::= (ListItem)+
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  NumberedList  ::= (ListItem)+
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  CalloutList   ::= (ListItem)+
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  LabeledList   ::= (ListEntry)+
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ListEntry     ::= (ListLabel,ListItem)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ListLabel     ::= (ListTerm+)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ListItem      ::= (ItemText,(List|ListParagraph|ListContinuation)*)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Where:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- '?' implies zero or one occurrence, '+' implies one or more
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  occurrences, '*' implies zero or more occurrences.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- All block elements are separated by line boundaries.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- `BlockId`, `AttributeEntry` and `AttributeList` block elements (not
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  shown) can occur almost anywhere.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- There are a number of document type and backend specific
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  restrictions imposed on the block syntax.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The following elements cannot contain blank lines: Header, Title,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Paragraph, ItemText.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- A ListParagraph is a Paragraph with its 'listelement' option set.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- A ListContinuation is a <>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X95]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Header
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The Header contains document meta-data, typically title plus optional
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -authorship and revision information:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The Header is optional, but if it is used it must start with a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  document <>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Optional Author and Revision information immediately follows the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  header title.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The document header must be separated from the remainder of the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  document by one or more blank lines and cannot contain blank lines.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The header can include comments.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The header can include <>, typically
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  'doctype', 'lang', 'encoding', 'icons', 'data-uri', 'toc',
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  'numbered'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Header attributes are overridden by command-line attributes.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- If the header contains non-UTF-8 characters then the 'encoding' must
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  precede the header (either in the document or on the command-line).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Here's an example AsciiDoc document header:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Writing Documentation using AsciiDoc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ====================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Joe Bloggs 
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  v2.0, February 2003:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Rewritten for version 2 release.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The author information line contains the author's name optionally
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -followed by the author's email address. The author's name is formatted
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -like:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  firstname[ [middlename ]lastname][ ]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -i.e. a first name followed by optional middle and last names followed
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -by an email address in that order.  Multi-word first, middle and last
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -names can be entered using the underscore as a word separator.  The
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -email address comes last and must be enclosed in angle <> brackets.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Here a some examples of author information lines:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Joe Bloggs 
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Joe Bloggs
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Vincent Willem van_Gogh
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -If the author line does not match the above specification then the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -entire author line is treated as the first name.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The optional revision information line follows the author information
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -line. The revision information can be one of two formats:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -. An optional document revision number followed by an optional
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  revision date followed by an optional revision remark:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -+
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ---
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  * If the revision number is specified it must be followed by a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    comma.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  * The revision number must contain at least one numeric character.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  * Any non-numeric characters preceding the first numeric character
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    will be dropped.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  * If a revision remark is specified it must be preceded by a colon.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    The revision remark extends from the colon up to the next blank
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    line, attribute entry or comment and is subject to normal text
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    substitutions.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  * If a revision number or remark has been set but the revision date
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    has not been set then the revision date is set to the value of the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    'docdate' attribute.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Examples:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  v2.0, February 2003
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  February 2003
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  v2.0,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  v2.0, February 2003: Rewritten for version 2 release.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  February 2003: Rewritten for version 2 release.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  v2.0,: Rewritten for version 2 release.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  :Rewritten for version 2 release.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ---
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -. The revision information line can also be an RCS/CVS/SVN $Id$
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  marker:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -+
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ---
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  * AsciiDoc extracts the 'revnumber', 'revdate', and 'author'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    attributes from the $Id$ revision marker and displays them in the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    document header.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  * If an $Id$ revision marker is used the header author line can be
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    omitted.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  $Id: mydoc.txt,v 1.5 2009/05/17 17:58:44 jbloggs Exp $
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ---
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -You can override or set header parameters by passing 'revnumber',
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'revremark', 'revdate', 'email', 'author', 'authorinitials',
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'firstname' and 'lastname' attributes using the asciidoc(1) `-a`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -(`--attribute`) command-line option. For example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  $ asciidoc -a revdate=2004/07/27 article.txt
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Attribute entries can also be added to the header for substitution in
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -the header template with <> elements.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The 'title' element in HTML outputs is set to the AsciiDoc document
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -title, you can set it to a different value by including a 'title'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -attribute entry in the document header.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X87]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Additional document header information
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc has two mechanisms for optionally including additional
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -meta-data in the header of the output document:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'docinfo' configuration file sections::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -If a <> section named 'docinfo' has been loaded
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -then it will be included in the document header. Typically the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'docinfo' section name will be prefixed with a '+' character so that it
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -is appended to (rather than replace) other 'docinfo' sections.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'docinfo' files::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Two docinfo files are recognized: one named `docinfo` and a second
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -named like the AsciiDoc source file with a `-docinfo` suffix.  For
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -example, if the source document is called `mydoc.txt` then the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -document information files would be `docinfo.xml` and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`mydoc-docinfo.xml` (for DocBook outputs) and `docinfo.html` and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`mydoc-docinfo.html` (for HTML outputs).  The <> attributes control which docinfo files are included in
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -the output files.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The contents docinfo templates and files is dependent on the type of
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -output:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -HTML::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Valid 'head' child elements. Typically 'style' and 'script' elements
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  for CSS and JavaScript inclusion.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -DocBook::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Valid 'articleinfo' or 'bookinfo' child elements.  DocBook defines
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  numerous elements for document meta-data, for example: copyrights,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  document history and authorship information.  See the DocBook
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  `./doc/article-docinfo.xml` example that comes with the AsciiDoc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  distribution.  The rendering of meta-data elements (or not) is
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  DocBook processor dependent.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X86]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Preamble
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The Preamble is an optional untitled section body between the document
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Header and the first Section title.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Sections
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -In addition to the document title (level 0), AsciiDoc supports four
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -section levels: 1 (top) to 4 (bottom).  Section levels are delimited
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -by section <>.  Sections are translated using
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -configuration file <>. AsciiDoc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -generates the following <> specifically for
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -use in section markup templates:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -level::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The `level` attribute is the section level number, it is normally just
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -the <> level number (1..4). However, if the `leveloffset`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -attribute is defined it will be added to the `level` attribute. The
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`leveloffset` attribute is useful for <>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -sectnum::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The `-n` (`--section-numbers`) command-line option generates the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`sectnum` (section number) attribute.  The `sectnum` attribute is used
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -for section numbers in HTML outputs (DocBook section numbering are
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -handled automatically by the DocBook toolchain commands).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X93]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Section markup templates
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -^^^^^^^^^^^^^^^^^^^^^^^^
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Section markup templates specify output markup and are defined in
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc configuration files.  Section markup template names are
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -derived as follows (in order of precedence):
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -1. From the title's first positional attribute or 'template'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   attribute. For example, the following three section titles are
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   functionally equivalent:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -+
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.....................................................................
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[terms]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[glossary]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -List of Terms
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -["glossary",id="terms"]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -List of Terms
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[template="glossary",id="terms"]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -List of Terms
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.....................................................................
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -2. When the title text matches a configuration file
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   <> entry.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -3. If neither of the above the default `sect` template is used
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   (where `` is a number from 1 to 4).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -In addition to the normal section template names ('sect1', 'sect2',
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'sect3', 'sect4') AsciiDoc has the following templates for
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -frontmatter, backmatter and other special sections: 'abstract',
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'preface', 'colophon', 'dedication', 'glossary', 'bibliography',
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'synopsis', 'appendix', 'index'.  These special section templates
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -generate the corresponding Docbook elements; for HTML outputs they
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -default to the 'sect1' section template.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Section IDs
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -^^^^^^^^^^^
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -If no explicit section ID is specified an ID will be synthesised from
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -the section title.  The primary purpose of this feature is to ensure
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -persistence of table of contents links (permalinks): the missing
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -section IDs are generated dynamically by the JavaScript TOC generator
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -*after* the page is loaded. If you link to a dynamically generated TOC
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -address the page will load but the browser will ignore the (as yet
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -ungenerated) section ID.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The IDs are generated by the following algorithm:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Replace all non-alphanumeric title characters with underscores.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Strip leading or trailing underscores.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Convert to lowercase.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Prepend the `idprefix` attribute (so there's no possibility of name
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  clashes with existing document IDs). Prepend an underscore if the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  `idprefix` attribute is not defined.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- A numbered suffix (`_2`, `_3` ...) is added if a same named
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  auto-generated section ID exists.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- If the `ascii-ids` attribute is defined then non-ASCII characters
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  are replaced with ASCII equivalents. This attribute may be
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  deprecated in future releases and *should be avoided*, it's sole
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  purpose is to accommodate deficient downstream applications that
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  cannot process non-ASCII ID attributes.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Example: the title 'Jim's House' would generate the ID `_jim_s_house`.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Section ID synthesis can be disabled by undefining the `sectids`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -attribute.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X16]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Special Section Titles
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -^^^^^^^^^^^^^^^^^^^^^^
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc has a mechanism for mapping predefined section titles
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -auto-magically to specific markup templates. For example a title
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'Appendix A: Code Reference' will automatically use the 'appendix'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<>. The mappings from title to template
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -name are specified in `[specialsections]` sections in the Asciidoc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -language configuration files (`lang-*.conf`).  Section entries are
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -formatted like:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  =<template>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`<title>` is a Python regular expression and `<template>` is the name
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -of a configuration file markup template section. If the `<title>`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -matches an AsciiDoc document section title then the backend output is
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -marked up using the `<template>` markup template (instead of the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -default `sect<level>` section template). The `{title}` attribute value
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -is set to the value of the matched regular expression group named
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'title', if there is no 'title' group `{title}` defaults to the whole
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -of the AsciiDoc section title. If `<template>` is blank then any
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -existing entry with the same `<title>` will be deleted.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Special section titles vs. explicit template names
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -*********************************************************************
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc has two mechanisms for specifying non-default section markup
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -templates: you can specify the template name explicitly (using the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'template' attribute) or indirectly (using 'special section titles').
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Specifying a <<X93,section template>> attribute explicitly is
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -preferred.  Auto-magical 'special section titles' have the following
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -drawbacks:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- They are non-obvious, you have to know the exact matching
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  title for each special section on a language by language basis.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Section titles are predefined and can only be customised with a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  configuration change.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The implementation is complicated by multiple languages: every
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  special section title has to be defined for each language (in each
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  of the `lang-*.conf` files).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Specifying special section template names explicitly does add more
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -noise to the source document (the 'template' attribute declaration),
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -but the intention is obvious and the syntax is consistent with other
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc elements c.f.  bibliographic, Q&A and glossary lists.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Special section titles have been deprecated but are retained for
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -backward compatibility.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -*********************************************************************
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Inline Elements
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<<X34,Inline document elements>> are used to format text and to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -perform various types of text substitution. Inline elements and inline
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -element syntax is defined in the asciidoc(1) configuration files.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Here is a list of AsciiDoc inline elements in the (default) order in
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -which they are processed:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Special characters::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        These character sequences escape special characters used by
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        the backend markup (typically `<`, `>`, and `&` characters).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        See `[specialcharacters]` configuration file sections.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Quotes::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Elements that markup words and phrases; usually for character
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        formatting. See `[quotes]` configuration file sections.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Special Words::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Word or word phrase patterns singled out for markup without
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        the need for further annotation.  See `[specialwords]`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        configuration file sections.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Replacements::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Each replacement defines a word or word phrase pattern to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        search for along with corresponding replacement text. See
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        `[replacements]` configuration file sections.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Attribute references::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Document attribute names enclosed in braces are replaced by
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        the corresponding attribute value.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Inline Macros::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Inline macros are replaced by the contents of parametrized
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        configuration file sections.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Document Processing
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The AsciiDoc source document is read and processed as follows:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -1. The document 'Header' is parsed, header parameter values are
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   substituted into the configuration file `[header]` template section
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   which is then written to the output file.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -2. Each document 'Section' is processed and its constituent elements
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   translated to the output file.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -3. The configuration file `[footer]` template section is substituted
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   and written to the output file.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -When a block element is encountered asciidoc(1) determines the type of
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -block by checking in the following order (first to last): (section)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Titles, BlockMacros, Lists, DelimitedBlocks, Tables, AttributeEntrys,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AttributeLists, BlockTitles, Paragraphs.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The default paragraph definition `[paradef-default]` is last element
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -to be checked.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Knowing the parsing order will help you devise unambiguous macro, list
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -and block syntax rules.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Inline substitutions within block elements are performed in the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -following default order:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -1. Special characters
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -2. Quotes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -3. Special words
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -4. Replacements
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -5. Attributes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -6. Inline Macros
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -7. Replacements2
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The substitutions and substitution order performed on
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Title, Paragraph and DelimitedBlock elements is determined by
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -configuration file parameters.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Text Formatting
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X51]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Quoted Text
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Words and phrases can be formatted by enclosing inline text with
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -quote characters:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -_Emphasized text_::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Word phrases \'enclosed in single quote characters' (acute
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        accents) or \_underline characters_ are emphasized.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -*Strong text*::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Word phrases \*enclosed in asterisk characters* are rendered
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        in a strong font (usually bold).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X81]]+Monospaced text+::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Word phrases \+enclosed in plus characters+ are rendered in a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        monospaced font. Word phrases \`enclosed in backtick
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        characters` (grave accents) are also rendered in a monospaced
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        font but in this case the enclosed text is rendered literally
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        and is not subject to further expansion (see <<X80,inline
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        literal passthrough>>).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`Single quoted text'::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Phrases enclosed with a \`single grave accent to the left and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        a single acute accent to the right' are rendered in single
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        quotation marks.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -``Double quoted text''::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Phrases enclosed with \\``two grave accents to the left and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        two acute accents to the right'' are rendered in quotation
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        marks.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -#Unquoted text#::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Placing \#hashes around text# does nothing, it is a mechanism
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        to allow inline attributes to be applied to otherwise
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        unformatted text.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -New quote types can be defined by editing asciidoc(1) configuration
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -files. See the <<X7,Configuration Files>> section for details.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Quoted text behavior
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Quoting cannot be overlapped.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Different quoting types can be nested.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- To suppress quoted text formatting place a backslash character
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  immediately in front of the leading quote character(s). In the case
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  of ambiguity between escaped and non-escaped text you will need to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  escape both leading and trailing quotes, in the case of
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  multi-character quotes you may even need to escape individual
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  characters.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X96]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Quoted text attributes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -^^^^^^^^^^^^^^^^^^^^^^
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Quoted text can be prefixed with an <<X21,attribute list>>.  The first
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -positional attribute ('role' attribute) is translated by AsciiDoc to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -an HTML 'span' element 'class' attribute or a DocBook 'phrase' element
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'role' attribute.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -DocBook XSL Stylesheets translate DocBook 'phrase' elements with
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'role' attributes to corresponding HTML 'span' elements with the same
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'class' attributes; CSS can then be used
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -http://www.sagehill.net/docbookxsl/UsingCSS.html[to style the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -generated HTML].  Thus CSS styling can be applied to both DocBook and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc generated HTML outputs.  You can also specify multiple class
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -names separated by spaces.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -CSS rules for text color, text background color, text size and text
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -decorators are included in the distributed AsciiDoc CSS files and are
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -used in conjunction with AsciiDoc 'xhtml11', 'html5' and 'docbook'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -outputs. The CSS class names are:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- '<color>' (text foreground color).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- '<color>-background' (text background color).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- 'big' and 'small' (text size).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- 'underline', 'overline' and 'line-through' (strike through) text
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  decorators.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Where '<color>' can be any of the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -http://en.wikipedia.org/wiki/Web_colors#HTML_color_names[sixteen HTML
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -color names].  Examples:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  [red]#Obvious# and [big red yellow-background]*very obvious*.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  [underline]#Underline text#, [overline]#overline text# and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  [blue line-through]*bold blue and line-through*.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -is rendered as:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[red]#Obvious# and [big red yellow-background]*very obvious*.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[underline]#Underline text#, [overline]#overline text# and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[bold blue line-through]*bold blue and line-through*.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -NOTE: Color and text decorator attributes are rendered for XHTML and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -HTML 5 outputs using CSS stylesheets.  The mechanism to implement
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -color and text decorator attributes is provided for DocBook toolchains
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -via the DocBook 'phrase' element 'role' attribute, but the actual
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -rendering is toolchain specific and is not part of the AsciiDoc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -distribution.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X52]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Constrained and Unconstrained Quotes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -There are actually two types of quotes:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Constrained quotes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -++++++++++++++++++
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Quoted must be bounded by white space or commonly adjoining
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -punctuation characters. These are the most commonly used type of
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -quote.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Unconstrained quotes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -++++++++++++++++++++
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Unconstrained quotes have no boundary constraints and can be placed
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -anywhere within inline text. For consistency and to make them easier
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -to remember unconstrained quotes are double-ups of the `_`, `*`, `+`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -and `#` constrained quotes:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  __unconstrained emphasized text__
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  **unconstrained strong text**
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ++unconstrained monospaced text++
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ##unconstrained unquoted text##
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The following example emboldens the letter F:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  **F**ile Open...
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Superscripts and Subscripts
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Put \^carets on either^ side of the text to be superscripted, put
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -\~tildes on either side~ of text to be subscripted.  For example, the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -following line:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  e^πi^+1 = 0. H~2~O and x^10^. Some ^super text^
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  and ~some sub text~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Is rendered like:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -e^πi^+1 = 0. H~2~O and x^10^. Some ^super text^
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -and ~some sub text~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Superscripts and subscripts are implemented as <<X52,unconstrained
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -quotes>> and they can be escaped with a leading backslash and prefixed
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -with with an attribute list.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Line Breaks
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -A plus character preceded by at least one space character at the end
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -of a non-blank line forces a line break. It generates a line break
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -(`br`) tag for HTML outputs and a custom XML `asciidoc-br` processing
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -instruction for DocBook outputs. The `asciidoc-br` processing
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -instruction is handled by <<X43,a2x(1)>>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Page Breaks
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -A line of three or more less-than (`<<<`) characters will generate a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -hard page break in DocBook and printed HTML outputs.  It uses the CSS
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`page-break-after` property for HTML outputs and a custom XML
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`asciidoc-pagebreak` processing instruction for DocBook outputs. The
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`asciidoc-pagebreak` processing instruction is handled by
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<<X43,a2x(1)>>. Hard page breaks are sometimes handy but as a general
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -rule you should let your page processor generate page breaks for you.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Rulers
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -A line of three or more apostrophe characters will generate a ruler
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -line.  It generates a ruler (`hr`) tag for HTML outputs and a custom
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -XML `asciidoc-hr` processing instruction for DocBook outputs. The
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`asciidoc-hr` processing instruction is handled by <<X43,a2x(1)>>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Tabs
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -By default tab characters input files will translated to 8 spaces. Tab
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -expansion is set with the 'tabsize' entry in the configuration file
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`[miscellaneous]` section and can be overridden in included files by
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -setting a 'tabsize' attribute in the `include` macro's attribute list.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -For example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  include::addendum.txt[tabsize=2]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The tab size can also be set using the attribute command-line option,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -for example `--attribute tabsize=4`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Replacements
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The following replacements are defined in the default AsciiDoc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -configuration:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  (C) copyright, (TM) trademark, (R) registered trademark,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  -- em dash, ... ellipsis, -> right arrow, <- left arrow, => right
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  double arrow, <= left double arrow.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Which are rendered as:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -(C) copyright, (TM) trademark, (R) registered trademark,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- em dash, ... ellipsis, -> right arrow, <- left arrow, => right
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -double arrow, <= left double arrow.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -You can also include arbitrary entity references in the AsciiDoc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -source. Examples:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ➊ ¶
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -renders:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -➊ ¶
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -To render a replacement literally escape it with a leading back-slash.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The <<X7,Configuration Files>> section explains how to configure your
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -own replacements.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Special Words
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Words defined in `[specialwords]` configuration file sections are
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -automatically marked up without having to be explicitly notated.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The <<X7,Configuration Files>> section explains how to add and replace
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -special words.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X17]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Titles
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Document and section titles can be in either of two formats:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Two line titles
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -A two line title consists of a title line, starting hard against the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -left margin, and an underline. Section underlines consist a repeated
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -character pairs spanning the width of the preceding title (give or
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -take up to two characters):
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The default title underlines for each of the document levels are:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Level 0 (top level):     ======================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Level 1:                 ----------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Level 2:                 ~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Level 3:                 ^^^^^^^^^^^^^^^^^^^^^^
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Level 4 (bottom level):  ++++++++++++++++++++++
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Examples:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Level One Section Title
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  -----------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Level 2 Subsection Title
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X46]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -One line titles
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -One line titles consist of a single line delimited on either side by
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -one or more equals characters (the number of equals characters
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -corresponds to the section level minus one).  Here are some examples:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  = Document Title (level 0) =
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  == Section title (level 1) ==
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  === Section title (level 2) ===
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ==== Section title (level 3) ====
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ===== Section title (level 4) =====
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[NOTE]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -=====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- One or more spaces must fall between the title and the delimiters.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The trailing title delimiter is optional.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The one-line title syntax can be changed by editing the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  configuration file `[titles]` section `sect0`...`sect4` entries.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -=====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Floating titles
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Setting the title's first positional attribute or 'style' attribute to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'float' generates a free-floating title. A free-floating title is
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -rendered just like a normal section title but is not formally
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -associated with a text body and is not part of the regular section
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -hierarchy so the normal ordering rules do not apply. Floating titles
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -can also be used in contexts where section titles are illegal: for
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -example sidebar and admonition blocks.  Example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  [float]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  The second day
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Floating titles do not appear in a document's table of contents.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X42]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Block Titles
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -A 'BlockTitle' element is a single line beginning with a period
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -followed by the title text. A BlockTitle is applied to the immediately
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -following Paragraph, DelimitedBlock, List, Table or BlockMacro. For
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -........................
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Notes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Note 1.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Note 2.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -........................
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -is rendered as:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Notes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Note 1.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Note 2.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X41]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -BlockId Element
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -A 'BlockId' is a single line block element containing a unique
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -identifier enclosed in double square brackets. It is used to assign an
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -identifier to the ensuing block element. For example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  [[chapter-titles]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Chapter titles can be ...
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The preceding example identifies the ensuing paragraph so it can be
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -referenced from other locations, for example with
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`<<chapter-titles,chapter titles>>`.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'BlockId' elements can be applied to Title, Paragraph, List,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -DelimitedBlock, Table and BlockMacro elements.  The BlockId element
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -sets the `{id}` attribute for substitution in the subsequent block's
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -markup template. If a second positional argument is supplied it sets
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -the `{reftext}` attribute which is used to set the DocBook `xreflabel`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -attribute.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The 'BlockId' element has the same syntax and serves the same function
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -to the <<X30,anchor inline macro>>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X79]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AttributeList Element
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -An 'AttributeList' block element is an <<X21,attribute list>> on a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -line by itself:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- 'AttributeList' attributes are only applied to the immediately
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  following block element -- the attributes are made available to the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  block's markup template.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Multiple contiguous 'AttributeList' elements are additively combined
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  in the order they appear..
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The first positional attribute in the list is often used to specify
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  the ensuing element's <<X23,style>>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Attribute value substitution
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -By default, only substitutions that take place inside attribute list
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -values are attribute references, this is because not all attributes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -are destined to be marked up and rendered as text (for example the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -table 'cols' attribute). To perform normal inline text substitutions
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -(special characters, quotes, macros, replacements) on an attribute
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -value you need to enclose it in single quotes. In the following quote
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -block the second attribute value in the AttributeList is quoted to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -ensure the 'http' macro is expanded to a hyperlink.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[quote,'http://en.wikipedia.org/wiki/Samuel_Johnson[Samuel Johnson]']
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -_____________________________________________________________________
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Sir, a woman's preaching is like a dog's walking on his hind legs. It
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -is not done well; but you are surprised to find it done at all.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -_____________________________________________________________________
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Common attributes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Most block elements support the following attributes:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[cols="1e,1,5a",frame="topbot",options="header"]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|Name |Backends |Description
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|id |html4, html5, xhtml11, docbook |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Unique identifier typically serve as link targets.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Can also be set by the 'BlockId' element.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|role |html4, html5, xhtml11, docbook |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Role contains a string used to classify or subclassify an element and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -can be applied to AsciiDoc block elements.  The AsciiDoc 'role'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -attribute is translated to the 'role' attribute in DocBook outputs and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -is included in the 'class' attribute in HTML outputs, in this respect
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -it behaves like the <<X96,quoted text role attribute>>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -DocBook XSL Stylesheets translate DocBook 'role' attributes to HTML
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'class' attributes; CSS can then be used
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -http://www.sagehill.net/docbookxsl/UsingCSS.html[to style the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -generated HTML].
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|reftext |docbook |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'reftext' is used to set the DocBook 'xreflabel' attribute.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The 'reftext' attribute can an also be set by the 'BlockId' element.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Paragraphs
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -----------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Paragraphs are blocks of text terminated by a blank line, the end of
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -file, or the start of a delimited block or a list.  There are three
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -paragraph syntaxes: normal, indented (literal) and admonition which
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -are rendered, by default, with the corresponding paragraph style.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Each syntax has a default style, but you can explicitly apply any
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -paragraph style to any paragraph syntax. You can also apply
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<<X104,delimited block>> styles to single paragraphs.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The built-in paragraph styles are: 'normal', 'literal', 'verse',
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'quote', 'listing', 'TIP', 'NOTE', 'IMPORTANT', 'WARNING', 'CAUTION',
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'abstract', 'partintro', 'comment', 'example', 'sidebar', 'source',
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'music', 'latex', 'graphviz'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -normal paragraph syntax
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Normal paragraph syntax consists of one or more non-blank lines of
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -text. The first line must start hard against the left margin (no
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -intervening white space). The default processing expectation is that
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -of a normal paragraph of text.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X85]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -literal paragraph syntax
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Literal paragraphs are rendered verbatim in a monospaced font without
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -any distinguishing background or border.  By default there is no text
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -formatting or substitutions within Literal paragraphs apart from
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Special Characters and Callouts.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The 'literal' style is applied implicitly to indented paragraphs i.e.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -where the first line of the paragraph is indented by one or more space
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -or tab characters.  For example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Consul *necessitatibus* per id,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  consetetur, eu pro everti postulant
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  homero verear ea mea, qui.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Renders:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Consul *necessitatibus* per id,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  consetetur, eu pro everti postulant
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  homero verear ea mea, qui.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -NOTE: Because <<X64,lists>> can be indented it's possible for your
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -indented paragraph to be misinterpreted as a list -- in situations
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -like this apply the 'literal' style to a normal paragraph.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Instead of using a paragraph indent you could apply the 'literal'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -style explicitly, for example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[literal]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Consul *necessitatibus* per id,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -consetetur, eu pro everti postulant
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -homero verear ea mea, qui.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Renders:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[literal]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Consul *necessitatibus* per id,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -consetetur, eu pro everti postulant
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -homero verear ea mea, qui.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X94]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -quote and verse paragraph styles
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The optional 'attribution' and 'citetitle' attributes (positional
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -attributes 2 and 3) specify the author and source respectively.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The 'verse' style retains the line breaks, for example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[verse, William Blake, from Auguries of Innocence]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -To see a world in a grain of sand,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -And a heaven in a wild flower,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Hold infinity in the palm of your hand,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -And eternity in an hour.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Which is rendered as:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[verse, William Blake, from Auguries of Innocence]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -To see a world in a grain of sand,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -And a heaven in a wild flower,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Hold infinity in the palm of your hand,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -And eternity in an hour.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The 'quote' style flows the text at left and right margins, for
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[quote, Bertrand Russell, The World of Mathematics (1956)]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -A good notation has subtlety and suggestiveness which at times makes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -it almost seem like a live teacher.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Which is rendered as:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[quote, Bertrand Russell, The World of Mathematics (1956)]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -A good notation has subtlety and suggestiveness which at times makes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -it almost seem like a live teacher.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X28]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Admonition Paragraphs
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'TIP', 'NOTE', 'IMPORTANT', 'WARNING' and 'CAUTION' admonishment
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -paragraph styles are generated by placing `NOTE:`, `TIP:`,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`IMPORTANT:`, `WARNING:` or `CAUTION:` as the first word of the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -paragraph. For example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  NOTE: This is an example note.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Alternatively, you can specify the paragraph admonition style
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -explicitly using an <<X79,AttributeList element>>. For example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  [NOTE]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  This is an example note.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Renders:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -NOTE: This is an example note.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -TIP: If your admonition requires more than a single paragraph use an
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<<X22,admonition block>> instead.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X47]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Admonition Icons and Captions
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -NOTE: Admonition customization with `icons`, `iconsdir`, `icon` and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`caption` attributes does not apply when generating DocBook output. If
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -you are going the DocBook route then the <<X43,a2x(1)>> `--no-icons`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -and `--icons-dir` options can be used to set the appropriate XSL
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Stylesheets parameters.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -By default the asciidoc(1) HTML backends generate text captions
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -instead of admonition icon image links. To generate links to icon
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -images define the <<X45,`icons`>> attribute, for example using the `-a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -icons` command-line option.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The <<X44,`iconsdir`>> attribute sets the location of linked icon
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -images.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -You can override the default icon image using the `icon` attribute to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -specify the path of the linked image. For example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  [icon="./images/icons/wink.png"]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  NOTE: What lovely war.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Use the `caption` attribute to customize the admonition captions (not
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -applicable to `docbook` backend). The following example suppresses the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -icon image and customizes the caption of a 'NOTE' admonition
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -(undefining the `icons` attribute with `icons=None` is only necessary
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -if <<X45,admonition icons>> have been enabled):
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  [icons=None, caption="My Special Note"]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  NOTE: This is my special note.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -This subsection also applies to <<X22,Admonition Blocks>>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X104]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Delimited Blocks
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -----------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Delimited blocks are blocks of text enveloped by leading and trailing
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -delimiter lines (normally a series of four or more repeated
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -characters). The behavior of Delimited Blocks is specified by entries
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -in configuration file `[blockdef-*]` sections.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Predefined Delimited Blocks
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc ships with a number of predefined DelimitedBlocks (see the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`asciidoc.conf` configuration file in the asciidoc(1) program
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -directory):
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Predefined delimited block underlines:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  CommentBlock:     //////////////////////////
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  PassthroughBlock: ++++++++++++++++++++++++++
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ListingBlock:     --------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  LiteralBlock:     ..........................
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  SidebarBlock:     **************************
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  QuoteBlock:       __________________________
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ExampleBlock:     ==========================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  OpenBlock:        --
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Default DelimitedBlock substitutions
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[cols="2e,7*^",frame="topbot",options="header,autowidth"]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|=====================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -| |Attributes |Callouts |Macros | Quotes |Replacements
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|Special chars |Special words
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|PassthroughBlock |Yes |No  |Yes |No  |No  |No  |No
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|ListingBlock     |No  |Yes |No  |No  |No  |Yes |No
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|LiteralBlock     |No  |Yes |No  |No  |No  |Yes |No
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|SidebarBlock     |Yes |No  |Yes |Yes |Yes |Yes |Yes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|QuoteBlock       |Yes |No  |Yes |Yes |Yes |Yes |Yes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|ExampleBlock     |Yes |No  |Yes |Yes |Yes |Yes |Yes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|OpenBlock        |Yes |No  |Yes |Yes |Yes |Yes |Yes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|=====================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Listing Blocks
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'ListingBlocks' are rendered verbatim in a monospaced font, they
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -retain line and whitespace formatting and are often distinguished by a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -background or border. There is no text formatting or substitutions
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -within Listing blocks apart from Special Characters and Callouts.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Listing blocks are often used for computer output and file listings.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Here's an example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[listing]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -......................................
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ---------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -#include <stdio.h>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -int main() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   printf("Hello World!\n");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   exit(0);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ---------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -......................................
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Which will be rendered like:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ---------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -#include <stdio.h>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -int main() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    printf("Hello World!\n");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    exit(0);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ---------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -By convention <<X59,filter blocks>> use the listing block syntax and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -are implemented as distinct listing block styles.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X65]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Literal Blocks
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'LiteralBlocks' are rendered just like <<X85,literal paragraphs>>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -...................................
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Consul *necessitatibus* per id,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -consetetur, eu pro everti postulant
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -homero verear ea mea, qui.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -...................................
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Renders:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -...................................
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Consul *necessitatibus* per id,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -consetetur, eu pro everti postulant
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -homero verear ea mea, qui.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -...................................
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -If the 'listing' style is applied to a LiteralBlock it will be
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -rendered as a ListingBlock (this is handy if you have a listing
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -containing a ListingBlock).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Sidebar Blocks
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -A sidebar is a short piece of text presented outside the narrative
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -flow of the main text. The sidebar is normally presented inside a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -bordered box to set it apart from the main text.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The sidebar body is treated like a normal section body.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Here's an example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.An Example Sidebar
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -************************************************
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Any AsciiDoc SectionBody element (apart from
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -SidebarBlocks) can be placed inside a sidebar.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -************************************************
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Which will be rendered like:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.An Example Sidebar
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -************************************************
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Any AsciiDoc SectionBody element (apart from
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -SidebarBlocks) can be placed inside a sidebar.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -************************************************
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X26]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Comment Blocks
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The contents of 'CommentBlocks' are not processed; they are useful for
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -annotations and for excluding new or outdated content that you don't
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -want displayed. CommentBlocks are never written to output files.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -//////////////////////////////////////////
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -CommentBlock contents are not processed by
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -asciidoc(1).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -//////////////////////////////////////////
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -See also <<X25,Comment Lines>>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -NOTE: System macros are executed inside comment blocks.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X76]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Passthrough Blocks
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -By default the block contents is subject only to 'attributes' and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'macros' substitutions (use an explicit 'subs' attribute to apply
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -different substitutions).  PassthroughBlock content will often be
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -backend specific. Here's an example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[subs="quotes"]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -++++++++++++++++++++++++++++++++++++++
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<table border="1"><tr>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  <td>*Cell 1*</td>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  <td>*Cell 2*</td>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -</tr></table>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -++++++++++++++++++++++++++++++++++++++
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The following styles can be applied to passthrough blocks:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -pass::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  No substitutions are performed. This is equivalent to `subs="none"`.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -asciimath, latexmath::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  By default no substitutions are performed, the contents are rendered
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  as <<X78,mathematical formulas>>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Quote Blocks
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'QuoteBlocks' are used for quoted passages of text. There are two
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -styles: 'quote' and 'verse'. The style behavior is identical to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<<X94,quote and verse paragraphs>> except that blocks can contain
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -multiple paragraphs and, in the case of the 'quote' style, other
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -section elements.  The first positional attribute sets the style, if
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -no attributes are specified the 'quote' style is used.  The optional
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'attribution' and 'citetitle' attributes (positional attributes 2 and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -3) specify the quote's author and source. For example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[quote, Sir Arthur Conan Doyle, The Adventures of Sherlock Holmes]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -____________________________________________________________________
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -As he spoke there was the sharp sound of horses' hoofs and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -grating wheels against the curb, followed by a sharp pull at the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -bell. Holmes whistled.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -"A pair, by the sound," said he. "Yes," he continued, glancing
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -out of the window. "A nice little brougham and a pair of
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -beauties. A hundred and fifty guineas apiece. There's money in
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -this case, Watson, if there is nothing else."
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -____________________________________________________________________
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Which is rendered as:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[quote, Sir Arthur Conan Doyle, The Adventures of Sherlock Holmes]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -____________________________________________________________________
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -As he spoke there was the sharp sound of horses' hoofs and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -grating wheels against the curb, followed by a sharp pull at the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -bell. Holmes whistled.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -"A pair, by the sound," said he. "Yes," he continued, glancing
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -out of the window. "A nice little brougham and a pair of
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -beauties. A hundred and fifty guineas apiece. There's money in
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -this case, Watson, if there is nothing else."
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -____________________________________________________________________
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X48]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Example Blocks
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'ExampleBlocks' encapsulate the DocBook Example element and are used
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -for, well, examples.  Example blocks can be titled by preceding them
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -with a 'BlockTitle'.  DocBook toolchains will normally automatically
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -number examples and generate a 'List of Examples' backmatter section.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Example blocks are delimited by lines of equals characters and can
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -contain any block elements apart from Titles, BlockTitles and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Sidebars) inside an example block. For example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.An example
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -=====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Qui in magna commodo, est labitur dolorum an. Est ne magna primis
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -adolescens.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -=====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Renders:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.An example
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -=====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Qui in magna commodo, est labitur dolorum an. Est ne magna primis
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -adolescens.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -=====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -A title prefix that can be inserted with the `caption` attribute
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -(HTML backends). For example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[caption="Example 1: "]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.An example with a custom caption
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -=====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Qui in magna commodo, est labitur dolorum an. Est ne magna primis
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -adolescens.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -=====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X22]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Admonition Blocks
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The 'ExampleBlock' definition includes a set of admonition
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<<X23,styles>> ('NOTE', 'TIP', 'IMPORTANT', 'WARNING', 'CAUTION') for
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -generating admonition blocks (admonitions containing more than a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<<X28,single paragraph>>).  Just precede the 'ExampleBlock' with an
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -attribute list specifying the admonition style name. For example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[NOTE]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.A NOTE admonition block
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -=====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Qui in magna commodo, est labitur dolorum an. Est ne magna primis
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -adolescens.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -. Fusce euismod commodo velit.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -. Vivamus fringilla mi eu lacus.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  .. Fusce euismod commodo velit.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  .. Vivamus fringilla mi eu lacus.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -. Donec eget arcu bibendum
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  nunc consequat lobortis.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -=====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Renders:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[NOTE]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.A NOTE admonition block
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -=====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Qui in magna commodo, est labitur dolorum an. Est ne magna primis
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -adolescens.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -. Fusce euismod commodo velit.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -. Vivamus fringilla mi eu lacus.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  .. Fusce euismod commodo velit.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  .. Vivamus fringilla mi eu lacus.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -. Donec eget arcu bibendum
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  nunc consequat lobortis.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -=====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -See also <<X47,Admonition Icons and Captions>>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X29]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Open Blocks
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Open blocks are special:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The open block delimiter is line containing two hyphen characters
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  (instead of four or more repeated characters).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- They can be used to group block elements for <<X15,List item
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  continuation>>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Open blocks can be styled to behave like any other type of delimited
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  block.  The  following built-in styles can be applied to open
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  blocks: 'literal', 'verse', 'quote', 'listing', 'TIP', 'NOTE',
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  'IMPORTANT', 'WARNING', 'CAUTION', 'abstract', 'partintro',
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  'comment', 'example', 'sidebar', 'source', 'music', 'latex',
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  'graphviz'. For example, the following open block and listing block
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  are functionally identical:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  [listing]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  --
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Lorum ipsum ...
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  --
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ---------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Lorum ipsum ...
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ---------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- An unstyled open block groups section elements but otherwise does
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  nothing.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Open blocks are used to generate document abstracts and book part
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -introductions:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Apply the 'abstract' style to generate an abstract, for example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  [abstract]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  --
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  In this paper we will ...
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  --
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -. Apply the 'partintro' style to generate a book part introduction for
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  a multi-part book, for example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  [partintro]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  .Optional part introduction title
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  --
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Optional part introduction goes here.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  --
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X64]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Lists
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.List types
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Bulleted lists. Also known as itemized or unordered lists.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Numbered lists. Also called ordered lists.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Labeled lists. Sometimes called variable or definition lists.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Callout lists (a list of callout annotations).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.List behavior
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- List item indentation is optional and does not determine nesting,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  indentation does however make the source more readable.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Another list or a literal paragraph immediately following a list
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  item will be implicitly included in the list item; use <<X15, list
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  item continuation>> to explicitly append other block elements to a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  list item.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- A comment block or a comment line block macro element will terminate
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  a list -- use inline comment lines to put comments inside lists.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The `listindex` <<X60,intrinsic attribute>> is the current list item
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  index (1..). If this attribute is used outside a list then it's value
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  is the number of items in the most recently closed list. Useful for
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  displaying the number of items in a list.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Bulleted Lists
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Bulleted list items start with a single dash or one to five asterisks
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -followed by some white space then some text. Bulleted list syntaxes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -are:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -...................
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- List item.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -* List item.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -** List item.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -*** List item.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -**** List item.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -***** List item.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -...................
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Numbered Lists
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -List item numbers are explicit or implicit.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Explicit numbering
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -List items begin with a number followed by some white space then the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -item text. The numbers can be decimal (arabic), roman (upper or lower
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -case) or alpha (upper or lower case). Decimal and alpha numbers are
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -terminated with a period, roman numbers are terminated with a closing
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -parenthesis. The different terminators are necessary to ensure 'i',
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'v' and 'x' roman numbers are are distinguishable from 'x', 'v' and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'x' alpha numbers. Examples:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.....................................................................
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -1.   Arabic (decimal) numbered list item.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -a.   Lower case alpha (letter) numbered list item.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -F.   Upper case alpha (letter) numbered list item.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -iii) Lower case roman numbered list item.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -IX)  Upper case roman numbered list item.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.....................................................................
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Implicit numbering
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -List items begin one to five period characters, followed by some white
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -space then the item text. Examples:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.....................................................................
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -. Arabic (decimal) numbered list item.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.. Lower case alpha (letter) numbered list item.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -... Lower case roman numbered list item.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.... Upper case alpha (letter) numbered list item.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -..... Upper case roman numbered list item.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.....................................................................
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -You can use the 'style' attribute (also the first positional
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -attribute) to specify an alternative numbering style.  The numbered
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -list style can be one of the following values: 'arabic', 'loweralpha',
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'upperalpha', 'lowerroman', 'upperroman'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Here are some examples of bulleted and numbered lists:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Praesent eget purus quis magna eleifend eleifend.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  1. Fusce euismod commodo velit.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    a. Fusce euismod commodo velit.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    b. Vivamus fringilla mi eu lacus.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    c. Donec eget arcu bibendum nunc consequat lobortis.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  2. Vivamus fringilla mi eu lacus.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    i)  Fusce euismod commodo velit.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    ii) Vivamus fringilla mi eu lacus.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  3. Donec eget arcu bibendum nunc consequat lobortis.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  4. Nam fermentum mattis ante.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  * Fusce euismod commodo velit.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ** Qui in magna commodo, est labitur dolorum an. Est ne magna primis
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -     adolescens. Sit munere ponderum dignissim et. Minim luptatum et
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -     vel.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ** Vivamus fringilla mi eu lacus.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  * Donec eget arcu bibendum nunc consequat lobortis.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Nulla porttitor vulputate libero.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  . Fusce euismod commodo velit.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  . Vivamus fringilla mi eu lacus.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[upperroman]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    .. Fusce euismod commodo velit.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    .. Vivamus fringilla mi eu lacus.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  . Donec eget arcu bibendum nunc consequat lobortis.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Which render as:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Praesent eget purus quis magna eleifend eleifend.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  1. Fusce euismod commodo velit.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    a. Fusce euismod commodo velit.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    b. Vivamus fringilla mi eu lacus.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    c. Donec eget arcu bibendum nunc consequat lobortis.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  2. Vivamus fringilla mi eu lacus.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    i)  Fusce euismod commodo velit.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    ii) Vivamus fringilla mi eu lacus.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  3. Donec eget arcu bibendum nunc consequat lobortis.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  4. Nam fermentum mattis ante.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  * Fusce euismod commodo velit.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ** Qui in magna commodo, est labitur dolorum an. Est ne magna primis
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -     adolescens. Sit munere ponderum dignissim et. Minim luptatum et
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -     vel.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ** Vivamus fringilla mi eu lacus.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  * Donec eget arcu bibendum nunc consequat lobortis.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Nulla porttitor vulputate libero.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  . Fusce euismod commodo velit.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  . Vivamus fringilla mi eu lacus.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[upperroman]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    .. Fusce euismod commodo velit.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    .. Vivamus fringilla mi eu lacus.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  . Donec eget arcu bibendum nunc consequat lobortis.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -A predefined 'compact' option is available to bulleted and numbered
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -lists -- this translates to the DocBook 'spacing="compact"' lists
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -attribute which may or may not be processed by the DocBook toolchain.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  [options="compact"]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  - Compact list item.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  - Another compact list item.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -TIP: To apply the 'compact' option globally define a document-wide
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'compact-option' attribute, e.g. using the `-a compact-option`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -command-line option.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -You can set the list start number using the 'start' attribute (works
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -for HTML outputs and DocBook outputs processed by DocBook XSL
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Stylesheets). Example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  [start=7]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  . List item 7.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  . List item 8.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Labeled Lists
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Labeled list items consist of one or more text labels followed by the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -text of the list item.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -An item label begins a line with an alphanumeric character hard
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -against the left margin and ends with two, three or four colons or two
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -semi-colons. A list item can have multiple labels, one per line.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The list item text consists of one or more lines of text starting
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -after the last label (either on the same line or a new line) and can
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -be followed by nested List or ListParagraph elements. Item text can be
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -optionally indented.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Here are some examples:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -In::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Lorem::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Fusce euismod commodo velit.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Fusce euismod commodo velit.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Ipsum:: Vivamus fringilla mi eu lacus.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  * Vivamus fringilla mi eu lacus.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  * Donec eget arcu bibendum nunc consequat lobortis.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Dolor::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Donec eget arcu bibendum nunc consequat lobortis.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Suspendisse;;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    A massa id sem aliquam auctor.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Morbi;;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    Pretium nulla vel lorem.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  In;;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    Dictum mauris in urna.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    Vivamus::: Fringilla mi eu lacus.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    Donec:::   Eget arcu bibendum nunc consequat lobortis.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Which render as:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -In::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Lorem::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Fusce euismod commodo velit.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Fusce euismod commodo velit.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Ipsum:: Vivamus fringilla mi eu lacus.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  * Vivamus fringilla mi eu lacus.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  * Donec eget arcu bibendum nunc consequat lobortis.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Dolor::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Donec eget arcu bibendum nunc consequat lobortis.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Suspendisse;;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    A massa id sem aliquam auctor.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Morbi;;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    Pretium nulla vel lorem.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  In;;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    Dictum mauris in urna.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    Vivamus::: Fringilla mi eu lacus.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    Donec:::   Eget arcu bibendum nunc consequat lobortis.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Horizontal labeled list style
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The 'horizontal' labeled list style (also the first positional
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -attribute) places the list text side-by-side with the label instead of
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -under the label. Here is an example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[horizontal]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -*Lorem*:: Fusce euismod commodo velit.  Qui in magna commodo, est
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -labitur dolorum an. Est ne magna primis adolescens.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Fusce euismod commodo velit.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -*Ipsum*:: Vivamus fringilla mi eu lacus.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Vivamus fringilla mi eu lacus.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Donec eget arcu bibendum nunc consequat lobortis.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -*Dolor*::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  - Vivamus fringilla mi eu lacus.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  - Donec eget arcu bibendum nunc consequat lobortis.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Which render as:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[horizontal]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -*Lorem*:: Fusce euismod commodo velit.  Qui in magna commodo, est
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -labitur dolorum an. Est ne magna primis adolescens.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Fusce euismod commodo velit.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -*Ipsum*:: Vivamus fringilla mi eu lacus.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Vivamus fringilla mi eu lacus.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Donec eget arcu bibendum nunc consequat lobortis.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -*Dolor*::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  - Vivamus fringilla mi eu lacus.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  - Donec eget arcu bibendum nunc consequat lobortis.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[NOTE]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -=====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Current PDF toolchains do not make a good job of determining
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  the relative column widths for horizontal labeled lists.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Nested horizontal labeled lists will generate DocBook validation
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  errors because the 'DocBook XML V4.2' DTD does not permit nested
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  informal tables (although <<X13,DocBook XSL Stylesheets>> and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  <<X31,dblatex>> process them correctly).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The label width can be set as a percentage of the total width by
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  setting the 'width' attribute e.g. `width="10%"`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -=====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Question and Answer Lists
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc comes pre-configured with a 'qanda' style labeled list for generating
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -DocBook question and answer (Q&A) lists. Example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[qanda]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Question one::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Answer one.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Question two::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Answer two.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Renders:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[qanda]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Question one::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Answer one.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Question two::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Answer two.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Glossary Lists
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc comes pre-configured with a 'glossary' style labeled list for
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -generating DocBook glossary lists. Example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[glossary]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -A glossary term::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    The corresponding definition.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -A second glossary term::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    The corresponding definition.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -For working examples see the `article.txt` and `book.txt` documents in
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -the AsciiDoc `./doc` distribution directory.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -NOTE: To generate valid DocBook output glossary lists must be located
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -in a section that uses the 'glossary' <<X93,section markup template>>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Bibliography Lists
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc comes with a predefined 'bibliography' bulleted list style
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -generating DocBook bibliography entries. Example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[bibliography]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Optional list title
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- [[[taoup]]] Eric Steven Raymond. 'The Art of UNIX
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Programming'. Addison-Wesley. ISBN 0-13-142901-9.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- [[[walsh-muellner]]] Norman Walsh & Leonard Muellner.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  'DocBook - The Definitive Guide'. O'Reilly & Associates.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  1999. ISBN 1-56592-580-7.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The `[[[<reference>]]]` syntax is a bibliography entry anchor, it
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -generates an anchor named `<reference>` and additionally displays
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`[<reference>]` at the anchor position. For example `[[[taoup]]]`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -generates an anchor named `taoup` that displays `[taoup]` at the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -anchor position. Cite the reference from elsewhere your document using
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`<<taoup>>`, this displays a hyperlink (`[taoup]`) to the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -corresponding bibliography entry anchor.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -For working examples see the `article.txt` and `book.txt` documents in
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -the AsciiDoc `./doc` distribution directory.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -NOTE: To generate valid DocBook output bibliography lists must be
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -located in a <<X93,bibliography section>>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X15]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -List Item Continuation
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Another list or a literal paragraph immediately following a list item
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -is implicitly appended to the list item; to append other block
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -elements to a list item you need to explicitly join them to the list
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -item with a 'list continuation' (a separator line containing a single
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -plus character). Multiple block elements can be appended to a list
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -item using list continuations (provided they are legal list item
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -children in the backend markup).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Here are some examples of list item continuations: list item one
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -contains multiple continuations; list item two is continued with an
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<<X29,OpenBlock>> containing multiple elements:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -1. List item one.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -+
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -List item one continued with a second paragraph followed by an
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Indented block.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -+
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.................
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -$ ls *.sh
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -$ mv *.sh ~/tmp
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.................
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -+
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -List item continued with a third paragraph.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -2. List item two continued with an open block.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -+
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ---
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -This paragraph is part of the preceding list item.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -a. This list is nested and does not require explicit item continuation.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -+
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -This paragraph is part of the preceding list item.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -b. List item b.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -This paragraph belongs to item two of the outer list.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ---
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Renders:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -1. List item one.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -+
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -List item one continued with a second paragraph followed by an
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Indented block.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -+
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.................
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -$ ls *.sh
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -$ mv *.sh ~/tmp
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.................
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -+
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -List item continued with a third paragraph.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -2. List item two continued with an open block.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -+
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ---
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -This paragraph is part of the preceding list item.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -a. This list is nested and does not require explicit item continuation.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -+
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -This paragraph is part of the preceding list item.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -b. List item b.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -This paragraph belongs to item two of the outer list.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ---
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X92]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Footnotes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The shipped AsciiDoc configuration includes three footnote inline
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -macros:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`footnote:[<text>]`::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Generates a footnote with text `<text>`.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`footnoteref:[<id>,<text>]`::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Generates a footnote with a reference ID `<id>` and text `<text>`.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`footnoteref:[<id>]`::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Generates a reference to the footnote with ID `<id>`.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The footnote text can span multiple lines.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The 'xhtml11' and 'html5' backends render footnotes dynamically using
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -JavaScript; 'html4' outputs do not use JavaScript and leave the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -footnotes inline; 'docbook' footnotes are processed by the downstream
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -DocBook toolchain.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Example footnotes:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  A footnote footnote:[An example footnote.];
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  a second footnote with a reference ID footnoteref:[note2,Second footnote.];
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  finally a reference to the second footnote footnoteref:[note2].
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Renders:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -A footnote footnote:[An example footnote.];
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -a second footnote with a reference ID footnoteref:[note2,Second footnote.];
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -finally a reference to the second footnote footnoteref:[note2].
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Indexes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The shipped AsciiDoc configuration includes the inline macros for
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -generating DocBook index entries.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`indexterm:[<primary>,<secondary>,<tertiary>]`::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`(((<primary>,<secondary>,<tertiary>)))`::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    This inline macro generates an index term (the `<secondary>` and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    `<tertiary>` positional attributes are optional). Example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    `indexterm:[Tigers,Big cats]` (or, using the alternative syntax
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    `(((Tigers,Big cats)))`.  Index terms that have secondary and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    tertiary entries also generate separate index terms for the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    secondary and tertiary entries. The index terms appear in the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    index, not the primary text flow.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`indexterm2:[<primary>]`::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`((<primary>))`::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    This inline macro generates an index term that appears in both the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    index and the primary text flow.  The `<primary>` should not be
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    padded to the left or right with white space characters.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -For working examples see the `article.txt` and `book.txt` documents in
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -the AsciiDoc `./doc` distribution directory.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -NOTE: Index entries only really make sense if you are generating
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -DocBook markup -- DocBook conversion programs automatically generate
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -an index at the point an 'Index' section appears in source document.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X105]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Callouts
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ---------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Callouts are a mechanism for annotating verbatim text (for example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -source code, computer output and user input). Callout markers are
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -placed inside the annotated text while the actual annotations are
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -presented in a callout list after the annotated text. Here's an
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - .MS-DOS directory listing
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - -----------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - 10/17/97   9:04         <DIR>    bin
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - 10/16/97  14:11         <DIR>    DOS            \<1>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - 10/16/97  14:40         <DIR>    Program Files
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - 10/16/97  14:46         <DIR>    TEMP
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - 10/17/97   9:04         <DIR>    tmp
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - 10/16/97  14:37         <DIR>    WINNT
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - 10/16/97  14:25             119  AUTOEXEC.BAT   \<2>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  2/13/94   6:21          54,619  COMMAND.COM    \<2>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - 10/16/97  14:25             115  CONFIG.SYS     \<2>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - 11/16/97  17:17      61,865,984  pagefile.sys
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  2/13/94   6:21           9,349  WINA20.386     \<3>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - -----------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - \<1> This directory holds MS-DOS.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - \<2> System startup code for DOS.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - \<3> Some sort of Windows 3.1 hack.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Which renders:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.MS-DOS directory listing
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -10/17/97   9:04         <DIR>    bin
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -10/16/97  14:11         <DIR>    DOS            <1>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -10/16/97  14:40         <DIR>    Program Files
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -10/16/97  14:46         <DIR>    TEMP
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -10/17/97   9:04         <DIR>    tmp
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -10/16/97  14:37         <DIR>    WINNT
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -10/16/97  14:25             119  AUTOEXEC.BAT   <2>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - 2/13/94   6:21          54,619  COMMAND.COM    <2>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -10/16/97  14:25             115  CONFIG.SYS     <2>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -11/16/97  17:17      61,865,984  pagefile.sys
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - 2/13/94   6:21           9,349  WINA20.386     <3>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<1> This directory holds MS-DOS.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<2> System startup code for DOS.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<3> Some sort of Windows 3.1 hack.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Explanation
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The callout marks are whole numbers enclosed in angle brackets --
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  they refer to the correspondingly numbered item in the following
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  callout list.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- By default callout marks are confined to 'LiteralParagraphs',
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  'LiteralBlocks' and 'ListingBlocks' (although this is a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  configuration file option and can be changed).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Callout list item numbering is fairly relaxed -- list items can
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  start with `<n>`, `n>` or `>` where `n` is the optional list item
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  number (in the latter case list items starting with a single `>`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  character are implicitly numbered starting at one).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Callout lists should not be nested.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Callout lists start list items hard against the left margin.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- If you want to present a number inside angle brackets you'll need to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  escape it with a backslash to prevent it being interpreted as a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  callout mark.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -NOTE: Define the AsciiDoc 'icons' attribute (for example using the `-a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -icons` command-line option) to display callout icons.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Implementation Notes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Callout marks are generated by the 'callout' inline macro while
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -callout lists are generated using the 'callout' list definition. The
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'callout' macro and 'callout' list are special in that they work
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -together. The 'callout' inline macro is not enabled by the normal
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'macros' substitutions option, instead it has its own 'callouts'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -substitution option.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The following attributes are available during inline callout macro
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -substitution:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`{index}`::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    The callout list item index inside the angle brackets.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`{coid}`::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    An identifier formatted like `CO<listnumber>-<index>` that
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    uniquely identifies the callout mark. For example `CO2-4`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    identifies the fourth callout mark in the second set of callout
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    marks.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The `{coids}` attribute can be used during callout list item
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -substitution -- it is a space delimited list of callout IDs that refer
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -to the explanatory list item.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Including callouts in included code
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -You can annotate working code examples with callouts -- just remember
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -to put the callouts inside source code comments. This example displays
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -the `test.py` source file (containing a single callout) using the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'source' (code highlighter) filter:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.AsciiDoc source
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - [source,python]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - -------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - \include::test.py[]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - -------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - \<1> Print statement.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Included `test.py` source
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -print 'Hello World!'   # \<1>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Macros
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Macros are a mechanism for substituting parametrized text into output
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -documents.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Macros have a 'name', a single 'target' argument and an 'attribute
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -list'.  The usual syntax is `<name>:<target>[<attrlist>]` (for
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -inline macros) and `<name>::<target>[<attrlist>]` (for block
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -macros).  Here are some examples:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  http://www.docbook.org/[DocBook.org]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  include::chapt1.txt[tabsize=2]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  mailto:srackham@gmail.com[]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Macro behavior
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- `<name>` is the macro name. It can only contain letters, digits or
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  dash characters and cannot start with a dash.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The optional `<target>` cannot contain white space characters.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- `<attrlist>` is a <<X21,list of attributes>> enclosed in square
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  brackets.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- `]` characters inside attribute lists must be escaped with a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  backslash.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Expansion of macro references can normally be escaped by prefixing a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  backslash character (see the AsciiDoc 'FAQ' for examples of
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  exceptions to this rule).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Attribute references in block macros are expanded.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The substitutions performed prior to Inline macro macro expansion
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  are determined by the inline context.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Macros are processed in the order they appear in the configuration
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  file(s).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Calls to inline macros can be nested inside different inline macros
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  (an inline macro call cannot contain a nested call to itself).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- In addition to `<name>`, `<target>` and `<attrlist>` the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  `<passtext>` and `<subslist>` named groups are available to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  <<X77,passthrough macros>>. A macro is a passthrough macro if the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  definition includes a `<passtext>` named group.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Inline Macros
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Inline Macros occur in an inline element context. Predefined Inline
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -macros include 'URLs', 'image' and 'link' macros.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -URLs
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -^^^^
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'http', 'https', 'ftp', 'file', 'mailto' and 'callto' URLs are
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -rendered using predefined inline macros.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- If you don't need a custom link caption you can enter the 'http',
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  'https', 'ftp', 'file' URLs and email addresses without any special
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  macro syntax.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- If the `<attrlist>` is empty the URL is displayed.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Here are some examples:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  http://www.docbook.org/[DocBook.org]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  http://www.docbook.org/
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  mailto:joe.bloggs@foobar.com[email Joe Bloggs]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  joe.bloggs@foobar.com
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Which are rendered:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -http://www.docbook.org/[DocBook.org]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -http://www.docbook.org/
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -mailto:joe.bloggs@foobar.com[email Joe Bloggs]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -joe.bloggs@foobar.com
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -If the `<target>` necessitates space characters use `%20`, for example
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`large%20image.png`.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Internal Cross References
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -^^^^^^^^^^^^^^^^^^^^^^^^^
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Two AsciiDoc inline macros are provided for creating hypertext links
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -within an AsciiDoc document. You can use either the standard macro
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -syntax or the (preferred) alternative.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X30]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -anchor
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -++++++
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Used to specify hypertext link targets:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  [[<id>,<xreflabel>]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  anchor:<id>[<xreflabel>]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The `<id>` is a unique string that conforms to the output markup's
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -anchor syntax. The optional `<xreflabel>` is the text to be displayed
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -by captionless 'xref' macros that refer to this anchor. The optional
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`<xreflabel>` is only really useful when generating DocBook output.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Example anchor:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  [[X1]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -You may have noticed that the syntax of this inline element is the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -same as that of the <<X41,BlockId block element>>, this is no
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -coincidence since they are functionally equivalent.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -xref
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -++++
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Creates a hypertext link to a document anchor.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  <<<id>,<caption>>>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  xref:<id>[<caption>]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The `<id>` refers to an anchor ID. The optional `<caption>` is the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -link's displayed text. Example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  <<X21,attribute lists>>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -If `<caption>` is not specified then the displayed text is
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -auto-generated:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The AsciiDoc 'xhtml11' and 'html5' backends display the `<id>`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  enclosed in square brackets.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- If DocBook is produced the DocBook toolchain is responsible for the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  displayed text which will normally be the referenced figure, table
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  or section title number followed by the element's title text.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Here is an example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[tiger_image]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Tyger tyger
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -image::tiger.png[]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -This can be seen in <<tiger_image>>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Linking to Local Documents
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Hypertext links to files on the local file system are specified using
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -the 'link' inline macro.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  link:<target>[<caption>]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The 'link' macro generates relative URLs. The link macro `<target>` is
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -the target file name (relative to the file system location of the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -referring document). The optional `<caption>` is the link's displayed
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -text. If `<caption>` is not specified then `<target>` is displayed.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  link:downloads/foo.zip[download foo.zip]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -You can use the `<filename>#<id>` syntax to refer to an anchor within
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -a target document but this usually only makes sense when targeting
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -HTML documents.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X9]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Images
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -^^^^^^
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Inline images are inserted into the output document using the 'image'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -macro. The inline syntax is:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  image:<target>[<attributes>]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The contents of the image file `<target>` is displayed. To display the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -image its file format must be supported by the target backend
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -application. HTML and DocBook applications normally support PNG or JPG
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -files.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`<target>` file name paths are relative to the location of the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -referring document.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X55]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Image macro attributes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The optional 'alt' attribute is also the first positional attribute,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  it specifies alternative text which is displayed if the output
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  application is unable to display the image file (see also
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  http://htmlhelp.com/feature/art3.htm[Use of ALT texts in IMGs]). For
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  image:images/logo.png[Company Logo]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The optional 'title' attribute provides a title for the image. The
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  <<X49,block image macro>> renders the title alongside the image.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  The inline image macro displays the title as a popup ``tooltip'' in
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  visual browsers (AsciiDoc HTML outputs only).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The optional `width` and `height` attributes scale the image size
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  and can be used in any combination. The units are pixels.  The
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  following example scales the previous example to a height of 32
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  pixels:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  image:images/logo.png["Company Logo",height=32]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The optional `link` attribute is used to link the image to an
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  external document. The following example links a screenshot
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  thumbnail to a full size version:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  image:screen-thumbnail.png[height=32,link="screen.png"]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The optional `scaledwidth` attribute is only used in DocBook block
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  images (specifically for PDF documents). The following example
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  scales the images to 75% of the available print width:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  image::images/logo.png[scaledwidth="75%",alt="Company Logo"]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The image `scale` attribute sets the DocBook `imagedata` element
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  `scale` attribute.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The optional `align` attribute is used for horizontal image
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  alignment.  Allowed values are `center`, `left` and `right`. For
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  image::images/tiger.png["Tiger image",align="left"]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The optional `float` attribute floats the image `left` or `right` on
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  the page (works with HTML outputs only, has no effect on DocBook
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  outputs). `float` and `align` attributes are mutually exclusive.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Use the `unfloat::[]` block macro to stop floating.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Comment Lines
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -^^^^^^^^^^^^^
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -See <<X25,comment block macro>>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Block Macros
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -A Block macro reference must be contained in a single line separated
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -either side by a blank line or a block delimiter.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Block macros behave just like Inline macros, with the following
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -differences:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- They occur in a block context.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The default syntax is `<name>::<target>[<attrlist>]` (two
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  colons, not one).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Markup template section names end in `-blockmacro` instead of
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  `-inlinemacro`.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Block Identifier
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -^^^^^^^^^^^^^^^^
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The Block Identifier macro sets the `id` attribute and has the same
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -syntax as the <<X30,anchor inline macro>> since it performs
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -essentially the same function -- block templates use the `id`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -attribute as a block element ID. For example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  [[X30]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -This is equivalent to the `[id="X30"]` <<X79,AttributeList element>>).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X49]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Images
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -^^^^^^
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The 'image' block macro is used to display images in a block context.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The syntax is:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  image::<target>[<attributes>]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The block `image` macro has the same <<X55,macro attributes>> as it's
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<<X9,inline image macro>> counterpart.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Block images can be titled by preceding the 'image' macro with a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'BlockTitle'.  DocBook toolchains normally number titled block images
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -and optionally list them in an automatically generated 'List of
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Figures' backmatter section.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -This example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  .Main circuit board
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  image::images/layout.png[J14P main circuit board]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -is equivalent to:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  image::images/layout.png["J14P main circuit board",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                            title="Main circuit board"]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -A title prefix that can be inserted with the `caption` attribute
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -(HTML backends). For example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  .Main circuit board
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  [caption="Figure 2: "]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  image::images/layout.png[J14P main circuit board]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X66]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Embedding images in XHTML documents
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -*********************************************************************
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -If you define the `data-uri` attribute then images will be embedded in
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -XHTML outputs using the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -http://en.wikipedia.org/wiki/Data:_URI_scheme[data URI scheme].  You
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -can use the 'data-uri' attribute with the 'xhtml11' and 'html5'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -backends to produce single-file XHTML documents with embedded images
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -and CSS, for example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  $ asciidoc -a data-uri mydocument.txt
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[NOTE]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -======
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- All current popular browsers support data URIs, although versions
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  of Internet Explorer prior to version 8 do not.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Some browsers limit the size of data URIs.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -======
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -*********************************************************************
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X25]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Comment Lines
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -^^^^^^^^^^^^^
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Single lines starting with two forward slashes hard up against the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -left margin are treated as comments. Comment lines do not appear in
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -the output unless the 'showcomments' attribute is defined.  Comment
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -lines have been implemented as both block and inline macros so a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -comment line can appear as a stand-alone block or within block elements
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -that support inline macro expansion. Example comment line:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  // This is a comment.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -If the 'showcomments' attribute is defined comment lines are written
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -to the output:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- In DocBook the comment lines are enclosed by the 'remark' element
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  (which may or may not be rendered by your toolchain).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The 'showcomments' attribute does not expose <<X26,Comment Blocks>>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Comment Blocks are never passed to the output.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -System Macros
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -System macros are block macros that perform a predefined task and are
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -hardwired into the asciidoc(1) program.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- You can escape system macros with a leading backslash character
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  (as you can with other macros).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The syntax and tasks performed by system macros is built into
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  asciidoc(1) so they don't appear in configuration files.  You can
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  however customize the syntax by adding entries to a configuration
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  file `[macros]` section.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X63]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Include Macros
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -^^^^^^^^^^^^^^
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The `include` and `include1`  system macros to include the contents of
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -a named file into the source document.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The `include` macro includes a file as if it were part of the parent
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -document -- tabs are expanded and system macros processed. The
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -contents of `include1` files are not subject to tab expansion or
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -system macro processing nor are attribute or lower priority
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -substitutions performed. The `include1` macro's intended use is to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -include verbatim embedded CSS or scripts into configuration file
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -headers.  Example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -\include::chapter1.txt[tabsize=4]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Include macro behavior
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- If the included file name is specified with a relative path then the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  path is relative to the location of the referring document.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Include macros can appear inside configuration files.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Files included from within 'DelimitedBlocks' are read to completion
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  to avoid false end-of-block underline termination.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Attribute references are expanded inside the include 'target'; if an
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  attribute is undefined then the included file is silently skipped.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The 'tabsize' macro attribute sets the number of space characters to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  be used for tab expansion in the included file (not applicable to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  `include1` macro).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The 'depth' macro attribute sets the maximum permitted number of
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  subsequent nested includes (not applicable to `include1` macro which
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  does not process nested includes). Setting 'depth' to '1' disables
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  nesting inside the included file. By default, nesting is limited to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  a depth of ten.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- If the he 'warnings' attribute is set to 'False' (or any other
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Python literal that evaluates to boolean false) then no warning
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  message is printed if the included file does not exist. By default
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  'warnings' are enabled.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Internally the `include1` macro is translated to the `include1`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  system attribute which means it must be evaluated in a region where
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  attribute substitution is enabled. To inhibit nested substitution in
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  included files it is preferable to use the `include` macro and set
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  the attribute `depth=1`.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Conditional Inclusion Macros
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Lines of text in the source document can be selectively included or
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -excluded from processing based on the existence (or not) of a document
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -attribute.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Document text between the `ifdef` and `endif` macros is included if a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -document attribute is defined:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ifdef::<attribute>[]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  :
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  endif::<attribute>[]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Document text between the `ifndef` and `endif` macros is not included
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -if a document attribute is defined:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ifndef::<attribute>[]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  :
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  endif::<attribute>[]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`<attribute>` is an attribute name which is optional in the trailing
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`endif` macro.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -If you only want to process a single line of text then the text can be
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -put inside the square brackets and the `endif` macro omitted, for
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ifdef::revnumber[Version number 42]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Is equivalent to:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ifdef::revnumber[]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Version number 42
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  endif::revnumber[]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'ifdef' and 'ifndef' macros also accept multiple attribute names:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Multiple ',' separated attribute names evaluate to defined if one
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  or more of the attributes is defined, otherwise it's value is
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  undefined.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Multiple '+' separated attribute names evaluate to defined if all
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  of the attributes is defined, otherwise it's value is undefined.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Document text between the `ifeval` and `endif` macros is included if
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -the Python expression inside the square brackets is true. Example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ifeval::[{rs458}==2]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  :
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  endif::[]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Document attribute references are expanded before the expression is
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  evaluated.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- If an attribute reference is undefined then the expression is
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  considered false.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Take a look at the `*.conf` configuration files in the AsciiDoc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -distribution for examples of conditional inclusion macro usage.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Executable system macros
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -^^^^^^^^^^^^^^^^^^^^^^^^
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The 'eval', 'sys' and 'sys2' block macros exhibit the same behavior as
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -their same named <<X24, system attribute references>>. The difference
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -is that system macros occur in a block macro context whereas system
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -attributes are confined to inline contexts where attribute
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -substitution is enabled.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The following example displays a long directory listing inside a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -literal block:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  sys::[ls -l *.txt]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -NOTE: There are no block macro versions of the 'eval3' and 'sys3'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -system attributes.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Template System Macro
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -^^^^^^^^^^^^^^^^^^^^^
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The `template` block macro allows the inclusion of one configuration
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -file template section within another.  The following example includes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -the `[admonitionblock]` section in the `[admonitionparagraph]`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -section:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  [admonitionparagraph]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  template::[admonitionblock]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Template macro behavior
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The `template::[]` macro is useful for factoring configuration file
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  markup.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- `template::[]` macros cannot be nested.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- `template::[]` macro expansion is applied after all configuration
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  files have been read.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X77]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Passthrough macros
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Passthrough macros are analogous to <<X76,passthrough blocks>> and are
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -used to pass text directly to the output. The substitution performed
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -on the text is determined by the macro definition but can be overridden
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -by the `<subslist>`.  The usual syntax is
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`<name>:<subslist>[<passtext>]` (for inline macros) and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`<name>::<subslist>[<passtext>]` (for block macros). Passthroughs, by
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -definition, take precedence over all other text substitutions.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -pass::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Inline and block. Passes text unmodified (apart from explicitly
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  specified substitutions). Examples:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  pass:[<q>To be or not to be</q>]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  pass:attributes,quotes[<u>the '{author}'</u>]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -asciimath, latexmath::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Inline and block. Passes text unmodified.  Used for
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  <<X78,mathematical formulas>>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -\+++::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Inline and block. The triple-plus passthrough is functionally
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  identical to the 'pass' macro but you don't have to escape `]`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  characters and you can prefix with quoted attributes in the inline
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  version. Example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Red [red]+++`sum_(i=1)\^n i=(n(n+1))/2`$+++ AsciiMathML formula
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -$$::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Inline and block. The double-dollar passthrough is functionally
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  identical to the triple-plus passthrough with one exception: special
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  characters are escaped. Example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  $$`[[a,b],[c,d]]((n),(k))`$$
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X80]]`::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Text quoted with single backtick characters constitutes an 'inline
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  literal' passthrough. The enclosed text is rendered in a monospaced
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  font and is only subject to special character substitution.  This
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  makes sense since monospace text is usually intended to be rendered
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  literally and often contains characters that would otherwise have to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  be escaped. If you need monospaced text containing inline
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  substitutions use a <<X81,plus character instead of a backtick>>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Macro Definitions
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Each entry in the configuration `[macros]` section is a macro
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -definition which can take one of the following forms:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`<pattern>=<name>[<subslist]`:: Inline macro definition.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`<pattern>=#<name>[<subslist]`:: Block macro definition.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`<pattern>=+<name>[<subslist]`:: System macro definition.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`<pattern>`:: Delete the existing macro with this `<pattern>`.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`<pattern>` is a Python regular expression and `<name>` is the name of
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -a markup template. If `<name>` is omitted then it is the value of the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -regular expression match group named 'name'.  The optional
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`[<subslist]` is a comma-separated list of substitution names enclosed
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -in `[]` brackets, it sets the default substitutions for passthrough
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -text, if omitted then no passthrough substitutions are performed.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Pattern named groups
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The following named groups can be used in macro `<pattern>` regular
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -expressions and are available as markup template attributes:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -name::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  The macro name.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -target::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  The macro target.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -attrlist::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  The macro attribute list.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -passtext::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Contents of this group are passed unmodified to the output subject
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  only to 'subslist' substitutions.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -subslist::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Processed as a comma-separated list of substitution names for
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  'passtext' substitution, overrides the the macro definition
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  'subslist'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Here's what happens during macro substitution
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Each contextually relevant macro 'pattern' from the `[macros]`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  section is matched against the input source line.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- If a match is found the text to be substituted is loaded from a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  configuration markup template section named like
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  `<name>-inlinemacro` or `<name>-blockmacro` (depending on the macro
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  type).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Global and macro attribute list attributes are substituted in the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  macro's markup template.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The substituted template replaces the macro reference in the output
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  document.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X98]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -HTML 5 audio and video block macros
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The 'html5' backend 'audio' and 'video' block macros generate the HTML
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -5 'audio' and 'video' elements respectively.  They follow the usual
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc block macro syntax `<name>::<target>[<attrlist>]` where:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[horizontal]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`<name>`:: 'audio' or 'video'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`<target>`:: The URL or file name of the video or audio file.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`<attrlist>`:: A list of named attributes (see below).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Audio macro attributes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[options="header",cols="1,5",frame="topbot"]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|Name | Value
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|options
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|A comma separated list of one or more of the following items:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'autoplay', 'loop' which correspond to the same-named HTML 5 'audio'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -element boolean attributes.  By default the player 'controls' are
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -enabled, include the 'nocontrols' option value to hide them.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Video macro attributes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[options="header",cols="1,5",frame="topbot"]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|Name   | Value
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|height | The height of the player in pixels.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|width  | The width of the player in pixels.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|poster | The URL or file name of an image representing the video.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|options
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|A comma separated list of one or more of the following items:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'autoplay', 'loop' and 'nocontrols'. The 'autoplay' and 'loop' options
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -correspond to the same-named HTML 5 'video' element boolean
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -attributes.  By default the player 'controls' are enabled, include the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'nocontrols' option value to hide them.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Examples:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -audio::images/example.ogg[]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -video::gizmo.ogv[width=200,options="nocontrols,autoplay"]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Example video
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -video::gizmo.ogv[]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -video::http://www.808.dk/pics/video/gizmo.ogv[]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -If your needs are more complex put raw HTML 5 in a markup block, for
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -example (from http://www.808.dk/?code-html-5-video):
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -++++
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<video poster="pics/video/gizmo.jpg" id="video" style="cursor: pointer;" >
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  <source src="pics/video/gizmo.mp4" />
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  <source src="pics/video/gizmo.webm" type="video/webm" />
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  <source src="pics/video/gizmo.ogv" type="video/ogg" />
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Video not playing? <a href="pics/video/gizmo.mp4">Download file</a> instead.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -</video>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<script type="text/javascript">
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  var video = document.getElementById('video');
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  video.addEventListener('click',function(){
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    video.play();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  },false);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -</script>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -++++
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Tables
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The AsciiDoc table syntax looks and behaves like other delimited block
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -types and supports standard <<X73,block configuration entries>>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Formatting is easy to read and, just as importantly, easy to enter.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Cells and columns can be formatted using built-in customizable styles.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Horizontal and vertical cell alignment can be set on columns and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  cell.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Horizontal and vertical cell spanning is supported.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Use tables sparingly
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -*********************************************************************
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -When technical users first start creating documents, tables (complete
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -with column spanning and table nesting) are often considered very
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -important. The reality is that tables are seldom used, even in
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -technical documentation.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Try this exercise: thumb through your library of technical books,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -you'll be surprised just how seldom tables are actually used, even
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -less seldom are tables containing block elements (such as paragraphs
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -or lists) or spanned cells. This is no accident, like figures, tables
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -are outside the normal document flow -- tables are for consulting not
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -for reading.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Tables are designed for, and should normally only be used for,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -displaying column oriented tabular data.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -*********************************************************************
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Example tables
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Simple table
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[width="15%"]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|=======
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|1 |2 |A
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|3 |4 |B
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|5 |6 |C
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|=======
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.AsciiDoc source
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[width="15%"]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|=======
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|1 |2 |A
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|3 |4 |B
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|5 |6 |C
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|=======
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Columns formatted with strong, monospaced and emphasis styles
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[width="50%",cols=">s,^m,e",frame="topbot",options="header,footer"]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|==========================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|      2+|Columns 2 and 3
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|1       |Item 1  |Item 1
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|2       |Item 2  |Item 2
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|3       |Item 3  |Item 3
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|4       |Item 4  |Item 4
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|footer 1|footer 2|footer 3
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|==========================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.AsciiDoc source
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.An example table
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[width="50%",cols=">s,^m,e",frame="topbot",options="header,footer"]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|==========================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|      2+|Columns 2 and 3
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|1       |Item 1  |Item 1
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|2       |Item 2  |Item 2
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|3       |Item 3  |Item 3
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|4       |Item 4  |Item 4
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|footer 1|footer 2|footer 3
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|==========================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Horizontal and vertical source data
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[width="80%",cols="3,^2,^2,10",options="header"]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|=========================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|Date |Duration |Avg HR |Notes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|22-Aug-08 |10:24 | 157 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Worked out MSHR (max sustainable heart rate) by going hard
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -for this interval.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|22-Aug-08 |23:03 | 152 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Back-to-back with previous interval.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|24-Aug-08 |40:00 | 145 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Moderately hard interspersed with 3x 3min intervals (2min
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -hard + 1min really hard taking the HR up to 160).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|=========================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Short cells can be entered horizontally, longer cells vertically.  The
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -default behavior is to strip leading and trailing blank lines within a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -cell. These characteristics aid readability and data entry.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.AsciiDoc source
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Windtrainer workouts
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[width="80%",cols="3,^2,^2,10",options="header"]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|=========================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|Date |Duration |Avg HR |Notes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|22-Aug-08 |10:24 | 157 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Worked out MSHR (max sustainable heart rate) by going hard
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -for this interval.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|22-Aug-08 |23:03 | 152 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Back-to-back with previous interval.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|24-Aug-08 |40:00 | 145 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Moderately hard interspersed with 3x 3min intervals (2min
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -hard + 1min really hard taking the HR up to 160).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|=========================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.A table with externally sourced CSV data
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[format="csv",cols="^1,4*2",options="header"]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|===================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -ID,Customer Name,Contact Name,Customer Address,Phone
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -include::customers.csv[]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|===================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.AsciiDoc source
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[format="csv",cols="^1,4*2",options="header"]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|===================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -ID,Customer Name,Contact Name,Customer Address,Phone
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -\include::customers.csv[]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|===================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Cell spans, alignments and styles
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[cols="e,m,^,>s",width="25%"]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|============================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|1 >s|2 |3 |4
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -^|5 2.2+^.^|6 .3+<.>m|7
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -^|8
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|9 2+>|10
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|============================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.AsciiDoc source
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[cols="e,m,^,>s",width="25%"]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|============================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|1 >s|2 |3 |4
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -^|5 2.2+^.^|6 .3+<.>m|7
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -^|8
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|9 2+>|10
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|============================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X68]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Table input data formats
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc table data can be 'psv', 'dsv' or 'csv' formatted.  The
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -default table format is 'psv'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc 'psv' ('Prefix Separated Values') and 'dsv' ('Delimiter
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Separated Values') formats are cell oriented -- the table is treated
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -as a sequence of cells -- there are no explicit row separators.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- 'psv' prefixes each cell with a separator whereas 'dsv' delimits
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  cells with a separator.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- 'psv' and 'dsv' separators are Python regular expressions.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The default 'psv' separator contains <<X84, cell specifier>> related
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  named regular expression groups.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The default 'dsv' separator is `:|\n` (a colon or a new line
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  character).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- 'psv' and 'dsv' cell separators can be escaped by preceding them
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  with a backslash character.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Here are four 'psv' cells (the second item spans two columns; the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -last contains an escaped separator):
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  |One 2+|Two and three |A \| separator character
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'csv'  is the quasi-standard row oriented 'Comma Separated Values
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -(CSV)' format commonly used to import and export spreadsheet and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -database data.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X69]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Table attributes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Tables can be customized by the following attributes:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -format::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'psv' (default), 'dsv' or 'csv' (See <<X68, Table Data Formats>>).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -separator::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The cell separator. A Python regular expression ('psv' and 'dsv'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -formats) or a single character ('csv' format).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -frame::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Defines the table border and can take the following values: 'topbot'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -(top and bottom), 'all' (all sides), 'none' and 'sides' (left and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -right sides). The default value is 'all'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -grid::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Defines which ruler lines are drawn between table rows and columns.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The 'grid' attribute value can be any of the following values: 'none',
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'cols', 'rows' and 'all'. The default value is 'all'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -align::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Use the 'align' attribute to horizontally align the table on the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -page (works with HTML outputs only, has no effect on DocBook outputs).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The following values are valid: 'left', 'right', and 'center'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -float::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Use the 'float' attribute to float the table 'left' or 'right' on the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -page (works with HTML outputs only, has no effect on DocBook outputs).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Floating only makes sense in conjunction with a table 'width'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -attribute value of less than 100% (otherwise the table will take up
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -all the available space).  'float' and 'align' attributes are mutually
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -exclusive.  Use the `unfloat::[]` block macro to stop floating.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -halign::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Use the 'halign' attribute to horizontally align all cells in a table.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The following values are valid: 'left', 'right', and 'center'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -(defaults to 'left'). Overridden by <<X70,Column specifiers>>  and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<<X84,Cell specifiers>>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -valign::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Use the 'valign' attribute to vertically align all cells in a table.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The following values are valid: 'top', 'bottom', and 'middle'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -(defaults to 'top'). Overridden by <<X70,Column specifiers>>  and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<<X84,Cell specifiers>>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -options::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The 'options' attribute can contain comma separated values, for
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -example: 'header', 'footer'. By default header and footer rows are
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -omitted.  See <<X74,attribute options>> for a complete list of
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -available table options.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -cols::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The 'cols' attribute is a comma separated list of <<X70,column
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -specifiers>>. For example `cols="2<p,2*,4p,>"`.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- If 'cols' is present it must specify all columns.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- If the 'cols' attribute is not specified the number of columns is
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  calculated as the number of data items in the *first line* of the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  table.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The degenerate form for the 'cols' attribute is an integer
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  specifying the number of columns e.g. `cols=4`.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -width::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The 'width' attribute is expressed as a percentage value
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -('"1%"'...'"99%"'). The width specifies the table width relative to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -the available width. HTML backends use this value to set the table
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -width attribute. It's a bit more complicated with DocBook, see the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<<X89,DocBook table widths>> sidebar.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -filter::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The 'filter' attribute defines an external shell command that is
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -invoked for each cell. The built-in 'asciidoc' table style is
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -implemented using a filter.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X89]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.DocBook table widths
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -**********************************************************************
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The AsciiDoc docbook backend generates CALS tables. CALS tables do not
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -support a table width attribute -- table width can only be controlled
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -by specifying absolute column widths.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Specifying absolute column widths is not media independent because
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -different presentation media have different physical dimensions. To
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -get round this limitation both
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -http://www.sagehill.net/docbookxsl/Tables.html#TableWidth[DocBook XSL
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Stylesheets] and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -http://dblatex.sourceforge.net/doc/manual/ch03s05.html#sec-table-width[dblatex]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -have implemented table width processing instructions for setting the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -table width as a percentage of the available width. AsciiDoc emits
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -these processing instructions if the 'width' attribute is set along
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -with proportional column widths (the AsciiDoc docbook backend
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'pageunits' attribute defaults to '*').
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -To generate DocBook tables with absolute column widths set the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'pageunits' attribute to a CALS absolute unit such as 'pt' and set the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'pagewidth' attribute to match the width of the presentation media.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -**********************************************************************
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X70]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Column Specifiers
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Column specifiers define how columns are rendered and appear in the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -table <<X69,cols attribute>>.  A column specifier consists of an
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -optional column multiplier followed by optional alignment, width and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -style values and is formatted like:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  [<multiplier>*][<align>][<width>][<style>]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- All components are optional. The multiplier must be first and the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  style last. The order of `<align>` or `<width>` is not important.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Column `<width>` can be either an integer proportional value (1...)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  or a percentage (1%...100%). The default value is 1. To ensure
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  portability across different backends, there is no provision for
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  absolute column widths (not to be confused with output column width
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  <<X72,markup attributes>> which are available in both percentage and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  absolute units).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The '<align>' column alignment specifier is formatted like:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  [<horizontal>][.<vertical>]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -+
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Where `<horizontal>` and `<vertical>` are one of the following
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -characters: `<`, `^` or `>` which represent 'left', 'center' and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'right' horizontal alignment or 'top', 'middle' and 'bottom' vertical
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -alignment respectively.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- A `<multiplier>` can be used to specify repeated columns e.g.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  `cols="4*<"` specifies four left-justified columns. The default
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  multiplier value is 1.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The `<style>` name specifies a <<X71,table style>> to used to markup
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  column cells (you can use the full style names if you wish but the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  first letter is normally sufficient).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Column specific styles are not applied to header rows.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X84]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Cell Specifiers
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Cell specifiers allow individual cells in 'psv' formatted tables to be
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -spanned, multiplied, aligned and styled.  Cell specifiers prefix 'psv'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`|` delimiters and are formatted like:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  [<span>*|+][<align>][<style>]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- '<span>' specifies horizontal and vertical cell spans ('+' operator) or
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  the number of times the cell is replicated ('*' operator). '<span>'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  is formatted like:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  [<colspan>][.<rowspan>]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -+
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Where `<colspan>` and `<rowspan>` are integers specifying the number of
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -columns and rows to span.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- `<align>` specifies horizontal and vertical cell alignment an is the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  same as in <<X70,column specifiers>>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- A `<style>` value is the first letter of <<X71,table style>> name.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -For example, the following 'psv' formatted cell will span two columns
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -and the text will be centered and emphasized:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  `2+^e| Cell text`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X71]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Table styles
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Table styles can be applied to the entire table (by setting the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'style' attribute in the table's attribute list) or on a per column
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -basis (by specifying the style in the table's <<X69,cols attribute>>).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Table data can be formatted using the following predefined styles:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -default::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The default style: AsciiDoc inline text formatting; blank lines are
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -treated as paragraph breaks.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -emphasis::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Like default but all text is emphasised.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -monospaced::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Like default but all text is in a monospaced font.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -strong::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Like default but all text is bold.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -header::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Apply the same style as the table header. Normally used to create a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -vertical header in the first column.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -asciidoc::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -With this style table cells can contain any of the AsciiDoc elements
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -that are allowed inside document sections. This style runs asciidoc(1)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -as a filter to process cell contents. See also <<X83,Docbook table
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -limitations>>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -literal::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -No text formatting; monospaced font; all line breaks are retained
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -(the same as the AsciiDoc <<X65,LiteralBlock>> element).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -verse::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -All line breaks are retained (just like the AsciiDoc <<X94,verse
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -paragraph style>>).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X72]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Markup attributes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc makes a number of attributes available to table markup
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -templates and tags. Column specific attributes are available when
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -substituting the 'colspec' cell data tags.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -pageunits::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -DocBook backend only. Specifies table column absolute width units.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Defaults to '*'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -pagewidth::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -DocBook backend only. The nominal output page width in 'pageunit'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -units. Used to calculate CALS tables absolute column and table
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -widths. Defaults to '425'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -tableabswidth::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Integer value calculated from 'width' and 'pagewidth' attributes.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -In 'pageunit' units.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -tablepcwidth::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Table width expressed as a percentage of the available width. Integer
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -value (0..100).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -colabswidth::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Integer value calculated from 'cols' column width, 'width' and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'pagewidth' attributes.  In 'pageunit' units.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -colpcwidth::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Column width expressed as a percentage of the table width. Integer
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -value (0..100).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -colcount::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Total number of table columns.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -rowcount::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Total number of table rows.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -halign::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Horizontal cell content alignment: 'left', 'right' or 'center'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -valign::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Vertical cell content alignment: 'top', 'bottom' or 'middle'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -colnumber, colstart::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The number of the leftmost column occupied by the cell (1...).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -colend::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The number of the rightmost column occupied by the cell (1...).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -colspan::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Number of columns the cell should span.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -rowspan::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Number of rows the cell should span (1...).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -morerows::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Number of additional rows the cell should span (0...).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Nested tables
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -An alternative 'psv' separator character '!' can be used (instead of
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'|') in nested tables. This allows a single level of table nesting.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Columns containing nested tables must use the 'asciidoc' style. An
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -example can be found in `./examples/website/newtables.txt`.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X83]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -DocBook table limitations
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Fully implementing tables is not trivial, some DocBook toolchains do
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -better than others.  AsciiDoc HTML table outputs are rendered
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -correctly in all the popular browsers -- if your DocBook generated
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -tables don't look right compare them with the output generated by the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc 'xhtml11' backend or try a different DocBook toolchain.  Here
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -is a list of things to be aware of:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Although nested tables are not legal in DocBook 4 the FOP and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  dblatex toolchains will process them correctly.  If you use `a2x(1)`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  you will need to include the `--no-xmllint` option to suppress
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  DocBook validation errors.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -+
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -NOTE: In theory you can nest DocBook 4 tables one level using the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'entrytbl' element, but not all toolchains process 'entrytbl'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- DocBook only allows a subset of block elements inside table cells so
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  not all AsciiDoc elements produce valid DocBook inside table cells.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  If you get validation errors running `a2x(1)` try the `--no-xmllint`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  option, toolchains will often process nested block elements such as
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  sidebar blocks and floating titles correctly even though, strictly
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  speaking, they are not legal.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Text formatting in cells using the 'monospaced' table style will
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  raise validation errors because the DocBook 'literal' element was
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  not designed to support formatted text (using the 'literal' element
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  is a kludge on the part of AsciiDoc as there is no easy way to set
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  the font style in DocBook.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Cell alignments are ignored for 'verse', 'literal' or 'asciidoc'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  table styles.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X1]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Manpage Documents
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Sooner or later, if you program in a UNIX environment, you're going
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -to have to write a man page.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -By observing a couple of additional conventions (detailed below) you
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -can write AsciiDoc files that will generate HTML and PDF man pages
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -plus the native manpage roff format.  The easiest way to generate roff
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -manpages from AsciiDoc source is to use the a2x(1) command. The
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -following example generates a roff formatted manpage file called
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`asciidoc.1` (a2x(1) uses asciidoc(1) to convert `asciidoc.1.txt` to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -DocBook which it then converts to roff using DocBook XSL Stylesheets):
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  a2x --doctype manpage --format manpage asciidoc.1.txt
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Viewing and printing manpage files
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -**********************************************************************
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Use the `man(1)` command to view the manpage file:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  $ man -l asciidoc.1
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -To print a high quality man page to a postscript printer:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  $ man -l -Tps asciidoc.1 | lpr
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -You could also create a PDF version of the man page by converting
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -PostScript to PDF using `ps2pdf(1)`:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  $ man -l -Tps asciidoc.1 | ps2pdf - asciidoc.1.pdf
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The `ps2pdf(1)` command is included in the Ghostscript distribution.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -**********************************************************************
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -To find out more about man pages view the `man(7)` manpage
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -(`man 7 man` and `man man-pages` commands).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Document Header
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -A manpage document Header is mandatory. The title line contains the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -man page name followed immediately by the manual section number in
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -brackets, for example 'ASCIIDOC(1)'. The title name should not contain
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -white space and the manual section number is a single digit optionally
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -followed by a single character.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The NAME Section
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The first manpage section is mandatory, must be titled 'NAME' and must
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -contain a single paragraph (usually a single line) consisting of a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -list of one or more comma separated command name(s) separated from the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -command purpose by a dash character. The dash must have at least one
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -white space character on either side. For example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  printf, fprintf, sprintf - print formatted output
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The SYNOPSIS Section
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The second manpage section is mandatory and must be titled 'SYNOPSIS'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -refmiscinfo attributes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -In addition to the automatically created man page <<X60,intrinsic
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -attributes>> you can assign DocBook
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -http://www.docbook.org/tdg5/en/html/refmiscinfo.html[refmiscinfo]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -element 'source', 'version' and 'manual' values using AsciiDoc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`{mansource}`, `{manversion}` and `{manmanual}` attributes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -respectively. This example is from the AsciiDoc header of a man page
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -source file:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  :man source:   AsciiDoc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  :man version:  {revnumber}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  :man manual:   AsciiDoc Manual
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X78]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Mathematical Formulas
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The 'asciimath' and 'latexmath' <<X77,passthrough macros>> along with
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'asciimath' and 'latexmath'  <<X76,passthrough blocks>> provide a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -(backend dependent) mechanism for rendering mathematical formulas. You
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -can use the following math markups:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -NOTE: The 'latexmath' macro used to include 'LaTeX Math' in DocBook
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -outputs is not the same as the 'latexmath' macro used to include
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'LaTeX MathML' in XHTML outputs.  'LaTeX Math' applies to DocBook
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -outputs that are processed by <<X31,dblatex>> and is normally used to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -generate PDF files.  'LaTeXMathML' is very much a subset of 'LaTeX
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Math' and applies to XHTML documents.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -LaTeX Math
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -ftp://ftp.ams.org/pub/tex/doc/amsmath/short-math-guide.pdf[LaTeX
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -math] can be included in documents that are processed by
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<<X31,dblatex(1)>>.  Example inline formula:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  latexmath:[$C = \alpha + \beta Y^{\gamma} + \epsilon$]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -For more examples see the {website}[AsciiDoc website] or the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -distributed `doc/latexmath.txt` file.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -ASCIIMathML
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -/////////////////////////////////////////////////////////////////////
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The older ASCIIMathML 1.47 version is used instead of version 2
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -because:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -1. Version 2 doesn't work when embedded.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -2. Version 2 is much larger.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -/////////////////////////////////////////////////////////////////////
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -http://www1.chapman.edu/~jipsen/mathml/asciimath.html[ASCIIMathML]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -formulas can be included in XHTML documents generated using the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'xhtml11' and 'html5' backends. To enable ASCIIMathML support you must
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -define the 'asciimath' attribute, for example using the `-a asciimath`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -command-line option.  Example inline formula:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  asciimath:[`x/x={(1,if x!=0),(text{undefined},if x=0):}`]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -For more examples see the {website}[AsciiDoc website] or the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -distributed `doc/asciimathml.txt` file.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -LaTeXMathML
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -/////////////////////////////////////////////////////////////////////
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -There is an http://math.etsu.edu/LaTeXMathML/[extended LaTeXMathML
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -version] by Jeff Knisley, in addition to a JavaScript file it requires
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -the inclusion of a CSS file.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -/////////////////////////////////////////////////////////////////////
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'LaTeXMathML' allows LaTeX Math style formulas to be included in XHTML
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -documents generated using the AsciiDoc 'xhtml11' and 'html5' backends.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc uses the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -http://www.maths.nottingham.ac.uk/personal/drw/lm.html[original
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -LaTeXMathML] by Douglas Woodall.  'LaTeXMathML' is derived from
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -ASCIIMathML and is for users who are more familiar with or prefer
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -using LaTeX math formulas (it recognizes a subset of LaTeX Math, the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -differences are documented on the 'LaTeXMathML' web page).  To enable
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -LaTeXMathML support you must define the 'latexmath' attribute, for
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -example using the `-a latexmath` command-line option.  Example inline
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -formula:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  latexmath:[$\sum_{n=1}^\infty \frac{1}{2^n}$]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -For more examples see the {website}[AsciiDoc website] or the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -distributed `doc/latexmathml.txt` file.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -MathML
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -http://www.w3.org/Math/[MathML] is a low level XML markup for
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -mathematics. AsciiDoc has no macros for MathML but users familiar with
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -this markup could use passthrough macros and passthrough blocks to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -include MathML in output documents.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X7]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Configuration Files
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc source file syntax and output file markup is largely
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -controlled by a set of cascading, text based, configuration files.  At
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -runtime The AsciiDoc default configuration files are combined with
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -optional user and document specific configuration files.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Configuration File Format
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Configuration files contain named sections. Each section begins with a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -section name in square brackets []. The section body consists of the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -lines of text between adjacent section headings.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Section names consist of one or more alphanumeric, underscore or
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  dash characters and cannot begin or end with a dash.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Lines starting with a '#' character are treated as comments and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ignored.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- If the section name is prefixed with a '+' character then the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  section contents is appended to the contents of an already existing
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  same-named section.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Otherwise same-named sections and section entries override
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  previously loaded sections and section entries (this is sometimes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  referred to as 'cascading').  Consequently, downstream configuration
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  files need only contain those sections and section entries that need
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  to be overridden.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -TIP: When creating custom configuration files you only need to include
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -the sections and entries that differ from the default configuration.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -TIP: The best way to learn about configuration files is to read the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -default configuration files in the AsciiDoc distribution in
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -conjunction with asciidoc(1) output files. You can view configuration
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -file load sequence by turning on the asciidoc(1) `-v` (`--verbose`)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -command-line option.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc reserves the following section names for specific purposes:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -miscellaneous::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Configuration options that don't belong anywhere else.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -attributes::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Attribute name/value entries.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -specialcharacters::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Special characters reserved by the backend markup.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -tags::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Backend markup tags.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -quotes::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Definitions for quoted inline character formatting.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -specialwords::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Lists of words and phrases singled out for special markup.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -replacements, replacements2, replacements3::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Find and replace substitution definitions.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -specialsections::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Used to single out special section names for specific markup.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -macros::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Macro syntax definitions.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -titles::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Heading, section and block title definitions.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -paradef-*::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Paragraph element definitions.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -blockdef-*::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        DelimitedBlock element definitions.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -listdef-*::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        List element definitions.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -listtags-*::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        List element tag definitions.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -tabledef-*::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Table element definitions.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -tabletags-*::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Table element tag definitions.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Each line of text in these sections is a 'section entry'. Section
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -entries share the following syntax:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -name=value::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        The entry value is set to value.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -name=::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        The entry value is set to a zero length string.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -name!::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        The entry is undefined (deleted from the configuration). This
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        syntax only applies to 'attributes' and 'miscellaneous'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        sections.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Section entry behavior
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- All equals characters inside the `name` must be escaped with a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  backslash character.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- `name` and `value` are stripped of leading and trailing white space.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Attribute names, tag entry names and markup template section names
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  consist of one or more alphanumeric, underscore or dash characters.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Names should not begin or end with a dash.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- A blank configuration file section (one without any entries) deletes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  any preceding section with the same name (applies to non-markup
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  template sections).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Miscellaneous section
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The optional `[miscellaneous]` section specifies the following
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`name=value` options:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -newline::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Output file line termination characters. Can include any
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        valid Python string escape sequences. The default value is
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        `\r\n` (carriage return, line feed). Should not be quoted or
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        contain explicit spaces (use `\x20` instead). For example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        $ asciidoc -a 'newline=\n' -b docbook mydoc.txt
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -outfilesuffix::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        The default extension for the output file, for example
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        `outfilesuffix=.html`. Defaults to backend name.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -tabsize::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        The number of spaces to expand tab characters, for example
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        `tabsize=4`. Defaults to 8. A 'tabsize' of zero suppresses tab
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        expansion (useful when piping included files through block
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        filters). Included files can override this option using the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        'tabsize' attribute.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -pagewidth, pageunits::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        These global table related options are documented in the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        <<X4,Table Configuration File Definitions>> sub-section.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -NOTE: `[miscellaneous]` configuration file entries can be set using
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -the asciidoc(1) `-a` (`--attribute`) command-line option.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Titles section
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -sectiontitle::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Two line section title pattern. The entry value is a Python
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        regular expression containing the named group 'title'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -underlines::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        A comma separated list of document and section title underline
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        character pairs starting with the section level 0 and ending
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        with section level 4 underline. The default setting is:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        underlines="==","--","~~","^^","++"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -sect0...sect4::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        One line section title patterns. The entry value is a Python
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        regular expression containing the named group 'title'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -blocktitle::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        <<X42,BlockTitle element>> pattern.  The entry value is a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Python regular expression containing the named group 'title'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -subs::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        A comma separated list of substitutions that are performed on
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        the document header and section titles. Defaults to 'normal'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        substitution.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Tags section
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The `[tags]` section contains backend tag definitions (one per
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -line). Tags are used to translate AsciiDoc elements to backend
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -markup.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -An AsciiDoc tag definition is formatted like
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`<tagname>=<starttag>|<endtag>`. For example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  emphasis=<em>|</em>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -In this example asciidoc(1) replaces the | character with the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -emphasized text from the AsciiDoc input file and writes the result to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -the output file.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Use the `{brvbar}` attribute reference if you need to include a | pipe
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -character inside tag text.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Attributes section
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The optional `[attributes]` section contains predefined attributes.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -If the attribute value requires leading or trailing spaces then the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -text text should be enclosed in quotation mark (") characters.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -To delete a attribute insert a `name!` entry in a downstream
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -configuration file or use the asciidoc(1) `--attribute name!`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -command-line option (an attribute name suffixed with a `!` character
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -deletes the attribute)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Special Characters section
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The `[specialcharacters]` section specifies how to escape characters
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -reserved by the backend markup. Each translation is specified on a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -single line formatted like:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  <special_character>=<translated_characters>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Special characters are normally confined to those that resolve
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -markup ambiguity (in the case of HTML and XML markups the ampersand,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -less than and greater than characters).  The following example causes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -all occurrences of the `<` character to be replaced by `<`.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  <=<
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Quoted Text section
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Quoting is used primarily for text formatting.  The `[quotes]` section
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -defines AsciiDoc quoting characters and their corresponding backend
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -markup tags.  Each section entry value is the name of a of a `[tags]`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -section entry. The entry name is the character (or characters) that
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -quote the text.  The following examples are taken from AsciiDoc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -configuration files:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  [quotes]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  _=emphasis
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  [tags]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  emphasis=<em>|</em>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -You can specify the left and right quote strings separately by
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -separating them with a | character, for example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ``|''=quoted
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Omitting the tag will disable quoting, for example, if you don't want
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -superscripts or subscripts put the following in a custom configuration
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -file or edit the global `asciidoc.conf` configuration file:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  [quotes]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ^=
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ~=
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<<X52,Unconstrained quotes>> are differentiated from constrained
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -quotes by prefixing the tag name with a hash character, for example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  __=#emphasis
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Quoted text behavior
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Quote characters must be non-alphanumeric.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- To minimize quoting ambiguity try not to use the same quote
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  characters in different quote types.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Special Words section
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The `[specialwords]` section is used to single out words and phrases
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -that you want to consistently format in some way throughout your
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -document without having to repeatedly specify the markup. The name of
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -each entry corresponds to a markup template section and the entry
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -value consists of a list of words and phrases to be marked up. For
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  [specialwords]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  strongwords=NOTE IMPORTANT
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  [strongwords]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  <strong>{words}</strong>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The examples specifies that any occurrence of `NOTE` or `IMPORTANT`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -should appear in a bold font.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Words and word phrases are treated as Python regular expressions: for
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -example, the word `^NOTE` would only match `NOTE` if appeared at
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -the start of a line.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc comes with three built-in Special Word types:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'emphasizedwords', 'monospacedwords' and 'strongwords', each has a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -corresponding (backend specific) markup template section. Edit the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -configuration files to customize existing Special Words and to add new
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -ones.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Special word behavior
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Word list entries must be separated by space characters.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Word list entries with embedded spaces should be enclosed in quotation (")
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  characters.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- A `[specialwords]` section entry of the form
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  +name=word1{nbsp}[word2...]+ adds words to existing `name` entries.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- A `[specialwords]` section entry of the form `name` undefines
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  (deletes) all existing `name` words.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Since word list entries are processed as Python regular expressions
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  you need to be careful to escape regular expression special
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  characters.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- By default Special Words are substituted before Inline Macros, this
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  may lead to undesirable consequences. For example the special word
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  `foobar` would be expanded inside the macro call
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  `http://www.foobar.com[]`.  A possible solution is to emphasize
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  whole words only by defining the word using regular expression
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  characters, for example `\bfoobar\b`.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- If the first matched character of a special word is a backslash then
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  the remaining characters are output without markup i.e. the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  backslash can be used to escape special word markup.  For example
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  the special word `\\?\b[Tt]en\b` will mark up the words `Ten` and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  `ten` only if they are not preceded by a backslash.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X10]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Replacements section
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`[replacements]`, `[replacements2]` and `[replacements3]`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -configuration file entries specify find and replace text and are
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -formatted like:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  <find_pattern>=<replacement_text>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The find text can be a Python regular expression; the replace text can
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -contain Python regular expression group references.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Use Replacement shortcuts for often used macro references, for
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -example (the second replacement allows us to backslash escape the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -macro name):
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  NEW!=image:./images/smallnew.png[New!]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  \\NEW!=NEW!
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The only difference between the three replacement types is how they
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -are applied. By default 'replacements' and 'replacement2' are applied
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -in <<X102,normal>> substitution contexts whereas 'replacements3' needs
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -to be configured explicitly and should only be used in backend
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -configuration files.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Replacement behavior
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The built-in replacements can be escaped with a backslash.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- If the find or replace text has leading or trailing spaces then the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  text should be enclosed in quotation (") characters.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Since the find text is processed as a regular expression you need to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  be careful to escape regular expression special characters.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Replacements are performed in the same order they appear in the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  configuration file replacements section.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Markup Template Sections
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Markup template sections supply backend markup for translating
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc elements.  Since the text is normally backend dependent
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -you'll find these sections in the backend specific configuration
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -files. Template sections differ from other sections in that they
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -contain a single block of text instead of per line 'name=value'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -entries. A markup template section body can contain:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Attribute references
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- System macro calls.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- A document content placeholder
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The document content placeholder is a single | character and is
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -replaced by text from the source element.  Use the `{brvbar}`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -attribute reference if you need a literal | character in the template.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X27]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Configuration file names, precedence and locations
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Configuration files have a `.conf` file name extension; they are
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -loaded from the following locations:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -1. The directory containing the asciidoc executable.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -2. If there is no `asciidoc.conf` file in the directory containing the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   asciidoc executable then load from the global configuration
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   directory (normally `/etc/asciidoc` or `/usr/local/etc/asciidoc`)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   i.e. the global configuration files directory is skipped if
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   AsciiDoc configuration files are installed in the same directory as
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   the asciidoc executable. This allows both a system wide copy and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   multiple local copies of AsciiDoc to coexist on the same host PC.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -3. The user's `$HOME/.asciidoc` directory (if it exists).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -4. The directory containing the AsciiDoc source file.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -5. Explicit configuration files specified using:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   - The `conf-files` attribute (one or more file names separated by a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -     `|` character). These files are loaded in the order they are
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -     specified and prior to files specified using the `--conf-file`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -     command-line option.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   - The asciidoc(1) `--conf-file`) command-line option.  The
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -     `--conf-file` option can be specified multiple times, in which
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -     case configuration files will be processed in the same order they
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -     appear on the command-line.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -6. <<X100,Backend plugin>> configuration files are loaded from
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   subdirectories named like `backends/<backend>` in locations 1, 2
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   and 3.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -7. <<X59,Filter>> configuration files are loaded from subdirectories
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   named like `filters/<filter>` in locations 1, 2 and 3.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Configuration files from the above locations are loaded in the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -following order:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The `[attributes]` section only from:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  * `asciidoc.conf` in location 3
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  * Files from location 5.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -+
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -This first pass makes locally set attributes available in the global
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`asciidoc.conf` file.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- `asciidoc.conf` from locations 1, 2, 3.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- 'attributes', 'titles' and 'specialcharacters' sections from the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  `asciidoc.conf` in location 4.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The document header is parsed at this point and we can assume the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  'backend' and 'doctype' have now been defined.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Backend plugin `<backend>.conf` and `<backend>-<doctype>.conf` files
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  from locations 6.  If a backend plugin is not found then try
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  locations 1, 2 and 3 for `<backend>.conf` and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  `<backend>-<doctype>.conf` backend configuration files.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Filter conf files from locations 7.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- `lang-<lang>.conf` from locations 1, 2, 3.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- `asciidoc.conf` from location 4.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- `<backend>.conf` and `<backend>-<doctype>.conf` from location 4.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Filter conf files from location 4.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- `<docfile>.conf` and `<docfile>-<backend>.conf` from location 4.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Configuration files from location 5.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Where:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- `<backend>` and `<doctype>` are values specified by the asciidoc(1)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  `-b` (`--backend`) and `-d` (`--doctype`) command-line options.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- `<infile>` is the path name of the AsciiDoc input file without the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  file name extension.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- `<lang>` is a two letter country code set by the the AsciiDoc 'lang'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  attribute.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[NOTE]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -=====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The backend and language global configuration files are loaded *after*
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -the header has been parsed.  This means that you can set most
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -attributes in the document header. Here's an example header:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Life's Mysteries
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  :author: Hu Nose
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  :doctype: book
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  :toc:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  :icons:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  :data-uri:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  :lang: en
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  :encoding: iso-8859-1
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Attributes set in the document header take precedence over
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -configuration file attributes.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -=====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -TIP: Use the asciidoc(1) `-v` (`--verbose`) command-line option to see
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -which configuration files are loaded and the order in which they are
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -loaded.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Document Attributes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -A document attribute is comprised of a 'name' and a textual 'value'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -and is used for textual substitution in AsciiDoc documents and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -configuration files. An attribute reference (an attribute name
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -enclosed in braces) is replaced by the corresponding attribute
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -value. Attribute names are case insensitive and can only contain
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -alphanumeric, dash and underscore characters.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -There are four sources of document attributes (from highest to lowest
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -precedence):
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Command-line attributes.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- AttributeEntry, AttributeList, Macro and BlockId elements.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Configuration file `[attributes]` sections.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Intrinsic attributes.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Within each of these divisions the last processed entry takes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -precedence.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -NOTE: If an attribute is not defined then the line containing the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -attribute reference is dropped. This property is used extensively in
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc configuration files to facilitate conditional markup
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -generation.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X18]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Attribute Entries
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The `AttributeEntry` block element allows document attributes to be
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -assigned within an AsciiDoc document. Attribute entries are added to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -the global document attributes dictionary. The attribute name/value
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -syntax is a single line like:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  :<name>: <value>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -For example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  :Author Initials: JB
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -This will set an attribute reference `{authorinitials}` to the value
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'JB' in the current document.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -To delete (undefine) an attribute use the following syntax:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  :<name>!:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.AttributeEntry behavior
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The attribute entry line begins with colon -- no white space allowed
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  in left margin.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- AsciiDoc converts the `<name>` to a legal attribute name (lower
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  case, alphanumeric, dash and underscore characters only -- all other
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  characters deleted). This allows more human friendly text to be
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  used.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Leading and trailing white space is stripped from the `<value>`.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Lines ending in a space followed by a plus character are continued
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  to the next line, for example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  :description: AsciiDoc is a text document format for writing notes, +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                documentation, articles, books, slideshows, web pages +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                and man pages.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- If the `<value>` is blank then the corresponding attribute value is
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  set to an empty string.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Attribute references contained in the entry `<value>` will be
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  expanded.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- By default AttributeEntry values are substituted for
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  `specialcharacters` and `attributes` (see above), if you want to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  change or disable AttributeEntry substitution use the <<X77,pass:[]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  inline macro>> syntax.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Attribute entries in the document Header are available for header
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  markup template substitution.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Attribute elements override configuration file and intrinsic
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  attributes but do not override command-line attributes.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Here are some more attribute entry examples:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc User Manual
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -====================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -:author:    Stuart Rackham
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -:email:     srackham@gmail.com
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -:revdate:   April 23, 2004
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -:revnumber: 5.1.1
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Which creates these attributes:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {author}, {firstname}, {lastname}, {authorinitials}, {email},
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {revdate}, {revnumber}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The previous example is equivalent to this <<X95,document header>>:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc User Manual
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -====================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Stuart Rackham <srackham@gmail.com>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -5.1.1, April 23, 2004
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Setting configuration entries
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -A variant of the Attribute Entry syntax allows configuration file
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -section entries and markup template sections to be set from within an
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc document:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  :<section_name>.[<entry_name>]: <entry_value>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Where `<section_name>` is the configuration section name,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`<entry_name>` is the name of the entry and `<entry_value>` is the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -optional entry value. This example sets the default labeled list
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -style to 'horizontal':
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  :listdef-labeled.style: horizontal
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -It is exactly equivalent to a configuration file containing:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  [listdef-labeled]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  style=horizontal
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- If the `<entry_name>` is omitted then the entire section is
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  substituted with the `<entry_value>`. This feature should only be
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  used to set markup template sections. The following example sets the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  'xref2' inline macro markup template:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  :xref2-inlinemacro.: <a href="#{1}">{2?{2}}</a>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- No substitution is performed on configuration file attribute entries
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  and they cannot be undefined.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- This feature can only be used in attribute entries -- configuration
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  attributes cannot be set using the asciidoc(1) command `--attribute`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  option.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X62]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Attribute entries promote clarity and eliminate repetition
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -*********************************************************************
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -URLs and file names in AsciiDoc macros are often quite long -- they
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -break paragraph flow and readability suffers.  The problem is
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -compounded by redundancy if the same name is used repeatedly.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Attribute entries can be used to make your documents easier to read
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -and write, here are some examples:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  :1:         http://freshmeat.net/projects/asciidoc/
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  :homepage:  http://methods.co.nz/asciidoc/[AsciiDoc home page]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  :new:       image:./images/smallnew.png[]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  :footnote1: footnote:[A meaningless latin term]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Using previously defined attributes: See the {1}[Freshmeat summary]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  or the {homepage} for something new {new}. Lorem ispum {footnote1}.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Note
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The attribute entry definition must precede it's usage.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- You are not limited to URLs or file names, entire macro calls or
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  arbitrary lines of text can be abbreviated.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Shared attributes entries could be grouped into a separate file and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  <<X63,included>> in multiple documents.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -*********************************************************************
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X21]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Attribute Lists
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- An attribute list is a comma separated list of attribute values.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The entire list is enclosed in square brackets.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Attribute lists are used to pass parameters to macros, blocks (using
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  the <<X79,AttributeList element>>) and inline quotes.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The list consists of zero or more positional attribute values followed
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -by zero or more named attribute values.  Here are three examples: a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -single unquoted positional attribute; three unquoted positional
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -attribute values; one positional attribute followed by two named
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -attributes; the unquoted attribute value in the final example contains
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -comma (`,`) and double-quote (`"`) character entities:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  [Hello]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  [quote, Bertrand Russell, The World of Mathematics (1956)]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ["22 times", backcolor="#0e0e0e", options="noborders,wide"]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  [A footnote, "with an image" image:smallnew.png[]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Attribute list behavior
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- If one or more attribute values contains a comma the all string
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  values must be quoted (enclosed in double quotation mark
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  characters).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- If the list contains any named or quoted attributes then all string
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  attribute values must be quoted.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- To include a double quotation mark (") character in a quoted
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  attribute value the the quotation mark must be escaped with a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  backslash.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- List attributes take precedence over existing attributes.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- List attributes can only be referenced in configuration file markup
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  templates and tags, they are not available elsewhere in the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  document.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Setting a named attribute to `None` undefines the attribute.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Positional attributes are referred to as `{1}`,`{2}`,`{3}`,...
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Attribute `{0}` refers to the entire list (excluding the enclosing
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  square brackets).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Named attribute names cannot contain dash characters.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X75]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Options attribute
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -If the attribute list contains an attribute named `options` it is
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -processed as a comma separated list of option names:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Each name generates an attribute named like `<option>-option` (where
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  `<option>` is the option name) with an empty string value.  For
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  example `[options="opt1,opt2,opt3"]` is equivalent to setting the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  following three attributes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  `[opt1-option="",opt2-option="",opt2-option=""]`.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- If you define a an option attribute globally (for example with an
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  <<X18,attribute entry>>) then it will apply to all elements in the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  document.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- AsciiDoc implements a number of predefined options which are listed
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  in the <<X74,Attribute Options appendix>>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Macro Attribute lists
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Macros calls are suffixed with an attribute list. The list may be
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -empty but it cannot be omitted. List entries are used to pass
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -attribute values to macro markup templates.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Attribute References
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ---------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -An attribute reference is an attribute name (possibly followed by an
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -additional parameters) enclosed in curly braces.  When an attribute
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -reference is encountered it is evaluated and replaced by its
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -corresponding text value.  If the attribute is undefined the line
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -containing the attribute is dropped.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -There are three types of attribute reference: 'Simple', 'Conditional'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -and 'System'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Attribute reference evaluation
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- You can suppress attribute reference expansion by placing a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  backslash character immediately in front of the opening brace
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  character.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- By default attribute references are not expanded in
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  'LiteralParagraphs', 'ListingBlocks' or 'LiteralBlocks'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Attribute substitution proceeds line by line in reverse line order.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Attribute reference evaluation is performed in the following order:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  'Simple' then 'Conditional' and finally 'System'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Simple Attributes References
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Simple attribute references take the form `{<name>}`. If the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -attribute name is defined its text value is substituted otherwise the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -line containing the reference is dropped from the output.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Conditional Attribute References
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Additional parameters are used in conjunction with attribute names to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -calculate a substitution value. Conditional attribute references take
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -the following forms:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`{<names>=<value>}`::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        `<value>` is substituted if the attribute `<names>` is
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        undefined otherwise its value is substituted. `<value>` can
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        contain simple attribute references.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`{<names>?<value>}`::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        `<value>` is substituted if the attribute `<names>` is defined
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        otherwise an empty string is substituted.  `<value>` can
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        contain simple attribute references.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`{<names>!<value>}`::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        `<value>` is substituted if the attribute `<names>` is
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        undefined otherwise an empty string is substituted.  `<value>`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        can contain simple attribute references.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`{<names>#<value>}`::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        `<value>` is substituted if the attribute `<names>` is defined
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        otherwise the undefined attribute entry causes the containing
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        line to be dropped.  `<value>` can contain simple attribute
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        references.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`{<names>%<value>}`::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        `<value>` is substituted if the attribute `<names>` is not
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        defined otherwise the containing line is dropped.  `<value>`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        can contain simple attribute references.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`{<names>@<regexp>:<value1>[:<value2>]}`::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        `<value1>` is substituted if the value of attribute `<names>`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        matches the regular expression `<regexp>` otherwise `<value2>`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        is substituted. If attribute `<names>` is not defined the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        containing line is dropped. If `<value2>` is omitted an empty
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        string is assumed. The values and the regular expression can
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        contain simple attribute references.  To embed colons in the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        values or the regular expression escape them with backslashes.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`{<names>$<regexp>:<value1>[:<value2>]}`::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Same behavior as the previous ternary attribute except for
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        the following cases:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        `{<names>$<regexp>:<value>}`;;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                Substitutes `<value>` if `<names>` matches `<regexp>`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                otherwise the result is undefined and the containing
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                line is dropped.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        `{<names>$<regexp>::<value>}`;;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                Substitutes `<value>` if `<names>` does not match
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                `<regexp>` otherwise the result is undefined and the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                containing line is dropped.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The attribute `<names>` parameter normally consists of a single
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -attribute name but it can be any one of the following:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- A single attribute name which evaluates to the attributes value.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Multiple ',' separated attribute names which evaluates to an empty
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  string if one or more of the attributes is defined, otherwise it's
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  value is undefined.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Multiple '+' separated attribute names which evaluates to an empty
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  string if all of the attributes are defined, otherwise it's value is
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  undefined.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Conditional attributes with single attribute names are evaluated first
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -so they can be used inside the multi-attribute conditional `<value>`.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Conditional attribute examples
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Conditional attributes are mainly used in AsciiDoc configuration
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -files -- see the distribution `.conf` files for examples.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Attribute equality test::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  If `{backend}` is 'docbook45' or 'xhtml11' the example evaluates to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ``DocBook 4.5 or XHTML 1.1 backend'' otherwise it evaluates to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ``some other backend'':
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {backend@docbook45|xhtml11:DocBook 4.5 or XHTML 1.1 backend:some other backend}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Attribute value map::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  This example maps the `frame` attribute values [`topbot`, `all`,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  `none`, `sides`] to [`hsides`, `border`, `void`, `vsides`]:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {frame@topbot:hsides}{frame@all:border}{frame@none:void}{frame@sides:vsides}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X24]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -System Attribute References
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -System attribute references generate the attribute text value by
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -executing a predefined action that is parametrized by one or more
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -arguments. The syntax is `{<action>:<arguments>}`.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`{counter:<attrname>[:<seed>]}`::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Increments the document attribute (if the attribute is
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        undefined it is set to `1`). Returns the new attribute value.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        - Counters generate global (document wide) attributes.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        - The optional `<seed>` specifies the counter's initial value;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -          it can be a number or a single letter; defaults to '1'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        - `<seed>` can contain simple and conditional attribute
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -          references.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        - The 'counter' system attribute will not be executed if the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -          containing line is dropped by the prior evaluation of an
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -          undefined attribute.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`{counter2:<attrname>[:<seed>]}`::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Same as `counter` except the it always returns a blank string.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`{eval:<expression>}`::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Substitutes the result of the Python `<expression>`.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        - If `<expression>` evaluates to `None` or `False` the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -          reference is deemed undefined and the line containing the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -          reference is dropped from the output.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        - If the expression evaluates to `True` the attribute
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -          evaluates to an empty string.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        - `<expression>` can contain simple and conditional attribute
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -          references.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        - The 'eval' system attribute can be nested inside other
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -          system attributes.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`{eval3:<command>}`::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Passthrough version of `{eval:<expression>}` -- the generated
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        output is written directly to the output without any further
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        substitutions.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`{include:<filename>}`::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Substitutes contents of the file named `<filename>`.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        - The included file is read at the time of attribute
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -          substitution.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        - If the file does not exist a warning is emitted and the line
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -          containing the reference is dropped from the output file.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        - Tabs are expanded based on the current 'tabsize' attribute
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -          value.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`{set:<attrname>[!][:<value>]}`::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Sets or unsets document attribute. Normally only used in
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        configuration file markup templates (use
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        <<X18,AttributeEntries>> in AsciiDoc documents).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        - If the attribute name is followed by an exclamation mark
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -          the attribute becomes undefined.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        - If `<value>` is omitted the attribute is set to a blank
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -          string.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        - `<value>` can contain simple and conditional attribute
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -          references.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        - Returns a blank string unless the attribute is undefined in
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -          which case the return value is undefined and the enclosing
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -          line will be dropped.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`{set2:<attrname>[!][:<value>]}`::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Same as `set` except that the attribute scope is local to the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        template.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`{sys:<command>}`::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Substitutes the stdout generated by the execution of the shell
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        `<command>`.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`{sys2:<command>}`::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Substitutes the stdout and stderr generated by the execution
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        of the shell `<command>`.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`{sys3:<command>}`::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Passthrough version of `{sys:<command>}` -- the generated
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        output is written directly to the output without any further
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        substitutions.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`{template:<template>}`::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        Substitutes the contents of the configuration file section
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        named `<template>`. Attribute references contained in the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        template are substituted.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.System reference behavior
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- System attribute arguments can contain non-system attribute
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  references.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Closing brace characters inside system attribute arguments must be
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  escaped with a backslash.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X60]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Intrinsic Attributes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ---------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Intrinsic attributes are simple attributes that are created
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -automatically from: AsciiDoc document header parameters; asciidoc(1)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -command-line arguments; attributes defined in the default
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -configuration files; the execution context.  Here's the list of
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -predefined intrinsic attributes:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {amp}                 ampersand (&) character entity
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {asciidoc-args}       used to pass inherited arguments to asciidoc filters
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {asciidoc-confdir}    the asciidoc(1) global configuration directory
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {asciidoc-dir}        the asciidoc(1) application directory
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {asciidoc-file}       the full path name of the asciidoc(1) script
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {asciidoc-version}    the version of asciidoc(1)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {author}              author's full name
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {authored}            empty string '' if {author} or {email} defined,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {authorinitials}      author initials (from document header)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {backend-<backend>}   empty string ''
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {<backend>-<doctype>} empty string ''
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {backend}             document backend specified by `-b` option
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {backend-confdir}     the directory containing the <backend>.conf file
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {backslash}           backslash character
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {basebackend-<base>}  empty string ''
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {basebackend}         html or docbook
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {blockname}           current block name (note 8).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {brvbar}              broken vertical bar (|) character
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {docdate}             document last modified date
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {docdir}              document input directory name  (note 5)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {docfile}             document file name  (note 5)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {docname}             document file name without extension (note 6)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {doctime}             document last modified time
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {doctitle}            document title (from document header)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {doctype-<doctype>}   empty string ''
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {doctype}             document type specified by `-d` option
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {email}               author's email address (from document header)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {empty}               empty string ''
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {encoding}            specifies input and output encoding
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {filetype-<fileext>}  empty string ''
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {filetype}            output file name file extension
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {firstname}           author first name (from document header)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {gt}                  greater than (>) character entity
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {id}                  running block id generated by BlockId elements
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {indir}               input file directory name (note 2,5)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {infile}              input file name (note 2,5)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {lastname}            author last name (from document header)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {ldquo}               Left double quote character (note 7)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {level}               title level 1..4 (in section titles)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {listindex}           the list index (1..) of the most recent list item
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {localdate}           the current date
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {localtime}           the current time
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {lsquo}               Left single quote character (note 7)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {lt}                  less than (<) character entity
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {manname}             manpage name (defined in NAME section)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {manpurpose}          manpage (defined in NAME section)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {mantitle}            document title minus the manpage volume number
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {manvolnum}           manpage volume number (1..8) (from document header)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {middlename}          author middle name (from document header)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {nbsp}                non-breaking space character entity
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {notitle}             do not display the document title
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {outdir}              document output directory name (note 2)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {outfile}             output file name (note 2)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {python}              the full path name of the Python interpreter executable
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {rdquo}               Right double quote character (note 7)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {reftext}             running block xreflabel generated by BlockId elements
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {revdate}             document revision date (from document header)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {revnumber}           document revision number (from document header)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {rsquo}               Right single quote character (note 7)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {sectnum}             formatted section number (in section titles)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {sp}                  space character
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {showcomments}        send comment lines to the output
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {title}               section title (in titled elements)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {two-colons}          Two colon characters
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {two-semicolons}      Two semicolon characters
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {user-dir}            the ~/.asciidoc directory (if it exists)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {verbose}             defined as '' if --verbose command option specified
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {wj}                  Word-joiner
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  {zwsp}                Zero-width space character entity
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[NOTE]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -======
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -1. Intrinsic attributes are global so avoid defining custom attributes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   with the same names.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -2. `{outfile}`, `{outdir}`, `{infile}`, `{indir}` attributes are
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   effectively read-only (you can set them but it won't affect the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   input or output file paths).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -3.  See also the <<X88,Backend Attributes>> section for attributes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    that relate to AsciiDoc XHTML file generation.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -4. The entries that translate to blank strings are designed to be used
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   for conditional text inclusion. You can also use the `ifdef`,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   `ifndef` and `endif` System macros for conditional inclusion.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   footnote:[Conditional inclusion using `ifdef` and `ifndef` macros
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   differs from attribute conditional inclusion in that the former
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   occurs when the file is read while the latter occurs when the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   contents are written.]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -5. `{docfile}` and `{docdir}` refer to root document specified on the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   asciidoc(1) command-line; `{infile}` and `{indir}` refer to the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   current input file which may be the root document or an included
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   file. When the input is being read from the standard input
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   (`stdin`) these attributes are undefined.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -6. If the input file is the standard input and the output file is not
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   the standard output then `{docname}` is the output file name sans
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   file extension.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -7. See
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   http://en.wikipedia.org/wiki/Non-English_usage_of_quotation_marks[non-English
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   usage of quotation marks].
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -8. The `{blockname}` attribute identifies the style of the current
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   block. It applies to delimited blocks, lists and tables. Here is a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   list of `{blockname}` values (does not include filters or custom
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   block and style names):
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   delimited blocks:: comment, sidebar, open, pass, literal, verse,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   listing, quote, example, note, tip, important, caution, warning,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   abstract, partintro
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   lists:: arabic, loweralpha, upperalpha, lowerroman, upperroman,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   labeled, labeled3, labeled4, qanda, horizontal, bibliography,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   glossary
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   tables:: table
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -======
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X73]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Block Element Definitions
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The syntax and behavior of Paragraph, DelimitedBlock, List and Table
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -block elements is determined by block definitions contained in
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<<X7,AsciiDoc configuration file>> sections.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Each definition consists of a section title followed by one or more
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -section entries. Each entry defines a block parameter controlling some
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -aspect of the block's behavior. Here's an example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[blockdef-listing]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -delimiter=^-{4,}$
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -template=listingblock
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -presubs=specialcharacters,callouts
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Configuration file block definition sections are processed
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -incrementally after each configuration file is loaded. Block
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -definition section entries are merged into the block definition, this
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -allows block parameters to be overridden and extended by later
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<<X27,loading configuration files>>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc Paragraph, DelimitedBlock, List and Table block elements
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -share a common subset of configuration file parameters:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -delimiter::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  A Python regular expression that matches the first line of a block
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  element -- in the case of DelimitedBlocks and Tables it also matches
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  the last line.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -template::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  The name of the configuration file markup template section that will
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  envelope the block contents. The pipe ('|') character is substituted
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  for the block contents. List elements use a set of (list specific)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  tag parameters instead of a single template. The template name can
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  contain attribute references allowing dynamic template selection a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  the time of template substitution.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -options::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  A comma delimited list of element specific option names. In addition
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  to being used internally, options are available during markup tag
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  and template substitution as attributes with an empty string value
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  named like `<option>-option` (where `<option>` is the option name).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  See <<X74,attribute options>> for a complete list of available
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  options.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -subs, presubs, postsubs::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  * 'presubs' and 'postsubs' are lists of comma separated substitutions that are
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    performed on the block contents. 'presubs' is applied first,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    'postsubs' (if specified) second.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  * 'subs' is an alias for 'presubs'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  * If a 'filter' is allowed (Paragraphs, DelimitedBlocks and Tables)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    and has been specified then 'presubs' and 'postsubs' substitutions
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    are performed before and after the filter is run respectively.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  * Allowed values: 'specialcharacters', 'quotes', 'specialwords',
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    'replacements', 'macros', 'attributes', 'callouts'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  * [[X102]]The following composite values are also allowed:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    'none';;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        No substitutions.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    'normal';;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        The following substitutions in the following order:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        'specialcharacters', 'quotes', 'attributes', 'specialwords',
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        'replacements', 'macros', 'replacements2'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    'verbatim';;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        The following substitutions in the following order:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        'specialcharacters' and 'callouts'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  * 'normal' and 'verbatim' substitutions can be redefined by with
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    `subsnormal` and `subsverbatim` entries in a configuration file
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    `[miscellaneous]` section.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  * The substitutions are processed in the order in which they are
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    listed and can appear more than once.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -filter::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  This optional entry specifies an executable shell command for
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  processing block content (Paragraphs, DelimitedBlocks and Tables).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  The filter command can contain attribute references.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -posattrs::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Optional comma separated list of positional attribute names. This
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  list maps positional attributes (in the block's <<X21,attribute
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  list>>) to named block attributes. The following example, from the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  QuoteBlock definition, maps the first and section positional
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  attributes:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  posattrs=attribution,citetitle
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -style::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  This optional parameter specifies the default style name.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<stylename>-style::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Optional style definition (see <<X23,Styles>> below).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The following block parameters behave like document attributes and can
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -be set in block attribute lists and style definitions: 'template',
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'options', 'subs', 'presubs', 'postsubs', 'filter'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X23]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Styles
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -A style is a set of block parameter bundled as a single named
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -parameter. The following example defines a style named 'verbatim':
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  verbatim-style=template="literalblock",subs="verbatim"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -If a block's <<X21,attribute list>> contains a 'style' attribute then
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -the corresponding style parameters are be merged into the default
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -block definition parameters.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- All style parameter names must be suffixed with `-style` and the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  style parameter value is in the form of a list of <<X21,named
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  attributes>>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The 'template' style parameter is mandatory, other parameters can be
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  omitted in which case they inherit their values from the default
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  block definition parameters.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Multi-item style parameters ('subs','presubs','postsubs','posattrs')
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  must be specified using Python tuple syntax (rather than a simple
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  list of values as they in separate entries) e.g.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  `postsubs=("callouts",)` not `postsubs="callouts"`.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Paragraphs
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Paragraph translation is controlled by `[paradef-*]` configuration
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -file section entries. Users can define new types of paragraphs and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -modify the behavior of existing types by editing AsciiDoc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -configuration files.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Here is the shipped Default paragraph definition:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ---------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[paradef-default]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -delimiter=(?P<text>\S.*)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -template=paragraph
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ---------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The normal paragraph definition has a couple of special properties:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -1. It must exist and be defined in a configuration file section named
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   `[paradef-default]`.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -2. Irrespective of its position in the configuration files default
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   paragraph document matches are attempted only after trying all
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   other paragraph types.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Paragraph specific block parameter notes:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -delimiter::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  This regular expression must contain the named group 'text' which
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  matches the text on the first line.  Paragraphs are terminated by a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  blank line, the end of file, or the start of a DelimitedBlock.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -options::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  The 'listelement' option specifies that paragraphs of this type will
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  automatically be considered part of immediately preceding list
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  items.  The 'skip' option causes the paragraph to be treated as a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  comment (see <<X26,CommentBlocks>>).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Paragraph processing proceeds as follows:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -1. The paragraph text is aligned to the left margin.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -2. Optional 'presubs' inline substitutions are performed on the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   paragraph text.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -3. If a filter command is specified it is executed and the paragraph
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   text piped to its standard input; the filter output replaces the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   paragraph text.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -4. Optional 'postsubs' inline substitutions are performed on the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   paragraph text.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -5. The paragraph text is enveloped by the paragraph's markup template
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   and written to the output file.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Delimited Blocks
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -DelimitedBlock 'options' values are:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -sectionbody::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    The block contents are processed as a SectionBody.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -skip::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    The block is treated as a comment (see <<X26,CommentBlocks>>).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    Preceding <<X21,attribute lists>> and <<X42,block titles>> are not
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    consumed.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'presubs', 'postsubs' and 'filter' entries are ignored when
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'sectionbody' or 'skip' options are set.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -DelimitedBlock processing proceeds as follows:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -1. Optional 'presubs' substitutions are performed on the block
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   contents.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -2. If a filter is specified it is executed and the block's contents
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   piped to its standard input. The filter output replaces the block
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   contents.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -3. Optional 'postsubs' substitutions are performed on the block
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   contents.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -4. The block contents is enveloped by the block's markup template and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   written to the output file.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -TIP: Attribute expansion is performed on the block filter command
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -before it is executed, this is useful for passing arguments to the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -filter.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Lists
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -List behavior and syntax is determined by `[listdef-*]` configuration
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -file sections. The user can change existing list behavior and add new
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -list types by editing configuration files.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -List specific block definition notes:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -type::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  This is either 'bulleted','numbered','labeled' or 'callout'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -delimiter::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  A Python regular expression that matches the first line of a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  list element entry. This expression can contain the named groups
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  'text' (bulleted groups), 'index' and 'text' (numbered lists),
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  'label' and 'text' (labeled lists).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -tags::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  The `<name>` of the `[listtags-<name>]` configuration file section
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  containing list markup tag definitions.  The tag entries ('list',
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  'entry', 'label', 'term', 'text') map the AsciiDoc list structure to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  backend markup; see the 'listtags' sections in the AsciiDoc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  distributed backend `.conf` configuration files for examples.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Tables
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Table behavior and syntax is determined by `[tabledef-*]` and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`[tabletags-*]` configuration file sections. The user can change
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -existing table behavior and add new table types by editing
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -configuration files.  The following `[tabledef-*]` section entries
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -generate table output markup elements:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -colspec::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  The table 'colspec' tag definition.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -headrow, footrow, bodyrow::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Table header, footer and body row tag definitions. 'headrow' and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  'footrow' table definition entries default to 'bodyrow' if
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  they are undefined.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -headdata, footdata, bodydata::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  Table header, footer and body data tag definitions. 'headdata' and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  'footdata' table definition entries default to 'bodydata' if they
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  are undefined.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -paragraph::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  If the 'paragraph' tag is specified then blank lines in the cell
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  data are treated as paragraph delimiters and marked up using this
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  tag.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X4]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Table behavior is also influenced by the following `[miscellaneous]`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -configuration file entries:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -pagewidth::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  This integer value is the printable width of the output media. See
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  <<X69,table attributes>>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -pageunits::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  The units of width in output markup width attribute values.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Table definition behavior
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The output markup generation is specifically designed to work with
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  the HTML and CALS (DocBook) table models, but should be adaptable to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  most XML table schema.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Table definitions can be ``mixed in'' from multiple cascading
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  configuration files.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- New table definitions inherit the default table and table tags
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  definitions (`[tabledef-default]` and `[tabletags-default]`) so you
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  only need to override those conf file entries that require
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  modification.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X59]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Filters
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc filters allow external commands to process AsciiDoc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'Paragraphs', 'DelimitedBlocks' and 'Table' content. Filters are
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -primarily an extension mechanism for generating specialized outputs.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Filters are implemented using external commands which are specified in
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -configuration file definitions.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -There's nothing special about the filters, they're just standard UNIX
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -filters: they read text from the standard input, process it, and write
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -to the standard output.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The asciidoc(1) command `--filter` option can be used to install and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -remove filters. The same option is used to unconditionally load a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -filter.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Attribute substitution is performed on the filter command prior to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -execution -- attributes can be used to pass parameters from the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc source document to the filter.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -WARNING: Filters sometimes included executable code. Before installing
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -a filter you should verify that it is from a trusted source.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Filter Search Paths
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -If the filter command does not specify a directory path then
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -asciidoc(1) recursively searches for the executable filter command:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- First it looks in the user's `$HOME/.asciidoc/filters` directory.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Next the global filters directory (usually `/etc/asciidoc/filters`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  or `/usr/local/etc/asciidoc`) directory is searched.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Then it looks in the asciidoc(1) `./filters` directory.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Finally it relies on the executing shell to search the environment
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  search path (`$PATH`).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Standard practice is to install each filter in it's own sub-directory
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -with the same name as the filter's style definition. For example the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -music filter's style name is 'music' so it's configuration and filter
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -files are stored in the `filters/music` directory.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Filter Configuration Files
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Filters are normally accompanied by a configuration file containing a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Paragraph or DelimitedBlock definition along with corresponding markup
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -templates.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -While it is possible to create new 'Paragraph' or 'DelimitedBlock'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -definitions the preferred way to implement a filter is to add a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<<X23,style>> to the existing Paragraph and ListingBlock definitions
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -(all filters shipped with AsciiDoc use this technique). The filter is
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -applied to the paragraph or delimited block by preceding it with an
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -attribute list: the first positional attribute is the style name,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -remaining attributes are normally filter specific parameters.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -asciidoc(1) auto-loads all `.conf` files found in the filter search
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -paths unless the container directory also contains a file named
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`__noautoload__` (see previous section). The `__noautoload__` feature
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -is used for filters that will be loaded manually using the `--filter`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -option.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X56]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Example Filter
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc comes with a toy filter for highlighting source code keywords
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -and comments.  See also the `./filters/code/code-filter-readme.txt`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -file.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -NOTE: The purpose of this toy filter is to demonstrate how to write a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -filter -- it's much to simplistic to be passed off as a code syntax
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -highlighter.  If you want a full featured multi-language highlighter
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -use the {website}source-highlight-filter.html[source code highlighter
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -filter].
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Built-in filters
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The AsciiDoc distribution includes 'source', 'music', 'latex' and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'graphviz' filters, details are on the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -{website}index.html#_filters[AsciiDoc website].
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[cols="1e,5",frame="topbot",options="header"]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Built-in filters list
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|Filter name |Description
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|music
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|A {website}music-filter.html[music filter] is included in the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -distribution `./filters/` directory. It translates music in
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -http://lilypond.org/[LilyPond] or http://abcnotation.org.uk/[ABC]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -notation to standard classical notation.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|source
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|A {website}source-highlight-filter.html[source code highlight filter]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -is included in the distribution `./filters/` directory.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|latex
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|The {website}latex-filter.html[AsciiDoc LaTeX filter] translates
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -LaTeX source to a PNG image that is automatically inserted into the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc output documents.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|graphviz
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|Gouichi Iisaka has written a http://www.graphviz.org/[Graphviz]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -filter for AsciiDoc.  Graphviz generates diagrams from a textual
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -specification. Gouichi Iisaka's Graphviz filter is included in the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc distribution. Here are some
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -{website}asciidoc-graphviz-sample.html[AsciiDoc Graphviz examples].
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X58]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Filter plugins
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Filter <<X101,plugins>> are a mechanism for distributing AsciiDoc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -filters.  A filter plugin is a Zip file containing the files that
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -constitute a filter.  The asciidoc(1) `--filter` option is used to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -load and manage filer <<X101,plugins>>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Filter plugins <<X27,take precedence>> over built-in filters with
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  the same name.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- By default filter plugins are installed in
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  `$HOME/.asciidoc/filters/<filter>` where `<filter>` is the filter
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  name.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X101]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Plugins
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The AsciiDoc plugin architecture is an extension mechanism that allows
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -additional <<X100,backends>>, <<X58,filters>> and <<X99,themes>> to be
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -added to AsciiDoc.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- A plugin is a Zip file containing an AsciiDoc backend, filter or
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  theme (configuration files, stylesheets, scripts, images).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The asciidoc(1) `--backend`, `--filter` and `--theme` command-line
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  options are used to load and manage plugins. Each of these options
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  responds to the plugin management 'install', 'list', 'remove' and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  'build' commands.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The plugin management command names are reserved and cannot be used
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  for filter, backend or theme names.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The plugin Zip file name always begins with the backend, filter or
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  theme name.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Plugin commands and conventions are documented in the asciidoc(1) man
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -page.  You can find lists of plugins on the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -{website}plugins.html[AsciiDoc website].
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X36]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Help Commands
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The asciidoc(1) command has a `--help` option which prints help topics
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -to stdout. The default topic summarizes asciidoc(1) usage:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  $ asciidoc --help
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -To print a help topic specify the topic name as a command argument.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Help topic names can be shortened so long as they are not ambiguous.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Examples:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  $ asciidoc --help manpage
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  $ asciidoc -h m              # Short version of previous example.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  $ asciidoc --help syntax
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  $ asciidoc -h s              # Short version of previous example.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Customizing Help
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -To change, delete or add your own help topics edit a help
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -configuration file.  The help file name `help-<lang>.conf` is based on
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -the setting of the `lang` attribute, it defaults to `help.conf`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -(English).  The <<X27,help file location>> will depend on whether you
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -want the topics to apply to all users or just the current user.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The help topic files have the same named section format as other
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<<X7,configuration files>>. The `help.conf` files are stored in the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -same locations and loaded in the same order as other configuration
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -files.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -When the `--help` command-line option is specified AsciiDoc loads the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -appropriate help files and then prints the contents of the section
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -whose name matches the help topic name.  If a topic name is not
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -specified `default` is used. You don't need to specify the whole help
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -topic name on the command-line, just enough letters to ensure it's not
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -ambiguous. If a matching help file section is not found a list of
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -available topics is printed.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Tips and Tricks
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Know Your Editor
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Writing AsciiDoc documents will be a whole lot more pleasant if you
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -know your favorite text editor. Learn how to indent and reformat text
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -blocks, paragraphs, lists and sentences. <<X20,Tips for 'vim' users>>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -follow.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X20]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Vim Commands for Formatting AsciiDoc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Text Wrap Paragraphs
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -^^^^^^^^^^^^^^^^^^^^
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Use the vim `:gq` command to reformat paragraphs. Setting the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'textwidth' sets the right text wrap margin; for example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  :set textwidth=70
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -To reformat a paragraph:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -1. Position the cursor at the start of the paragraph.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -2. Type `gq}`.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Execute `:help gq` command to read about the vim gq command.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[TIP]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -=====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Assign the `gq}` command to the Q key with the `nnoremap Q gq}`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  command or put it in your `~/.vimrc` file to so it's always
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  available (see the <<X61, Example `~/.vimrc` file>>).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Put `set` commands in your `~/.vimrc` file so you don't have to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  enter them manually.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The Vim website (http://www.vim.org) has a wealth of resources,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  including scripts for automated spell checking and ASCII Art
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  drawing.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -=====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Format Lists
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -^^^^^^^^^^^^
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The `gq` command can also be used to format bulleted, numbered and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -callout lists. First you need to set the `comments`, `formatoptions`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -and `formatlistpat` (see the <<X61, Example `~/.vimrc` file>>).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Now you can format simple lists that use dash, asterisk, period and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -plus bullets along with numbered ordered lists:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -1. Position the cursor at the start of the list.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -2. Type `gq}`.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Indent Paragraphs
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -^^^^^^^^^^^^^^^^^
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Indent whole paragraphs by indenting the fist line with the desired
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -indent and then executing the `gq}` command.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X61]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Example `~/.vimrc` File
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -^^^^^^^^^^^^^^^^^^^^^^^
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -" Use bold bright fonts.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -set background=dark
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -" Show tabs and trailing characters.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -set listchars=tab:,trail:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -set list
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -" Don't highlight searched text.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -highlight clear Search
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -" Don't move to matched text while search pattern is being entered.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -set noincsearch
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -" Reformat paragraphs and list.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -nnoremap R gq}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -" Delete trailing white space and Dos-returns and to expand tabs to spaces.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -nnoremap S :set et<CR>:retab!<CR>:%s/[\r \t]\+$//<CR>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -autocmd BufRead,BufNewFile *.txt,README,TODO,CHANGELOG,NOTES
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        \ setlocal autoindent expandtab tabstop=8 softtabstop=2 shiftwidth=2 filetype=asciidoc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        \ textwidth=70 wrap formatoptions=tcqn
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        \ formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\\|^\\s*<\\d\\+>\\s\\+\\\\|^\\s*[a-zA-Z.]\\.\\s\\+\\\\|^\\s*[ivxIVX]\\+\\.\\s\\+
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        \ comments=s1:/*,ex:*/,://,b:#,:%,:XCOMM,fb:-,fb:*,fb:+,fb:.,fb:>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Troubleshooting
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc diagnostic features are detailed in the <<X82,Diagnostics
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -appendix>>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Gotchas
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Incorrect character encoding::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    If you get an error message like `'UTF-8' codec can't decode ...`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    then you source file contains invalid UTF-8 characters -- set the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    AsciiDoc <<X54,encoding attribute>> for the correct character set
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    (typically ISO-8859-1 (Latin-1) for European languages).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Invalid output::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    AsciiDoc attempts to validate the input AsciiDoc source but makes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    no attempt to validate the output markup, it leaves that to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    external tools such as `xmllint(1)` (integrated into `a2x(1)`).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    Backend validation cannot be hardcoded into AsciiDoc because
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    backends are dynamically configured. The following example
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    generates valid HTML but invalid DocBook (the DocBook `literal`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    element cannot contain an `emphasis` element):
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    +monospaced text with an _emphasized_ word+
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Misinterpreted text formatting::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    You can suppress markup expansion by placing a backslash character
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    immediately in front of the element. The following example
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    suppresses inline monospaced formatting:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    \+1 for C++.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Overlapping text formatting::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    Overlapping text formatting will generate illegal overlapping
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    markup tags which will result in downstream XML parsing errors.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    Here's an example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    Some *strong markup _that overlaps* emphasized markup_.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Ambiguous underlines::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    A DelimitedBlock can immediately follow a paragraph without an
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    intervening blank line, but be careful, a single line paragraph
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    underline may be misinterpreted as a section title underline
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    resulting in a ``closing block delimiter expected'' error.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Ambiguous ordered list items::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    Lines beginning with numbers at the end of sentences will be
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    interpreted as ordered list items.  The following example
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    (incorrectly) begins a new list with item number 1999:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    He was last sighted in
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    1999. Since then things have moved on.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -+
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The 'list item out of sequence' warning makes it unlikely that this
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -problem will go unnoticed.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Special characters in attribute values::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    Special character substitution precedes attribute substitution so
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    if attribute values contain special characters you may, depending
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    on the substitution context, need to escape the special characters
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    yourself. For example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    $ asciidoc -a 'orgname=Bill & Ben Inc.' mydoc.txt
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Attribute lists::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    If any named attribute entries are present then all string
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    attribute values must be quoted.  For example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    ["Desktop screenshot",width=32]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X90]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Combining separate documents
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -You have a number of stand-alone AsciiDoc documents that you want to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -process as a single document. Simply processing them with a series of
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`include` macros won't work because the documents contain (level 0)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -document titles.  The solution is to create a top level wrapper
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -document and use the `leveloffset` attribute to push them all down one
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -level. For example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[listing]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.....................................................................
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Combined Document Title
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -=======================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -// Push titles down one level.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -:leveloffset: 1
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -\include::document1.txt[]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -// Return to normal title levels.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -:leveloffset: 0
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -A Top Level Section
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Lorum ipsum.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -// Push titles down one level.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -:leveloffset: 1
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -\include::document2.txt[]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -\include::document3.txt[]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.....................................................................
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The document titles in the included documents will now be processed as
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -level 1 section titles, level 1 sections as level 2 sections and so
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -on.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Put a blank line between the `include` macro lines to ensure the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  title of the included document is not seen as part of the last
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  paragraph of the previous document.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- You won't want non-title document header lines (for example, Author
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  and Revision lines) in the included files -- conditionally exclude
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  them if they are necessary for stand-alone processing.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Processing document sections separately
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -You have divided your AsciiDoc document into separate files (one per
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -top level section) which are combined and processed with the following
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -top level document:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Combined Document Title
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -=======================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Joe Bloggs
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -v1.0, 12-Aug-03
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -\include::section1.txt[]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -\include::section2.txt[]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -\include::section3.txt[]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -You also want to process the section files as separate documents.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -This is easy because asciidoc(1) will quite happily process
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`section1.txt`, `section2.txt` and `section3.txt` separately -- the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -resulting output documents contain the section but have no document
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -title.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Processing document snippets
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Use the `-s` (`--no-header-footer`) command-line option to suppress
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -header and footer output, this is useful if the processed output is to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -be included in another file. For example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  $ asciidoc -sb docbook section1.txt
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -asciidoc(1) can be used as a filter, so you can pipe chunks of text
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -through it. For example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  $ echo 'Hello *World!*' | asciidoc -s -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  <div class="paragraph"><p>Hello <strong>World!</strong></p></div>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Badges in HTML page footers
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -See the `[footer]` section in the AsciiDoc distribution `xhtml11.conf`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -configuration file.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Pretty printing AsciiDoc output
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -If the indentation and layout of the asciidoc(1) output is not to your
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -liking you can:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -1. Change the indentation and layout of configuration file markup
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   template sections. The `{empty}` attribute is useful for outputting
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   trailing blank lines in markup templates.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -2. Use Dave Raggett's http://tidy.sourceforge.net/[HTML Tidy] program
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   to tidy asciidoc(1) output. Example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   $ asciidoc -b docbook -o - mydoc.txt | tidy -indent -xml >mydoc.xml
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -3. Use the `xmllint(1)` format option. Example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   $ xmllint --format mydoc.xml
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Supporting minor DocBook DTD variations
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The conditional inclusion of DocBook SGML markup at the end of the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -distribution `docbook45.conf` file illustrates how to support minor
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -DTD variations. The included sections override corresponding entries
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -from preceding sections.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Creating stand-alone HTML documents
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -If you've ever tried to send someone an HTML document that includes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -stylesheets and images you'll know that it's not as straight-forward
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -as exchanging a single file.  AsciiDoc has options to create
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -stand-alone documents containing embedded images, stylesheets and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -scripts.  The following AsciiDoc command creates a single file
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -containing <<X66,embedded images>>, CSS stylesheets, and JavaScript
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -(for table of contents and footnotes):
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  $ asciidoc -a data-uri -a icons -a toc -a max-width=55em article.txt
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -You can view the HTML file here: {website}article-standalone.html[]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Shipping stand-alone AsciiDoc source
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Reproducing presentation documents from someone else's source has one
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -major problem: unless your configuration files are the same as the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -creator's you won't get the same output.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The solution is to create a single backend specific configuration file
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -using the asciidoc(1) `-c` (`--dump-conf`) command-line option. You
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -then ship this file along with the AsciiDoc source document plus the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`asciidoc.py` script. The only end user requirement is that they have
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Python installed (and that they consider you a trusted source). This
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -example creates a composite HTML configuration file for `mydoc.txt`:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  $ asciidoc -cb xhtml11 mydoc.txt > mydoc-xhtml11.conf
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Ship `mydoc.txt`, `mydoc-html.conf`, and `asciidoc.py`. With
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -these three files (and a Python interpreter) the recipient can
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -regenerate the HMTL output:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  $ ./asciidoc.py -eb xhtml11 mydoc.txt
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The `-e` (`--no-conf`) option excludes the use of implicit
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -configuration files, ensuring that only entries from the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`mydoc-html.conf` configuration are used.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Inserting blank space
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Adjust your style sheets to add the correct separation between block
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -elements. Inserting blank paragraphs containing a single non-breaking
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -space character `{nbsp}` works but is an ad hoc solution compared
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -to using style sheets.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Closing open sections
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -You can close off section tags up to level `N` by calling the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`eval::[Section.setlevel(N)]` system macro. This is useful if you
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -want to include a section composed of raw markup. The following
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -example includes a DocBook glossary division at the top section level
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -(level 0):
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -\ifdef::basebackend-docbook[]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -\eval::[Section.setlevel(0)]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -+++++++++++++++++++++++++++++++
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<glossary>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  <title>Glossary
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  ...
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -+++++++++++++++++++++++++++++++
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -\endif::basebackend-docbook[]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------------------------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Validating output files
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Use `xmllint(1)` to check the AsciiDoc generated markup is both well
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -formed and valid. Here are some examples:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  $ xmllint --nonet --noout --valid docbook-file.xml
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  $ xmllint --nonet --noout --valid xhtml11-file.html
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  $ xmllint --nonet --noout --valid --html html4-file.html
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The `--valid` option checks the file is valid against the document
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -type's DTD, if the DTD is not installed in your system's catalog then
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -it will be fetched from its Internet location. If you omit the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`--valid` option the document will only be checked that it is well
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -formed.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The online http://validator.w3.org/#validate_by_uri+with_options[W3C
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Markup Validation Service] is the defacto standard when it comes to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -validating HTML (it validates all HTML standards including HTML5).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -:numbered!:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[glossary]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Glossary
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ---------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[glossary]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X8]] Block element::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    An AsciiDoc block element is a document entity composed of one or
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    more whole lines of text.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X34]] Inline element::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    AsciiDoc inline elements occur within block element textual
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    content, they perform formatting and substitution tasks.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Formal element::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    An AsciiDoc block element that has a BlockTitle. Formal elements
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    are normally listed in front or back matter, for example lists of
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    tables, examples and figures.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Verbatim element::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    The word verbatim indicates that white space and line breaks in
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    the source document are to be preserved in the output document.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[appendix]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Migration Notes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ----------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X53]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Version 7 to version 8
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- A new set of quotes has been introduced which may match inline text
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  in existing documents -- if they do you'll need to escape the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  matched text with backslashes.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The index entry inline macro syntax has changed -- if your documents
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  include indexes you may need to edit them.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Replaced a2x(1) `--no-icons` and `--no-copy` options with their
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  negated equivalents: `--icons` and `--copy` respectively. The
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  default behavior has also changed -- the use of icons and copying of
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  icon and CSS files must be specified explicitly with the `--icons`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  and `--copy` options.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The rationale for the changes can be found in the AsciiDoc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`CHANGELOG`.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -NOTE: If you want to disable unconstrained quotes, the new alternative
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -constrained quotes syntax and the new index entry syntax then you can
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -define the attribute `asciidoc7compatible` (for example by using the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`-a asciidoc7compatible` command-line option).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X38]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[appendix]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Packager Notes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ---------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Read the `README` and `INSTALL` files (in the distribution root
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -directory) for install prerequisites and procedures.  The distribution
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`Makefile.in` (used by `configure` to generate the `Makefile`) is the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -canonical installation procedure.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X39]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[appendix]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc Safe Mode
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc 'safe mode' skips potentially dangerous scripted sections in
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc source files by inhibiting the execution of arbitrary code or
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -the inclusion of arbitrary files.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The safe mode is disabled by default, it can be enabled with the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -asciidoc(1) `--safe` command-line option.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Safe mode constraints
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- `eval`, `sys` and `sys2` executable attributes and block macros are
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  not executed.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- `include::[]` and `include1::[]` block macro
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  files must reside inside the parent file's directory.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- `{include:}` executable attribute files must reside
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  inside the source document directory.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Passthrough Blocks are dropped.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[WARNING]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -=====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The safe mode is not designed to protect against unsafe AsciiDoc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -configuration files. Be especially careful when:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -1. Implementing filters.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -2. Implementing elements that don't escape special characters.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -3. Accepting configuration files from untrusted sources.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -=====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[appendix]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Using AsciiDoc with non-English Languages
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ------------------------------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc can process UTF-8 character sets but there are some things
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -you need to be aware of:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- If you are generating output documents using a DocBook toolchain
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  then you should set the AsciiDoc `lang` attribute to the appropriate
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  language (it defaults to `en` (English)). This will ensure things
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  like table of contents, figure and table captions and admonition
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  captions are output in the specified language.  For example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  $ a2x -a lang=es doc/article.txt
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- If you are outputting HTML directly from asciidoc(1) you'll
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  need to set the various `*_caption` attributes to match your target
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  language (see the list of captions and titles in the `[attributes]`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  section of the distribution `lang-*.conf` files). The easiest way is
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  to create a language `.conf` file (see the AsciiDoc's `lang-en.conf`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  file).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -+
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -NOTE: You still use the 'NOTE', 'CAUTION', 'TIP', 'WARNING',
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'IMPORTANT' captions in the AsciiDoc source, they get translated in
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -the HTML output file.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- asciidoc(1) automatically loads configuration files named like
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  `lang-.conf` where `` is a two letter language code that
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  matches the current AsciiDoc `lang` attribute. See also
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  <>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[appendix]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Vim Syntax Highlighter
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -----------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Syntax highlighting is incredibly useful, in addition to making
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -reading AsciiDoc documents much easier syntax highlighting also helps
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -you catch AsciiDoc syntax errors as you write your documents.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The AsciiDoc `./vim/` distribution directory contains Vim syntax
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -highlighter and filetype detection scripts for AsciiDoc.  Syntax
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -highlighting makes it much easier to spot AsciiDoc syntax errors.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -If Vim is installed on your system the AsciiDoc installer
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -(`install.sh`) will automatically install the vim scripts in the Vim
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -global configuration directory (`/etc/vim`).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -You can also turn on syntax highlighting by adding the following line
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -to the end of you AsciiDoc source files:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  // vim: set syntax=asciidoc:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -TIP: Bold fonts are often easier to read, use the Vim `:set
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -background=dark` command to set bold bright fonts.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -NOTE: There are a number of alternative syntax highlighters for
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -various editors listed on the {website}[AsciiDoc website].
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Limitations
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -~~~~~~~~~~~
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The current implementation does a reasonable job but on occasions gets
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -things wrong:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Nested quoted text formatting is highlighted according to the outer
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  format.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- If a closing Example Block delimiter is sometimes mistaken for a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  title underline. A workaround is to insert a blank line before the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  closing delimiter.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Lines within a paragraph starting with equals characters may be
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  highlighted as single-line titles.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Lines within a paragraph beginning with a period may be highlighted
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  as block titles.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X74]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[appendix]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Attribute Options
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Here is the list of predefined <>:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[cols="2e,2,2,5",frame="topbot",options="header"]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|Option|Backends|AsciiDoc Elements|Description
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|autowidth |xhtml11, html5, html4 |table|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The column widths are determined by the browser, not the AsciiDoc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'cols' attribute. If there is no 'width' attribute the table width is
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -also left up to the browser.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|unbreakable |xhtml11, html5 |block elements|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'unbreakable' attempts to keep the block element together on a single
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -printed page c.f. the 'breakable' and 'unbreakable' docbook (XSL/FO)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -options below.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|breakable, unbreakable |docbook (XSL/FO) |table, example, block image|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The 'breakable' options allows block elements to break across page
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -boundaries; 'unbreakable' attempts to keep the block element together
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -on a single page. If neither option is specified the default XSL
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -stylesheet behavior prevails.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|compact |docbook, xhtml11, html5 |bulleted list, numbered list|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Minimizes vertical space in the list
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|footer |docbook, xhtml11, html5, html4 |table|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The last row of the table is rendered as a footer.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|header |docbook, xhtml11, html5, html4 |table|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The first row of the table is rendered as a header.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|pgwide |docbook (XSL/FO) |table, block image, horizontal labeled list|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Specifies that the element should be rendered across the full text
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -width of the page irrespective of the current indentation.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|strong |xhtml11, html5, html4 |labeled lists|
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Emboldens label text.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X82]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[appendix]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Diagnostics
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The `asciidoc(1)` `--verbose` command-line option prints additional
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -information to stderr: files processed, filters processed, warnings,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -system attribute evaluation.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -A special attribute named 'trace' enables the output of
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -element-by-element diagnostic messages detailing output markup
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -generation to stderr.  The 'trace' attribute can be set on the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -command-line or from within the document using <> (the latter allows tracing to be confined to specific
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -portions of the document).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- Trace messages print the source file name and line number and the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  trace name followed by related markup.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- 'trace names' are normally the names of AsciiDoc elements (see the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  list below).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The trace message is only printed if the 'trace' attribute value
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  matches the start of a 'trace name'. The 'trace' attribute value can
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  be any Python regular expression.  If a trace value is not specified
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  all trace messages will be printed (this can result in large amounts
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  of output if applied to the whole document).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- In the case of inline substitutions:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  * The text before and after the substitution is printed; the before
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    text is preceded by a line containing `<<<` and the after text by
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    a line containing `>>>`.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  * The 'subs' trace value is an alias for all inline substitutions.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.Trace names
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.....................................................................
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - block close
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - block open
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -dropped line (a line containing an undefined attribute reference).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -floating title
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -footer
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -header
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -list close
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -list entry close
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -list entry open
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -list item close
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -list item open
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -list label close
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -list label open
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -list open
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -macro block (a block macro)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -name (man page NAME section)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -paragraph
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -preamble close
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -preamble open
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -push blockname
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -pop blockname
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -section close
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -section open: level 
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -subs (all inline substitutions)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -table
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.....................................................................
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Where:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- `` is section level number '0...4'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- `` is a delimited block name: 'comment', 'sidebar',
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  'open', 'pass', 'listing', 'literal', 'quote', 'example'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- `` is an inline substitution type:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  'specialcharacters','quotes','specialwords', 'replacements',
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  'attributes','macros','callouts', 'replacements2', 'replacements3'.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Command-line examples:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -. Trace the entire document.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  $ asciidoc -a trace mydoc.txt
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -. Trace messages whose names start with `quotes` or `macros`:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  $ asciidoc -a 'trace=quotes|macros'  mydoc.txt
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -. Print the first line of each trace message:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  $ asciidoc -a trace mydoc.txt 2>&1 | grep ^TRACE:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Attribute Entry examples:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -. Begin printing all trace messages:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  :trace:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -. Print only matched trace messages:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  :trace: quotes|macros
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -. Turn trace messages off:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  :trace!:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[[X88]]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[appendix]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Backend Attributes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -------------------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -This table contains a list of optional attributes that influence the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -generated outputs.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[cols="1e,1,5a",frame="topbot",options="header"]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|Name |Backends |Description
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|badges |xhtml11, html5 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Link badges ('XHTML 1.1' and 'CSS') in document footers. By default
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -badges are omitted ('badges' is undefined).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -NOTE: The path names of images, icons and scripts are relative path
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -names to the output document not the source document.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|data-uri |xhtml11, html5 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Embed images using the <>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|css-signature |html5, xhtml11 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Set a 'CSS signature' for the document (sets the 'id' attribute of the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -HTML 'body' element). CSS signatures provide a mechanism that allows
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -users to personalize the document appearance. The term 'CSS signature'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -was http://archivist.incutio.com/viewlist/css-discuss/13291[coined by
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Eric Meyer].
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|disable-javascript |xhtml11, html5 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -If the `disable-javascript` attribute is defined the `asciidoc.js`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -JavaScript is not embedded or linked to the output document.  By
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -default AsciiDoc automatically embeds or links the `asciidoc.js`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -JavaScript to the output document. The script dynamically generates
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<> and <>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|[[X97]] docinfo, docinfo1, docinfo2 |All backends |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -These three attributes control which <> will be included in the the header of the output file:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -docinfo:: Include `-docinfo.`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -docinfo1:: Include `docinfo.`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -docinfo2:: Include `docinfo.` and `-docinfo.`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Where `` is the file name (sans extension) of the AsciiDoc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -input file and `` is `.html` for HTML outputs or `.xml` for
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -DocBook outputs. If the input file is the standard input then the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -output file name is used. The following example will include the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`mydoc-docinfo.xml` docinfo file in the DocBook `mydoc.xml` output
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -file:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  $ asciidoc -a docinfo -b docbook mydoc.txt
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -This next example will include `docinfo.html` and `mydoc-docinfo.html`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -docinfo files in the HTML output file:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  $ asciidoc -a docinfo2 -b html4 mydoc.txt
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|[[X54]]encoding |html4, html5, xhtml11, docbook |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Set the input and output document character set encoding. For example
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -the `--attribute encoding=ISO-8859-1` command-line option will set the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -character set encoding to `ISO-8859-1`.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The default encoding is UTF-8.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- This attribute specifies the character set in the output document.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The encoding name must correspond to a Python codec name or alias.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The 'encoding' attribute can be set using an AttributeEntry inside
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  the document header. For example:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  :encoding: ISO-8859-1
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|[[X45]]icons |xhtml11, html5 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Link admonition paragraph and admonition block icon images and badge
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -images. By default 'icons' is undefined and text is used in place of
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -icon images.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|[[X44]]iconsdir |html4, html5, xhtml11, docbook |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The name of the directory containing linked admonition icons,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -navigation icons and the `callouts` sub-directory (the `callouts`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -sub-directory contains <> number images). 'iconsdir'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -defaults to `./images/icons`.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|imagesdir |html4, html5, xhtml11, docbook |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -If this attribute is defined it is prepended to the target image file
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -name paths in inline and block image macros.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|keywords, description, title |html4, html5, xhtml11 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The 'keywords' and 'description' attributes set the correspondingly
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -named HTML meta tag contents; the 'title' attribute sets the HTML
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -title tag contents.  Their principle use is for SEO (Search Engine
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Optimisation).  All three are optional, but if they are used they must
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -appear in the document header (or on the command-line). If 'title' is
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -not specified the AsciiDoc document title is used.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|linkcss |html5, xhtml11 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Link CSS stylesheets and JavaScripts. By default 'linkcss' is
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -undefined in which case stylesheets and scripts are automatically
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -embedded in the output document.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|[[X103]]max-width |html5, xhtml11 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Set the document maximum display width (sets the 'body' element CSS
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'max-width' property).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|numbered |html4, html5, xhtml11, docbook (XSL Stylesheets) |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Adds section numbers to section titles. The 'docbook' backend ignores
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'numbered' attribute entries after the document header.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|plaintext | All backends |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -If this global attribute is defined all inline substitutions are
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -suppressed and block indents are retained.  This option is useful when
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -dealing with large amounts of imported plain text.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|quirks |xhtml11 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Include the `xhtml11-quirks.conf` configuration file and
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`xhtml11-quirks.css` <> to work around IE6 browser
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -incompatibilities. This feature is deprecated and its use is
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -discouraged -- documents are still viewable in IE6 without it.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|revremark |docbook |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -A short summary of changes in this document revision. Must be defined
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -prior to the first document section. The document also needs to be
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -dated to output this attribute.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|scriptsdir |html5, xhtml11 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The name of the directory containing linked JavaScripts.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -See <>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|sgml |docbook45 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The `--backend=docbook45` command-line option produces DocBook 4.5
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -XML.  You can produce the older DocBook SGML format using the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -`--attribute sgml` command-line option.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|stylesdir |html5, xhtml11 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The name of the directory containing linked or embedded
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -See <>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|stylesheet |html5, xhtml11 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The file name of an optional additional CSS <>.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|theme |html5, xhtml11 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Use alternative stylesheet (see <>).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|[[X91]]toc |html5, xhtml11, docbook (XSL Stylesheets) |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Adds a table of contents to the start of an article or book document.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -The `toc` attribute can be specified using the `--attribute toc`
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -command-line option or a `:toc:` attribute entry in the document
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -header. The 'toc' attribute is defined by default when the 'docbook'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -backend is used. To disable table of contents generation undefine the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -'toc' attribute by putting a `:toc!:` attribute entry in the document
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -header or from the command-line with an `--attribute toc!` option.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -*xhtml11 and html5 backends*
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- JavaScript needs to be enabled in your browser.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -- The following example generates a numbered table of contents using a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  JavaScript embedded in the `mydoc.html` output document:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  $ asciidoc -a toc -a numbered mydoc.txt
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|toc2 |html5, xhtml11 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Adds a scrollable table of contents in the left hand margin of an
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -article or book document. Use the 'max-width' attribute to change the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -content width. In all other respects behaves the same as the 'toc'
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -attribute.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|toc-placement |html5, xhtml11 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -When set to 'auto' (the default value) asciidoc(1) will place the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -table of contents in the document header. When 'toc-placement' is set
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -to 'manual' the TOC can be positioned anywhere in the document by
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -placing the `toc::[]` block macro at the point you want the TOC to
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -appear.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -NOTE: If you use 'toc-placement' then you also have to define the
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<> attribute.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|toc-title |html5, xhtml11 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Sets the table of contents title (defaults to 'Table of Contents').
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|toclevels |html5, xhtml11 |
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Sets the number of title levels (1..4) reported in the table of
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -contents (see the 'toc' attribute above). Defaults to 2 and must be
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -used with the 'toc' attribute. Example usage:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  $ asciidoc -a toc -a toclevels=3 doc/asciidoc.txt
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -|====================================================================
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -[appendix]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -License
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --------
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc is free software; you can redistribute it and/or modify it
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -under the terms of the 'GNU General Public License version 2' (GPLv2)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -as published by the Free Software Foundation.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc is distributed in the hope that it will be useful, but
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -WITHOUT ANY WARRANTY; without even the implied warranty of
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -General Public License version 2 for more details.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -AsciiDoc Highlighter sponsored by O'Reilly Media
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Copyright (C) 2002-2011 Stuart Rackham.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/demo/kitchen-sink/docs/assembly_x86.asm b/demo/kitchen-sink/docs/assembly_x86.asm
                                                                                                                                                                                                                                                                                                                                                                                                                                                              deleted file mode 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                              index 01e8305c..00000000
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- a/demo/kitchen-sink/docs/assembly_x86.asm
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +++ /dev/null
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -1,18 +0,0 @@
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -section	.text
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    global main         ;must be declared for using gcc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -main:	                ;tell linker entry point
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	mov	edx, len	    ;message length
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	mov	ecx, msg	    ;message to write
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	mov	ebx, 1	        ;file descriptor (stdout)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	mov	eax, 4	        ;system call number (sys_write)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	int	0x80	        ;call kernel
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	mov	eax, 1	        ;system call number (sys_exit)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	int	0x80	        ;call kernel
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -section	.data
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -msg	db	'Hello, world!',0xa	;our dear string
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -len	equ	$ - msg			;length of our dear string
                                                                                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/demo/kitchen-sink/docs/autohotkey.ahk b/demo/kitchen-sink/docs/autohotkey.ahk
                                                                                                                                                                                                                                                                                                                                                                                                                                                              deleted file mode 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                              index 73687e67..00000000
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- a/demo/kitchen-sink/docs/autohotkey.ahk
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +++ /dev/null
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -1,35 +0,0 @@
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -#NoEnv
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -SetBatchLines -1
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -CoordMode Mouse, Screen
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -OnExit GuiClose
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -zoom := 9
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -computeSize(){
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	global as_x
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	as_x := Round(ws_x/zoom/2 - 0.5)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	if (zoom>1) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -		pix := Round(zoom)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	} ele {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -		pix := 1
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    ToolTip Message %as_x% %zoom% %ws_x% %hws_x% 
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -hdc_frame := DllCall("GetDC", UInt, MagnifierID)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -; comment
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -DrawCross(byRef x="", rX,rY,z, dc){
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        ;specify the style, thickness and color of the cross lines
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    h_pen := DllCall( "gdi32.dll\CreatePen", Int, 0, Int, 1, UInt, 0x0000FF)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -;Ctrl ^; Shift +; Win #; Alt !
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -^NumPadAdd::
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -^WheelUp::   
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -^;::   ;comment
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    If(zoom < ws_x and ( A_ThisHotKey = "^WheelUp" or A_ThisHotKey ="^NumPadAdd") )
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -		zoom *= 1.189207115         ; sqrt(sqrt(2))
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -	Gosub,setZoom
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -return
                                                                                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/demo/kitchen-sink/docs/batchfile.bat b/demo/kitchen-sink/docs/batchfile.bat
                                                                                                                                                                                                                                                                                                                                                                                                                                                              deleted file mode 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                              index c066a9e9..00000000
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- a/demo/kitchen-sink/docs/batchfile.bat
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +++ /dev/null
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -1,15 +0,0 @@
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -:: batch file highlighting in Ace!
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -@echo off
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -CALL set var1=%cd%
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -echo unhide everything in %var1%!
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -:: FOR loop in bat is super strange!
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -FOR /f "tokens=*" %%G IN ('dir /A:D /b') DO (
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -echo %var1%%%G
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -attrib -r -a -h -s "%var1%%%G" /D /S
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -pause
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -REM that's all
                                                                                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/demo/kitchen-sink/docs/c9search.c9search_results b/demo/kitchen-sink/docs/c9search.c9search_results
                                                                                                                                                                                                                                                                                                                                                                                                                                                              index 0ad9ccd4..bf0fdb87 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- a/demo/kitchen-sink/docs/c9search.c9search_results
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +++ b/demo/kitchen-sink/docs/c9search.c9search_results
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -1,4 +1,4 @@
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -Searching for var in/.c9/metadata/workspace/pluginsregexp, case sensitive, whole word
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +Searching for 'var' in /workspace/configs
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               configs/default.js:
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   1: var fs = require("fs");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/demo/kitchen-sink/docs/c_cpp.cpp b/demo/kitchen-sink/docs/c_cpp.cpp
                                                                                                                                                                                                                                                                                                                                                                                                                                                              deleted file mode 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                              index a2ebdaa2..00000000
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- a/demo/kitchen-sink/docs/c_cpp.cpp
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +++ /dev/null
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -1,44 +0,0 @@
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -// compound assignment operators
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -#include 
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -#include \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -#include \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -#include \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   "iostream"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -#include 
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -#include "boost/asio/io_service.hpp"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -#include \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   "iostream" \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   "string" \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -using namespace std;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -int main ()
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -{
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    int a, b=3; /* foobar */
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    a = b;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    a+=2; // equivalent to a=a+2
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    cout << a;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    #if VERBOSE >= 2
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        prints("trace message");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    #endif
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    return 0;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -/* Print an error message and get out */
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -#define ABORT                             \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    do {                                  \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        print( "Abort\n" );                \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        exit(8);                          \
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -} while (0)                      /* Note: No semicolon */
                                                                                                                                                                                                                                                                                                                                                                                                                                                              \ No newline at end of file
                                                                                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/demo/kitchen-sink/docs/cirru.cirru b/demo/kitchen-sink/docs/cirru.cirru
                                                                                                                                                                                                                                                                                                                                                                                                                                                              deleted file mode 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                              index 244833df..00000000
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- a/demo/kitchen-sink/docs/cirru.cirru
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +++ /dev/null
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -1,42 +0,0 @@
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- https://github.com/Cirru/cirru-gopher/blob/master/code/scope.cr,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -set a (int 2)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -print (self)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -set c (child)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -under c
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  under parent
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    print a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -print $ get c a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -set c x (int 3)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -print $ get c x
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -set just-print $ code
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  print a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -print just-print
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -eval (self) just-print
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -eval just-print
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -print (string "string with space")
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -print (string "escapes \n \"\\")
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -brackets ((((()))))
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -"eval" $ string "eval"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -print (add $ (int 1) (int 2))
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -print $ unwrap $
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  map (a $ int 1) (b $ int 2)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -print a
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  int 1
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  , b c
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  int 2
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  , d
                                                                                                                                                                                                                                                                                                                                                                                                                                                              \ No newline at end of file
                                                                                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/demo/kitchen-sink/docs/cobol.CBL b/demo/kitchen-sink/docs/cobol.CBL
                                                                                                                                                                                                                                                                                                                                                                                                                                                              deleted file mode 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                              index 30404ce4..00000000
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- a/demo/kitchen-sink/docs/cobol.CBL
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +++ /dev/null
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -1 +0,0 @@
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -TODO
                                                                                                                                                                                                                                                                                                                                                                                                                                                              \ No newline at end of file
                                                                                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/demo/kitchen-sink/docs/coffee.coffee b/demo/kitchen-sink/docs/coffeescript.coffee
                                                                                                                                                                                                                                                                                                                                                                                                                                                              similarity index 100%
                                                                                                                                                                                                                                                                                                                                                                                                                                                              rename from demo/kitchen-sink/docs/coffee.coffee
                                                                                                                                                                                                                                                                                                                                                                                                                                                              rename to demo/kitchen-sink/docs/coffeescript.coffee
                                                                                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/demo/kitchen-sink/docs/cpp.cpp b/demo/kitchen-sink/docs/cpp.cpp
                                                                                                                                                                                                                                                                                                                                                                                                                                                              new file mode 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                              index 00000000..1a2843db
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- /dev/null
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +++ b/demo/kitchen-sink/docs/cpp.cpp
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -0,0 +1,13 @@
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +// compound assignment operators
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +#include 
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +using namespace std;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +int main ()
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +{
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    int a, b=3; /* foobar */
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    a = b;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    a+=2; // equivalent to a=a+2
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    cout << a;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    return 0;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              \ No newline at end of file
                                                                                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/demo/kitchen-sink/docs/css.css b/demo/kitchen-sink/docs/css.css
                                                                                                                                                                                                                                                                                                                                                                                                                                                              index 6d2d71f5..a4c3b4fd 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- a/demo/kitchen-sink/docs/css.css
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +++ b/demo/kitchen-sink/docs/css.css
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -1,18 +1,28 @@
                                                                                                                                                                                                                                                                                                                                                                                                                                                               .text-layer {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    font: 12px Monaco, "Courier New", monospace;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    font-family: Monaco, "Courier New", monospace;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    font-size: 12px;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   cursor: text;
                                                                                                                                                                                                                                                                                                                                                                                                                                                               }
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               .blinker {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    animation: blink 1s linear infinite alternate;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    animation-duration: 1s;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    animation-name: blink;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    animation-iteration-count: infinite;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    animation-direction: alternate;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    animation-timing-function: linear;
                                                                                                                                                                                                                                                                                                                                                                                                                                                               }
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               @keyframes blink {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    0%, 40% {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    0% {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       opacity: 0;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    40.5%, 100% {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    40% {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        opacity: 0;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    40.5% {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +        opacity: 1
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +    100% {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                       opacity: 1
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   }
                                                                                                                                                                                                                                                                                                                                                                                                                                                               }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              \ No newline at end of file
                                                                                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/demo/kitchen-sink/docs/curly.curly b/demo/kitchen-sink/docs/curly.curly
                                                                                                                                                                                                                                                                                                                                                                                                                                                              deleted file mode 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                              index c42d6790..00000000
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- a/demo/kitchen-sink/docs/curly.curly
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +++ /dev/null
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -1,16 +0,0 @@
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        

                                                                                                                                                                                                                                                                                                                                                                                                                                                              {{author_name}}

                                                                                                                                                                                                                                                                                                                                                                                                                                                              - - diff --git a/demo/kitchen-sink/docs/d.d b/demo/kitchen-sink/docs/d.d deleted file mode 100644 index 57069067..00000000 --- a/demo/kitchen-sink/docs/d.d +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env rdmd -// Computes average line length for standard input. -import std.stdio; - -void main() { - ulong lines = 0; - double sumLength = 0; - foreach (line; stdin.byLine()) { - ++lines; - sumLength += line.length; - } - writeln("Average line length: ", - lines ? sumLength / lines : 0); -} \ No newline at end of file diff --git a/demo/kitchen-sink/docs/dart.dart b/demo/kitchen-sink/docs/dart.dart deleted file mode 100644 index 735a20b3..00000000 --- a/demo/kitchen-sink/docs/dart.dart +++ /dev/null @@ -1,19 +0,0 @@ -// Go ahead and modify this example. - -import "dart:html"; - -// Computes the nth Fibonacci number. -int fibonacci(int n) { - if (n < 2) return n; - return fibonacci(n - 1) + fibonacci(n - 2); -} - -// Displays a Fibonacci number. -void main() { - int i = 20; - String message = "fibonacci($i) = ${fibonacci(i)}"; - - // This example uses HTML to display the result and it will appear - // in a nested HTML frame (an iframe). - document.body.append(new HeadingElement.h1()..appendText(message)); -} diff --git a/demo/kitchen-sink/docs/diff.diff b/demo/kitchen-sink/docs/diff.diff index 16c89890..3f58128a 100644 --- a/demo/kitchen-sink/docs/diff.diff +++ b/demo/kitchen-sink/docs/diff.diff @@ -16,7 +16,7 @@ index 23fc3fc..ed3b273 100644 + this.highlight = function(re) { + if (!this.$searchHighlight) { -+ var highlight = new SearchHighlight(null, "ace_selected-word", "text"); ++ var highlight = new SearchHighlight(null, "ace_selected_word", "text"); + this.$searchHighlight = this.addDynamicMarker(highlight); + } + this.$searchHighlight.setRegexp(re); diff --git a/demo/kitchen-sink/docs/dot.dot b/demo/kitchen-sink/docs/dot.dot deleted file mode 100644 index 1e13be7e..00000000 --- a/demo/kitchen-sink/docs/dot.dot +++ /dev/null @@ -1,110 +0,0 @@ -// Original source: http://www.graphviz.org/content/lion_share -##"A few people in the field of genetics are using dot to draw "marriage node diagram" pedigree drawings. Here is one I have done of a test pedigree from the FTREE pedigree drawing package (Lion Share was a racehorse)." Contributed by David Duffy. - -##Command to get the layout: "dot -Tpng thisfile > thisfile.png" - -digraph Ped_Lion_Share { -# page = "8.2677165,11.692913" ; -ratio = "auto" ; -mincross = 2.0 ; -label = "Pedigree Lion_Share" ; - -"001" [shape=box , regular=1,style=filled,fillcolor=white ] ; -"002" [shape=box , regular=1,style=filled,fillcolor=white ] ; -"003" [shape=circle , regular=1,style=filled,fillcolor=white ] ; -"004" [shape=box , regular=1,style=filled,fillcolor=white ] ; -"005" [shape=box , regular=1,style=filled,fillcolor=white ] ; -"006" [shape=circle , regular=1,style=filled,fillcolor=white ] ; -"007" [shape=circle , regular=1,style=filled,fillcolor=white ] ; -"009" [shape=circle , regular=1,style=filled,fillcolor=white ] ; -"014" [shape=circle , regular=1,style=filled,fillcolor=white ] ; -"015" [shape=circle , regular=1,style=filled,fillcolor=white ] ; -"016" [shape=circle , regular=1,style=filled,fillcolor=white ] ; -"ZZ01" [shape=circle , regular=1,style=filled,fillcolor=white ] ; -"ZZ02" [shape=circle , regular=1,style=filled,fillcolor=white ] ; -"017" [shape=circle , regular=1,style=filled,fillcolor=white ] ; -"012" [shape=circle , regular=1,style=filled,fillcolor=white ] ; -"008" [shape=box , regular=1,style=filled,fillcolor=white ] ; -"011" [shape=box , regular=1,style=filled,fillcolor=white ] ; -"013" [shape=box , regular=1,style=filled,fillcolor=white ] ; -"010" [shape=box , regular=1,style=filled,fillcolor=white ] ; -"023" [shape=circle , regular=1,style=filled,fillcolor=white ] ; -"020" [shape=circle , regular=1,style=filled,fillcolor=white ] ; -"021" [shape=circle , regular=1,style=filled,fillcolor=white ] ; -"018" [shape=circle , regular=1,style=filled,fillcolor=white ] ; -"025" [shape=circle , regular=1,style=filled,fillcolor=white ] ; -"019" [shape=box , regular=1,style=filled,fillcolor=white ] ; -"022" [shape=box , regular=1,style=filled,fillcolor=white ] ; -"024" [shape=box , regular=1,style=filled,fillcolor=white ] ; -"027" [shape=circle , regular=1,style=filled,fillcolor=white ] ; -"026" [shape=box , regular=1,style=filled,fillcolor=white ] ; -"028" [shape=box , regular=1,style=filled,fillcolor=grey ] ; -"marr0001" [shape=diamond,style=filled,label="",height=.1,width=.1] ; -"001" -> "marr0001" [dir=none,weight=1] ; -"007" -> "marr0001" [dir=none,weight=1] ; -"marr0001" -> "017" [dir=none, weight=2] ; -"marr0002" [shape=diamond,style=filled,label="",height=.1,width=.1] ; -"001" -> "marr0002" [dir=none,weight=1] ; -"ZZ02" -> "marr0002" [dir=none,weight=1] ; -"marr0002" -> "012" [dir=none, weight=2] ; -"marr0003" [shape=diamond,style=filled,label="",height=.1,width=.1] ; -"002" -> "marr0003" [dir=none,weight=1] ; -"003" -> "marr0003" [dir=none,weight=1] ; -"marr0003" -> "008" [dir=none, weight=2] ; -"marr0004" [shape=diamond,style=filled,label="",height=.1,width=.1] ; -"002" -> "marr0004" [dir=none,weight=1] ; -"006" -> "marr0004" [dir=none,weight=1] ; -"marr0004" -> "011" [dir=none, weight=2] ; -"marr0005" [shape=diamond,style=filled,label="",height=.1,width=.1] ; -"002" -> "marr0005" [dir=none,weight=1] ; -"ZZ01" -> "marr0005" [dir=none,weight=1] ; -"marr0005" -> "013" [dir=none, weight=2] ; -"marr0006" [shape=diamond,style=filled,label="",height=.1,width=.1] ; -"004" -> "marr0006" [dir=none,weight=1] ; -"009" -> "marr0006" [dir=none,weight=1] ; -"marr0006" -> "010" [dir=none, weight=2] ; -"marr0007" [shape=diamond,style=filled,label="",height=.1,width=.1] ; -"005" -> "marr0007" [dir=none,weight=1] ; -"015" -> "marr0007" [dir=none,weight=1] ; -"marr0007" -> "023" [dir=none, weight=2] ; -"marr0008" [shape=diamond,style=filled,label="",height=.1,width=.1] ; -"005" -> "marr0008" [dir=none,weight=1] ; -"016" -> "marr0008" [dir=none,weight=1] ; -"marr0008" -> "020" [dir=none, weight=2] ; -"marr0009" [shape=diamond,style=filled,label="",height=.1,width=.1] ; -"005" -> "marr0009" [dir=none,weight=1] ; -"012" -> "marr0009" [dir=none,weight=1] ; -"marr0009" -> "021" [dir=none, weight=2] ; -"marr0010" [shape=diamond,style=filled,label="",height=.1,width=.1] ; -"008" -> "marr0010" [dir=none,weight=1] ; -"017" -> "marr0010" [dir=none,weight=1] ; -"marr0010" -> "018" [dir=none, weight=2] ; -"marr0011" [shape=diamond,style=filled,label="",height=.1,width=.1] ; -"011" -> "marr0011" [dir=none,weight=1] ; -"023" -> "marr0011" [dir=none,weight=1] ; -"marr0011" -> "025" [dir=none, weight=2] ; -"marr0012" [shape=diamond,style=filled,label="",height=.1,width=.1] ; -"013" -> "marr0012" [dir=none,weight=1] ; -"014" -> "marr0012" [dir=none,weight=1] ; -"marr0012" -> "019" [dir=none, weight=2] ; -"marr0013" [shape=diamond,style=filled,label="",height=.1,width=.1] ; -"010" -> "marr0013" [dir=none,weight=1] ; -"021" -> "marr0013" [dir=none,weight=1] ; -"marr0013" -> "022" [dir=none, weight=2] ; -"marr0014" [shape=diamond,style=filled,label="",height=.1,width=.1] ; -"019" -> "marr0014" [dir=none,weight=1] ; -"020" -> "marr0014" [dir=none,weight=1] ; -"marr0014" -> "024" [dir=none, weight=2] ; -"marr0015" [shape=diamond,style=filled,label="",height=.1,width=.1] ; -"022" -> "marr0015" [dir=none,weight=1] ; -"025" -> "marr0015" [dir=none,weight=1] ; -"marr0015" -> "027" [dir=none, weight=2] ; -"marr0016" [shape=diamond,style=filled,label="",height=.1,width=.1] ; -"024" -> "marr0016" [dir=none,weight=1] ; -"018" -> "marr0016" [dir=none,weight=1] ; -"marr0016" -> "026" [dir=none, weight=2] ; -"marr0017" [shape=diamond,style=filled,label="",height=.1,width=.1] ; -"026" -> "marr0017" [dir=none,weight=1] ; -"027" -> "marr0017" [dir=none,weight=1] ; -"marr0017" -> "028" [dir=none, weight=2] ; -} diff --git a/demo/kitchen-sink/docs/eiffel.e b/demo/kitchen-sink/docs/eiffel.e deleted file mode 100644 index 943cdb35..00000000 --- a/demo/kitchen-sink/docs/eiffel.e +++ /dev/null @@ -1,30 +0,0 @@ -note - description: "Represents a person." - -class - PERSON - -create - make, make_unknown - -feature {NONE} -- Creation - - make (a_name: like name) - -- Create a person with `a_name' as `name'. - do - name := a_name - ensure - name = a_name - end - - make_unknown - do ensure - name = Void - end - -feature -- Access - - name: detachable STRING - -- Full name or Void if unknown. - -end \ No newline at end of file diff --git a/demo/kitchen-sink/docs/ejs.ejs b/demo/kitchen-sink/docs/ejs.ejs deleted file mode 100644 index aaf497a9..00000000 --- a/demo/kitchen-sink/docs/ejs.ejs +++ /dev/null @@ -1,31 +0,0 @@ - - - - Cloud9 Rocks! - - - - - - - - - <% if (!isRoot) { %> - - - - - <% } %> - <% entries.forEach(function(entry) { %> - - - - - <% }) %> -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              NameSize
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ..
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - - <%= entry.name %> - <%= entry.size %>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - - - \ No newline at end of file diff --git a/demo/kitchen-sink/docs/elixir.ex b/demo/kitchen-sink/docs/elixir.ex deleted file mode 100644 index bb6a45f1..00000000 --- a/demo/kitchen-sink/docs/elixir.ex +++ /dev/null @@ -1,42 +0,0 @@ -defmodule HelloModule do - @moduledoc """ - This is supposed to be `markdown`. - __Yes__ this is [mark](http://down.format) - - # Truly - - ## marked - - * with lists - * more - * and more - - Even.with(code) - blocks |> with |> samples - - _Docs are first class citizens in Elixir_ (Jose Valim) - """ - - # A "Hello world" function - def some_fun do - IO.puts "Juhu Kinners!" - end - # A private function - defp priv do - is_regex ~r""" - This is a regex - spanning several - lines. - """ - x = elem({ :a, :b, :c }, 0) #=> :a - end -end - -test_fun = fn(x) -> - cond do - x > 10 -> - :greater_than_ten - true -> - :maybe_ten - end -end \ No newline at end of file diff --git a/demo/kitchen-sink/docs/elm.elm b/demo/kitchen-sink/docs/elm.elm deleted file mode 100644 index eef70b2a..00000000 --- a/demo/kitchen-sink/docs/elm.elm +++ /dev/null @@ -1,12 +0,0 @@ -{- Ace {- 4 -} Elm -} -main = lift clock (every second) - -clock t = collage 400 400 [ filled lightGrey (ngon 12 110) - , outlined (solid grey) (ngon 12 110) - , hand orange 100 t - , hand charcoal 100 (t/60) - , hand charcoal 60 (t/720) ] - -hand clr len time = - let angle = degrees (90 - 6 * inSeconds time) - in traced (solid clr) <| segment (0,0) (len * cos angle, len * sin angle) \ No newline at end of file diff --git a/demo/kitchen-sink/docs/erlang.erl b/demo/kitchen-sink/docs/erlang.erl deleted file mode 100644 index 705642b3..00000000 --- a/demo/kitchen-sink/docs/erlang.erl +++ /dev/null @@ -1,20 +0,0 @@ - %% A process whose only job is to keep a counter. - %% First version - -module(counter). - -export([start/0, codeswitch/1]). - - start() -> loop(0). - - loop(Sum) -> - receive - {increment, Count} -> - loop(Sum+Count); - {counter, Pid} -> - Pid ! {counter, Sum}, - loop(Sum); - code_switch -> - ?MODULE:codeswitch(Sum) - % Force the use of 'codeswitch/1' from the latest MODULE version - end. - - codeswitch(Sum) -> loop(Sum). \ No newline at end of file diff --git a/demo/kitchen-sink/docs/forth.frt b/demo/kitchen-sink/docs/forth.frt deleted file mode 100644 index dc85cd7b..00000000 --- a/demo/kitchen-sink/docs/forth.frt +++ /dev/null @@ -1,41 +0,0 @@ -: HELLO ( -- ) CR ." Hello, world!" ; - -HELLO -Hello, world! - -: [CHAR] CHAR POSTPONE LITERAL ; IMMEDIATE - -0 value ii 0 value jj -0 value KeyAddr 0 value KeyLen -create SArray 256 allot \ state array of 256 bytes -: KeyArray KeyLen mod KeyAddr ; - -: get_byte + c@ ; -: set_byte + c! ; -: as_byte 255 and ; -: reset_ij 0 TO ii 0 TO jj ; -: i_update 1 + as_byte TO ii ; -: j_update ii SArray get_byte + as_byte TO jj ; -: swap_s_ij - jj SArray get_byte - ii SArray get_byte jj SArray set_byte - ii SArray set_byte -; - -: rc4_init ( KeyAddr KeyLen -- ) - 256 min TO KeyLen TO KeyAddr - 256 0 DO i i SArray set_byte LOOP - reset_ij - BEGIN - ii KeyArray get_byte jj + j_update - swap_s_ij - ii 255 < WHILE - ii i_update - REPEAT - reset_ij -; -: rc4_byte - ii i_update jj j_update - swap_s_ij - ii SArray get_byte jj SArray get_byte + as_byte SArray get_byte xor -; \ No newline at end of file diff --git a/demo/kitchen-sink/docs/ftl.ftl b/demo/kitchen-sink/docs/ftl.ftl deleted file mode 100644 index faa573f5..00000000 --- a/demo/kitchen-sink/docs/ftl.ftl +++ /dev/null @@ -1,46 +0,0 @@ -<#ftl encoding="utf-8" /> -<#setting locale="en_US" /> -<#import "library" as lib /> -<#-- - FreeMarker comment - ${abc} <#assign a=12 /> ---> - - - - - - - ${title!"FreeMarker"}<title> - </head> - - <body> - - <h1>Hello ${name!""}</h1> - - <p>Today is: ${.now?date}</p> - - <#assign x = 13> - <#if x > 12 && x lt 14>x equals 13: ${x}</#if> - - <ul> - <#list items as item> - <li>${item_index}: ${item.name!?split("\n")[0]}</li> - </#list> - </ul> - - User directive: <@lib.function attr1=true attr2='value' attr3=-42.12>Test</@lib.function> - <@anotherOne /> - - <#if variable?exists> - Deprecated - <#elseif variable??> - Better - <#else> - Default - </#if> - - <img src="images/${user.id}.png" /> - - </body> -</html> diff --git a/demo/kitchen-sink/docs/gcode.gcode b/demo/kitchen-sink/docs/gcode.gcode deleted file mode 100644 index 5f47bca3..00000000 --- a/demo/kitchen-sink/docs/gcode.gcode +++ /dev/null @@ -1,31 +0,0 @@ -O003 (DIAMOND SQUARE) -N2 G54 G90 G49 G80 -N3 M6 T1 (1.ENDMILL) -N4 M3 S1800 -N5 G0 X-.6 Y2.050 -N6 G43 H1 Z.1 -N7 G1 Z-.3 F50. -N8 G41 D1 Y1.45 -N9 G1 X0 F20. -N10 G2 J-1.45 -(CUTTER COMP CANCEL) -N11 G1 Z-.2 F50. -N12 Y-.990 -N13 G40 -N14 G0 X-.6 Y1.590 -N15 G0 Z.1 -N16 M5 G49 G28 G91 Z0 -N17 CALL O9456 -N18 #500=0.004 -N19 #503=[#500+#501] -N20 VC45=0.0006 -VS4=0.0007 -N21 G90 G10 L20 P3 X5.Y4. Z6.567 -N22 G0 X5000 -N23 IF [#1 LT 0.370] GOTO 49 -N24 X-0.678 Y+.990 -N25 G84.3 X-0.1 -N26 #4=#5*COS[45] -N27 #4=#5*SIN[45] -N28 VZOFZ=652.9658 -% \ No newline at end of file diff --git a/demo/kitchen-sink/docs/gherkin.feature b/demo/kitchen-sink/docs/gherkin.feature deleted file mode 100644 index 52cd811e..00000000 --- a/demo/kitchen-sink/docs/gherkin.feature +++ /dev/null @@ -1,28 +0,0 @@ -@these @are @tags -Feature: Serve coffee - Coffee should not be served until paid for - Coffee should not be served until the button has been pressed - If there is no coffee left then money should be refunded - - Scenario Outline: Eating - Given there are <start> cucumbers - When I eat <eat> cucumbers - Then I should have <left> cucumbers - - Examples: - | start | eat | left | - | 12 | 5 | 7 | - | 20 | 5 | 15 | - - Scenario: Buy last coffee - Given there are 1 coffees left in the machine - And I have deposited 1$ - When I press the coffee button - Then I should be served a "coffee" - - # this a comment - - """ - this is a - pystring - """ \ No newline at end of file diff --git a/demo/kitchen-sink/docs/haml.haml b/demo/kitchen-sink/docs/haml.haml deleted file mode 100644 index d07ed4a2..00000000 --- a/demo/kitchen-sink/docs/haml.haml +++ /dev/null @@ -1,36 +0,0 @@ -!!!5 - -# <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]--> -# <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]--> -# <!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]--> -# <!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]--> - - -/adasdasdad -%div{:id => "#{@item.type}_#{@item.number}", :class => '#{@item.type} #{@item.urgency}', :phoney => `asdasdasd`} -/ file: app/views/movies/index.html.haml -\d -%ads:{:bleh => 33} -%p==ddd== - Date/Time: - - now = DateTime.now - %strong= now - = if now DateTime.parse("December 31, 2006") - = "Happy new " + "year!" -%sfd.dfdfg -#content - .title - %h1= @title - = link_to 'Home', home_url - - #contents -%div#content - %div.articles - %div.article.title Blah - %div.article.date 2006-11-05 - %div.article.entry - Neil Patrick Harris - -%div[@user, :greeting] - %bar[290]/ - ==Hello!== diff --git a/demo/kitchen-sink/docs/handlebars.hbs b/demo/kitchen-sink/docs/handlebars.hbs deleted file mode 100644 index bb096a1a..00000000 --- a/demo/kitchen-sink/docs/handlebars.hbs +++ /dev/null @@ -1,8 +0,0 @@ -{{!-- Ace + :-}} --}} - -<div id="comments"> - {{#each comments}} - <h2><a href="/posts/{{../permalink}}#{{id}}">{{title}}</a></h2> - <div>{{{body}}}</div> - {{/each}} -</div> diff --git a/demo/kitchen-sink/docs/haskell.hs b/demo/kitchen-sink/docs/haskell.hs deleted file mode 100644 index 5c0defc2..00000000 --- a/demo/kitchen-sink/docs/haskell.hs +++ /dev/null @@ -1,20 +0,0 @@ --- Type annotation (optional) -fib :: Int -> Integer - --- With self-referencing data -fib n = fibs !! n - where fibs = 0 : scanl (+) 1 fibs - -- 0,1,1,2,3,5,... - --- Same, coded directly -fib n = fibs !! n - where fibs = 0 : 1 : next fibs - next (a : t@(b:_)) = (a+b) : next t - --- Similar idea, using zipWith -fib n = fibs !! n - where fibs = 0 : 1 : zipWith (+) fibs (tail fibs) - --- Using a generator function -fib n = fibs (0,1) !! n - where fibs (a,b) = a : fibs (b,a+b) \ No newline at end of file diff --git a/demo/kitchen-sink/docs/htaccess b/demo/kitchen-sink/docs/htaccess deleted file mode 100644 index a9f5a27c..00000000 --- a/demo/kitchen-sink/docs/htaccess +++ /dev/null @@ -1,10 +0,0 @@ -Redirect /linux http://www.linux.org -Redirect 301 /kernel http://www.linux.org - -# comment -RewriteEngine on - -RewriteCond %{HTTP_USER_AGENT} ^Mozilla.* -RewriteRule ^/$ /homepage.max.html [L] - -RewriteRule ^/$ /homepage.std.html [L] diff --git a/demo/kitchen-sink/docs/html.html b/demo/kitchen-sink/docs/html.html index 81398bef..a3a566ff 100644 --- a/demo/kitchen-sink/docs/html.html +++ b/demo/kitchen-sink/docs/html.html @@ -1,4 +1,3 @@ -<!DOCTYPE html> <html> <head> diff --git a/demo/kitchen-sink/docs/html_ruby.erb b/demo/kitchen-sink/docs/html_ruby.erb deleted file mode 100644 index f75835ca..00000000 --- a/demo/kitchen-sink/docs/html_ruby.erb +++ /dev/null @@ -1,26 +0,0 @@ -<h1>Listing Books</h1> - -<table> - <tr> - <th>Title</th> - <th>Summary</th> - <th></th> - <th></th> - <th></th> - </tr> - -<% @books.each do |book| %> - <tr> - <%# comment %> - <td><%= book.title %></td> - <td><%= book.content %></td> - <td><%= link_to 'Show', book %></td> - <td><%= link_to 'Edit', edit_book_path(book) %></td> - <td><%= link_to 'Remove', book, :confirm => 'Are you sure?', :method => :delete %></td> - </tr> -<% end %> -</table> - -<br /> - -<%= link_to 'New book', new_book_path %> \ No newline at end of file diff --git a/demo/kitchen-sink/docs/ini.ini b/demo/kitchen-sink/docs/ini.ini deleted file mode 100644 index 45f83c9a..00000000 --- a/demo/kitchen-sink/docs/ini.ini +++ /dev/null @@ -1,4 +0,0 @@ -[.ShellClassInfo] -IconResource=..\logo.png -[ViewState] -FolderType=Generic diff --git a/demo/kitchen-sink/docs/io.io b/demo/kitchen-sink/docs/io.io deleted file mode 100644 index 4b80b6c2..00000000 --- a/demo/kitchen-sink/docs/io.io +++ /dev/null @@ -1,6 +0,0 @@ -// computes factorial of a number -factorial := method(n, - if(n == 0, return 1) - res := 1 - Range 1 to(n) foreach(i, res = res * i) -) \ No newline at end of file diff --git a/demo/kitchen-sink/docs/jade.jade b/demo/kitchen-sink/docs/jade.jade deleted file mode 100644 index d9fb7e30..00000000 --- a/demo/kitchen-sink/docs/jade.jade +++ /dev/null @@ -1,45 +0,0 @@ -!!!doctype -!!!5 -!!! - -include something - - include another_thing - - // let's talk about it - -// - here it is. a block comment! - and another row! -but not here. - - // - a far spaced - should be lack of block - - // also not a comment - div.attemptAtBlock - - span#myName - - #{implicit} - !{more_explicit} - - #idDiv - - .idDiv - - test(id="tag") - header(id="tag", blah="foo", meh="aads") -mixin article(obj, parents) - - mixin bleh() - - mixin clever-name - - -var x = "0"; - - y each z - - - var items = ["one", "two", "three"] - each item in items - li= item \ No newline at end of file diff --git a/demo/kitchen-sink/docs/jsoniq.jq b/demo/kitchen-sink/docs/jsoniq.jq deleted file mode 100644 index 30404ce4..00000000 --- a/demo/kitchen-sink/docs/jsoniq.jq +++ /dev/null @@ -1 +0,0 @@ -TODO \ No newline at end of file diff --git a/demo/kitchen-sink/docs/jsp.jsp b/demo/kitchen-sink/docs/jsp.jsp deleted file mode 100644 index 43fbb835..00000000 --- a/demo/kitchen-sink/docs/jsp.jsp +++ /dev/null @@ -1,46 +0,0 @@ -<html> -<body> - <script> - var x = "abc"; - function y { - } - </script> - <style> - .class { - background: #124356; - } - </style> - - <p> - Today's date: <%= (new java.util.Date()).toLocaleString()%> - </p> - <%! int i = 0; %> - <jsp:declaration> - int j = 10; - </jsp:declaration> - - <%-- This is JSP comment --%> - <%@ directive attribute="value" %> - - <h2>Select Languages:</h2> - - <form ACTION="jspCheckBox.jsp"> - <input type="checkbox" name="id" value="Java"> Java<BR> - <input type="checkbox" name="id" value=".NET"> .NET<BR> - <input type="checkbox" name="id" value="PHP"> PHP<BR> - <input type="checkbox" name="id" value="C/C++"> C/C++<BR> - <input type="checkbox" name="id" value="PERL"> PERL <BR> - <input type="submit" value="Submit"> - </form> - - <% - String select[] = request.getParameterValues("id"); - if (select != null && select.length != 0) { - out.println("You have selected: "); - for (int i = 0; i < select.length; i++) { - out.println(select[i]); - } - } - %> -</body> -</html> \ No newline at end of file diff --git a/demo/kitchen-sink/docs/julia.jl b/demo/kitchen-sink/docs/julia.jl deleted file mode 100644 index f558ae22..00000000 --- a/demo/kitchen-sink/docs/julia.jl +++ /dev/null @@ -1,15 +0,0 @@ -for op = (:+, :*, :&, :|, :$) - @eval ($op)(a,b,c) = ($op)(($op)(a,b),c) -end - -v = α'; -function g(x,y) - return x * y - x + y -end - -cd("data") do - open("outfile", "w") do f - write(f, data) - end -end diff --git a/demo/kitchen-sink/docs/lean.lean b/demo/kitchen-sink/docs/lean.lean deleted file mode 100644 index 40e82753..00000000 --- a/demo/kitchen-sink/docs/lean.lean +++ /dev/null @@ -1,9 +0,0 @@ -import logic -section - variables (A : Type) (p q : A → Prop) - - example : (∀x : A, p x ∧ q x) → ∀y : A, p y := - assume H : ∀x : A, p x ∧ q x, - take y : A, - show p y, from and.elim_left (H y) -end diff --git a/demo/kitchen-sink/docs/lisp.lisp b/demo/kitchen-sink/docs/lisp.lisp deleted file mode 100644 index e8d25558..00000000 --- a/demo/kitchen-sink/docs/lisp.lisp +++ /dev/null @@ -1,22 +0,0 @@ -(defun prompt-for-cd () - "Prompts - for CD" - (prompt-read "Title" 1.53 1 2/4 1.7 1.7e0 2.9E-4 +42 -7 #b001 #b001/100 #o777 #O777 #xabc55 #c(0 -5.6)) - (prompt-read "Artist" &rest) - (or (parse-integer (prompt-read "Rating") :junk-allowed t) 0) - (if x (format t "yes") (format t "no" nil) ;and here comment - ) 0xFFLL -23ull - ;; second line comment - '(+ 1 2) - (defvar *lines*) ; list of all lines - (position-if-not #'sys::whitespacep line :start beg)) - (quote (privet 1 2 3)) - '(hello world) - (* 5 7) - (1 2 34 5) - (:use "aaaa") - (let ((x 10) (y 20)) - (print (+ x y)) - ) LAmbDa - - "asdad\0eqweqe" \ No newline at end of file diff --git a/demo/kitchen-sink/docs/livescript.ls b/demo/kitchen-sink/docs/livescript.ls deleted file mode 100644 index ce082b4c..00000000 --- a/demo/kitchen-sink/docs/livescript.ls +++ /dev/null @@ -1,245 +0,0 @@ -# Defines an editing mode for [Ace](http://ace.ajax.org). -# -# Open [test/ace.html](../test/ace.html) to test. - -require, exports, module <-! define \ace/mode/ls - -identifier = /(?![\d\s])[$\w\xAA-\uFFDC](?:(?!\s)[$\w\xAA-\uFFDC]|-[A-Za-z])*/$ - -exports.Mode = class LiveScriptMode extends require(\ace/mode/text)Mode - -> - @$tokenizer = - new (require \ace/tokenizer)Tokenizer LiveScriptMode.Rules - if require \ace/mode/matching_brace_outdent - @$outdent = new that.MatchingBraceOutdent - - indenter = // (? - : [({[=:] - | [-~]> - | \b (?: e(?:lse|xport) | d(?:o|efault) | t(?:ry|hen) | finally | - import (?:\s* all)? | const | var | - let | new | catch (?:\s* #identifier)? ) - ) \s* $ // - - getNextLineIndent: (state, line, tab) -> - indent = @$getIndent line - {tokens} = @$tokenizer.getLineTokens line, state - unless tokens.length and tokens[*-1]type is \comment - indent += tab if state is \start and indenter.test line - indent - - toggleCommentLines: (state, doc, startRow, endRow) -> - comment = /^(\s*)#/; range = new (require \ace/range)Range 0 0 0 0 - for i from startRow to endRow - if out = comment.test line = doc.getLine i - then line.=replace comment, \$1 - else line.=replace /^\s*/ \$&# - range.end.row = range.start.row = i - range.end.column = line.length + 1 - doc.replace range, line - 1 - out * 2 - - checkOutdent: (state, line, input) -> @$outdent?checkOutdent line, input - - autoOutdent: (state, doc, row) -> @$outdent?autoOutdent doc, row - -### Highlight Rules - -keywordend = /(?![$\w]|-[A-Za-z]|\s*:(?![:=]))/$ -stringfill = token: \string, regex: '.+' - -LiveScriptMode.Rules = - start: - * token: \keyword - regex: //(? - :t(?:h(?:is|row|en)|ry|ypeof!?) - |c(?:on(?:tinue|st)|a(?:se|tch)|lass) - |i(?:n(?:stanceof)?|mp(?:ort(?:\s+all)?|lements)|[fs]) - |d(?:e(?:fault|lete|bugger)|o) - |f(?:or(?:\s+own)?|inally|unction) - |s(?:uper|witch) - |e(?:lse|x(?:tends|port)|val) - |a(?:nd|rguments) - |n(?:ew|ot) - |un(?:less|til) - |w(?:hile|ith) - |o[fr]|return|break|let|var|loop - )//$ + keywordend - - * token: \constant.language - regex: '(?:true|false|yes|no|on|off|null|void|undefined)' + keywordend - - * token: \invalid.illegal - regex: '(? - :p(?:ackage|r(?:ivate|otected)|ublic) - |i(?:mplements|nterface) - |enum|static|yield - )' + keywordend - - * token: \language.support.class - regex: '(? - :R(?:e(?:gExp|ferenceError)|angeError) - |S(?:tring|yntaxError) - |E(?:rror|valError) - |Array|Boolean|Date|Function|Number|Object|TypeError|URIError - )' + keywordend - - * token: \language.support.function - regex: '(? - :is(?:NaN|Finite) - |parse(?:Int|Float) - |Math|JSON - |(?:en|de)codeURI(?:Component)? - )' + keywordend - - * token: \variable.language - regex: '(?:t(?:hat|il|o)|f(?:rom|allthrough)|it|by|e)' + keywordend - - * token: \identifier - regex: identifier + /\s*:(?![:=])/$ - - * token: \variable - regex: identifier - - * token: \keyword.operator - regex: /(?:\.{3}|\s+\?)/$ - - * token: \keyword.variable - regex: /(?:@+|::|\.\.)/$ - next : \key - - * token: \keyword.operator - regex: /\.\s*/$ - next : \key - - * token: \string - regex: /\\\S[^\s,;)}\]]*/$ - - * token: \string.doc - regex: \''' - next : \qdoc - - * token: \string.doc - regex: \""" - next : \qqdoc - - * token: \string - regex: \' - next : \qstring - - * token: \string - regex: \" - next : \qqstring - - * token: \string - regex: \` - next : \js - - * token: \string - regex: '<\\[' - next : \words - - * token: \string.regex - regex: \// - next : \heregex - - * token: \comment.doc - regex: '/\\*' - next : \comment - - * token: \comment - regex: '#.*' - - * token: \string.regex - regex: // - /(?: [^ [ / \n \\ ]* - (?: (?: \\. - | \[ [^\]\n\\]* (?:\\.[^\]\n\\]*)* \] - ) [^ [ / \n \\ ]* - )* - )/ [gimy$]{0,4} - //$ - next : \key - - * token: \constant.numeric - regex: '(?:0x[\\da-fA-F][\\da-fA-F_]* - |(?:[2-9]|[12]\\d|3[0-6])r[\\da-zA-Z][\\da-zA-Z_]* - |(?:\\d[\\d_]*(?:\\.\\d[\\d_]*)?|\\.\\d[\\d_]*) - (?:e[+-]?\\d[\\d_]*)?[\\w$]*)' - - * token: \lparen - regex: '[({[]' - - * token: \rparen - regex: '[)}\\]]' - next : \key - - * token: \keyword.operator - regex: \\\S+ - - * token: \text - regex: \\\s+ - - heregex: - * token: \string.regex - regex: '.*?//[gimy$?]{0,4}' - next : \start - * token: \string.regex - regex: '\\s*#{' - * token: \comment.regex - regex: '\\s+(?:#.*)?' - * token: \string.regex - regex: '\\S+' - - key: - * token: \keyword.operator - regex: '[.?@!]+' - * token: \identifier - regex: identifier - next : \start - * token: \text - regex: '.' - next : \start - - comment: - * token: \comment.doc - regex: '.*?\\*/' - next : \start - * token: \comment.doc - regex: '.+' - - qdoc: - token: \string - regex: ".*?'''" - next : \key - stringfill - - qqdoc: - token: \string - regex: '.*?"""' - next : \key - stringfill - - qstring: - token: \string - regex: /[^\\']*(?:\\.[^\\']*)*'/$ - next : \key - stringfill - - qqstring: - token: \string - regex: /[^\\"]*(?:\\.[^\\"]*)*"/$ - next : \key - stringfill - - js: - token: \string - regex: /[^\\`]*(?:\\.[^\\`]*)*`/$ - next : \key - stringfill - - words: - token: \string - regex: '.*?\\]>' - next : \key - stringfill diff --git a/demo/kitchen-sink/docs/logiql.logic b/demo/kitchen-sink/docs/logiql.logic deleted file mode 100644 index 910862d7..00000000 --- a/demo/kitchen-sink/docs/logiql.logic +++ /dev/null @@ -1,16 +0,0 @@ -// ancestors -parentof("douglas", "john"). -parentof("john", "bob"). -parentof("bob", "ebbon"). - -parentof("douglas", "jane"). -parentof("jane", "jan"). - -ancestorof(A, B) <- parentof(A, B). -ancestorof(A, C) <- ancestorof(A, B), parentof(B,C). - -grandparentof(A, B) <- parentof(A, C), parentof(C, B). - -cousins(A,B) <- grandparentof(C,A), grandparentof(C,B). - -parentof[`arg](A, B) -> int[32](A), !string(B). \ No newline at end of file diff --git a/demo/kitchen-sink/docs/lsl.lsl b/demo/kitchen-sink/docs/lsl.lsl deleted file mode 100644 index baf06f08..00000000 --- a/demo/kitchen-sink/docs/lsl.lsl +++ /dev/null @@ -1,75 +0,0 @@ -/* - Testing syntax highlighting - of Ace Editor - for the Linden Scripting Language -*/ - -integer someIntNormal = 3672; -integer someIntHex = 0x00000000; -integer someIntMath = PI_BY_TWO; - -integer event = 5673; // invalid.illegal - -key someKeyTexture = TEXTURE_DEFAULT; -string someStringSpecial = EOF; - -some_user_defined_function_without_return_type(string inputAsString) -{ - llSay(PUBLIC_CHANNEL, inputAsString); -} - -string user_defined_function_returning_a_string(key inputAsKey) -{ - return (string)inputAsKey; -} - -default -{ - state_entry() - { - key someKey = NULL_KEY; - someKey = llGetOwner(); - - string someString = user_defined_function_returning_a_string(someKey); - - some_user_defined_function_without_return_type(someString); - } - - touch_start(integer num_detected) - { - list agentsInRegion = llGetAgentList(AGENT_LIST_REGION, []); - integer numOfAgents = llGetListLength(agentsInRegion); - - integer index; // defaults to 0 - for (; index <= numOfAgents - 1; index++) // for each agent in region - { - llRegionSayTo(llList2Key(agentsInRegion, index), PUBLIC_CHANNEL, "Hello, Avatar!"); - } - } - - touch_end(integer num_detected) - { - someIntNormal = 3672; - someIntHex = 0x00000000; - someIntMath = PI_BY_TWO; - - event = 5673; // invalid.illegal - - someKeyTexture = TEXTURE_DEFAULT; - someStringSpecial = EOF; - - llSetInventoryPermMask("some item", MASK_NEXT, PERM_ALL); // reserved.godmode - - llWhisper(PUBLIC_CHANNEL, "Leaving \"default\" now..."); - state other; - } -} - -state other -{ - state_entry() - { - llWhisper(PUBLIC_CHANNEL, "Entered \"state other\", returning to \"default\" again..."); - state default; - } -} diff --git a/demo/kitchen-sink/docs/lua.lua b/demo/kitchen-sink/docs/lua.lua index 6c927197..381b782c 100644 --- a/demo/kitchen-sink/docs/lua.lua +++ b/demo/kitchen-sink/docs/lua.lua @@ -34,5 +34,3 @@ print([===[ table.maxn is deprecated, use # instead. --]=]-- print(table.maxn{1,2,[4]=4,[8]=8) -- outputs 8 instead of 2 - -print(5 --[[ blah ]]) \ No newline at end of file diff --git a/demo/kitchen-sink/docs/lucene.lucene b/demo/kitchen-sink/docs/lucene.lucene deleted file mode 100644 index 7ac4b90b..00000000 --- a/demo/kitchen-sink/docs/lucene.lucene +++ /dev/null @@ -1 +0,0 @@ -(title:"foo bar" AND body:"quick fox") OR title:fox \ No newline at end of file diff --git a/demo/kitchen-sink/docs/markdown.md b/demo/kitchen-sink/docs/markdown.md index 63e96eab..6755f481 100644 --- a/demo/kitchen-sink/docs/markdown.md +++ b/demo/kitchen-sink/docs/markdown.md @@ -36,7 +36,7 @@ Previously known as “Bespin” and “Skywriter” it’s now known as Ace (Aj Getting the code ---------------- -Ace is a community project. We actively encourage and support contributions. The Ace source code is hosted on GitHub. It is released under the BSD License. This license is very simple, and is friendly to all kinds of projects, whether open source or not. Take charge of your editor and add your favorite language highlighting and keybindings! +Ace is a community project. We actively encourage and support contributions. The Ace source code is hosted on GitHub. It is released under the Mozilla tri-license (MPL/GPL/LGPL), the same license used by Firefox. This license is friendly to all kinds of projects, whether open source or not. Take charge of your editor and add your favorite language highlighting and keybindings! ```bash git clone git://github.com/ajaxorg/ace.git diff --git a/demo/kitchen-sink/docs/mask.mask b/demo/kitchen-sink/docs/mask.mask deleted file mode 100644 index 85a9e6c2..00000000 --- a/demo/kitchen-sink/docs/mask.mask +++ /dev/null @@ -1,52 +0,0 @@ -/* Mask Syntax Demo */ - -div > ' Test ~[name]'; - -define :userProfile { - header { - h4 > @title; - button.close; - } -} - -:userProfile { - @title > ' Hello ~[: username.toUpperCase()]' -} - -style { - html, body { - background: url('name.png') 0 0 no-repeat; - } -} - -button { - event click (e) { - this.textContent = `name ${e.clientX} !`; - } -} - -md > """ - -- div -- span - -Hello - -[one](http://google.com) - -"""; - - -header .foo > 'Heading' - -button .baz x-signal='click: test' disabled > " - Hello, - world - \"Buddy\" -" - -var a = { - name: `name ${window.innerWidth}` -}; - -span .foo > "~[bind: a.name]" \ No newline at end of file diff --git a/demo/kitchen-sink/docs/matlab.matlab b/demo/kitchen-sink/docs/matlab.matlab deleted file mode 100644 index b2ca44d5..00000000 --- a/demo/kitchen-sink/docs/matlab.matlab +++ /dev/null @@ -1,17 +0,0 @@ -%{ - %{ - Ace Matlab demo - %} -%} - -classdef hello - methods - function greet(this) - disp('Hello!') % say hi - end - end -end - -% transpose -a = [ 'x''y', "x\n\ - y", 1' ]' + 2' \ No newline at end of file diff --git a/demo/kitchen-sink/docs/mel.mel b/demo/kitchen-sink/docs/mel.mel deleted file mode 100644 index 63dc14d6..00000000 --- a/demo/kitchen-sink/docs/mel.mel +++ /dev/null @@ -1,33 +0,0 @@ -// animated duplicates, instances script -proc animatedDuplication (int $rangeStart, int $rangeEnd, int $numOfDuplicates, int $duplicateOrInstance) -{ - int $range_start = $rangeStart; - int $range_end = $rangeEnd; - int $num_of_duplicates = $numOfDuplicates; - int $step_size = ($range_end - $range_start) / $num_of_duplicates; - int $i = 0; - int $temp; - - currentTime $range_start; // set to range start - - string $selectedObjects[]; // to store selected objects - $selectedObjects = `ls -sl`; // store selected objects - select $selectedObjects; - - while ($i <= $num_of_duplicates) - { - $temp = $range_start + ($step_size * $i); - currentTime ($temp); - // seleced the objects to duplicate or instance - select $selectedObjects; - if($duplicateOrInstance == 0) - { - duplicate; - } - else - { - instance; - } - $i++; - } -} \ No newline at end of file diff --git a/demo/kitchen-sink/docs/mushcode.mc b/demo/kitchen-sink/docs/mushcode.mc deleted file mode 100644 index 6861f955..00000000 --- a/demo/kitchen-sink/docs/mushcode.mc +++ /dev/null @@ -1,8 +0,0 @@ -@create phone -&pickup phone=$pick up:@ifelse [u(is,u(mode),ICC)]={@pemit %#=You pick up the [fullname(me)].[set(me,PHONER:%#)][set(me,MODE:CIP)][set([u(INCOMING)],CONNECTED:[num(me)])][set(me,CONNECTED:[u(INCOMING)])]%r[showpicture(PICPICKUP)]%rUse '[color(green,black,psay <message>)]' (or '[color(green,black,p <message>)]') to talk into the phone.;@oemit %#=%N picks up the [fullname(me)].},{@pemit %#=You pick up the phone but no one is there. You hear a dialtone and then hang up. [play(u(DIALTONE))];@oemit %#=%N picks up the phone, but no one is on the other end.} -&ringfun phone=[ifelse(eq(comp([u(%0/ringtone)],off),0),[color(black,cyan,INCOMING CALL FROM %1)],[play([switch([u(%0/ringtone)],1,[u(%0/ringtone1)],2,[u(%0/ringtone2)],3,[u(%0/ringtone3)],4,[u(%0/ringtone4)],5,[u(%0/ringtone5)],6,[u(%0/ringtone6)],7,[u(%0/ringtone7)],8,[u(%0/ringtone8)],9,[u(%0/ringtone9)],custom,[u(%0/customtone)],vibrate,[u(%0/vibrate)])])] -&ringloop phone=@switch [u(ringstate)]=1,{@emit [setq(q,[u(connecting)])][set(%qq,rangs:0)][set(%qq,mode:WFC)][set(%qq,INCOMING:)];@ifelse [u(%qq/HASVMB)]={@tr me/ROUTEVMB=[u(connecting)];},{@pemit %#=[u(MSGCNC)];}},2,{@pemit %#=The call is connected.[setq(q,[u(CONNECTING)])][set(me,CONNECTED:%qq)][set(%qq,CONNECTED:[num(me)])][set(%qq,MODE:CIP)];@tr me/ciploop;@tr %qq/ciploop;},3,{@emit On [fullname(me)]'s earpiece you hear a ringing sound.[play(u(LINETONE))];@tr me/ringhere;@increment [u(connecting)]/RANGS;@wait 5={@tr me/ringloop};},4,{} -&ringstate phone=[setq(q,u(connecting))][setq(1,[gt(u(%qq/rangs),sub(u(%qq/rings),1))])][setq(2,[and(u(is,u(%qq/MODE),CIP),u(is,u(%qq/INCOMING),[num(me)]))][setq(3,[u(is,u(%qq/MODE),ICC)])][ifelse(%q1,1,ifelse(%q2,2,ifelse(%q3,3,4)))] -;comment -@@(comment) -say [time()] diff --git a/demo/kitchen-sink/docs/mysql.mysql b/demo/kitchen-sink/docs/mysql.mysql deleted file mode 100644 index 30404ce4..00000000 --- a/demo/kitchen-sink/docs/mysql.mysql +++ /dev/null @@ -1 +0,0 @@ -TODO \ No newline at end of file diff --git a/demo/kitchen-sink/docs/objectivec.m b/demo/kitchen-sink/docs/objectivec.m deleted file mode 100644 index 1728dfe5..00000000 --- a/demo/kitchen-sink/docs/objectivec.m +++ /dev/null @@ -1,104 +0,0 @@ -@protocol Printing: someParent --(void) print; -@end - -@interface Fraction: NSObject <Printing, NSCopying> { - int numerator; - int denominator; -} -@end - -@"blah\8" @"a\222sd\d" @"\faw\"\? \' \4 n\\" @"\56" -@"\xSF42" - --(NSDecimalNumber*)addCount:(id)addObject{ - -return [count decimalNumberByAdding:addObject.count]; - -} - - NS_DURING NS_HANDLER NS_ENDHANDLER - -@try { - if (argc > 1) { - @throw [NSException exceptionWithName:@"Throwing a test exception" reason:@"Testing the @throw directive." userInfo:nil]; - } -} -@catch (id theException) { - NSLog(@"%@", theException); - result = 1 ; -} -@finally { - NSLog(@"This always happens."); - result += 2 ; -} - - @synchronized(lock) { - NSLog(@"Hello World"); - } - -struct { @defs( NSObject) } - -char *enc1 = @encode(int); - - IBOutlet|IBAction|BOOL|SEL|id|unichar|IMP|Class - - - @class @protocol - -@public - // instance variables -@package - // instance variables -@protected - // instance variables -@private - // instance variables - - YES NO Nil nil -NSApp() -NSRectToCGRect (Protocol ProtocolFromString:"NSTableViewDelegate")) - -[SPPoint pointFromCGPoint:self.position] - -NSRoundDownToMultipleOfPageSize - -#import <stdio.h> - -int main( int argc, const char *argv[] ) { - printf( "hello world\n" ); - return 0; -} - -NSChangeSpelling - -@"0 != SUBQUERY(image, $x, 0 != SUBQUERY($x.bookmarkItems, $y, $y.@count == 0).@count).@count" - -@selector(lowercaseString) @selector(uppercaseString:) - -NSFetchRequest *localRequest = [[NSFetchRequest alloc] init]; -localRequest.entity = [NSEntityDescription entityForName:@"VNSource" inManagedObjectContext:context]; -localRequest.sortDescriptors = [NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"resolution" ascending:YES]]; -NSPredicate *predicate = [NSPredicate predicateWithFormat:@"0 != SUBQUERY(image, $x, 0 != SUBQUERY($x.bookmarkItems, $y, $y.@count == 0).@count).@count"]; -[NSPredicate predicateWithFormat:] -NSString *predicateString = [NSString stringWithFormat:@"SELF beginsWith[cd] %@", searchString]; -NSPredicate *pred = [NSPredicate predicateWithFormat:predicateString]; -NSArray *filteredKeys = [[myMutableDictionary allKeys] filteredArrayUsingPredicate:pred]; - -localRequest.predicate = [NSPredicate predicateWithFormat:@"whichChart = %@" argumentArray: listChartToDownload]; -localRequest.fetchBatchSize = 100; -arrayRequest = [context executeFetchRequest:localRequest error:&error1]; - -[localRequest release]; - -#ifndef Nil -#define Nil __DARWIN_NULL /* id of Nil class */ -#endif - -@implementation MyObject -- (unsigned int)areaOfWidth:(unsigned int)width - height:(unsigned int)height -{ - return width*height; -} -@end diff --git a/demo/kitchen-sink/docs/pascal.pas b/demo/kitchen-sink/docs/pascal.pas deleted file mode 100644 index 7a4a7fc6..00000000 --- a/demo/kitchen-sink/docs/pascal.pas +++ /dev/null @@ -1,48 +0,0 @@ -(***************************************************************************** - * A simple bubble sort program. Reads integers, one per line, and prints * - * them out in sorted order. Blows up if there are more than 49. * - *****************************************************************************) -PROGRAM Sort(input, output); - CONST - (* Max array size. *) - MaxElts = 50; - TYPE - (* Type of the element array. *) - IntArrType = ARRAY [1..MaxElts] OF Integer; - - VAR - (* Indexes, exchange temp, array size. *) - i, j, tmp, size: integer; - - (* Array of ints *) - arr: IntArrType; - - (* Read in the integers. *) - PROCEDURE ReadArr(VAR size: Integer; VAR a: IntArrType); - BEGIN - size := 1; - WHILE NOT eof DO BEGIN - readln(a[size]); - IF NOT eof THEN - size := size + 1 - END - END; - - BEGIN - (* Read *) - ReadArr(size, arr); - - (* Sort using bubble sort. *) - FOR i := size - 1 DOWNTO 1 DO - FOR j := 1 TO i DO - IF arr[j] > arr[j + 1] THEN BEGIN - tmp := arr[j]; - arr[j] := arr[j + 1]; - arr[j + 1] := tmp; - END; - - (* Print. *) - FOR i := 1 TO size DO - writeln(arr[i]) - END. - \ No newline at end of file diff --git a/demo/kitchen-sink/docs/perl.pl b/demo/kitchen-sink/docs/perl.pl index d6a332e2..01178e1c 100644 --- a/demo/kitchen-sink/docs/perl.pl +++ b/demo/kitchen-sink/docs/perl.pl @@ -1,8 +1,4 @@ #!/usr/bin/perl -=begin - perl example code for Ace -=cut - use strict; use warnings; my $num_primes = 0; @@ -34,4 +30,3 @@ for my $p (0 .. ($num_primes-1)) print $primes[$p], ", "; } print "\n"; - diff --git a/demo/kitchen-sink/docs/pgsql.pgsql b/demo/kitchen-sink/docs/pgsql.pgsql index ef265cdc..67be9882 100644 --- a/demo/kitchen-sink/docs/pgsql.pgsql +++ b/demo/kitchen-sink/docs/pgsql.pgsql @@ -41,8 +41,8 @@ SELECT city, temp_lo, temp_hi, prcp, "date", location /** * Dollar quotes starting at the end of the line are colored as SQL unless -* a special language tag is used. Dollar quote syntax coloring is implemented -* for Perl, Python, JavaScript, and Json. +* a special language tag is used. Pearl and Python are currently implemented +* but lots of others are possible. */ create or replace function blob_content_chunked( in p_data bytea, @@ -82,24 +82,6 @@ CREATE FUNCTION usesavedplan() RETURNS trigger AS $python$ SD["plan"] = plan $python$ LANGUAGE plpythonu; --- pl/v8 (javascript) -CREATE FUNCTION plv8_test(keys text[], vals text[]) RETURNS text AS $javascript$ -var o = {}; -for(var i=0; i<keys.length; i++){ - o[keys[i]] = vals[i]; -} -return JSON.stringify(o); -$javascript$ LANGUAGE plv8 IMMUTABLE STRICT; - --- json -select * from json_object_keys($json$ -{ - "f1": 5, - "f2": "test", - "f3": {} -} -$json$); - -- psql commands \df cash* diff --git a/demo/kitchen-sink/docs/praat.praat b/demo/kitchen-sink/docs/praat.praat deleted file mode 100644 index 3700ae6f..00000000 --- a/demo/kitchen-sink/docs/praat.praat +++ /dev/null @@ -1,148 +0,0 @@ -form Highlighter test - sentence My_sentence This should all be a string - text My_text This should also all be a string - word My_word Only the first word is a string, the rest is invalid - boolean Binary 1 - boolean Text no - boolean Quoted "yes" - comment This should be a string - real left_Range -123.6 - positive right_Range_max 3.3 - integer Int 4 - natural Nat 4 -endform - -# External scripts -include /path/to/file -runScript: "/path/to/file" -execute /path/to/file - -stopwatch - -# old-style procedure call -call oldStyle "quoted" 2 unquoted string -assert oldStyle.local = 1 - -# New-style procedure call with parens -@newStyle("quoted", 2, "quoted string") -if praatVersion >= 5364 - # New-style procedure call with colon - @newStyle: "quoted", 2, "quoted string" -endif - -# if-block with built-in variables -if windows - # We are on Windows -elsif unix = 1 or !macintosh - exitScript: "We are on Linux" -else macintosh == 1 - exit We are on Mac -endif - -# inline if with inline comment -var = if macintosh = 1 then 0 else 1 fi ; This is an inline comment - -# for-loop with explicit from using local variable -# and paren-style function calls and variable interpolation -n = numberOfSelected("Sound") -for i from newStyle.local to n - sound'i' = selected("Sound", i) - sound[i] = sound'i' -endfor - -for i from 1 to n - # Different styles of object selection - select sound'i' - sound = selected() - sound$ = selected$("Sound") - select Sound 'sound$' - selectObject(sound[i]) - selectObject: sound - - # Pause commands - beginPause("Viewing " + sound$) - if i > 1 - button = endPause("Stop", "Previous", - ...if i = total_sounds then "Finish" else "Next" fi, - ...3, 1) - else - button = endPause("Stop", - ...if i = total_sounds then "Finish" else "Next" fi, - ...2, 1) - endif - editor_name$ = if total_textgrids then "TextGrid " else "Sound " fi + name$ - nocheck editor 'editor_name$' - nocheck Close - nocheck endeditor - - # New-style standalone command call - Rename: "SomeName" - - # Command call with assignment - duration = Get total duration - - # Multi-line command with modifier - pitch = noprogress To Pitch (ac): 0, 75, 15, "no", - ...0.03, 0.45, 0.01, 0.35, 0.14, 600 - - # do-style command with assignment - minimum = do("Get minimum...", 0, 0, "Hertz", "Parabolic") - - # New-style multi-line command call with broken strings - table = Create Table with column names: "table", 0, - ..."file subject speaker - ...f0 f1 f2 f3 " + - ..."duration response" - - removeObject: pitch, table - - # Picture window commands - selectObject: sound - # do-style command - do("Select inner viewport...", 1, 6, 0.5, 1.5) - Black - Draw... 0 0 0 0 "no" Curve - Draw inner box - Text bottom: "yes", sound$ - Erase all - - # Demo window commands - demo Erase all - demo Select inner viewport... 0 100 0 100 - demo Axes... 0 100 0 100 - demo Paint rectangle... white 0 100 0 100 - demo Text... 50 centre 50 half Click to finish - demoWaitForInput ( ) - demo Erase all - demo Text: 50, "centre", 50, "half", "Finished" -endfor - -# An old-style sendpraat block -sendpraat Praat - ...'newline$' Create Sound as pure tone... "tone" 1 0 0.4 44100 440 0.2 0.01 0.01 - ...'newline$' Play - ...'newline$' Remove - -# A new-style sendpraat block -beginSendPraat: "Praat" - Create Sound as pure tone: "tone", 1, 0, 0.4, 44100, 440, 0.2, 0.01, 0.01 - duration = Get total duration - Remove -endSendPraat: "duration" -appendInfoLine: "The generated sound lasted for ", duration, "seconds" - -time = stopwatch -clearinfo -echo This script took -print 'time' seconds to -printline execute. - -# Old-style procedure declaration -procedure oldStyle .str1$ .num .str2$ - .local = 1 -endproc - -# New-style procedure declaration -procedure newStyle (.str1$, .num, .str2$) - .local = 1 -endproc diff --git a/demo/kitchen-sink/docs/prolog.plg b/demo/kitchen-sink/docs/prolog.plg deleted file mode 100644 index 2c867157..00000000 --- a/demo/kitchen-sink/docs/prolog.plg +++ /dev/null @@ -1,18 +0,0 @@ -partition([], _, [], []). -partition([X|Xs], Pivot, Smalls, Bigs) :- - ( X @< Pivot -> - Smalls = [X|Rest], - partition(Xs, Pivot, Rest, Bigs) - ; Bigs = [X|Rest], - partition(Xs, Pivot, Smalls, Rest) - ). - -quicksort([]) --> []. -quicksort([X|Xs]) --> - { partition(Xs, X, Smaller, Bigger) }, - quicksort(Smaller), [X], quicksort(Bigger). - -perfect(N) :- - between(1, inf, N), U is N // 2, - findall(D, (between(1,U,D), N mod D =:= 0), Ds), - sumlist(Ds, N). \ No newline at end of file diff --git a/demo/kitchen-sink/docs/properties.properties b/demo/kitchen-sink/docs/properties.properties deleted file mode 100644 index 446b340d..00000000 --- a/demo/kitchen-sink/docs/properties.properties +++ /dev/null @@ -1,15 +0,0 @@ -# You are reading the ".properties" entry. -! The exclamation mark can also mark text as comments. -# The key and element characters #, !, =, and : are written with a preceding backslash to ensure that they are properly loaded. -website = http\://en.wikipedia.org/ -language = English -# The backslash below tells the application to continue reading -# the value onto the next line. -message = Welcome to \ - Wikipedia! -# Add spaces to the key -key\ with\ spaces = This is the value that could be looked up with the key "key with spaces". -# Unicode -tab : \u0009 -empty-key= -last.line=value diff --git a/demo/kitchen-sink/docs/protobuf.proto b/demo/kitchen-sink/docs/protobuf.proto deleted file mode 100644 index 4da95a75..00000000 --- a/demo/kitchen-sink/docs/protobuf.proto +++ /dev/null @@ -1,16 +0,0 @@ -message Point { - required int32 x = 1; - required int32 y = 2; - optional string label = 3; -} - -message Line { - required Point start = 1; - required Point end = 2; - optional string label = 3; -} - -message Polyline { - repeated Point point = 1; - optional string label = 2; -} \ No newline at end of file diff --git a/demo/kitchen-sink/docs/r.r b/demo/kitchen-sink/docs/r.r deleted file mode 100644 index e4d4c579..00000000 --- a/demo/kitchen-sink/docs/r.r +++ /dev/null @@ -1,20 +0,0 @@ -Call: -lm(formula = y ~ x) - -Residuals: -1 2 3 4 5 6 -3.3333 -0.6667 -2.6667 -2.6667 -0.6667 3.3333 - -Coefficients: - Estimate Std. Error t value Pr(>|t|) -(Intercept) -9.3333 2.8441 -3.282 0.030453 * -x 7.0000 0.7303 9.585 0.000662 *** ---- -Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 - -Residual standard error: 3.055 on 4 degrees of freedom -Multiple R-squared: 0.9583, Adjusted R-squared: 0.9478 -F-statistic: 91.88 on 1 and 4 DF, p-value: 0.000662 - -> par(mfrow=c(2, 2)) # Request 2x2 plot layout -> plot(lm_1) # Diagnostic plot of regression model \ No newline at end of file diff --git a/demo/kitchen-sink/docs/rdoc.Rd b/demo/kitchen-sink/docs/rdoc.Rd deleted file mode 100644 index 16664795..00000000 --- a/demo/kitchen-sink/docs/rdoc.Rd +++ /dev/null @@ -1,64 +0,0 @@ -\name{picker} -\alias{picker} -\title{Create a picker control} -\description{ - Create a picker control to enable manipulation of plot variables based on a set of fixed choices. -} - -\usage{ -picker(..., initial = NULL, label = NULL) -} - - -\arguments{ - \item{\dots}{ - Arguments containing objects to be presented as choices for the picker (or a list containing the choices). If an element is named then the name is used to display it within the picker. If an element is not named then it is displayed within the picker using \code{\link{as.character}}. -} - \item{initial}{ - Initial value for picker. Value must be present in the list of choices specified. If not specified defaults to the first choice. -} - \item{label}{ - Display label for picker. Defaults to the variable name if not specified. -} -} - -\value{ - An object of class "manipulator.picker" which can be passed to the \code{\link{manipulate}} function. -} - -\seealso{ -\code{\link{manipulate}}, \code{\link{slider}}, \code{\link{checkbox}}, \code{\link{button}} -} - - -\examples{ -\dontrun{ - -## Filtering data with a picker -manipulate( - barplot(as.matrix(longley[,factor]), - beside = TRUE, main = factor), - factor = picker("GNP", "Unemployed", "Employed")) - -## Create a picker with labels -manipulate( - plot(pressure, type = type), - type = picker("points" = "p", "line" = "l", "step" = "s")) - -## Picker with groups -manipulate( - barplot(as.matrix(mtcars[group,"mpg"]), beside=TRUE), - group = picker("Group 1" = 1:11, - "Group 2" = 12:22, - "Group 3" = 23:32)) - -## Histogram w/ picker to select type -require(lattice) -require(stats) -manipulate( - histogram(~ height | voice.part, - data = singer, type = type), - type = picker("percent", "count", "density")) - -} -} \ No newline at end of file diff --git a/demo/kitchen-sink/docs/rhtml.Rhtml b/demo/kitchen-sink/docs/rhtml.Rhtml deleted file mode 100644 index 5eb6189d..00000000 --- a/demo/kitchen-sink/docs/rhtml.Rhtml +++ /dev/null @@ -1,22 +0,0 @@ -<html> - -<head> -<title>Title - - - - -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              This is an R HTML document. When you click the Knit HTML button a web page will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              - - - -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              You can also embed plots, for example:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              - - - - - diff --git a/demo/kitchen-sink/docs/ruby.rb b/demo/kitchen-sink/docs/ruby.rb index 386fbb86..afe2efa0 100644 --- a/demo/kitchen-sink/docs/ruby.rb +++ b/demo/kitchen-sink/docs/ruby.rb @@ -9,27 +9,4 @@ def fact(n) end end -puts fact(ARGV[0].to_i) - -class Range - def to_json(*a) - { - 'json_class' => self.class.name, # = 'Range' - 'data' => [ first, last, exclude_end? ] - }.to_json(*a) - end -end - -{:id => ?", :key => "value"} - - - herDocs = [<<'FOO', <(vector: &[T], function: &fn(v: &T) -> U) -> ~[U] { - let mut accumulator = ~[]; - for vec::each(vector) |element| { - accumulator.push(function(element)); - } - return accumulator; -} diff --git a/demo/kitchen-sink/docs/sass.sass b/demo/kitchen-sink/docs/sass.sass deleted file mode 100644 index 6caaaff8..00000000 --- a/demo/kitchen-sink/docs/sass.sass +++ /dev/null @@ -1,39 +0,0 @@ -// sass ace mode; - -@import url(http://fonts.googleapis.com/css?family=Ace:700) - -html, body - :background-color #ace - text-align: center - height: 100% - /*;*********; - ;comment ; - ;*********; - -.toggle - $size: 14px - - :background url(http://subtlepatterns.com/patterns/dark_stripes.png) - border-radius: 8px - height: $size - - &:before - $radius: $size * 0.845 - $glow: $size * 0.125 - - box-shadow: 0 0 $glow $glow / 2 #fff - border-radius: $radius - - &:active - ~ .button - box-shadow: 0 15px 25px -4px rgba(0,0,0,0.4) - ~ .label - font-size: 40px - color: rgba(0,0,0,0.45) - - &:checked - ~ .button - box-shadow: 0 15px 25px -4px #ace - ~ .label - font-size: 40px - color: #c9c9c9 diff --git a/demo/kitchen-sink/docs/scheme.scm b/demo/kitchen-sink/docs/scheme.scm deleted file mode 100644 index 8c78359c..00000000 --- a/demo/kitchen-sink/docs/scheme.scm +++ /dev/null @@ -1,21 +0,0 @@ -(define (prompt-for-cd) - "Prompts - for CD" - (prompt-read "Title" 1.53 1 2/4 1.7 1.7e0 2.9E-4 +42 -7 #b001 #b001/100 #o777 #O777 #xabc55 #c(0 -5.6)) - (prompt-read "Artist") - (or (parse-integer (prompt-read "Rating") #:junk-allowed #t) 0) - (if x (format #t "yes") (format #f "no") ;and here comment - ) - ;; second line comment - '(+ 1 2) - (position-if-not char-set:whitespace line #:start beg)) - (quote (privet 1 2 3)) - '(hello world) - (* 5 7) - (1 2 34 5) - (#:use "aaaa") - (let ((x 10) (y 20)) - (display (+ x y)) - ) - - "asdad\0eqweqe" diff --git a/demo/kitchen-sink/docs/sh.sh b/demo/kitchen-sink/docs/sh.sh index 4c5e6968..010ad500 100755 --- a/demo/kitchen-sink/docs/sh.sh +++ b/demo/kitchen-sink/docs/sh.sh @@ -2,9 +2,9 @@ # Script to open a browser to current branch # Repo formats: -# ssh git@github.com:richo/gh_pr.git -# http https://richoH@github.com/richo/gh_pr.git -# git git://github.com/richo/gh_pr.git +# ssh git@github.com:richoH/gh_pr.git +# http https://richoH@github.com/richoH/gh_pr.git +# git git://github.com/richoH/gh_pr.git username=`git config --get github.user` @@ -30,8 +30,6 @@ get_repo() { fi } -echo ${#x[@]} - if repo=`get_repo $@`; then branch=`git symbolic-ref HEAD 2>/dev/null` echo "http://github.com/$repo/pull/new/${branch##refs/heads/}" diff --git a/demo/kitchen-sink/docs/sjs.sjs b/demo/kitchen-sink/docs/sjs.sjs deleted file mode 100644 index 18ce0e49..00000000 --- a/demo/kitchen-sink/docs/sjs.sjs +++ /dev/null @@ -1,28 +0,0 @@ -var { each, map } = require('sjs:sequence'); -var { get } = require('sjs:http'); - -function foo(items, nada) { - var component = { name: "Ace", role: "Editor" }; - console.log(" - Welcome, #{component.name} - ".trim()); - - logging.debug(`Component added: $String(component) (${component})`); - - console.log(` - Welcome, {${function() { - return { x: 1, y: "why?}"}; - }()} - `.trim()); - - waitfor { - items .. each.par { |item| - get(item); - } - } and { - var lengths = items .. map(i -> i.length); - } or { - hold(1500); - throw new Error("timed out"); - } -} // Real Tab. diff --git a/demo/kitchen-sink/docs/smarty.smarty b/demo/kitchen-sink/docs/smarty.smarty deleted file mode 100644 index 77206724..00000000 --- a/demo/kitchen-sink/docs/smarty.smarty +++ /dev/null @@ -1,7 +0,0 @@ -{foreach $foo as $bar} - {$bar.zag} - {$bar.zag2} - {$bar.zag3} -{foreachelse} - There were no rows found. -{/foreach} \ No newline at end of file diff --git a/demo/kitchen-sink/docs/snippets.snippets b/demo/kitchen-sink/docs/snippets.snippets deleted file mode 100644 index be99f51e..00000000 --- a/demo/kitchen-sink/docs/snippets.snippets +++ /dev/null @@ -1,26 +0,0 @@ -# Function -snippet fun - function ${1?:function_name}(${2:argument}) { - ${3:// body...} - } -# Anonymous Function -regex /((=)\s*|(:)\s*|(\()|\b)/f/(\))?/ -name f - function${M1?: ${1:functionName}}($2) { - ${0:$TM_SELECTED_TEXT} - }${M2?;}${M3?,}${M4?)} -# Immediate function -trigger \(?f\( -endTrigger \)? -snippet f( - (function(${1}) { - ${0:${TM_SELECTED_TEXT:/* code */}} - }(${1})); -# if -snippet if - if (${1:true}) { - ${0} - } - - - \ No newline at end of file diff --git a/demo/kitchen-sink/docs/soy_template.soy b/demo/kitchen-sink/docs/soy_template.soy deleted file mode 100644 index 3a9e3436..00000000 --- a/demo/kitchen-sink/docs/soy_template.soy +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Greets a person using "Hello" by default. - * @param name The name of the person. - * @param? greetingWord Optional greeting word to use instead of "Hello". - */ -{template .helloName #eee} - {if not $greetingWord} - Hello {$name}! - {else} - {$greetingWord} {$name}! - {/if} -{/template} - -/** - * Greets a person and optionally a list of other people. - * @param name The name of the person. - * @param additionalNames The additional names to greet. May be an empty list. - */ -{template .helloNames} - // Greet the person. - {call .helloName data="all" /}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - // Greet the additional people. - {foreach $additionalName in $additionalNames} - {call .helloName} - {param name: $additionalName /} - {/call} - {if not isLast($additionalName)} -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              // break after every line except the last - {/if} - {ifempty} - No additional people to greet. - {/foreach} -{/template} - - -{/foreach} -{if length($items) > 5} -{msg desc="Says hello to the user."} - - -{namespace ns autoescape="contextual"} - -/** Example. */ -{template .example} - foo is {$ij.foo} -{/template} \ No newline at end of file diff --git a/demo/kitchen-sink/docs/space.space b/demo/kitchen-sink/docs/space.space deleted file mode 100644 index 7bd8ab19..00000000 --- a/demo/kitchen-sink/docs/space.space +++ /dev/null @@ -1,56 +0,0 @@ -query - count 10 - created 2011-06-21T08:10:46Z - lang en-US - results - photo - 0 - farm 6 - id 5855620975 - isfamily 0 - isfriend 0 - ispublic 1 - owner 32021554@N04 - secret f1f5e8515d - server 5110 - title 7087 bandit cat - 1 - farm 4 - id 5856170534 - isfamily 0 - isfriend 0 - ispublic 1 - owner 32021554@N04 - secret ff1efb2a6f - server 3217 - title 6975 rusty cat - 2 - farm 6 - id 5856172972 - isfamily 0 - isfriend 0 - ispublic 1 - owner 51249875@N03 - secret 6c6887347c - server 5192 - title watermarked-cats - 3 - farm 6 - id 5856168328 - isfamily 0 - isfriend 0 - ispublic 1 - owner 32021554@N04 - secret 0c1cfdf64c - server 5078 - title 7020 mandy cat - 4 - farm 3 - id 5856171774 - isfamily 0 - isfriend 0 - ispublic 1 - owner 32021554@N04 - secret 7f5a3180ab - server 2696 - title 7448 bobby cat diff --git a/demo/kitchen-sink/docs/sqlserver.sqlserver b/demo/kitchen-sink/docs/sqlserver.sqlserver deleted file mode 100644 index 7efd2b7e..00000000 --- a/demo/kitchen-sink/docs/sqlserver.sqlserver +++ /dev/null @@ -1,72 +0,0 @@ --- ============================================= --- Author: Morgan Yarbrough --- Create date: 4/27/2015 --- Description: Test procedure that shows off language features. --- Includes non-standard folding with region comments using either --- line comments or block comments (both are demonstrated below). --- This mode imitates SSMS and it designed to be used with SQL Server theme. --- ============================================= -CREATE PROCEDURE dbo.TestProcedure - ---#region parameters - @vint INT = 1 - ,@vdate DATE = NULL - ,@vdatetime DATETIME = DATEADD(dd, 1, GETDATE()) - ,@vvarchar VARCHAR(MAX) = '' ---#endregion - -AS -BEGIN - - /*#region set statements */ - SET NOCOUNT ON; - SET XACT_ABORT ON; - SET QUOTED_IDENTIFIER ON; - /*#endregion*/ - - /** - * These comments will produce a fold widget - */ - - -- folding demonstration - SET @vint = CASE - WHEN @vdate IS NULL - THEN 1 - ELSE 2 - END - - -- another folding demonstration - IF @vint = 1 - BEGIN - SET @vvarchar = 'one' - SET @vint = DATEDIFF(dd, @vdate, @vdatetime) - END - - -- this mode handles strings properly - DECLARE @sql NVARCHAR(4000) = N'SELECT TOP(1) OrderID - FROM Orders - WHERE @OrderDate > GETDATE()' - - -- this mode is aware of built in stored procedures - EXECUTE sp_executesql @sql - - -- demonstrating some syntax highlighting - SELECT Orders.OrderID - ,Customers.CompanyName - ,DATEFROMPARTS(YEAR(GETDATE()), 1, 1) AS FirstDayOfYear - FROM Orders - INNER JOIN Customers - ON Orders.CustomerID = Customers.CustomerID - WHERE CompanyName NOT LIKE '%something' - OR CompanyName IS NULL - OR CompanyName IN ('bla', 'nothing') - - -- this mode includes snippets - -- place your cusor at the end of the line below and trigger auto complete (Ctrl+Space) - createpr - - -- SQL Server allows using keywords as object names (not recommended) as long as they are wrapped in brackets - DATABASE -- keyword - [DATABASE] -- not a keyword - -END diff --git a/demo/kitchen-sink/docs/stylus.styl b/demo/kitchen-sink/docs/stylus.styl deleted file mode 100644 index 614981a4..00000000 --- a/demo/kitchen-sink/docs/stylus.styl +++ /dev/null @@ -1,55 +0,0 @@ -// I'm a comment! - -/* - * Adds the given numbers together. - */ - - -/*! - * Adds the given numbers together. - */ - - -asdasdasdad(df, ad=23) - -add(a, b = a) - a + b -green(#0c0) - add(10, 5) - // => 15 - - add(10) - add(a, b) - - &asdasd - - (arguments) - - @sdfsdf -.signatures - background-color #e0e8e0 - border 1px solid grayLighter - box-shadow 0 0 3px grayLightest - border-radius 3px - padding 3px 5px - "adsads" - margin-left 0 - list-style none -.signature - list-style none - display: inline - margin-left 0 - > li - display inline -is not -.signature-values - list-style none - display inline - margin-left 0 - &:before - content '→' - margin 0 5px - > li - !important - - unless \ No newline at end of file diff --git a/demo/kitchen-sink/docs/svg.svg b/demo/kitchen-sink/docs/svg.svg index 4bb28e22..a3f1c757 100644 --- a/demo/kitchen-sink/docs/svg.svg +++ b/demo/kitchen-sink/docs/svg.svg @@ -47,7 +47,7 @@ setTimeout("ShowAndGrowElement()", timer_increment) } window.ShowAndGrowElement = ShowAndGrowElement - ]]> + ]] - - - My Webpage - - - - - {% if 1 not in [1, 2, 3] %} - - {# is equivalent to #} - {% if not (1 in [1, 2, 3]) %} - - {% autoescape true %} - {{ var }} - {{ var|raw }} {# var won't be escaped #} - {{ var|escape }} {# var won't be doubled-escaped #} - {% endautoescape %} - - {{ include('twig.html', sandboxed = true) }} - - {{"string #{with} \" escapes" 'another#one' }} -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              My Webpage

                                                                                                                                                                                                                                                                                                                                                                                                                                                              - {{ a_variable }} - - \ No newline at end of file diff --git a/demo/kitchen-sink/docs/typescript.ts b/demo/kitchen-sink/docs/typescript.ts deleted file mode 100644 index 2f880d03..00000000 --- a/demo/kitchen-sink/docs/typescript.ts +++ /dev/null @@ -1,72 +0,0 @@ -class Greeter { - greeting: string; - constructor (message: string) { - this.greeting = message; - } - greet() { - return "Hello, " + this.greeting; - } -} - -var greeter = new Greeter("world"); - -var button = document.createElement('button') -button.innerText = "Say Hello" -button.onclick = function() { - alert(greeter.greet()) -} - -document.body.appendChild(button) - -class Snake extends Animal { - move() { - alert("Slithering..."); - super(5); - } -} - -class Horse extends Animal { - move() { - alert("Galloping..."); - super.move(45); - } -} - -module Sayings { - export class Greeter { - greeting: string; - constructor (message: string) { - this.greeting = message; - } - greet() { - return "Hello, " + this.greeting; - } - } -} -module Mankala { - export class Features { - public turnContinues = false; - public seedStoredCount = 0; - public capturedCount = 0; - public spaceCaptured = NoSpace; - - public clear() { - this.turnContinues = false; - this.seedStoredCount = 0; - this.capturedCount = 0; - this.spaceCaptured = NoSpace; - } - - public toString() { - var stringBuilder = ""; - if (this.turnContinues) { - stringBuilder += " turn continues,"; - } - stringBuilder += " stores " + this.seedStoredCount; - if (this.capturedCount > 0) { - stringBuilder += " captures " + this.capturedCount + " from space " + this.spaceCaptured; - } - return stringBuilder; - } - } -} \ No newline at end of file diff --git a/demo/kitchen-sink/docs/vala.vala b/demo/kitchen-sink/docs/vala.vala deleted file mode 100644 index f9600286..00000000 --- a/demo/kitchen-sink/docs/vala.vala +++ /dev/null @@ -1,21 +0,0 @@ -using Gtk; - -int main (string[] args) { - Gtk.init (ref args); - var foo = new MyFoo>(); - - var window = new Window(); - window.title = "Hello, World!"; - window.border_width = 10; - window.window_position = WindowPosition.CENTER; - window.set_default_size(350, 70); - window.destroy.connect(Gtk.main_quit); - - var label = new Label("Hello, World!"); - - window.add(label); - window.show_all(); - - Gtk.main(); - return 0; -} \ No newline at end of file diff --git a/demo/kitchen-sink/docs/vbscript.vbs b/demo/kitchen-sink/docs/vbscript.vbs deleted file mode 100644 index ace5c9f9..00000000 --- a/demo/kitchen-sink/docs/vbscript.vbs +++ /dev/null @@ -1,23 +0,0 @@ -myfilename = "C:\Wikipedia - VBScript - Example - Hello World.txt" -MakeHelloWorldFile myfilename - -Sub MakeHelloWorldFile (FileName) -'Create a new file in C: drive or overwrite existing file - Set FSO = CreateObject("Scripting.FileSystemObject") - If FSO.FileExists(FileName) Then - Answer = MsgBox ("File " & FileName & " exists ... OK to overwrite?", vbOKCancel) - 'If button selected is not OK, then quit now - 'vbOK is a language constant - If Answer <> vbOK Then Exit Sub - Else - 'Confirm OK to create - Answer = MsgBox ("File " & FileName & " ... OK to create?", vbOKCancel) - If Answer <> vbOK Then Exit Sub - End If - 'Create new file (or replace an existing file) - Set FileObject = FSO.CreateTextFile (FileName) - FileObject.WriteLine "Time ... " & Now() - FileObject.WriteLine "Hello World" - FileObject.Close() - MsgBox "File " & FileName & " ... updated." -End Sub \ No newline at end of file diff --git a/demo/kitchen-sink/docs/velocity.vm b/demo/kitchen-sink/docs/velocity.vm deleted file mode 100644 index 9156020b..00000000 --- a/demo/kitchen-sink/docs/velocity.vm +++ /dev/null @@ -1,44 +0,0 @@ -#* - This is a sample comment block that - spans multiple lines. -*# - -#macro ( outputItem $item ) -
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • ${item}
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • -#end - -## Define the items to iterate -#set ( $items = [1, 2, 3, 4] ) - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                - ## Iterate over the items and output the evens. - #foreach ( $item in $items ) - #if ( $_MathTool.mod($item, 2) == 0 ) - #outputItem ($item) - #end - #end -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - - - - \ No newline at end of file diff --git a/demo/kitchen-sink/docs/verilog.v b/demo/kitchen-sink/docs/verilog.v deleted file mode 100644 index b1f79265..00000000 --- a/demo/kitchen-sink/docs/verilog.v +++ /dev/null @@ -1,12 +0,0 @@ -always @(negedge reset or posedge clk) begin - if (reset == 0) begin - d_out <= 16'h0000; - d_out_mem[resetcount] <= d_out; - laststoredvalue <= d_out; - end else begin - d_out <= d_out + 1'b1; - end -end - -always @(bufreadaddr) - bufreadval = d_out_mem[bufreadaddr]; \ No newline at end of file diff --git a/demo/kitchen-sink/docs/vhdl.vhd b/demo/kitchen-sink/docs/vhdl.vhd deleted file mode 100644 index 662375e8..00000000 --- a/demo/kitchen-sink/docs/vhdl.vhd +++ /dev/null @@ -1,34 +0,0 @@ -library IEEE -user IEEE.std_logic_1164.all; -use IEEE.numeric_std.all; - -entity COUNT16 is - - port ( - cOut :out std_logic_vector(15 downto 0); -- counter output - clkEn :in std_logic; -- count enable - clk :in std_logic; -- clock input - rst :in std_logic -- reset input - ); - -end entity; - -architecture count_rtl of COUNT16 is - signal count :std_logic_vector (15 downto 0); - -begin - process (clk, rst) begin - - if(rst = '1') then - count <= (others=>'0'); - elsif(rising_edge(clk)) then - if(clkEn = '1') then - count <= count + 1; - end if; - end if; - - end process; - cOut <= count; - -end architecture; - \ No newline at end of file diff --git a/demo/kitchen-sink/file_drop.js b/demo/kitchen-sink/file_drop.js deleted file mode 100644 index 8b89d5f1..00000000 --- a/demo/kitchen-sink/file_drop.js +++ /dev/null @@ -1,73 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -var config = require("ace/config"); -var event = require("ace/lib/event"); -var modelist = require("ace/ext/modelist"); - -module.exports = function(editor) { - event.addListener(editor.container, "dragover", function(e) { - var types = e.dataTransfer.types; - if (types && Array.prototype.indexOf.call(types, 'Files') !== -1) - return event.preventDefault(e); - }); - - event.addListener(editor.container, "drop", function(e) { - var file; - try { - file = e.dataTransfer.files[0]; - if (window.FileReader) { - var reader = new FileReader(); - reader.onload = function() { - var mode = modelist.getModeForPath(file.name); - editor.session.doc.setValue(reader.result); - editor.session.setMode(mode.mode); - editor.session.modeName = mode.name; - }; - reader.readAsText(file); - } - return event.preventDefault(e); - } catch(err) { - return event.stopEvent(e); - } - }); -}; - -var Editor = require("ace/editor").Editor; -config.defineOptions(Editor.prototype, "editor", { - loadDroppedFile: { - set: function() { module.exports(this); }, - value: true - } -}); - -}); \ No newline at end of file diff --git a/demo/kitchen-sink/inline_editor.js b/demo/kitchen-sink/inline_editor.js deleted file mode 100644 index 6b56887d..00000000 --- a/demo/kitchen-sink/inline_editor.js +++ /dev/null @@ -1,102 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - - -define(function(require, exports, module) { -"use strict"; - -var LineWidgets = require("ace/line_widgets").LineWidgets; -var Editor = require("ace/editor").Editor; -var Renderer = require("ace/virtual_renderer").VirtualRenderer; -var dom = require("ace/lib/dom"); - - -require("ace/commands/default_commands").commands.push({ - name: "openInlineEditor", - bindKey: "F3", - exec: function(editor) { - var split = window.env.split; - var s = editor.session; - var inlineEditor = new Editor(new Renderer()); - var splitSession = split.$cloneSession(s); - - var row = editor.getCursorPosition().row; - if (editor.session.lineWidgets && editor.session.lineWidgets[row]) { - editor.session.lineWidgets[row].destroy(); - return; - } - - var rowCount = 10; - var w = { - row: row, - // rowCount: rowCount, - fixedWidth: true, - el: dom.createElement("div"), - editor: inlineEditor - }; - var el = w.el; - el.appendChild(inlineEditor.container); - - if (!editor.session.widgetManager) { - editor.session.widgetManager = new LineWidgets(editor.session); - editor.session.widgetManager.attach(editor); - } - - var h = rowCount*editor.renderer.layerConfig.lineHeight; - inlineEditor.container.style.height = h + "px"; - - el.style.position = "absolute"; - el.style.zIndex = "4"; - el.style.borderTop = "solid blue 2px"; - el.style.borderBottom = "solid blue 2px"; - - inlineEditor.setSession(splitSession); - editor.session.widgetManager.addLineWidget(w); - - var kb = { - handleKeyboard:function(_,hashId, keyString) { - if (hashId === 0 && keyString === "esc") { - w.destroy(); - return true; - } - } - }; - - w.destroy = function() { - editor.keyBinding.removeKeyboardHandler(kb); - s.widgetManager.removeLineWidget(w); - }; - - editor.keyBinding.addKeyboardHandler(kb); - inlineEditor.keyBinding.addKeyboardHandler(kb); - inlineEditor.setTheme("ace/theme/solarized_light"); - } -}); -}); diff --git a/demo/kitchen-sink/layout.js b/demo/kitchen-sink/layout.js deleted file mode 100644 index 1332eef3..00000000 --- a/demo/kitchen-sink/layout.js +++ /dev/null @@ -1,132 +0,0 @@ - -define(function(require, exports, module) { -"use strict"; - -var dom = require("ace/lib/dom"); -var event = require("ace/lib/event"); - -var EditSession = require("ace/edit_session").EditSession; -var UndoManager = require("ace/undomanager").UndoManager; -var Renderer = require("ace/virtual_renderer").VirtualRenderer; -var Editor = require("ace/editor").Editor; -var MultiSelect = require("ace/multi_select").MultiSelect; - -dom.importCssString("\ -splitter {\ - border: 1px solid #C6C6D2;\ - width: 0px;\ - cursor: ew-resize;\ - z-index:10}\ -splitter:hover {\ - margin-left: -2px;\ - width:3px;\ - border-color: #B5B4E0;\ -}\ -", "splitEditor"); - -exports.edit = function(el) { - if (typeof(el) == "string") - el = document.getElementById(el); - - var editor = new Editor(new Renderer(el, require("ace/theme/textmate"))); - - editor.resize(); - event.addListener(window, "resize", function() { - editor.resize(); - }); - return editor; -}; - - -var SplitRoot = function(el, theme, position, getSize) { - el.style.position = position || "relative"; - this.container = el; - this.getSize = getSize || this.getSize; - this.resize = this.$resize.bind(this); - - event.addListener(el.ownerDocument.defaultView, "resize", this.resize); - this.editor = this.createEditor(); -}; - -(function(){ - this.createEditor = function() { - var el = document.createElement("div"); - el.className = this.$editorCSS; - el.style.cssText = "position: absolute; top:0px; bottom:0px"; - this.$container.appendChild(el); - var session = new EditSession(""); - var editor = new Editor(new Renderer(el, this.$theme)); - - /*editor.on("focus", function() { - this._emit("focus", editor); - }.bind(this));*/ - - this.$editors.push(editor); - editor.setFontSize(this.$fontSize); - return editor; - }; - this.$resize = function() { - var size = this.getSize(this.container); - this.rect = { - x: size.left, - y: size.top, - w: size.width, - h: size.height - }; - this.item.resize(this.rect); - }; - this.getSize = function(el) { - return el.getBoundingClientRect(); - }; - this.destroy = function() { - var win = this.container.ownerDocument.defaultView; - event.removeListener(win, "resize", this.resize); - }; - - -}).call(SplitRoot.prototype); - - - -var Split = function(){ - -}; -(function(){ - this.execute = function(options) { - this.$u.execute(options); - }; - -}).call(Split.prototype); - - - -exports.singleLineEditor = function(el) { - var renderer = new Renderer(el); - el.style.overflow = "hidden"; - - renderer.screenToTextCoordinates = function(x, y) { - var pos = this.pixelToScreenCoordinates(x, y); - return this.session.screenToDocumentPosition( - Math.min(this.session.getScreenLength() - 1, Math.max(pos.row, 0)), - Math.max(pos.column, 0) - ); - }; - - renderer.$maxLines = 4; - - renderer.setStyle("ace_one-line"); - var editor = new Editor(renderer); - editor.session.setUndoManager(new UndoManager()); - - editor.setShowPrintMargin(false); - editor.renderer.setShowGutter(false); - editor.renderer.setHighlightGutterLine(false); - editor.$mouseHandler.$focusWaitTimout = 0; - - return editor; -}; - - - -}); - diff --git a/demo/kitchen-sink/logo.png b/demo/kitchen-sink/logo.png index a722472f..58df6062 100644 Binary files a/demo/kitchen-sink/logo.png and b/demo/kitchen-sink/logo.png differ diff --git a/demo/kitchen-sink/package.json b/demo/kitchen-sink/package.json new file mode 100644 index 00000000..2345fccd --- /dev/null +++ b/demo/kitchen-sink/package.json @@ -0,0 +1,16 @@ +{ + "main": "./demo.js", + "mappings": { + "ace": "../.." + }, + "config": { + "github.com/sourcemint/bundler-js/0/-meta/config/0": { + "adapter": "github.com/sourcemint/sdk-requirejs/0", + "resources": [ + "./icons/*", + "./logo.png", + "./styles.css" + ] + } + } +} \ No newline at end of file diff --git a/demo/kitchen-sink/require.js b/demo/kitchen-sink/require.js index 203843c1..d016e1da 100644 --- a/demo/kitchen-sink/require.js +++ b/demo/kitchen-sink/require.js @@ -1,28 +1,25 @@ /** vim: et:ts=4:sw=4:sts=4 - * @license RequireJS 2.1.11+ Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved. + * @license RequireJS 2.0.1 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. * Available via the MIT or new BSD license. * see: http://github.com/jrburke/requirejs for details */ -//Not using strict: uneven strict support in browsers, #392, and causes -//problems with requirejs.exec()/transpiler plugins that may not be strict. -/*jslint regexp: true, nomen: true, sloppy: true */ -/*global window, navigator, document, importScripts, setTimeout, opera */ +/*jslint regexp: true, nomen: true */ +/*global window, navigator, document, importScripts, jQuery, setTimeout, opera */ var requirejs, require, define; (function (global) { - var req, s, head, baseElement, dataMain, src, - interactiveScript, currentlyAddingScript, mainScript, subPath, - version = '2.1.11+', + 'use strict'; + + var version = '2.0.1', commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg, - cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g, + cjsRequireRegExp = /require\s*\(\s*["']([^'"\s]+)["']\s*\)/g, jsSuffixRegExp = /\.js$/, currDirRegExp = /^\.\//, - op = Object.prototype, - ostring = op.toString, - hasOwn = op.hasOwnProperty, + ostring = Object.prototype.toString, ap = Array.prototype, + aps = ap.slice, apsp = ap.splice, - isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document), + isBrowser = !!(typeof window !== 'undefined' && navigator && document), isWebWorker = !isBrowser && typeof importScripts !== 'undefined', //PS3 indicates loaded and complete, but need to wait for complete //specifically. Sequence is 'loading', 'loaded', execution, @@ -36,7 +33,9 @@ var requirejs, require, define; contexts = {}, cfg = {}, globalDefQueue = [], - useInteractive = false; + useInteractive = false, + req, s, head, baseElement, dataMain, src, + interactiveScript, currentlyAddingScript, mainScript, subPath; function isFunction(it) { return ostring.call(it) === '[object Function]'; @@ -54,7 +53,7 @@ var requirejs, require, define; if (ary) { var i; for (i = 0; i < ary.length; i += 1) { - if (ary[i] && func(ary[i], i, ary)) { + if (func(ary[i], i, ary)) { break; } } @@ -69,7 +68,7 @@ var requirejs, require, define; if (ary) { var i; for (i = ary.length - 1; i > -1; i -= 1) { - if (ary[i] && func(ary[i], i, ary)) { + if (func(ary[i], i, ary)) { break; } } @@ -77,11 +76,7 @@ var requirejs, require, define; } function hasProp(obj, prop) { - return hasOwn.call(obj, prop); - } - - function getOwn(obj, prop) { - return hasProp(obj, prop) && obj[prop]; + return obj.hasOwnProperty(prop); } /** @@ -92,7 +87,7 @@ var requirejs, require, define; function eachProp(obj, func) { var prop; for (prop in obj) { - if (hasProp(obj, prop)) { + if (obj.hasOwnProperty(prop)) { if (func(obj[prop], prop)) { break; } @@ -103,26 +98,18 @@ var requirejs, require, define; /** * Simple function to mix in properties from source into target, * but only if target does not already have a property of the same name. + * This is not robust in IE for transferring methods that match + * Object.prototype names, but the uses of mixin here seem unlikely to + * trigger a problem related to that. */ - function mixin(target, source, force, deepStringMixin) { + function mixin(target, source, force) { if (source) { eachProp(source, function (value, prop) { if (force || !hasProp(target, prop)) { - if (deepStringMixin && typeof value === 'object' && value && - !isArray(value) && !isFunction(value) && - !(value instanceof RegExp)) { - - if (!target[prop]) { - target[prop] = {}; - } - mixin(target[prop], value, force, deepStringMixin); - } else { - target[prop] = value; - } + target[prop] = value; } }); } - return target; } //Similar to Function.prototype.bind, but the 'this' object is specified @@ -137,11 +124,7 @@ var requirejs, require, define; return document.getElementsByTagName('script'); } - function defaultOnError(err) { - throw err; - } - - //Allow getting a global that is expressed in + //Allow getting a global that expressed in //dot notation, like 'a.b.c'. function getGlobal(value) { if (!value) { @@ -154,6 +137,32 @@ var requirejs, require, define; return g; } + function makeContextModuleFunc(func, relMap, enableBuildCallback) { + return function () { + //A version of a require function that passes a moduleName + //value for items that may need to + //look up paths relative to the moduleName + var args = aps.call(arguments, 0), lastArg; + if (enableBuildCallback && + isFunction((lastArg = args[args.length - 1]))) { + lastArg.__requireJsBuild = true; + } + args.push(relMap); + return func.apply(null, args); + }; + } + + function addRequireMethods(req, context, relMap) { + each([ + ['toUrl'], + ['undef'], + ['defined', 'requireDefined'], + ['specified', 'requireSpecified'] + ], function (item) { + req[item[0]] = makeContextModuleFunc(context[item[1] || item[0]], relMap); + }); + } + /** * Constructs an error with a pointer to an URL with more information. * @param {String} id the error ID that maps to an ID on a web page. @@ -180,7 +189,7 @@ var requirejs, require, define; if (typeof requirejs !== 'undefined') { if (isFunction(requirejs)) { - //Do not overwrite an existing requirejs instance. + //Do not overwrite and existing requirejs instance. return; } cfg = requirejs; @@ -195,32 +204,28 @@ var requirejs, require, define; } function newContext(contextName) { - var inCheckLoaded, Module, context, handlers, - checkLoadedTimeoutId, - config = { - //Defaults. Do not set a default for map - //config to speed up normalize(), which - //will run faster if there is no default. + var config = { waitSeconds: 7, baseUrl: './', paths: {}, - bundles: {}, pkgs: {}, - shim: {}, - config: {} + shim: {} }, registry = {}, - //registry of just enabled modules, to speed - //cycle breaking code when lots of modules - //are registered, but not activated. - enabledRegistry = {}, undefEvents = {}, defQueue = [], defined = {}, + urlMap = {}, urlFetched = {}, - bundlesMap = {}, requireCounter = 1, - unnormalizedCounter = 1; + unnormalizedCounter = 1, + //Used to track the order in which modules + //should be executed, by the order they + //load. Important for consistent cycle resolution + //behavior. + waitAry = [], + inCheckLoaded, Module, context, handlers, + checkLoadedTimeoutId; /** * Trims the . and .. from an array of path segments. @@ -232,8 +237,8 @@ var requirejs, require, define; * @param {Array} ary the array of path segments. */ function trimDots(ary) { - var i, part, length = ary.length; - for (i = 0; i < length; i++) { + var i, part; + for (i = 0; ary[i]; i+= 1) { part = ary[i]; if (part === '.') { ary.splice(i, 1); @@ -266,12 +271,11 @@ var requirejs, require, define; * @returns {String} normalized name */ function normalize(name, baseName, applyMap) { - var pkgMain, mapValue, nameParts, i, j, nameSegment, lastIndex, - foundMap, foundI, foundStarMap, starI, - baseParts = baseName && baseName.split('/'), - normalizedBaseParts = baseParts, + var baseParts = baseName && baseName.split('/'), map = config.map, - starMap = map && map['*']; + starMap = map && map['*'], + pkgName, pkgConfig, mapValue, nameParts, i, j, nameSegment, + foundMap; //Adjust any relative paths. if (name && name.charAt(0) === '.') { @@ -279,26 +283,29 @@ var requirejs, require, define; //otherwise, assume it is a top-level require that will //be relative to baseUrl in the end. if (baseName) { - //Convert baseName to array, and lop off the last part, - //so that . matches that 'directory' and not name of the baseName's - //module. For instance, baseName of 'one/two/three', maps to - //'one/two/three.js', but we want the directory, 'one/two' for - //this normalization. - normalizedBaseParts = baseParts.slice(0, baseParts.length - 1); - name = name.split('/'); - lastIndex = name.length - 1; - - // If wanting node ID compatibility, strip .js from end - // of IDs. Have to do this here, and not in nameToUrl - // because node allows either .js or non .js to map - // to same file. - if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) { - name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, ''); + if (config.pkgs[baseName]) { + //If the baseName is a package name, then just treat it as one + //name to concat the name with. + baseParts = [baseName]; + } else { + //Convert baseName to array, and lop off the last part, + //so that . matches that 'directory' and not name of the baseName's + //module. For instance, baseName of 'one/two/three', maps to + //'one/two/three.js', but we want the directory, 'one/two' for + //this normalization. + baseParts = baseParts.slice(0, baseParts.length - 1); } - name = normalizedBaseParts.concat(name); + name = baseParts.concat(name.split('/')); trimDots(name); + + //Some use of packages may use a . path to reference the + //'main' module name, so normalize for that. + pkgConfig = config.pkgs[(pkgName = name[0])]; name = name.join('/'); + if (pkgConfig && name === pkgName + '/' + pkgConfig.main) { + name = pkgName; + } } else if (name.indexOf('./') === 0) { // No baseName, so this is ID is resolved relative // to baseUrl, pull off the leading dot. @@ -307,64 +314,51 @@ var requirejs, require, define; } //Apply map config if available. - if (applyMap && map && (baseParts || starMap)) { + if (applyMap && (baseParts || starMap) && map) { nameParts = name.split('/'); - outerLoop: for (i = nameParts.length; i > 0; i -= 1) { + for (i = nameParts.length; i > 0; i -= 1) { nameSegment = nameParts.slice(0, i).join('/'); if (baseParts) { //Find the longest baseName segment match in the config. //So, do joins on the biggest to smallest lengths of baseParts. for (j = baseParts.length; j > 0; j -= 1) { - mapValue = getOwn(map, baseParts.slice(0, j).join('/')); + mapValue = map[baseParts.slice(0, j).join('/')]; - //baseName segment has config, find if it has one for + //baseName segment has config, find if it has one for //this name. if (mapValue) { - mapValue = getOwn(mapValue, nameSegment); + mapValue = mapValue[nameSegment]; if (mapValue) { //Match, update name to the new value. foundMap = mapValue; - foundI = i; - break outerLoop; + break; } } } } - //Check for a star map match, but just hold on to it, - //if there is a shorter segment match later in a matching - //config, then favor over this star map. - if (!foundStarMap && starMap && getOwn(starMap, nameSegment)) { - foundStarMap = getOwn(starMap, nameSegment); - starI = i; + if (!foundMap && starMap && starMap[nameSegment]) { + foundMap = starMap[nameSegment]; } - } - if (!foundMap && foundStarMap) { - foundMap = foundStarMap; - foundI = starI; - } - - if (foundMap) { - nameParts.splice(0, foundI, foundMap); - name = nameParts.join('/'); + if (foundMap) { + nameParts.splice(0, i, foundMap); + name = nameParts.join('/'); + break; + } } } - // If the name points to a package's name, use - // the package main instead. - pkgMain = getOwn(config.pkgs, name); - - return pkgMain ? pkgMain : name; + return name; } function removeScript(name) { if (isBrowser) { each(scripts(), function (scriptNode) { if (scriptNode.getAttribute('data-requiremodule') === name && - scriptNode.getAttribute('data-requirecontext') === context.contextName) { + scriptNode.getAttribute('data-requirecontext') === context.contextName) { scriptNode.parentNode.removeChild(scriptNode); return true; } @@ -373,36 +367,18 @@ var requirejs, require, define; } function hasPathFallback(id) { - var pathConfig = getOwn(config.paths, id); + var pathConfig = config.paths[id]; if (pathConfig && isArray(pathConfig) && pathConfig.length > 1) { + removeScript(id); //Pop off the first array value, since it failed, and //retry pathConfig.shift(); - context.require.undef(id); - - //Custom require that does not do map translation, since - //ID is "absolute", already mapped/resolved. - context.makeRequire(null, { - skipMap: true - })([id]); - + context.undef(id); + context.require([id]); return true; } } - //Turns a plugin!resource to [plugin, resource] - //with the plugin being undefined if the name - //did not have a plugin prefix. - function splitPrefix(name) { - var prefix, - index = name ? name.indexOf('!') : -1; - if (index > -1) { - prefix = name.substring(0, index); - name = name.substring(index + 1, name.length); - } - return [prefix, name]; - } - /** * Creates a module mapping that includes plugin prefix, module * name, and path. If parentModuleMap is provided it will @@ -419,12 +395,13 @@ var requirejs, require, define; * @returns {Object} */ function makeModuleMap(name, parentModuleMap, isNormalized, applyMap) { - var url, pluginModule, suffix, nameParts, + var index = name ? name.indexOf('!') : -1, prefix = null, parentName = parentModuleMap ? parentModuleMap.name : null, originalName = name, isDefine = true, - normalizedName = ''; + normalizedName = '', + url, pluginModule, suffix; //If no name, then it means it is a require call, generate an //internal name. @@ -433,13 +410,14 @@ var requirejs, require, define; name = '_@r' + (requireCounter += 1); } - nameParts = splitPrefix(name); - prefix = nameParts[0]; - name = nameParts[1]; + if (index !== -1) { + prefix = name.substring(0, index); + name = name.substring(index + 1, name.length); + } if (prefix) { prefix = normalize(prefix, parentName, applyMap); - pluginModule = getOwn(defined, prefix); + pluginModule = defined[prefix]; } //Account for relative paths if there is a base name. @@ -457,15 +435,22 @@ var requirejs, require, define; //A regular module. normalizedName = normalize(name, parentName, applyMap); - //Normalized name may be a plugin ID due to map config - //application in normalize. The map config values must - //already be normalized, so do not need to redo that part. - nameParts = splitPrefix(normalizedName); - prefix = nameParts[0]; - normalizedName = nameParts[1]; - isNormalized = true; + url = urlMap[normalizedName]; + if (!url) { + //Calculate url for the module, if it has a name. + //Use name here since nameToUrl also calls normalize, + //and for relative names that are outside the baseUrl + //this causes havoc. Was thinking of just removing + //parentModuleMap to avoid extra normalization, but + //normalize() still does a dot removal because of + //issue #142, so just pass in name here and redo + //the normalization. Paths outside baseUrl are just + //messy to support. + url = context.nameToUrl(name, null, parentModuleMap); - url = context.nameToUrl(normalizedName); + //Store the URL mapping for later. + urlMap[normalizedName] = url; + } } } @@ -485,14 +470,14 @@ var requirejs, require, define; originalName: originalName, isDefine: isDefine, id: (prefix ? - prefix + '!' + normalizedName : - normalizedName) + suffix + prefix + '!' + normalizedName : + normalizedName) + suffix }; } function getModule(depMap) { var id = depMap.id, - mod = getOwn(registry, id); + mod = registry[id]; if (!mod) { mod = registry[id] = new context.Module(depMap); @@ -503,20 +488,15 @@ var requirejs, require, define; function on(depMap, name, fn) { var id = depMap.id, - mod = getOwn(registry, id); + mod = registry[id]; if (hasProp(defined, id) && - (!mod || mod.defineEmitComplete)) { + (!mod || mod.defineEmitComplete)) { if (name === 'defined') { fn(defined[id]); } } else { - mod = getModule(depMap); - if (mod.error && name === 'error') { - fn(mod.error); - } else { - mod.on(name, fn); - } + getModule(depMap).on(name, fn); } } @@ -528,7 +508,7 @@ var requirejs, require, define; errback(err); } else { each(ids, function (id) { - var mod = getOwn(registry, id); + var mod = registry[id]; if (mod) { //Set error on module, so it skips timeout checks. mod.error = err; @@ -556,88 +536,168 @@ var requirejs, require, define; //local var ref to defQueue, so cannot just reassign the one //on context. apsp.apply(defQueue, - [defQueue.length, 0].concat(globalDefQueue)); + [defQueue.length - 1, 0].concat(globalDefQueue)); globalDefQueue = []; } } + /** + * Helper function that creates a require function object to give to + * modules that ask for it as a dependency. It needs to be specific + * per module because of the implication of path mappings that may + * need to be relative to the module name. + */ + function makeRequire(mod, enableBuildCallback, altRequire) { + var relMap = mod && mod.map, + modRequire = makeContextModuleFunc(altRequire || context.require, + relMap, + enableBuildCallback); + + addRequireMethods(modRequire, context, relMap); + modRequire.isBrowser = isBrowser; + + return modRequire; + } + handlers = { 'require': function (mod) { - if (mod.require) { - return mod.require; - } else { - return (mod.require = context.makeRequire(mod.map)); - } + return makeRequire(mod); }, 'exports': function (mod) { mod.usingExports = true; if (mod.map.isDefine) { - if (mod.exports) { - return (defined[mod.map.id] = mod.exports); - } else { - return (mod.exports = defined[mod.map.id] = {}); - } + return (mod.exports = defined[mod.map.id] = {}); } }, 'module': function (mod) { - if (mod.module) { - return mod.module; - } else { - return (mod.module = { - id: mod.map.id, - uri: mod.map.url, - config: function () { - return getOwn(config.config, mod.map.id) || {}; - }, - exports: mod.exports || (mod.exports = {}) - }); - } + return (mod.module = { + id: mod.map.id, + uri: mod.map.url, + config: function () { + return (config.config && config.config[mod.map.id]) || {}; + }, + exports: defined[mod.map.id] + }); } }; - function cleanRegistry(id) { + function removeWaiting(id) { //Clean up machinery used for waiting modules. delete registry[id]; - delete enabledRegistry[id]; + + each(waitAry, function (mod, i) { + if (mod.map.id === id) { + waitAry.splice(i, 1); + if (!mod.defined) { + context.waitCount -= 1; + } + return true; + } + }); } - function breakCycle(mod, traced, processed) { - var id = mod.map.id; + function findCycle(mod, traced) { + var id = mod.map.id, + depArray = mod.depMaps, + foundModule; - if (mod.error) { - mod.emit('error', mod.error); - } else { - traced[id] = true; - each(mod.depMaps, function (depMap, i) { - var depId = depMap.id, - dep = getOwn(registry, depId); - - //Only force things that have not completed - //being defined, so still in the registry, - //and only if it has not been matched up - //in the module already. - if (dep && !mod.depMatched[i] && !processed[depId]) { - if (getOwn(traced, depId)) { - mod.defineDep(i, defined[depId]); - mod.check(); //pass false? - } else { - breakCycle(dep, traced, processed); - } - } - }); - processed[id] = true; + //Do not bother with unitialized modules or not yet enabled + //modules. + if (!mod.inited) { + return; } + + //Found the cycle. + if (traced[id]) { + return mod; + } + + traced[id] = true; + + //Trace through the dependencies. + each(depArray, function (depMap) { + var depId = depMap.id, + depMod = registry[depId]; + + if (!depMod) { + return; + } + + if (!depMod.inited || !depMod.enabled) { + //Dependency is not inited, so this cannot + //be used to determine a cycle. + foundModule = null; + delete traced[id]; + return true; + } + + return (foundModule = findCycle(depMod, traced)); + }); + + return foundModule; + } + + function forceExec(mod, traced, uninited) { + var id = mod.map.id, + depArray = mod.depMaps; + + if (!mod.inited || !mod.map.isDefine) { + return; + } + + if (traced[id]) { + return defined[id]; + } + + traced[id] = mod; + + each(depArray, function(depMap) { + var depId = depMap.id, + depMod = registry[depId], + value; + + if (handlers[depId]) { + return; + } + + if (depMod) { + if (!depMod.inited || !depMod.enabled) { + //Dependency is not inited, + //so this module cannot be + //given a forced value yet. + uninited[id] = true; + return; + } + + //Get the value for the current dependency + value = forceExec(depMod, traced, uninited); + + //Even with forcing it may not be done, + //in particular if the module is waiting + //on a plugin resource. + if (!uninited[depId]) { + mod.defineDepById(depId, value); + } + } + }); + + mod.check(true); + + return defined[id]; + } + + function modCheck(mod) { + mod.check(); } function checkLoaded() { - var err, usingPathFallback, - waitInterval = config.waitSeconds * 1000, + var waitInterval = config.waitSeconds * 1000, //It is possible to disable the wait interval by using waitSeconds of 0. expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(), noLoads = [], - reqCalls = [], stillLoading = false, - needCycleCheck = true; + needCycleCheck = true, + map, modId, err, usingPathFallback; //Do not bother if this call was a result of a cycle break. if (inCheckLoaded) { @@ -647,19 +707,15 @@ var requirejs, require, define; inCheckLoaded = true; //Figure out the state of all the modules. - eachProp(enabledRegistry, function (mod) { - var map = mod.map, - modId = map.id; + eachProp(registry, function (mod) { + map = mod.map; + modId = map.id; //Skip things that are not enabled or in error state. if (!mod.enabled) { return; } - if (!map.isDefine) { - reqCalls.push(mod); - } - if (!mod.error) { //If the module should be executed, and it has not //been inited and time is up, remember it. @@ -694,9 +750,31 @@ var requirejs, require, define; //Not expired, check for a cycle. if (needCycleCheck) { - each(reqCalls, function (mod) { - breakCycle(mod, {}, {}); + + each(waitAry, function (mod) { + if (mod.defined) { + return; + } + + var cycleMod = findCycle(mod, {}), + traced = {}; + + if (cycleMod) { + forceExec(cycleMod, traced, {}); + + //traced modules may have been + //removed from the registry, but + //their listeners still need to + //be called. + eachProp(traced, modCheck); + } }); + + //Now that dependencies have + //been satisfied, trigger the + //completion check that then + //notifies listeners. + eachProp(registry, modCheck); } //If still waiting on loads, and the waiting load is something @@ -717,9 +795,9 @@ var requirejs, require, define; } Module = function (map) { - this.events = getOwn(undefEvents, map.id) || {}; + this.events = undefEvents[map.id] || {}; this.map = map; - this.shim = getOwn(config.shim, map.id); + this.shim = config.shim[map.id]; this.depExports = []; this.depMaps = []; this.depMatched = []; @@ -733,7 +811,7 @@ var requirejs, require, define; }; Module.prototype = { - init: function (depMaps, factory, errback, options) { + init: function(depMaps, factory, errback, options) { options = options || {}; //Do not do more inits if already done. Can happen if there @@ -756,14 +834,33 @@ var requirejs, require, define; }); } - //Do a copy of the dependency array, so that - //source inputs are not modified. For example - //"shim" deps are passed in here directly, and - //doing a direct modification of the depMaps array - //would affect that config. - this.depMaps = depMaps && depMaps.slice(0); + each(depMaps, bind(this, function (depMap, i) { + if (typeof depMap === 'string') { + depMap = makeModuleMap(depMap, + (this.map.isDefine ? this.map : this.map.parentMap), + false, + true); + this.depMaps.push(depMap); + } - this.errback = errback; + var handler = handlers[depMap.id]; + + if (handler) { + this.depExports[i] = handler(this); + return; + } + + this.depCount += 1; + + on(depMap, 'defined', bind(this, function (depExports) { + this.defineDep(i, depExports); + this.check(); + })); + + if (errback) { + on(depMap, 'error', errback); + } + })); //Indicate this module has be initialized this.inited = true; @@ -783,6 +880,20 @@ var requirejs, require, define; } }, + defineDepById: function (id, depExports) { + var i; + + //Find the index for this dependency. + each(this.depMaps, function (map, index) { + if (map.id === id) { + i = index; + return true; + } + }); + + return this.defineDep(i, depExports); + }, + defineDep: function (i, depExports) { //Because of cycles, defined callback for a given //export can be called more than once. @@ -805,19 +916,19 @@ var requirejs, require, define; //If the manager is for a plugin managed resource, //ask the plugin to load it now. - if (this.shim) { - context.makeRequire(this.map, { - enableBuildCallback: true - })(this.shim.deps || [], bind(this, function () { - return map.prefix ? this.callPlugin() : this.load(); + if (map.prefix) { + this.callPlugin(); + } else if (this.shim) { + makeRequire(this, true)(this.shim.deps || [], bind(this, function () { + this.load(); })); } else { //Regular dependency. - return map.prefix ? this.callPlugin() : this.load(); + this.load(); } }, - load: function () { + load: function() { var url = this.map.url; //Regular dependency. @@ -828,19 +939,21 @@ var requirejs, require, define; }, /** - * Checks if the module is ready to define itself, and if so, - * define it. + * Checks is the module is ready to define itself, and if so, + * define it. If the silent argument is true, then it will just + * define, but not notify listeners, and not ask for a context-wide + * check of all loaded modules. That is useful for cycle breaking. */ - check: function () { - if (!this.enabled || this.enabling) { + check: function (silent) { + if (!this.enabled) { return; } - var err, cjsModule, - id = this.map.id, + var id = this.map.id, depExports = this.depExports, exports = this.exports, - factory = this.factory; + factory = this.factory, + err, cjsModule; if (!this.inited) { this.fetch(); @@ -856,13 +969,8 @@ var requirejs, require, define; if (this.depCount < 1 && !this.defined) { if (isFunction(factory)) { //If there is an error listener, favor passing - //to that instead of throwing an error. However, - //only do it for define()'d modules. require - //errbacks should not be called for failures in - //their callbacks (#699). However if a global - //onError is set, use that. - if ((this.events.error && this.map.isDefine) || - req.onError !== defaultOnError) { + //to that instead of throwing an error. + if (this.events.error) { try { exports = context.execCb(id, factory, depExports, exports); } catch (e) { @@ -872,14 +980,17 @@ var requirejs, require, define; exports = context.execCb(id, factory, depExports, exports); } - // Favor return value over exports. If node/cjs in play, - // then will not have a return value anyway. Favor - // module.exports assignment over exports object. - if (this.map.isDefine && exports === undefined) { + if (this.map.isDefine) { + //If setting exports via 'module' is in play, + //favor that over return value and exports. After that, + //favor a non-undefined return value over exports use. cjsModule = this.module; - if (cjsModule) { + if (cjsModule && + cjsModule.exports !== undefined && + //Make sure it is not already the exports value + cjsModule.exports !== this.exports) { exports = cjsModule.exports; - } else if (this.usingExports) { + } else if (exports === undefined && this.usingExports) { //exports already set the defined value. exports = this.exports; } @@ -887,8 +998,8 @@ var requirejs, require, define; if (err) { err.requireMap = this.map; - err.requireModules = this.map.isDefine ? [this.map.id] : null; - err.requireType = this.map.isDefine ? 'define' : 'require'; + err.requireModules = [this.map.id]; + err.requireType = 'define'; return onError((this.error = err)); } @@ -908,9 +1019,14 @@ var requirejs, require, define; } //Clean up - cleanRegistry(id); + delete registry[id]; this.defined = true; + context.waitCount -= 1; + if (context.waitCount === 0) { + //Clear the wait array used for cycles. + waitAry = []; + } } //Finished the define stage. Allow calling check again @@ -918,33 +1034,25 @@ var requirejs, require, define; //cycle. this.defining = false; - if (this.defined && !this.defineEmitted) { - this.defineEmitted = true; - this.emit('defined', this.exports); - this.defineEmitComplete = true; + if (!silent) { + if (this.defined && !this.defineEmitted) { + this.defineEmitted = true; + this.emit('defined', this.exports); + this.defineEmitComplete = true; + } } - } }, - callPlugin: function () { + callPlugin: function() { var map = this.map, id = map.id, - //Map already normalized the prefix. - pluginMap = makeModuleMap(map.prefix); - - //Mark this as a dependency for this plugin, so it - //can be traced for cycles. - this.depMaps.push(pluginMap); + pluginMap = makeModuleMap(map.prefix, null, false, true); on(pluginMap, 'defined', bind(this, function (plugin) { - var load, normalizedMap, normalizedMod, - bundleId = getOwn(bundlesMap, this.map.id), - name = this.map.name, + var name = this.map.name, parentName = this.map.parentMap ? this.map.parentMap.name : null, - localRequire = context.makeRequire(map.parentMap, { - enableBuildCallback: true - }); + load, normalizedMap, normalizedMod; //If current map is not normalized, wait for that //normalized name to load instead of continuing. @@ -956,24 +1064,16 @@ var requirejs, require, define; }) || ''; } - //prefix and name should already be normalized, no need - //for applying map config again either. - normalizedMap = makeModuleMap(map.prefix + '!' + name, - this.map.parentMap); + normalizedMap = makeModuleMap(map.prefix + '!' + name); on(normalizedMap, - 'defined', bind(this, function (value) { - this.init([], function () { return value; }, null, { - enabled: true, - ignore: true - }); - })); - - normalizedMod = getOwn(registry, normalizedMap.id); + 'defined', bind(this, function (value) { + this.init([], function () { return value; }, null, { + enabled: true, + ignore: true + }); + })); + normalizedMod = registry[normalizedMap.id]; if (normalizedMod) { - //Mark this as a dependency for this plugin, so it - //can be traced for cycles. - this.depMaps.push(normalizedMap); - if (this.events.error) { normalizedMod.on('error', bind(this, function (err) { this.emit('error', err); @@ -985,14 +1085,6 @@ var requirejs, require, define; return; } - //If a paths config, then just load that file instead to - //resolve the plugin, as it is built into that paths layer. - if (bundleId) { - this.map.url = context.nameToUrl(bundleId); - this.load(); - return; - } - load = bind(this, function (value) { this.init([], function () { return value; }, null, { enabled: true @@ -1008,7 +1100,7 @@ var requirejs, require, define; //since they will never be resolved otherwise now. eachProp(registry, function (mod) { if (mod.map.id.indexOf(id + '_unnormalized') === 0) { - cleanRegistry(mod.map.id); + removeWaiting(mod.map.id); } }); @@ -1017,19 +1109,9 @@ var requirejs, require, define; //Allow plugins to load other code without having to know the //context or how to 'complete' the load. - load.fromText = bind(this, function (text, textAlt) { + load.fromText = function (moduleName, text) { /*jslint evil: true */ - var moduleName = map.name, - moduleMap = makeModuleMap(moduleName), - hasInteractive = useInteractive; - - //As of 2.1.0, support just passing the text, to reinforce - //fromText only being called once per resource. Still - //support old style of passing moduleName but discard - //that moduleName in favor of the internal ref. - if (textAlt) { - text = textAlt; - } + var hasInteractive = useInteractive; //Turn off interactive script matching for IE for any define //calls in the text, then turn it back on at the end. @@ -1037,45 +1119,22 @@ var requirejs, require, define; useInteractive = false; } - //Prime the system by creating a module instance for - //it. - getModule(moduleMap); - - //Transfer any config to this other module. - if (hasProp(config.config, id)) { - config.config[moduleName] = config.config[id]; - } - - try { - req.exec(text); - } catch (e) { - return onError(makeError('fromtexteval', - 'fromText eval for ' + id + - ' failed: ' + e, - e, - [id])); - } + req.exec(text); if (hasInteractive) { useInteractive = true; } - //Mark this as a dependency for the plugin - //resource - this.depMaps.push(moduleMap); - //Support anonymous modules. context.completeLoad(moduleName); - - //Bind the value of that module to the value for this - //resource ID. - localRequire([moduleName], load); - }); + }; //Use parentName here since the plugin's name is not reliable, //could be some weird string with no path that actually wants to //reference the parentName's path. - plugin.load(map.name, localRequire, load, config); + plugin.load(map.name, makeRequire(map.parentMap, true, function (deps, cb) { + return context.require(deps, cb); + }), load, config); })); context.enable(pluginMap, this); @@ -1083,73 +1142,39 @@ var requirejs, require, define; }, enable: function () { - enabledRegistry[this.map.id] = this; this.enabled = true; - //Set flag mentioning that the module is enabling, - //so that immediate calls to the defined callbacks - //for dependencies do not trigger inadvertent load - //with the depCount still being zero. - this.enabling = true; + if (!this.waitPushed) { + waitAry.push(this); + context.waitCount += 1; + this.waitPushed = true; + } //Enable each dependency - each(this.depMaps, bind(this, function (depMap, i) { - var id, mod, handler; - - if (typeof depMap === 'string') { - //Dependency needs to be converted to a depMap - //and wired up to this module. - depMap = makeModuleMap(depMap, - (this.map.isDefine ? this.map : this.map.parentMap), - false, - !this.skipMap); - this.depMaps[i] = depMap; - - handler = getOwn(handlers, depMap.id); - - if (handler) { - this.depExports[i] = handler(this); - return; - } - - this.depCount += 1; - - on(depMap, 'defined', bind(this, function (depExports) { - this.defineDep(i, depExports); - this.check(); - })); - - if (this.errback) { - on(depMap, 'error', bind(this, this.errback)); - } - } - - id = depMap.id; - mod = registry[id]; - + each(this.depMaps, bind(this, function (map) { + var id = map.id, + mod = registry[id]; //Skip special modules like 'require', 'exports', 'module' //Also, don't call enable if it is already enabled, //important in circular dependency cases. - if (!hasProp(handlers, id) && mod && !mod.enabled) { - context.enable(depMap, this); + if (!handlers[id] && mod && !mod.enabled) { + context.enable(map, this); } })); //Enable each plugin that is used in //a dependency eachProp(this.pluginMaps, bind(this, function (pluginMap) { - var mod = getOwn(registry, pluginMap.id); + var mod = registry[pluginMap.id]; if (mod && !mod.enabled) { context.enable(pluginMap, this); } })); - this.enabling = false; - this.check(); }, - on: function (name, cb) { + on: function(name, cb) { var cbs = this.events[name]; if (!cbs) { cbs = this.events[name] = []; @@ -1164,17 +1189,14 @@ var requirejs, require, define; if (name === 'error') { //Now that the error handler was triggered, remove //the listeners, since this broken Module instance - //can stay around for a while in the registry. + //can stay around for a while in the registry/waitAry. delete this.events[name]; } } }; function callGetModule(args) { - //Skip modules already defined. - if (!hasProp(defined, args[0])) { - getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]); - } + getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]); } function removeListener(node, func, name, ieName) { @@ -1214,36 +1236,17 @@ var requirejs, require, define; }; } - function intakeDefines() { - var args; - - //Any defined modules in the global queue, intake them now. - takeGlobalQueue(); - - //Make sure any remaining defQueue items get properly processed. - while (defQueue.length) { - args = defQueue.shift(); - if (args[0] === null) { - return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' + args[args.length - 1])); - } else { - //args are id, deps, factory. Should be normalized by the - //define() function. - callGetModule(args); - } - } - } - - context = { + return (context = { config: config, contextName: contextName, registry: registry, defined: defined, + urlMap: urlMap, urlFetched: urlFetched, + waitCount: 0, defQueue: defQueue, Module: Module, makeModuleMap: makeModuleMap, - nextTick: req.nextTick, - onError: onError, /** * Set a configuration for the context. @@ -1257,36 +1260,25 @@ var requirejs, require, define; } } - //Save off the paths since they require special processing, + //Save off the paths and packages since they require special processing, //they are additive. - var shim = config.shim, - objs = { - paths: true, - bundles: true, - config: true, - map: true - }; + var paths = config.paths, + pkgs = config.pkgs, + shim = config.shim, + map = config.map || {}; - eachProp(cfg, function (value, prop) { - if (objs[prop]) { - if (!config[prop]) { - config[prop] = {}; - } - mixin(config[prop], value, true, true); - } else { - config[prop] = value; - } - }); + //Mix in the config values, favoring the new values over + //existing ones in context.config. + mixin(config, cfg, true); - //Reverse map the bundles - if (cfg.bundles) { - eachProp(cfg.bundles, function (value, prop) { - each(value, function (v) { - if (v !== prop) { - bundlesMap[v] = prop; - } - }); - }); + //Merge paths. + mixin(paths, cfg.paths, true); + config.paths = paths; + + //Merge map + if (cfg.map) { + mixin(map, cfg.map, true); + config.map = map; } //Merge shim @@ -1298,8 +1290,8 @@ var requirejs, require, define; deps: value }; } - if ((value.exports || value.init) && !value.exportsFn) { - value.exportsFn = context.makeShimExports(value); + if (value.exports && !value.exports.__buildReady) { + value.exports = context.makeShimExports(value.exports); } shim[id] = value; }); @@ -1309,38 +1301,30 @@ var requirejs, require, define; //Adjust packages if necessary. if (cfg.packages) { each(cfg.packages, function (pkgObj) { - var location, name; + var location; pkgObj = typeof pkgObj === 'string' ? { name: pkgObj } : pkgObj; - - name = pkgObj.name; location = pkgObj.location; - if (location) { - config.paths[name] = pkgObj.location; - } - //Save pointer to main module ID for pkg name. - //Remove leading dot in main, so main paths are normalized, - //and remove any trailing .js, since different package - //envs have different conventions: some use a module name, - //some use a file name. - config.pkgs[name] = pkgObj.name + '/' + (pkgObj.main || 'main') - .replace(currDirRegExp, '') - .replace(jsSuffixRegExp, ''); + //Create a brand new object on pkgs, since currentPackages can + //be passed in again, and config.pkgs is the internal transformed + //state for all package configs. + pkgs[pkgObj.name] = { + name: pkgObj.name, + location: location || pkgObj.name, + //Remove leading dot in main, so main paths are normalized, + //and remove any trailing .js, since different package + //envs have different conventions: some use a module name, + //some use a file name. + main: (pkgObj.main || 'main') + .replace(currDirRegExp, '') + .replace(jsSuffixRegExp, '') + }; }); - } - //If there are any "waiting to execute" modules in the registry, - //update the maps for them, since their info, like URLs to load, - //may have changed. - eachProp(registry, function (mod, id) { - //If module already has init called, since it is too - //late to modify them, and ignore unnormalized ones - //since they are transient. - if (!mod.inited && !mod.map.unnormalized) { - mod.map = makeModuleMap(id); - } - }); + //Done with modifications, assing packages back to context config + config.pkgs = pkgs; + } //If a deps array or a config callback is specified, then call //require with those args. This is useful when require is defined as a @@ -1350,169 +1334,131 @@ var requirejs, require, define; } }, - makeShimExports: function (value) { - function fn() { - var ret; - if (value.init) { - ret = value.init.apply(global, arguments); - } - return ret || (value.exports && getGlobal(value.exports)); - } - return fn; - }, - - makeRequire: function (relMap, options) { - options = options || {}; - - function localRequire(deps, callback, errback) { - var id, map, requireMod; - - if (options.enableBuildCallback && callback && isFunction(callback)) { - callback.__requireJsBuild = true; - } - - if (typeof deps === 'string') { - if (isFunction(callback)) { - //Invalid call - return onError(makeError('requireargs', 'Invalid require call'), errback); - } - - //If require|exports|module are requested, get the - //value for them from the special handlers. Caveat: - //this only works while module is being defined. - if (relMap && hasProp(handlers, deps)) { - return handlers[deps](registry[relMap.id]); - } - - //Synchronous access to one module. If require.get is - //available (as in the Node adapter), prefer that. - if (req.get) { - return req.get(context, deps, relMap, localRequire); - } - - //Normalize module name, if it contains . or .. - map = makeModuleMap(deps, relMap, false, true); - id = map.id; - - if (!hasProp(defined, id)) { - return onError(makeError('notloaded', 'Module name "' + - id + - '" has not been loaded yet for context: ' + - contextName + - (relMap ? '' : '. Use require([])'))); - } - return defined[id]; - } - - //Grab defines waiting in the global queue. - intakeDefines(); - - //Mark all the dependencies as needing to be loaded. - context.nextTick(function () { - //Some defines could have been added since the - //require call, collect them. - intakeDefines(); - - requireMod = getModule(makeModuleMap(null, relMap)); - - //Store if map config should be applied to this require - //call for dependencies. - requireMod.skipMap = options.skipMap; - - requireMod.init(deps, callback, errback, { - enabled: true - }); - - checkLoaded(); - }); - - return localRequire; - } - - mixin(localRequire, { - isBrowser: isBrowser, - - /** - * Converts a module name + .extension into an URL path. - * *Requires* the use of a module name. It does not support using - * plain URLs like nameToUrl. - */ - toUrl: function (moduleNamePlusExt) { - var ext, - index = moduleNamePlusExt.lastIndexOf('.'), - segment = moduleNamePlusExt.split('/')[0], - isRelative = segment === '.' || segment === '..'; - - //Have a file extension alias, and it is not the - //dots from a relative path. - if (index !== -1 && (!isRelative || index > 1)) { - ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length); - moduleNamePlusExt = moduleNamePlusExt.substring(0, index); - } - - return context.nameToUrl(normalize(moduleNamePlusExt, - relMap && relMap.id, true), ext, true); - }, - - defined: function (id) { - return hasProp(defined, makeModuleMap(id, relMap, false, true).id); - }, - - specified: function (id) { - id = makeModuleMap(id, relMap, false, true).id; - return hasProp(defined, id) || hasProp(registry, id); - } - }); - - //Only allow undef on top level require calls - if (!relMap) { - localRequire.undef = function (id) { - //Bind any waiting define() calls to this context, - //fix for #408 - takeGlobalQueue(); - - var map = makeModuleMap(id, relMap, true), - mod = getOwn(registry, id); - - removeScript(id); - - delete defined[id]; - delete urlFetched[map.url]; - delete undefEvents[id]; - - //Clean queued defines too. Go backwards - //in array so that the splices do not - //mess up the iteration. - eachReverse(defQueue, function(args, i) { - if(args[0] === id) { - defQueue.splice(i, 1); - } - }); - - if (mod) { - //Hold on to listeners in case the - //module will be attempted to be reloaded - //using a different config. - if (mod.events.defined) { - undefEvents[id] = mod.events; - } - - cleanRegistry(id); - } + makeShimExports: function (exports) { + var func; + if (typeof exports === 'string') { + func = function () { + return getGlobal(exports); + }; + //Save the exports for use in nodefine checking. + func.exports = exports; + return func; + } else { + return function () { + return exports.apply(global, arguments); }; } + }, - return localRequire; + requireDefined: function (id, relMap) { + return hasProp(defined, makeModuleMap(id, relMap, false, true).id); + }, + + requireSpecified: function (id, relMap) { + id = makeModuleMap(id, relMap, false, true).id; + return hasProp(defined, id) || hasProp(registry, id); + }, + + require: function (deps, callback, errback, relMap) { + var moduleName, id, map, requireMod, args; + if (typeof deps === 'string') { + if (isFunction(callback)) { + //Invalid call + return onError(makeError('requireargs', 'Invalid require call'), errback); + } + + //Synchronous access to one module. If require.get is + //available (as in the Node adapter), prefer that. + //In this case deps is the moduleName and callback is + //the relMap + if (req.get) { + return req.get(context, deps, callback); + } + + //Just return the module wanted. In this scenario, the + //second arg (if passed) is just the relMap. + moduleName = deps; + relMap = callback; + + //Normalize module name, if it contains . or .. + map = makeModuleMap(moduleName, relMap, false, true); + id = map.id; + + if (!hasProp(defined, id)) { + return onError(makeError('notloaded', 'Module name "' + + id + + '" has not been loaded yet for context: ' + + contextName)); + } + return defined[id]; + } + + //Callback require. Normalize args. if callback or errback is + //not a function, it means it is a relMap. Test errback first. + if (errback && !isFunction(errback)) { + relMap = errback; + errback = undefined; + } + if (callback && !isFunction(callback)) { + relMap = callback; + callback = undefined; + } + + //Any defined modules in the global queue, intake them now. + takeGlobalQueue(); + + //Make sure any remaining defQueue items get properly processed. + while (defQueue.length) { + args = defQueue.shift(); + if (args[0] === null) { + return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' + args[args.length - 1])); + } else { + //args are id, deps, factory. Should be normalized by the + //define() function. + callGetModule(args); + } + } + + //Mark all the dependencies as needing to be loaded. + requireMod = getModule(makeModuleMap(null, relMap)); + + requireMod.init(deps, callback, errback, { + enabled: true + }); + + checkLoaded(); + + return context.require; + }, + + undef: function (id) { + var map = makeModuleMap(id, null, true), + mod = registry[id]; + + delete defined[id]; + delete urlMap[id]; + delete urlFetched[map.url]; + delete undefEvents[id]; + + if (mod) { + //Hold on to listeners in case the + //module will be attempted to be reloaded + //using a different config. + if (mod.events.defined) { + undefEvents[id] = mod.events; + } + + removeWaiting(id); + } }, /** * Called to enable a module if it is still in the registry - * awaiting enablement. A second arg, parent, the parent module, - * is passed in for context, when this method is overridden by - * the optimizer. Not shown here to keep code compact. + * awaiting enablement. parent module is passed in for context, + * used by the optimizer. */ - enable: function (depMap) { - var mod = getOwn(registry, depMap.id); + enable: function (depMap, parent) { + var mod = registry[depMap.id]; if (mod) { getModule(depMap).enable(); } @@ -1525,9 +1471,9 @@ var requirejs, require, define; * @param {String} moduleName the name of the module to potentially complete. */ completeLoad: function (moduleName) { - var found, args, mod, - shim = getOwn(config.shim, moduleName) || {}, - shExports = shim.exports; + var shim = config.shim[moduleName] || {}, + shExports = shim.exports && shim.exports.exports, + found, args, mod; takeGlobalQueue(); @@ -1552,9 +1498,11 @@ var requirejs, require, define; //Do this after the cycle of callGetModule in case the result //of those calls/init calls changes the registry. - mod = getOwn(registry, moduleName); + mod = registry[moduleName]; - if (!found && !hasProp(defined, moduleName) && mod && !mod.inited) { + if (!found && + !defined[moduleName] && + mod && !mod.inited) { if (config.enforceDefine && (!shExports || !getGlobal(shExports))) { if (hasPathFallback(moduleName)) { return; @@ -1567,34 +1515,40 @@ var requirejs, require, define; } else { //A script that does not call define(), so just simulate //the call for it. - callGetModule([moduleName, (shim.deps || []), shim.exportsFn]); + callGetModule([moduleName, (shim.deps || []), shim.exports]); } } checkLoaded(); }, + /** + * Converts a module name + .extension into an URL path. + * *Requires* the use of a module name. It does not support using + * plain URLs like nameToUrl. + */ + toUrl: function (moduleNamePlusExt, relModuleMap) { + var index = moduleNamePlusExt.lastIndexOf('.'), + ext = null; + + if (index !== -1) { + ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length); + moduleNamePlusExt = moduleNamePlusExt.substring(0, index); + } + + return context.nameToUrl(moduleNamePlusExt, ext, relModuleMap); + }, + /** * Converts a module name to a file path. Supports cases where * moduleName may actually be just an URL. - * Note that it **does not** call normalize on the moduleName, - * it is assumed to have already been normalized. This is an - * internal API, not a public one. Use toUrl for the public API. */ - nameToUrl: function (moduleName, ext, skipExt) { - var paths, syms, i, parentModule, url, - parentPath, bundleId, - pkgMain = getOwn(config.pkgs, moduleName); + nameToUrl: function (moduleName, ext, relModuleMap) { + var paths, pkgs, pkg, pkgPath, syms, i, parentModule, url, + parentPath; - if (pkgMain) { - moduleName = pkgMain; - } - - bundleId = getOwn(bundlesMap, moduleName); - - if (bundleId) { - return context.nameToUrl(bundleId, ext, skipExt); - } + //Normalize module name if have a base relative module name to work from. + moduleName = normalize(moduleName, relModuleMap && relModuleMap.id, true); //If a colon is in the URL, it indicates a protocol is used and it is just //an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?) @@ -1608,6 +1562,7 @@ var requirejs, require, define; } else { //A module that needs to be converted to a path. paths = config.paths; + pkgs = config.pkgs; syms = moduleName.split('/'); //For each module name segment, see if there is a path @@ -1615,8 +1570,8 @@ var requirejs, require, define; //and work up from it. for (i = syms.length; i > 0; i -= 1) { parentModule = syms.slice(0, i).join('/'); - - parentPath = getOwn(paths, parentModule); + pkg = pkgs[parentModule]; + parentPath = paths[parentModule]; if (parentPath) { //If an array, it means there are a few choices, //Choose the one that is desired @@ -1625,12 +1580,21 @@ var requirejs, require, define; } syms.splice(0, i, parentPath); break; + } else if (pkg) { + //If module name is just the package name, then looking + //for the main module. + if (moduleName === pkg.name) { + pkgPath = pkg.location + '/' + pkg.main; + } else { + pkgPath = pkg.location; + } + syms.splice(0, i, pkgPath); + break; } } //Join the path parts together, then figure out if baseUrl is needed. - url = syms.join('/'); - url += (ext || (/^data\:|\?/.test(url) || skipExt ? '' : '.js')); + url = syms.join('/') + (ext || '.js'); url = (url.charAt(0) === '/' || url.match(/^[\w\+\.\-]+:/) ? '' : config.baseUrl) + url; } @@ -1646,7 +1610,7 @@ var requirejs, require, define; }, /** - * Executes a module callback function. Broken out as a separate function + * Executes a module callack function. Broken out as a separate function * solely to allow the build system to sequence the files in the built * layer in the right sequence. * @@ -1667,7 +1631,7 @@ var requirejs, require, define; //all old browsers will be supported, but this one was easy enough //to support and still makes sense. if (evt.type === 'load' || - (readyRegExp.test((evt.currentTarget || evt.srcElement).readyState))) { + (readyRegExp.test((evt.currentTarget || evt.srcElement).readyState))) { //Reset interactive script so a script node is not held onto for //to long. interactiveScript = null; @@ -1684,13 +1648,10 @@ var requirejs, require, define; onScriptError: function (evt) { var data = getScriptData(evt); if (!hasPathFallback(data.id)) { - return onError(makeError('scripterror', 'Script error for: ' + data.id, evt, [data.id])); + return onError(makeError('scripterror', 'Script error', evt, [data.id])); } } - }; - - context.require = context.makeRequire(); - return context; + }); } /** @@ -1710,8 +1671,8 @@ var requirejs, require, define; req = requirejs = function (deps, callback, errback, optional) { //Find the right context, use default - var context, config, - contextName = defContextName; + var contextName = defContextName, + context, config; // Determine if have config object in the call. if (!isArray(deps) && typeof deps !== 'string') { @@ -1731,7 +1692,7 @@ var requirejs, require, define; contextName = config.context; } - context = getOwn(contexts, contextName); + context = contexts[contextName]; if (!context) { context = contexts[contextName] = req.s.newContext(contextName); } @@ -1751,16 +1712,6 @@ var requirejs, require, define; return req(config); }; - /** - * Execute something after the current tick - * of the event loop. Override for other envs - * that have a better solution than setTimeout. - * @param {Function} fn function to execute later. - */ - req.nextTick = typeof setTimeout !== 'undefined' ? function (fn) { - setTimeout(fn, 4); - } : function (fn) { fn(); }; - /** * Export require as a global, but only if it does not already exist. */ @@ -1781,21 +1732,9 @@ var requirejs, require, define; //Create default context. req({}); - //Exports some context-sensitive methods on global require. - each([ - 'toUrl', - 'undef', - 'defined', - 'specified' - ], function (prop) { - //Reference from contexts instead of early binding to default context, - //so that during builds, the latest instance of the default context - //with its config gets used. - req[prop] = function () { - var ctx = contexts[defContextName]; - return ctx.require[prop].apply(ctx, arguments); - }; - }); + //Exports some context-sensitive methods on global require, using + //default context if no context specified. + addRequireMethods(req, contexts[defContextName]); if (isBrowser) { head = s.head = document.getElementsByTagName('head')[0]; @@ -1813,19 +1752,8 @@ var requirejs, require, define; * function. Intercept/override it if you want custom error handling. * @param {Error} err the error object. */ - req.onError = defaultOnError; - - /** - * Creates the node for the load command. Only used in browser envs. - */ - req.createNode = function (config, moduleName, url) { - var node = config.xhtml ? - document.createElementNS('http://www.w3.org/1999/xhtml', 'html:script') : - document.createElement('script'); - node.type = config.scriptType || 'text/javascript'; - node.charset = 'utf-8'; - node.async = true; - return node; + req.onError = function (err) { + throw err; }; /** @@ -1842,7 +1770,11 @@ var requirejs, require, define; node; if (isBrowser) { //In the browser so use a script tag - node = req.createNode(config, moduleName, url); + node = config.xhtml ? + document.createElementNS('http://www.w3.org/1999/xhtml', 'html:script') : + document.createElement('script'); + node.type = config.scriptType || 'text/javascript'; + node.charset = 'utf-8'; node.setAttribute('data-requirecontext', context.contextName); node.setAttribute('data-requiremodule', moduleName); @@ -1856,15 +1788,15 @@ var requirejs, require, define; //UNFORTUNATELY Opera implements attachEvent but does not follow the script //script execution mode. if (node.attachEvent && - //Check if node.attachEvent is artificially added by custom script or - //natively supported by browser - //read https://github.com/jrburke/requirejs/issues/187 - //if we can NOT find [native code] then it must NOT natively supported. - //in IE8, node.attachEvent does not have toString() - //Note the test for "[native code" with no closing brace, see: - //https://github.com/jrburke/requirejs/issues/273 - !(node.attachEvent.toString && node.attachEvent.toString().indexOf('[native code') < 0) && - !isOpera) { + //Check if node.attachEvent is artificially added by custom script or + //natively supported by browser + //read https://github.com/jrburke/requirejs/issues/187 + //if we can NOT find [native code] then it must NOT natively supported. + //in IE8, node.attachEvent does not have toString() + //Note the test for "[native code" with no closing brace, see: + //https://github.com/jrburke/requirejs/issues/273 + !(node.attachEvent.toString && node.attachEvent.toString().indexOf('[native code') < 0) && + !isOpera) { //Probably IE. IE (at least 6-8) do not fire //script onload right after executing the script, so //we cannot tie the anonymous define call to a name. @@ -1875,7 +1807,7 @@ var requirejs, require, define; node.attachEvent('onreadystatechange', context.onScriptLoad); //It would be great to add an error handler here to catch //404s in IE9+. However, onreadystatechange will fire before - //the error handler, so that does not help. If addEventListener + //the error handler, so that does not help. If addEvenListener //is used, then IE will fire error before load, but we cannot //use that pathway given the connect.microsoft.com issue //mentioned above about not doing the 'script execute, @@ -1904,24 +1836,16 @@ var requirejs, require, define; return node; } else if (isWebWorker) { - try { - //In a web worker, use importScripts. This is not a very - //efficient use of importScripts, importScripts will block until - //its script is downloaded and evaluated. However, if web workers - //are in play, the expectation that a build has been done so that - //only one script needs to be loaded anyway. This may need to be - //reevaluated if other use cases become common. - importScripts(url); + //In a web worker, use importScripts. This is not a very + //efficient use of importScripts, importScripts will block until + //its script is downloaded and evaluated. However, if web workers + //are in play, the expectation that a build has been done so that + //only one script needs to be loaded anyway. This may need to be + //reevaluated if other use cases become common. + importScripts(url); - //Account for anonymous modules - context.completeLoad(moduleName); - } catch (e) { - context.onError(makeError('importscripts', - 'importScripts failed for ' + - moduleName + ' at ' + url, - e, - [moduleName])); - } + //Account for anonymous modules + context.completeLoad(moduleName); } }; @@ -1939,7 +1863,7 @@ var requirejs, require, define; } //Look for a data-main script attribute, which could also adjust the baseUrl. - if (isBrowser && !cfg.skipDataMain) { + if (isBrowser) { //Figure out baseUrl. Get it from the script tag with require.js in it. eachReverse(scripts(), function (script) { //Set the 'head' where we can append children by @@ -1953,31 +1877,22 @@ var requirejs, require, define; //baseUrl, if it is not already set. dataMain = script.getAttribute('data-main'); if (dataMain) { - //Preserve dataMain in case it is a path (i.e. contains '?') - mainScript = dataMain; - - //Set final baseUrl if there is not already an explicit one. if (!cfg.baseUrl) { //Pull off the directory of data-main for use as the //baseUrl. - src = mainScript.split('/'); + src = dataMain.split('/'); mainScript = src.pop(); subPath = src.length ? src.join('/') + '/' : './'; + //Set final config. cfg.baseUrl = subPath; - } - - //Strip off any trailing .js since mainScript is now - //like a module name. - mainScript = mainScript.replace(jsSuffixRegExp, ''); - - //If mainScript is still a path, fall back to dataMain - if (req.jsExtRegExp.test(mainScript)) { - mainScript = dataMain; + //Strip off any trailing .js since dataMain is now + //like a module name. + dataMain = mainScript.replace(jsSuffixRegExp, ''); } //Put the data-main script in the files to load. - cfg.deps = cfg.deps ? cfg.deps.concat(mainScript) : [mainScript]; + cfg.deps = cfg.deps ? cfg.deps.concat(dataMain) : [dataMain]; return true; } @@ -1994,7 +1909,7 @@ var requirejs, require, define; define = function (name, deps, callback) { var node, context; - //Allow for anonymous modules + //Allow for anonymous functions if (typeof name !== 'string') { //Adjust args appropriately callback = deps; @@ -2005,13 +1920,12 @@ var requirejs, require, define; //This module may not have dependencies if (!isArray(deps)) { callback = deps; - deps = null; + deps = []; } //If no name, and callback is a function, then figure out if it a //CommonJS thing with dependencies. - if (!deps && isFunction(callback)) { - deps = []; + if (!deps.length && isFunction(callback)) { //Remove comments from the callback string, //look for require calls, and pull them into the dependencies, //but only if there are function args. diff --git a/demo/kitchen-sink/styles.css b/demo/kitchen-sink/styles.css index 3f46f701..e5909787 100644 --- a/demo/kitchen-sink/styles.css +++ b/demo/kitchen-sink/styles.css @@ -1,3 +1,7 @@ +/*PACKAGE +@import url(//fonts.googleapis.com/css?family=Droid+Sans+Mono); + PACKAGE*/ + html { height: 100%; width: 100%; @@ -16,12 +20,12 @@ body { color: white; } -#c9-logo, #ace-logo { - padding: 0; - border: none; +#logo { + padding: 15px; + margin-left: 70px; } -#editor-container { +#editor { position: absolute; top: 0px; left: 280px; @@ -40,16 +44,4 @@ body { #controls td + td { text-align: left; -} -.ace_status-indicator { - color: gray; - position: absolute; - right: 0; - border-left: 1px solid; -} - -/* .ace_text-input { - z-index: 10!important; - opacity: 1!important; - background: rgb(84, 0, 255)!important; -}*/ +} \ No newline at end of file diff --git a/demo/kitchen-sink/token_tooltip.js b/demo/kitchen-sink/token_tooltip.js deleted file mode 100644 index 9e607f69..00000000 --- a/demo/kitchen-sink/token_tooltip.js +++ /dev/null @@ -1,156 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var dom = require("ace/lib/dom"); -var oop = require("ace/lib/oop"); -var event = require("ace/lib/event"); -var Range = require("ace/range").Range; -var Tooltip = require("ace/tooltip").Tooltip; - -function TokenTooltip (editor) { - if (editor.tokenTooltip) - return; - Tooltip.call(this, editor.container); - editor.tokenTooltip = this; - this.editor = editor; - - this.update = this.update.bind(this); - this.onMouseMove = this.onMouseMove.bind(this); - this.onMouseOut = this.onMouseOut.bind(this); - event.addListener(editor.renderer.scroller, "mousemove", this.onMouseMove); - event.addListener(editor.renderer.content, "mouseout", this.onMouseOut); -} - -oop.inherits(TokenTooltip, Tooltip); - -(function(){ - this.token = {}; - this.range = new Range(); - - this.update = function() { - this.$timer = null; - - var r = this.editor.renderer; - if (this.lastT - (r.timeStamp || 0) > 1000) { - r.rect = null; - r.timeStamp = this.lastT; - this.maxHeight = window.innerHeight; - this.maxWidth = window.innerWidth; - } - - var canvasPos = r.rect || (r.rect = r.scroller.getBoundingClientRect()); - var offset = (this.x + r.scrollLeft - canvasPos.left - r.$padding) / r.characterWidth; - var row = Math.floor((this.y + r.scrollTop - canvasPos.top) / r.lineHeight); - var col = Math.round(offset); - - var screenPos = {row: row, column: col, side: offset - col > 0 ? 1 : -1}; - var session = this.editor.session; - var docPos = session.screenToDocumentPosition(screenPos.row, screenPos.column); - var token = session.getTokenAt(docPos.row, docPos.column); - - if (!token && !session.getLine(docPos.row)) { - token = { - type: "", - value: "", - state: session.bgTokenizer.getState(0) - }; - } - if (!token) { - session.removeMarker(this.marker); - this.hide(); - return; - } - - var tokenText = token.type; - if (token.state) - tokenText += "|" + token.state; - if (token.merge) - tokenText += "\n merge"; - if (token.stateTransitions) - tokenText += "\n " + token.stateTransitions.join("\n "); - - if (this.tokenText != tokenText) { - this.setText(tokenText); - this.width = this.getWidth(); - this.height = this.getHeight(); - this.tokenText = tokenText; - } - - this.show(null, this.x, this.y); - - this.token = token; - session.removeMarker(this.marker); - this.range = new Range(docPos.row, token.start, docPos.row, token.start + token.value.length); - this.marker = session.addMarker(this.range, "ace_bracket", "text"); - }; - - this.onMouseMove = function(e) { - this.x = e.clientX; - this.y = e.clientY; - if (this.isOpen) { - this.lastT = e.timeStamp; - this.setPosition(this.x, this.y); - } - if (!this.$timer) - this.$timer = setTimeout(this.update, 100); - }; - - this.onMouseOut = function(e) { - if (e && e.currentTarget.contains(e.relatedTarget)) - return; - this.hide(); - this.editor.session.removeMarker(this.marker); - this.$timer = clearTimeout(this.$timer); - }; - - this.setPosition = function(x, y) { - if (x + 10 + this.width > this.maxWidth) - x = window.innerWidth - this.width - 10; - if (y > window.innerHeight * 0.75 || y + 20 + this.height > this.maxHeight) - y = y - this.height - 30; - - Tooltip.prototype.setPosition.call(this, x + 10, y + 20); - }; - - this.destroy = function() { - this.onMouseOut(); - event.removeListener(this.editor.renderer.scroller, "mousemove", this.onMouseMove); - event.removeListener(this.editor.renderer.content, "mouseout", this.onMouseOut); - delete this.editor.tokenTooltip; - }; - -}).call(TokenTooltip.prototype); - -exports.TokenTooltip = TokenTooltip; - -}); diff --git a/demo/kitchen-sink/util.js b/demo/kitchen-sink/util.js deleted file mode 100644 index c4b74f38..00000000 --- a/demo/kitchen-sink/util.js +++ /dev/null @@ -1,235 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var dom = require("ace/lib/dom"); -var event = require("ace/lib/event"); - -var EditSession = require("ace/edit_session").EditSession; -var UndoManager = require("ace/undomanager").UndoManager; -var Renderer = require("ace/virtual_renderer").VirtualRenderer; -var Editor = require("ace/editor").Editor; -var MultiSelect = require("ace/multi_select").MultiSelect; - -exports.createEditor = function(el) { - return new Editor(new Renderer(el)); -}; - -exports.createSplitEditor = function(el) { - if (typeof(el) == "string") - el = document.getElementById(el); - - var e0 = document.createElement("div"); - var s = document.createElement("splitter"); - var e1 = document.createElement("div"); - el.appendChild(e0); - el.appendChild(e1); - el.appendChild(s); - e0.style.position = e1.style.position = s.style.position = "absolute"; - el.style.position = "relative"; - var split = {$container: el}; - - split.editor0 = split[0] = new Editor(new Renderer(e0)); - split.editor1 = split[1] = new Editor(new Renderer(e1)); - split.splitter = s; - - s.ratio = 0.5; - - split.resize = function resize(){ - var height = el.parentNode.clientHeight - el.offsetTop; - var total = el.clientWidth; - var w1 = total * s.ratio; - var w2 = total * (1- s.ratio); - s.style.left = w1 - 1 + "px"; - s.style.height = el.style.height = height + "px"; - - var st0 = split[0].container.style; - var st1 = split[1].container.style; - st0.width = w1 + "px"; - st1.width = w2 + "px"; - st0.left = 0 + "px"; - st1.left = w1 + "px"; - - st0.top = st1.top = "0px"; - st0.height = st1.height = height + "px"; - - split[0].resize(); - split[1].resize(); - }; - - split.onMouseDown = function(e) { - var rect = el.getBoundingClientRect(); - var x = e.clientX; - var y = e.clientY; - - var button = e.button; - if (button !== 0) { - return; - } - - var onMouseMove = function(e) { - x = e.clientX; - y = e.clientY; - }; - var onResizeEnd = function(e) { - clearInterval(timerId); - }; - - var onResizeInterval = function() { - s.ratio = (x - rect.left) / rect.width; - split.resize(); - }; - - event.capture(s, onMouseMove, onResizeEnd); - var timerId = setInterval(onResizeInterval, 40); - - return e.preventDefault(); - }; - - - - event.addListener(s, "mousedown", split.onMouseDown); - event.addListener(window, "resize", split.resize); - split.resize(); - return split; -}; - -/***************************/ -exports.stripLeadingComments = function(str) { - if(str.slice(0,2)=='/*') { - var j = str.indexOf('*/')+2; - str = str.substr(j); - } - return str.trim() + "\n"; -}; - -/***************************/ -exports.saveOption = function(el, val) { - if (!el.onchange && !el.onclick) - return; - - if ("checked" in el) { - if (val !== undefined) - el.checked = val; - - localStorage && localStorage.setItem(el.id, el.checked ? 1 : 0); - } - else { - if (val !== undefined) - el.value = val; - - localStorage && localStorage.setItem(el.id, el.value); - } -}; - -exports.bindCheckbox = function(id, callback, noInit) { - if (typeof id == "string") - var el = document.getElementById(id); - else { - var el = id; - id = el.id; - } - var el = document.getElementById(id); - if (localStorage && localStorage.getItem(id)) - el.checked = localStorage.getItem(id) == "1"; - - var onCheck = function() { - callback(!!el.checked); - exports.saveOption(el); - }; - el.onclick = onCheck; - noInit || onCheck(); - return el; -}; - -exports.bindDropdown = function(id, callback, noInit) { - if (typeof id == "string") - var el = document.getElementById(id); - else { - var el = id; - id = el.id; - } - if (localStorage && localStorage.getItem(id)) - el.value = localStorage.getItem(id); - - var onChange = function() { - callback(el.value); - exports.saveOption(el); - }; - - el.onchange = onChange; - noInit || onChange(); -}; - -exports.fillDropdown = function(el, values) { - if (typeof el == "string") - el = document.getElementById(el); - - dropdown(values).forEach(function(e) { - el.appendChild(e); - }); -}; - -function elt(tag, attributes, content) { - var el = dom.createElement(tag); - if (typeof content == "string") { - el.appendChild(document.createTextNode(content)); - } else if (content) { - content.forEach(function(ch) { - el.appendChild(ch); - }); - } - - for (var i in attributes) - el.setAttribute(i, attributes[i]); - return el; -} - -function optgroup(values) { - return values.map(function(item) { - if (typeof item == "string") - item = {name: item, caption: item}; - return elt("option", {value: item.value || item.name}, item.caption || item.desc); - }); -} - -function dropdown(values) { - if (Array.isArray(values)) - return optgroup(values); - - return Object.keys(values).map(function(i) { - return elt("optgroup", {"label": i}, optgroup(values[i])); - }); -} - - -}); diff --git a/demo/modelist.html b/demo/modelist.html deleted file mode 100644 index 9b4b6039..00000000 --- a/demo/modelist.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - ACE Editor Modelist Demo - - - - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/demo/r.js/build.js b/demo/r.js/build.js
                                                                                                                                                                                                                                                                                                                                                                                                                                                              deleted file mode 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                              index 028d2234..00000000
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- a/demo/r.js/build.js
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +++ /dev/null
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -1,20 +0,0 @@
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -({
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    optimize: "none",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    preserveLicenseComments: false,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    name: "node_modules/almond/almond",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    baseUrl: "../../",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    paths: {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        ace : "lib/ace",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        demo: "demo/kitchen-sink"        
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    },
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    packages: [
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    ],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    include: [
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        "ace/ace"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    ],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    exclude: [
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    ],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    out: "./packed.js",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    useStrict: true,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    wrap: false
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -})
                                                                                                                                                                                                                                                                                                                                                                                                                                                              \ No newline at end of file
                                                                                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/demo/r.js/editor.html b/demo/r.js/editor.html
                                                                                                                                                                                                                                                                                                                                                                                                                                                              deleted file mode 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                              index 9f7a47bf..00000000
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- a/demo/r.js/editor.html
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +++ /dev/null
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -1,36 +0,0 @@
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    Editor
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - - - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - demo showing Ace usage with r.js: - - install r.js and almond - and run `r.js -o demo/r.js/build.js` - - note that you also need ace/build/src to lazy load modes and themes - require("ace/config").set("basePath", "../../build/src"); - require("ace/config").set("packaged", true); -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - - - - - diff --git a/demo/requirejs+build.html b/demo/requirejs+build.html index 72d50dbc..4a494063 100644 --- a/demo/requirejs+build.html +++ b/demo/requirejs+build.html @@ -29,20 +29,14 @@ } + diff --git a/demo/scrollable-page.html b/demo/scrollable-page.html index ef725c4a..308208ed 100644 --- a/demo/scrollable-page.html +++ b/demo/scrollable-page.html @@ -5,18 +5,19 @@ Editor - - - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/demo/show_own_source.js b/demo/show_own_source.js
                                                                                                                                                                                                                                                                                                                                                                                                                                                              deleted file mode 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                              index a9e0ec69..00000000
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- a/demo/show_own_source.js
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +++ /dev/null
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -1,16 +0,0 @@
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -if (typeof ace == "undefined" && typeof require == "undefined") {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    document.body.innerHTML = "

                                                                                                                                                                                                                                                                                                                                                                                                                                                              couldn't find ace.js file,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              " - + "to build it run node Makefile.dryice.js full" -} else if (typeof ace == "undefined" && typeof require != "undefined") { - require(["ace/ace"], setValue) -} else { - require = ace.require; - setValue() -} - -function setValue() { - require("ace/lib/net").get(document.baseURI, function(t){ - var el = document.getElementById("editor"); - el.env.editor.setValue(t, 1); - }) -} \ No newline at end of file diff --git a/demo/static-highlighter.html b/demo/static-highlighter.html deleted file mode 100644 index 8e43789d..00000000 --- a/demo/static-highlighter.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - - Static Code highlighter using Ace - - - - - -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Client Side Syntax Highlighting

                                                                                                                                                                                                                                                                                                                                                                                                                                                              - -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Syntax highlighting using Ace language modes and themes.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -.code { - width: 50%; - white-space: pre-wrap; - border: solid lightgrey 1px -} - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -function wobble (flam) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    return flam.wobbled = true;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ---[[-- -num_args takes in 5.1 byte code and extracts the number of arguments from its function header. ---]]-- - -function int(t) - return t:byte(1) + t:byte(2) * 0x100 + t:byte(3) * 0x10000 + t:byte(4) * 0x1000000 -end - -function num_args(func) - local dump = string.dump(func) - local offset, cursor = int(dump:sub(13)), offset + 26 - --Get the params and var flag (whether there's a ... in the param) - return dump:sub(cursor):byte(), dump:sub(cursor+1):byte() -end - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - - - - - - - diff --git a/demo/static-highlighter/client.html b/demo/static-highlighter/client.html index 93d20909..c3e6cef6 100644 --- a/demo/static-highlighter/client.html +++ b/demo/static-highlighter/client.html @@ -23,8 +23,8 @@ } }; - - + - - - - - diff --git a/doc/Contributor_License_Agreement-v2.pdf b/doc/Contributor_License_Agreement-v2.pdf new file mode 100644 index 00000000..1c4baa87 Binary files /dev/null and b/doc/Contributor_License_Agreement-v2.pdf differ diff --git a/doc/Corporate_Contributor_License_Agreement-v2.pdf b/doc/Corporate_Contributor_License_Agreement-v2.pdf new file mode 100644 index 00000000..dbeaf37c Binary files /dev/null and b/doc/Corporate_Contributor_License_Agreement-v2.pdf differ diff --git a/doc/Editor.mm b/doc/Editor.mm new file mode 100644 index 00000000..ebcd7a5f --- /dev/null +++ b/doc/Editor.mm @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/additionalObjs.json b/doc/additionalObjs.json index dd734f78..45903778 100644 --- a/doc/additionalObjs.json +++ b/doc/additionalObjs.json @@ -1,24 +1,23 @@ { - "Array" : "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array", - "Boolean" : "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Boolean", - "Date" : "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date", - "Error" : "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Error", - "EvalError" : "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/EvalError", - "RangeError" : "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/RangeError", - "ReferenceError" : "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/ReferenceError", - "SyntaxError" : "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/SyntaxError", - "TypeError" : "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/TypeError", - "URIError" : "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/URIError", - "Function" : "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Function", - "Infinity" : "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Infinity", - "JSON" : "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/JSON", - "Math" : "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math", - "NaN" : "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/NaN", - "Number" : "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number", - "Object" : "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object", - "RegExp" : "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/RegExp", - "String" : "https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String", - + "Array" : "http://www.nodemanual.org/latest/js_doc/Array.html", + "Boolean" : "http://www.nodemanual.org/latest/js_doc/Boolean.html", + "Date" : "http://www.nodemanual.org/latest/js_doc/Date.html", + "Error" : "http://www.nodemanual.org/latest/js_doc/Error.html", + "EvalError" : "http://www.nodemanual.org/latest/js_doc/EvalError.html", + "RangeError" : "http://www.nodemanual.org/latest/js_doc/RangeError.html", + "ReferenceError" : "http://www.nodemanual.org/latest/js_doc/ReferenceError.html", + "SyntaxError" : "http://www.nodemanual.org/latest/js_doc/SyntaxError.html", + "TypeError" : "http://www.nodemanual.org/latest/js_doc/TypeError.html", + "URIError" : "http://www.nodemanual.org/latest/js_doc/URIError.html", + "Function" : "http://www.nodemanual.org/latest/js_doc/Function.html", + "Infinity" : "http://www.nodemanual.org/latest/js_doc/Infinity.html", + "JSON" : "http://www.nodemanual.org/latest/js_doc/JSON.html", + "Math" : "http://www.nodemanual.org/latest/js_doc/Math.html", + "NaN" : "http://www.nodemanual.org/latest/js_doc/NaN.html", + "Number" : "http://www.nodemanual.org/latest/js_doc/Number.html", + "Object" : "http://www.nodemanual.org/latest/js_doc/Object.html", + "RegExp" : "http://www.nodemanual.org/latest/js_doc/RegExp.html", + "String" : "http://www.nodemanual.org/latest/js_doc/String.html", "DOMElement": "https://developer.mozilla.org/en/DOM/element", "Event": "https://github.com/ajaxorg/ace/blob/master/lib/ace/lib/event.js", "TextMode": "https://github.com/ajaxorg/ace/blob/master/lib/ace/mode/text.js", diff --git a/doc/build.js b/doc/build.js index 2b1b469c..fcc6f599 100644 --- a/doc/build.js +++ b/doc/build.js @@ -1,31 +1,23 @@ -var fs = require("fs"); var path = require("path"); + var panino = require("panino"); + var srcPath = __dirname + "/../lib/ace"; -var buildType = process.argv.splice(2)[0]; + +var buildOptions = { + parseOptions: "./parseOptions.json", + additionalObjs: "./additionalObjs.json" +} var options = { title : "Ace API", - parseType : "jsd", - linkFormat : function(linkHtml) { - var href = linkHtml.href; - var o = href.match(/(.+)\.html(#.+)/); - var c = href.match(/#(.+)/); - - if ( o !== null ) { - href = href.replace(href, '#nav=api&api=' + o[1]);// + '§ion=' + o[2]); - } - - linkHtml.href = href; - - return linkHtml; - }, + linkFormat : 'http://example.com/{file}#{line}', output : "../api/", outputAssets : "../api/resources", - skin : "./template/jade/layout.jade", - assets : "./template/resources", + skin : "./resources/ace/templates/layout.jade", + assets : "./resources/ace/skeleton", additionalObjs : "./additionalObjs.json", - exclude : ["**/*_test.js", "**/mode/**", "default_commands.js", "multi_select_commands.js", "**/test/**", "**/theme/**", "**/worker/**"], + exclude : ["**/*_test.js", "**/mode/**", "**/test/**", "**/theme/**", "**/worker/**"], index : "./index.md" }; @@ -36,32 +28,11 @@ panino.parse(files, options, function (err, ast) { console.error(err); process.exit(1); } - - panino.render(buildType || 'html', ast, options, function (err) { + + panino.render('html', ast, options, function (err) { if (err) { console.error(err); process.exit(1); } - - /*fs.readdir(options.output, function (err, files) { - files.forEach(function(file) { - if (file.match(/\.html$/)) { - var outFile = options.output + "/" + file; - fs.readFile(outFile, "utf8", function(err, data) { - var otherPageRegExp = new RegExp('=2.2.0", + "panino" : ">=2.0.1", "asset-smasher": "0.2.0" } } \ No newline at end of file diff --git a/doc/template/resources/csses/ace_api.css b/doc/resources/ace/skeleton/csses/ace_api.css similarity index 81% rename from doc/template/resources/csses/ace_api.css rename to doc/resources/ace/skeleton/csses/ace_api.css index 7a90b4c3..b703b26b 100644 --- a/doc/template/resources/csses/ace_api.css +++ b/doc/resources/ace/skeleton/csses/ace_api.css @@ -1,21 +1,22 @@ /* Generic "affects everything" stuff */ - -#wrapper .content .column2 { - float: none; +body { + min-width: 1010px; + color: #2D2D2D; + background: #EDF5FA url(../images/main_bg.png) 0 0 repeat; } -#documentation ul { +ul { font-size: 13px; } -#documentation li { +li { color: black; } -pre { - background-color: #FFFFFF; +a, a:hover { + color : #00438a; } code { @@ -24,13 +25,14 @@ code { font-family: 'Ubuntu Mono',Monaco,Consolas,monospace !important; background-color: #F9F9F9; border-radius: 3px 3px 3px 3px; + box-shadow: 0 0 2px #888888; display: inline-block; padding: 0 4px; margin: 2px 1px; color: inherit; } -#documentation pre { +pre { margin-top: 10px; border-radius: none; box-shadow: none; @@ -49,27 +51,29 @@ code { background : white; } -#documentation pre code { +pre code { background-color: transparent; border-radius: none; box-shadow: none; } -#documentation a code { +a code { color: #00438a; } -#documentation h2 { +h2 { font-size: 26px; } -#documentation p { +p { font-size: 13px; + line-height : 20px; + margin-bottom : 13px; } -#documentation li p:last-child { +li p:last-child { margin-bottom : 5px; } -#documentation blockquote p{ +blockquote p{ font-size: 14px; font-weight: 500; line-height: 23px; @@ -90,10 +94,6 @@ code { zoom:1; /* hasLayout ie7 trigger */ } -.navbar .nav > li > a { - padding: 10px 15px 11px; -} - .navbar { text-align:center; } @@ -111,8 +111,8 @@ code { margin-left: 0px; } .brand { - background: transparent url(../images/ace_logo_menu.png) no-repeat 33px 5px; - width: 80px; + background: transparent url(../images/ace_logo_menu.png) no-repeat 13px 5px; + width: 105px; outline: none; height: 40px; padding: 0 10px !important; @@ -142,34 +142,25 @@ code { Menu venue */ - -h3.api_title { - padding-top: 10px; -} - ul.menu { - margin-left: 2px; + margin-left: 16px; } .menu li { list-style-image: url(../images/menu_disc.png); - margin-bottom: 4px; - font-weight: 700; - padding-left: 10px; - margin-left: 0; + margin-bottom: 3px; + font-weight : 700; } .menu li .menu-item a.menuLink, .menu li .menu-item span.menuLink { - color: #3E7096; - font-weight: 100; + color: #262626; } .menuTwo { margin-bottom: 5px; margin-top: 2px; } .menuTwo li .menu-item a.menuLink { - color: #3E7096; - font-weight: 100; + color: #262626; } /* need specificity to "beat" the above colors */ @@ -181,6 +172,50 @@ ul.menu { Members and the tabs that represent them */ +.members { +/* width: 800px; */ + /*width: 700px;*/ +/* margin: 0 10px;*/ + + height: 42px; + left: 0; +/* position: fixed;*/ + top: 0; +/* transition-duration: 300ms, 300ms; + transition-property: box-shadow, height; + transition-timing-function: ease-out, ease-out; + -moz-transition-duration: 300ms, 300ms; + -moz-transition-property: -moz-box-shadow, height; + -moz-transition-timing-function: ease-out, ease-out; + -o-transition-duration: 300ms, 300ms; + -o-transition-property: -o-box-shadow, height; + -o-transition-timing-function: ease-out, ease-out; + -webkit-transition-duration: 300ms, 300ms; + -webkit-transition-property: -webkit-box-shadow, height; + -webkit-transition-timing-function: ease-out, ease-out;*/ +/* width: 100%;*/ + /*transition-duration: 300ms; + transition-property: box-shadow; + transition-timing-function: ease-out; + -moz-transition-duration: 300ms, 300ms; + -moz-transition-property: -moz-box-shadow, height; + -moz-transition-timing-function: ease-out, ease-out; + -o-transition-duration: 300ms; + -o-transition-property: -o-box-shadow; + -o-transition-timing-function: ease-out;*/ + -webkit-transition-duration: 400ms, 0ms; + -webkit-transition-property: -webkit-box-shadow, background; + -webkit-transition-timing-function: ease-out, ease-out; + z-index: 100; + padding-bottom : 5px; + overflow: visible !important; + +/* background: #FFF; + width: 100%; + padding-bottom: 13px; + top: 40px; + position: fixed;*/ +} .srolled .members { width: 100%; /* -webkit-box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.35); @@ -188,6 +223,7 @@ ul.menu { box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.35); */ padding-bottom: 15px; /* height: 31px;*/ + top: 40px; position: fixed; } .shadow.members{ @@ -234,15 +270,10 @@ ul.menu { } .srolled .membersContent { /*top : 0;*/ - width: 625px; - padding-left: 327px; + width : 695px; + padding-left : 305px; margin : 0 auto 0 auto; } - -.srolled ul.nav { - padding-right: 10px; -} - .membersBackground { /* background-color: white; position: fixed; @@ -276,18 +307,13 @@ ul.menu { } -ul.tabs li:first-child ul{ - left: -63px; -} - .tabs a.menu:after, .tabs .dropdown-toggle:after { margin-top: 22px; } -.nav .dropdown-toggle .caret { - margin-top: 12px; - border-top-color: #6D8CA0; - border-bottom-color: #6D8CA0; +.dropdown .caret { + margin-top: 14px; + color: #6D8CA0; } li.dropdown { @@ -295,12 +321,14 @@ li.dropdown { font-weight: bold; } -.editInC9 { + +.backToMDN, .editInC9 { font-size: 11px; color: #657383; + margin : 0 0 0 5px; } -.editInC9 a { +.backToMDN a, .editInC9 a { color: #657383; font-weight: normal; position : relative; @@ -308,7 +336,7 @@ li.dropdown { } .tabs { - padding-top: 14px; + padding-top: 10px; /*border-bottom: 1px solid #848484;*/ min-height : 27px; padding-bottom : 5px; @@ -335,10 +363,14 @@ li.dropdown { margin-left: 6px; } +.members .tabs ul li { + font-weight: bold; +} + .memberLink a { margin-left: 0 !important; } -.menu-dropdown { +.menu-dropdown, .dropdown-menu { min-width : 105px; max-height: 350px; overflow: auto; @@ -351,6 +383,9 @@ li.dropdown { background-color: #ffffff; color: #000000; } +.dropdown-menu { + border-top: none; +} .tabs a.menu:after, .tabs .dropdown-toggle:after { margin-top: 13px; @@ -398,8 +433,9 @@ li.dropdown { } .tabs .menu-dropdown, .tabs .dropdown-menu { border-radius: 0 0 6px 6px; - left: 10px; - width: 160px; + top: 32px; + right: 0px; + width: 150px; } .srolled .tabs .menu-dropdown, .srolled .tabs .dropdown-menu { top: 32px; @@ -435,6 +471,11 @@ ul.tabs .double ul, ul.tabs .triple ul, ul.tabs .quad ul{ .content { height: 100%; } +.content .row { + width: 1060px; + margin-left: auto; + margin-right: auto; +} header.filler { position: relative; @@ -442,6 +483,11 @@ header.filler { width: 100%; } +.centerpiece { + background: url(../images/sidebar_border.png) repeat-y 230px 0; + height: 100%; +} + /* .container-fluid .row-fluid { width: 1000px; @@ -455,42 +501,44 @@ header.filler { margin-bottom: 3px; } +#sidebarContainer { + margin-right: 60px; +} + +#sidebar { + margin-top: 9px; + /*background: url(../images/sidebar-border.png) repeat-y right 0;*/ + margin-left: 12px; +/* width: 280px;*/ +/* overflow: auto;*/ + padding-right : 10px; +} + #sidebar h3 a, #sidebar h3 a:hover { color: #404040; } -#sidebarContainer { - padding-top: 20px; -} - #mainContent { margin-left: 30px; } #documentation { - padding-top: 35px; padding-bottom: 10px; } #documentation article.article { +/* border-bottom: 1px solid #e9e9e9;*/ border-top: 1px solid #e9e9e9; padding: 16px 10px 2px; - -webkit-transition: padding 0.2s; - -moz-transition: padding 0.2s; - -o-transition: padding 0.2s; } - -#documentation h3.sectionHeader + article.article { - border-top: none; -} - div#documentation article:last-child { border-bottom: 1px solid #e9e9e9; padding-bottom: 40px; } #documentation article.article.methodToggleOpen { background: rgba(255, 255, 255, 0.5); + padding: 20px; font-size: 13px; line-height: 24px; margin: 0 0 10px 0; @@ -615,7 +663,7 @@ li.signature { cursor: pointer; } -#documentation .signature-call a { +.signature-call a { color: #8e487e; } @@ -626,7 +674,7 @@ li.signature { .eventObjName { font-style: italic; } -.eventListenerStart, .eventListenerClose, .eventFunctionOpen, .eventFunctionClose { +.eventListenerStart, .eventFunctionOpen, .eventFunctionClose { color: #999999; } .eventMember { @@ -662,19 +710,14 @@ li.signature { text-transform: capitalize; } -.undocumented { - background-color: #B94A48; - color: #ffffff; -} - -#documentation .alias a, #documentation .related-to a { +.alias a, .related-to a { color: #ffffff; /* text-decoration: underline; */ } -#documentation .alias a:hover, #documentation .related-to a:hover { +.alias a:hover, .related-to a:hover { text-decoration: none; } -.#documentation alias:hover, #documentation .related-to:hover { +.alias:hover, .related-to:hover { opacity: 0.8; cursor: pointer; } @@ -698,8 +741,8 @@ li.signature { color: #ffffff; } .description h4 { - padding-top: 10px; font-size: 18px; + margin: 20px 0 10px; line-height : 18px; } @@ -722,34 +765,15 @@ li.signature { Everyday I'm togglin' */ -#documentation i.methodToggle { - cursor: pointer; - color: #9f9f9f; - padding-top: 2px; - float: left; +#documentation h3 { + font-size: 24px; + margin-top: 5px; } -#documentation i.methodToggle.methodToggleHover { - text-shadow: 0 0 10px #4699d5; - color: #4699d5; +#documentation h3.methodToggle { + margin: 0; } -#documentation i.methodToggle.active { - text-shadow: 0 0 10px #4699d5; - color: #4699d5; - /* Safari */ - -webkit-transform: rotate(45deg); - - /* Firefox */ - -moz-transform: rotate(45deg); - - /* IE */ - -ms-transform: rotate(45deg); - - /* Opera */ - -o-transform: rotate(45deg); - padding-top: 9px; -} - #documentation h3.sectionHeader { + margin: 10px 0 17px 0; line-height : 24px; } @@ -910,3 +934,25 @@ body #dsq-reply h3{ #dsq-global-toolbar, #dsq-pagination, .dsq-trackback-url{ display : none; } + +/* Sticky footer stuff */ + +* { + margin: 0; +} +html, body { + height: 100%; +} +#nonFooter { + height: 100%; + margin: 0 auto -40px; /* the bottom margin is the negative value of the footer's height */ +} +div.push { + height: 40px; /* .push must be the same height as .footer */ +} +#footer, div.push { +clear: both; +} +#footer { + margin-top: 40px; +} \ No newline at end of file diff --git a/doc/resources/ace/skeleton/csses/bootstrap.min.css b/doc/resources/ace/skeleton/csses/bootstrap.min.css new file mode 100644 index 00000000..c9514677 --- /dev/null +++ b/doc/resources/ace/skeleton/csses/bootstrap.min.css @@ -0,0 +1,689 @@ +article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block;} +audio,canvas,video{display:inline-block;*display:inline;*zoom:1;} +audio:not([controls]){display:none;} +html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;} +a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;} +a:hover,a:active{outline:0;} +sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline;} +sup{top:-0.5em;} +sub{bottom:-0.25em;} +img{height:auto;border:0;-ms-interpolation-mode:bicubic;vertical-align:middle;} +button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle;} +button,input{*overflow:visible;line-height:normal;} +button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0;} +button,input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button;} +input[type="search"]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;} +input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none;} +textarea{overflow:auto;vertical-align:top;} +.clearfix{*zoom:1;}.clearfix:before,.clearfix:after{display:table;content:"";} +.clearfix:after{clear:both;} +.hide-text{overflow:hidden;text-indent:100%;white-space:nowrap;} +.input-block-level{display:block;width:100%;min-height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;} +body{margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;line-height:18px;color:#333333;background-color:#ffffff;} +a{color:#0088cc;text-decoration:none;} +a:hover{color:#005580;text-decoration:underline;} +.row{margin-left:-20px;*zoom:1;}.row:before,.row:after{display:table;content:"";} +.row:after{clear:both;} +[class*="span"]{float:left;margin-left:20px;} +.container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px;} +.span12{width:940px;} +.span11{width:860px;} +.span10{width:780px;} +.span9{width:700px;} +.span8{width:620px;} +.span7{width:540px;} +.span6{width:460px;} +.span5{width:380px;} +.span4{width:300px;} +.span3{width:220px;} +.span2{width:140px;} +.span1{width:60px;} +.offset12{margin-left:980px;} +.offset11{margin-left:900px;} +.offset10{margin-left:820px;} +.offset9{margin-left:740px;} +.offset8{margin-left:660px;} +.offset7{margin-left:580px;} +.offset6{margin-left:500px;} +.offset5{margin-left:420px;} +.offset4{margin-left:340px;} +.offset3{margin-left:260px;} +.offset2{margin-left:180px;} +.offset1{margin-left:100px;} +.row-fluid{width:100%;*zoom:1;}.row-fluid:before,.row-fluid:after{display:table;content:"";} +.row-fluid:after{clear:both;} +.row-fluid>[class*="span"]{float:left;margin-left:2.127659574%;} +.row-fluid>[class*="span"]:first-child{margin-left:0;} +.row-fluid > .span12{width:99.99999998999999%;} +.row-fluid > .span11{width:91.489361693%;} +.row-fluid > .span10{width:82.97872339599999%;} +.row-fluid > .span9{width:74.468085099%;} +.row-fluid > .span8{width:65.95744680199999%;} +.row-fluid > .span7{width:57.446808505%;} +.row-fluid > .span6{width:48.93617020799999%;} +.row-fluid > .span5{width:40.425531911%;} +.row-fluid > .span4{width:31.914893614%;} +.row-fluid > .span3{width:23.404255317%;} +.row-fluid > .span2{width:14.89361702%;} +.row-fluid > .span1{width:6.382978723%;} +.container{margin-left:auto;margin-right:auto;*zoom:1;}.container:before,.container:after{display:table;content:"";} +.container:after{clear:both;} +.container-fluid{padding-left:20px;padding-right:20px;*zoom:1;}.container-fluid:before,.container-fluid:after{display:table;content:"";} +.container-fluid:after{clear:both;} +p{margin:0 0 9px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;line-height:18px;}p small{font-size:11px;color:#999999;} +.lead{margin-bottom:18px;font-size:20px;font-weight:200;line-height:27px;} +h1,h2,h3,h4,h5,h6{margin:0;font-family:inherit;font-weight:bold;color:inherit;text-rendering:optimizelegibility;}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{font-weight:normal;color:#999999;} +h1{font-size:30px;line-height:36px;}h1 small{font-size:18px;} +h2{font-size:24px;line-height:36px;}h2 small{font-size:18px;} +h3{line-height:27px;font-size:18px;}h3 small{font-size:14px;} +h4,h5,h6{line-height:18px;} +h4{font-size:14px;}h4 small{font-size:12px;} +h5{font-size:12px;} +h6{font-size:11px;color:#999999;text-transform:uppercase;} +.page-header{padding-bottom:17px;margin:18px 0;border-bottom:1px solid #eeeeee;} +.page-header h1{line-height:1;} +ul,ol{padding:0;margin:0 0 9px 25px;} +ul ul,ul ol,ol ol,ol ul{margin-bottom:0;} +ul{list-style:disc;} +ol{list-style:decimal;} +li{line-height:18px;} +ul.unstyled,ol.unstyled{margin-left:0;list-style:none;} +dl{margin-bottom:18px;} +dt,dd{line-height:18px;} +dt{font-weight:bold;line-height:17px;} +dd{margin-left:9px;} +.dl-horizontal dt{float:left;clear:left;width:120px;text-align:right;} +.dl-horizontal dd{margin-left:130px;} +hr{margin:18px 0;border:0;border-top:1px solid #eeeeee;border-bottom:1px solid #ffffff;} +strong{font-weight:bold;} +em{font-style:italic;} +.muted{color:#999999;} +abbr[title]{border-bottom:1px dotted #ddd;cursor:help;} +abbr.initialism{font-size:90%;text-transform:uppercase;} +blockquote{padding:0 0 0 15px;margin:0 0 18px;border-left:5px solid #eeeeee;}blockquote p{margin-bottom:0;font-size:16px;font-weight:300;line-height:22.5px;} +blockquote small{display:block;line-height:18px;color:#999999;}blockquote small:before{content:'\2014 \00A0';} +blockquote.pull-right{float:right;padding-left:0;padding-right:15px;border-left:0;border-right:5px solid #eeeeee;}blockquote.pull-right p,blockquote.pull-right small{text-align:right;} +q:before,q:after,blockquote:before,blockquote:after{content:"";} +address{display:block;margin-bottom:18px;line-height:18px;font-style:normal;} +small{font-size:100%;} +cite{font-style:normal;} +code,pre{padding:0 3px 2px;font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;color:#333333;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} +code{padding:2px 4px;color:#d14;background-color:#f7f7f9;border:1px solid #e1e1e8;} +pre{display:block;padding:8.5px;margin:0 0 9px;font-size:12.025px;line-height:18px;background-color:#f5f5f5;border:1px solid #ccc;border:1px solid rgba(0, 0, 0, 0.15);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;white-space:pre;white-space:pre-wrap;word-break:break-all;word-wrap:break-word;}pre.prettyprint{margin-bottom:18px;} +pre code{padding:0;color:inherit;background-color:transparent;border:0;} +.pre-scrollable{max-height:340px;overflow-y:scroll;} +form{margin:0 0 18px;} +fieldset{padding:0;margin:0;border:0;} +legend{display:block;width:100%;padding:0;margin-bottom:27px;font-size:19.5px;line-height:36px;color:#333333;border:0;border-bottom:1px solid #eee;}legend small{font-size:13.5px;color:#999999;} +label,input,button,select,textarea{font-size:13px;font-weight:normal;line-height:18px;} +input,button,select,textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;} +label{display:block;margin-bottom:5px;color:#333333;} +input,textarea,select,.uneditable-input{display:inline-block;width:210px;height:18px;padding:4px;margin-bottom:9px;font-size:13px;line-height:18px;color:#555555;border:1px solid #cccccc;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} +.uneditable-textarea{width:auto;height:auto;} +label input,label textarea,label select{display:block;} +input[type="image"],input[type="checkbox"],input[type="radio"]{width:auto;height:auto;padding:0;margin:3px 0;*margin-top:0;line-height:normal;cursor:pointer;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;border:0 \9;} +input[type="image"]{border:0;} +input[type="file"]{width:auto;padding:initial;line-height:initial;border:initial;background-color:#ffffff;background-color:initial;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;} +input[type="button"],input[type="reset"],input[type="submit"]{width:auto;height:auto;} +select,input[type="file"]{height:28px;*margin-top:4px;line-height:28px;} +input[type="file"]{line-height:18px \9;} +select{width:220px;background-color:#ffffff;} +select[multiple],select[size]{height:auto;} +input[type="image"]{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;} +textarea{height:auto;} +input[type="hidden"]{display:none;} +.radio,.checkbox{padding-left:18px;} +.radio input[type="radio"],.checkbox input[type="checkbox"]{float:left;margin-left:-18px;} +.controls>.radio:first-child,.controls>.checkbox:first-child{padding-top:5px;} +.radio.inline,.checkbox.inline{display:inline-block;padding-top:5px;margin-bottom:0;vertical-align:middle;} +.radio.inline+.radio.inline,.checkbox.inline+.checkbox.inline{margin-left:10px;} +input,textarea{-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-webkit-transition:border linear 0.2s,box-shadow linear 0.2s;-moz-transition:border linear 0.2s,box-shadow linear 0.2s;-ms-transition:border linear 0.2s,box-shadow linear 0.2s;-o-transition:border linear 0.2s,box-shadow linear 0.2s;transition:border linear 0.2s,box-shadow linear 0.2s;} +input:focus,textarea:focus{border-color:rgba(82, 168, 236, 0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 8px rgba(82, 168, 236, 0.6);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 8px rgba(82, 168, 236, 0.6);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075),0 0 8px rgba(82, 168, 236, 0.6);outline:0;outline:thin dotted \9;} +input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus,select:focus{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;} +.input-mini{width:60px;} +.input-small{width:90px;} +.input-medium{width:150px;} +.input-large{width:210px;} +.input-xlarge{width:270px;} +.input-xxlarge{width:530px;} +input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input{float:none;margin-left:0;} +input,textarea,.uneditable-input{margin-left:0;} +input.span12, textarea.span12, .uneditable-input.span12{width:930px;} +input.span11, textarea.span11, .uneditable-input.span11{width:850px;} +input.span10, textarea.span10, .uneditable-input.span10{width:770px;} +input.span9, textarea.span9, .uneditable-input.span9{width:690px;} +input.span8, textarea.span8, .uneditable-input.span8{width:610px;} +input.span7, textarea.span7, .uneditable-input.span7{width:530px;} +input.span6, textarea.span6, .uneditable-input.span6{width:450px;} +input.span5, textarea.span5, .uneditable-input.span5{width:370px;} +input.span4, textarea.span4, .uneditable-input.span4{width:290px;} +input.span3, textarea.span3, .uneditable-input.span3{width:210px;} +input.span2, textarea.span2, .uneditable-input.span2{width:130px;} +input.span1, textarea.span1, .uneditable-input.span1{width:50px;} +input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{background-color:#eeeeee;border-color:#ddd;cursor:not-allowed;} +.control-group.warning>label,.control-group.warning .help-block,.control-group.warning .help-inline{color:#c09853;} +.control-group.warning input,.control-group.warning select,.control-group.warning textarea{color:#c09853;border-color:#c09853;}.control-group.warning input:focus,.control-group.warning select:focus,.control-group.warning textarea:focus{border-color:#a47e3c;-webkit-box-shadow:0 0 6px #dbc59e;-moz-box-shadow:0 0 6px #dbc59e;box-shadow:0 0 6px #dbc59e;} +.control-group.warning .input-prepend .add-on,.control-group.warning .input-append .add-on{color:#c09853;background-color:#fcf8e3;border-color:#c09853;} +.control-group.error>label,.control-group.error .help-block,.control-group.error .help-inline{color:#b94a48;} +.control-group.error input,.control-group.error select,.control-group.error textarea{color:#b94a48;border-color:#b94a48;}.control-group.error input:focus,.control-group.error select:focus,.control-group.error textarea:focus{border-color:#953b39;-webkit-box-shadow:0 0 6px #d59392;-moz-box-shadow:0 0 6px #d59392;box-shadow:0 0 6px #d59392;} +.control-group.error .input-prepend .add-on,.control-group.error .input-append .add-on{color:#b94a48;background-color:#f2dede;border-color:#b94a48;} +.control-group.success>label,.control-group.success .help-block,.control-group.success .help-inline{color:#468847;} +.control-group.success input,.control-group.success select,.control-group.success textarea{color:#468847;border-color:#468847;}.control-group.success input:focus,.control-group.success select:focus,.control-group.success textarea:focus{border-color:#356635;-webkit-box-shadow:0 0 6px #7aba7b;-moz-box-shadow:0 0 6px #7aba7b;box-shadow:0 0 6px #7aba7b;} +.control-group.success .input-prepend .add-on,.control-group.success .input-append .add-on{color:#468847;background-color:#dff0d8;border-color:#468847;} +input:focus:required:invalid,textarea:focus:required:invalid,select:focus:required:invalid{color:#b94a48;border-color:#ee5f5b;}input:focus:required:invalid:focus,textarea:focus:required:invalid:focus,select:focus:required:invalid:focus{border-color:#e9322d;-webkit-box-shadow:0 0 6px #f8b9b7;-moz-box-shadow:0 0 6px #f8b9b7;box-shadow:0 0 6px #f8b9b7;} +.form-actions{padding:17px 20px 18px;margin-top:18px;margin-bottom:18px;background-color:#eeeeee;border-top:1px solid #ddd;*zoom:1;}.form-actions:before,.form-actions:after{display:table;content:"";} +.form-actions:after{clear:both;} +.uneditable-input{display:block;background-color:#ffffff;border-color:#eee;-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);-moz-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);cursor:not-allowed;} +:-moz-placeholder{color:#999999;} +::-webkit-input-placeholder{color:#999999;} +.help-block,.help-inline{color:#555555;} +.help-block{display:block;margin-bottom:9px;} +.help-inline{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;padding-left:5px;} +.input-prepend,.input-append{margin-bottom:5px;}.input-prepend input,.input-append input,.input-prepend select,.input-append select,.input-prepend .uneditable-input,.input-append .uneditable-input{*margin-left:0;-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0;}.input-prepend input:focus,.input-append input:focus,.input-prepend select:focus,.input-append select:focus,.input-prepend .uneditable-input:focus,.input-append .uneditable-input:focus{position:relative;z-index:2;} +.input-prepend .uneditable-input,.input-append .uneditable-input{border-left-color:#ccc;} +.input-prepend .add-on,.input-append .add-on{display:inline-block;width:auto;min-width:16px;height:18px;padding:4px 5px;font-weight:normal;line-height:18px;text-align:center;text-shadow:0 1px 0 #ffffff;vertical-align:middle;background-color:#eeeeee;border:1px solid #ccc;} +.input-prepend .add-on,.input-append .add-on,.input-prepend .btn,.input-append .btn{-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;} +.input-prepend .active,.input-append .active{background-color:#a9dba9;border-color:#46a546;} +.input-prepend .add-on,.input-prepend .btn{margin-right:-1px;} +.input-append input,.input-append select .uneditable-input{-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;} +.input-append .uneditable-input{border-left-color:#eee;border-right-color:#ccc;} +.input-append .add-on,.input-append .btn{margin-left:-1px;-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0;} +.input-prepend.input-append input,.input-prepend.input-append select,.input-prepend.input-append .uneditable-input{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} +.input-prepend.input-append .add-on:first-child,.input-prepend.input-append .btn:first-child{margin-right:-1px;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;} +.input-prepend.input-append .add-on:last-child,.input-prepend.input-append .btn:last-child{margin-left:-1px;-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0;} +.search-query{padding-left:14px;padding-right:14px;margin-bottom:0;-webkit-border-radius:14px;-moz-border-radius:14px;border-radius:14px;} +.form-search input,.form-inline input,.form-horizontal input,.form-search textarea,.form-inline textarea,.form-horizontal textarea,.form-search select,.form-inline select,.form-horizontal select,.form-search .help-inline,.form-inline .help-inline,.form-horizontal .help-inline,.form-search .uneditable-input,.form-inline .uneditable-input,.form-horizontal .uneditable-input,.form-search .input-prepend,.form-inline .input-prepend,.form-horizontal .input-prepend,.form-search .input-append,.form-inline .input-append,.form-horizontal .input-append{display:inline-block;margin-bottom:0;} +.form-search .hide,.form-inline .hide,.form-horizontal .hide{display:none;} +.form-search label,.form-inline label{display:inline-block;} +.form-search .input-append,.form-inline .input-append,.form-search .input-prepend,.form-inline .input-prepend{margin-bottom:0;} +.form-search .radio,.form-search .checkbox,.form-inline .radio,.form-inline .checkbox{padding-left:0;margin-bottom:0;vertical-align:middle;} +.form-search .radio input[type="radio"],.form-search .checkbox input[type="checkbox"],.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{float:left;margin-left:0;margin-right:3px;} +.control-group{margin-bottom:9px;} +legend+.control-group{margin-top:18px;-webkit-margin-top-collapse:separate;} +.form-horizontal .control-group{margin-bottom:18px;*zoom:1;}.form-horizontal .control-group:before,.form-horizontal .control-group:after{display:table;content:"";} +.form-horizontal .control-group:after{clear:both;} +.form-horizontal .control-label{float:left;width:140px;padding-top:5px;text-align:right;} +.form-horizontal .controls{margin-left:160px;*display:inline-block;*margin-left:0;*padding-left:20px;} +.form-horizontal .help-block{margin-top:9px;margin-bottom:0;} +.form-horizontal .form-actions{padding-left:160px;} +table{max-width:100%;border-collapse:collapse;border-spacing:0;background-color:transparent;} +.table{width:100%;margin-bottom:18px;}.table th,.table td{padding:8px;line-height:18px;text-align:left;vertical-align:top;border-top:1px solid #dddddd;} +.table th{font-weight:bold;} +.table thead th{vertical-align:bottom;} +.table colgroup+thead tr:first-child th,.table colgroup+thead tr:first-child td,.table thead:first-child tr:first-child th,.table thead:first-child tr:first-child td{border-top:0;} +.table tbody+tbody{border-top:2px solid #dddddd;} +.table-condensed th,.table-condensed td{padding:4px 5px;} +.table-bordered{border:1px solid #dddddd;border-left:0;border-collapse:separate;*border-collapse:collapsed;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}.table-bordered th,.table-bordered td{border-left:1px solid #dddddd;} +.table-bordered thead:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child td{border-top:0;} +.table-bordered thead:first-child tr:first-child th:first-child,.table-bordered tbody:first-child tr:first-child td:first-child{-webkit-border-radius:4px 0 0 0;-moz-border-radius:4px 0 0 0;border-radius:4px 0 0 0;} +.table-bordered thead:first-child tr:first-child th:last-child,.table-bordered tbody:first-child tr:first-child td:last-child{-webkit-border-radius:0 4px 0 0;-moz-border-radius:0 4px 0 0;border-radius:0 4px 0 0;} +.table-bordered thead:last-child tr:last-child th:first-child,.table-bordered tbody:last-child tr:last-child td:first-child{-webkit-border-radius:0 0 0 4px;-moz-border-radius:0 0 0 4px;border-radius:0 0 0 4px;} +.table-bordered thead:last-child tr:last-child th:last-child,.table-bordered tbody:last-child tr:last-child td:last-child{-webkit-border-radius:0 0 4px 0;-moz-border-radius:0 0 4px 0;border-radius:0 0 4px 0;} +.table-striped tbody tr:nth-child(odd) td,.table-striped tbody tr:nth-child(odd) th{background-color:#f9f9f9;} +.table tbody tr:hover td,.table tbody tr:hover th{background-color:#f5f5f5;} +table .span1{float:none;width:44px;margin-left:0;} +table .span2{float:none;width:124px;margin-left:0;} +table .span3{float:none;width:204px;margin-left:0;} +table .span4{float:none;width:284px;margin-left:0;} +table .span5{float:none;width:364px;margin-left:0;} +table .span6{float:none;width:444px;margin-left:0;} +table .span7{float:none;width:524px;margin-left:0;} +table .span8{float:none;width:604px;margin-left:0;} +table .span9{float:none;width:684px;margin-left:0;} +table .span10{float:none;width:764px;margin-left:0;} +table .span11{float:none;width:844px;margin-left:0;} +table .span12{float:none;width:924px;margin-left:0;} +table .span13{float:none;width:1004px;margin-left:0;} +table .span14{float:none;width:1084px;margin-left:0;} +table .span15{float:none;width:1164px;margin-left:0;} +table .span16{float:none;width:1244px;margin-left:0;} +table .span17{float:none;width:1324px;margin-left:0;} +table .span18{float:none;width:1404px;margin-left:0;} +table .span19{float:none;width:1484px;margin-left:0;} +table .span20{float:none;width:1564px;margin-left:0;} +table .span21{float:none;width:1644px;margin-left:0;} +table .span22{float:none;width:1724px;margin-left:0;} +table .span23{float:none;width:1804px;margin-left:0;} +table .span24{float:none;width:1884px;margin-left:0;} +[class^="icon-"],[class*=" icon-"]{display:inline-block;width:14px;height:14px;line-height:14px;vertical-align:text-top;background-image:url("../img/glyphicons-halflings.png");background-position:14px 14px;background-repeat:no-repeat;*margin-right:.3em;}[class^="icon-"]:last-child,[class*=" icon-"]:last-child{*margin-left:0;} +.icon-white{background-image:url("../img/glyphicons-halflings-white.png");} +.icon-glass{background-position:0 0;} +.icon-music{background-position:-24px 0;} +.icon-search{background-position:-48px 0;} +.icon-envelope{background-position:-72px 0;} +.icon-heart{background-position:-96px 0;} +.icon-star{background-position:-120px 0;} +.icon-star-empty{background-position:-144px 0;} +.icon-user{background-position:-168px 0;} +.icon-film{background-position:-192px 0;} +.icon-th-large{background-position:-216px 0;} +.icon-th{background-position:-240px 0;} +.icon-th-list{background-position:-264px 0;} +.icon-ok{background-position:-288px 0;} +.icon-remove{background-position:-312px 0;} +.icon-zoom-in{background-position:-336px 0;} +.icon-zoom-out{background-position:-360px 0;} +.icon-off{background-position:-384px 0;} +.icon-signal{background-position:-408px 0;} +.icon-cog{background-position:-432px 0;} +.icon-trash{background-position:-456px 0;} +.icon-home{background-position:0 -24px;} +.icon-file{background-position:-24px -24px;} +.icon-time{background-position:-48px -24px;} +.icon-road{background-position:-72px -24px;} +.icon-download-alt{background-position:-96px -24px;} +.icon-download{background-position:-120px -24px;} +.icon-upload{background-position:-144px -24px;} +.icon-inbox{background-position:-168px -24px;} +.icon-play-circle{background-position:-192px -24px;} +.icon-repeat{background-position:-216px -24px;} +.icon-refresh{background-position:-240px -24px;} +.icon-list-alt{background-position:-264px -24px;} +.icon-lock{background-position:-287px -24px;} +.icon-flag{background-position:-312px -24px;} +.icon-headphones{background-position:-336px -24px;} +.icon-volume-off{background-position:-360px -24px;} +.icon-volume-down{background-position:-384px -24px;} +.icon-volume-up{background-position:-408px -24px;} +.icon-qrcode{background-position:-432px -24px;} +.icon-barcode{background-position:-456px -24px;} +.icon-tag{background-position:0 -48px;} +.icon-tags{background-position:-25px -48px;} +.icon-book{background-position:-48px -48px;} +.icon-bookmark{background-position:-72px -48px;} +.icon-print{background-position:-96px -48px;} +.icon-camera{background-position:-120px -48px;} +.icon-font{background-position:-144px -48px;} +.icon-bold{background-position:-167px -48px;} +.icon-italic{background-position:-192px -48px;} +.icon-text-height{background-position:-216px -48px;} +.icon-text-width{background-position:-240px -48px;} +.icon-align-left{background-position:-264px -48px;} +.icon-align-center{background-position:-288px -48px;} +.icon-align-right{background-position:-312px -48px;} +.icon-align-justify{background-position:-336px -48px;} +.icon-list{background-position:-360px -48px;} +.icon-indent-left{background-position:-384px -48px;} +.icon-indent-right{background-position:-408px -48px;} +.icon-facetime-video{background-position:-432px -48px;} +.icon-picture{background-position:-456px -48px;} +.icon-pencil{background-position:0 -72px;} +.icon-map-marker{background-position:-24px -72px;} +.icon-adjust{background-position:-48px -72px;} +.icon-tint{background-position:-72px -72px;} +.icon-edit{background-position:-96px -72px;} +.icon-share{background-position:-120px -72px;} +.icon-check{background-position:-144px -72px;} +.icon-move{background-position:-168px -72px;} +.icon-step-backward{background-position:-192px -72px;} +.icon-fast-backward{background-position:-216px -72px;} +.icon-backward{background-position:-240px -72px;} +.icon-play{background-position:-264px -72px;} +.icon-pause{background-position:-288px -72px;} +.icon-stop{background-position:-312px -72px;} +.icon-forward{background-position:-336px -72px;} +.icon-fast-forward{background-position:-360px -72px;} +.icon-step-forward{background-position:-384px -72px;} +.icon-eject{background-position:-408px -72px;} +.icon-chevron-left{background-position:-432px -72px;} +.icon-chevron-right{background-position:-456px -72px;} +.icon-plus-sign{background-position:0 -96px;} +.icon-minus-sign{background-position:-24px -96px;} +.icon-remove-sign{background-position:-48px -96px;} +.icon-ok-sign{background-position:-72px -96px;} +.icon-question-sign{background-position:-96px -96px;} +.icon-info-sign{background-position:-120px -96px;} +.icon-screenshot{background-position:-144px -96px;} +.icon-remove-circle{background-position:-168px -96px;} +.icon-ok-circle{background-position:-192px -96px;} +.icon-ban-circle{background-position:-216px -96px;} +.icon-arrow-left{background-position:-240px -96px;} +.icon-arrow-right{background-position:-264px -96px;} +.icon-arrow-up{background-position:-289px -96px;} +.icon-arrow-down{background-position:-312px -96px;} +.icon-share-alt{background-position:-336px -96px;} +.icon-resize-full{background-position:-360px -96px;} +.icon-resize-small{background-position:-384px -96px;} +.icon-plus{background-position:-408px -96px;} +.icon-minus{background-position:-433px -96px;} +.icon-asterisk{background-position:-456px -96px;} +.icon-exclamation-sign{background-position:0 -120px;} +.icon-gift{background-position:-24px -120px;} +.icon-leaf{background-position:-48px -120px;} +.icon-fire{background-position:-72px -120px;} +.icon-eye-open{background-position:-96px -120px;} +.icon-eye-close{background-position:-120px -120px;} +.icon-warning-sign{background-position:-144px -120px;} +.icon-plane{background-position:-168px -120px;} +.icon-calendar{background-position:-192px -120px;} +.icon-random{background-position:-216px -120px;} +.icon-comment{background-position:-240px -120px;} +.icon-magnet{background-position:-264px -120px;} +.icon-chevron-up{background-position:-288px -120px;} +.icon-chevron-down{background-position:-313px -119px;} +.icon-retweet{background-position:-336px -120px;} +.icon-shopping-cart{background-position:-360px -120px;} +.icon-folder-close{background-position:-384px -120px;} +.icon-folder-open{background-position:-408px -120px;} +.icon-resize-vertical{background-position:-432px -119px;} +.icon-resize-horizontal{background-position:-456px -118px;} +.dropdown{position:relative;} +.dropdown-toggle{*margin-bottom:-3px;} +.dropdown-toggle:active,.open .dropdown-toggle{outline:0;} +.caret{display:inline-block;width:0;height:0;vertical-align:top;border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid #000000;opacity:0.3;filter:alpha(opacity=30);content:"";} +.dropdown .caret{margin-top:8px;margin-left:2px;} +.dropdown:hover .caret,.open.dropdown .caret{opacity:1;filter:alpha(opacity=100);} +.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;float:left;display:none;min-width:160px;padding:4px 0;margin:0;list-style:none;background-color:#ffffff;border-color:#ccc;border-color:rgba(0, 0, 0, 0.2);border-style:solid;border-width:1px;-webkit-border-radius:0 0 5px 5px;-moz-border-radius:0 0 5px 5px;border-radius:0 0 5px 5px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box;*border-right-width:2px;*border-bottom-width:2px;}.dropdown-menu.pull-right{right:0;left:auto;} +.dropdown-menu .divider{height:1px;margin:8px 1px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #ffffff;*width:100%;*margin:-5px 0 5px;} +.dropdown-menu a{display:block;padding:3px 15px;clear:both;font-weight:normal;line-height:18px;color:#333333;white-space:nowrap;} +.dropdown-menu li>a:hover,.dropdown-menu .active>a,.dropdown-menu .active>a:hover{color:#ffffff;text-decoration:none;background-color:#0088cc;} +.dropdown.open{*z-index:1000;}.dropdown.open .dropdown-toggle{color:#ffffff;background:#ccc;background:rgba(0, 0, 0, 0.3);} +.dropdown.open .dropdown-menu{display:block;} +.pull-right .dropdown-menu{left:auto;right:0;} +.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid #000000;content:"\2191";} +.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px;} +.typeahead{margin-top:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} +.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #eee;border:1px solid rgba(0, 0, 0, 0.05);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);}.well blockquote{border-color:#ddd;border-color:rgba(0, 0, 0, 0.15);} +.well-large{padding:24px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;} +.well-small{padding:9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} +.fade{-webkit-transition:opacity 0.15s linear;-moz-transition:opacity 0.15s linear;-ms-transition:opacity 0.15s linear;-o-transition:opacity 0.15s linear;transition:opacity 0.15s linear;opacity:0;}.fade.in{opacity:1;} +.collapse{-webkit-transition:height 0.35s ease;-moz-transition:height 0.35s ease;-ms-transition:height 0.35s ease;-o-transition:height 0.35s ease;transition:height 0.35s ease;position:relative;overflow:hidden;height:0;}.collapse.in{height:auto;} +.close{float:right;font-size:20px;font-weight:bold;line-height:18px;color:#000000;text-shadow:0 1px 0 #ffffff;opacity:0.2;filter:alpha(opacity=20);}.close:hover{color:#000000;text-decoration:none;opacity:0.4;filter:alpha(opacity=40);cursor:pointer;} +.btn{display:inline-block;*display:inline;*zoom:1;padding:4px 10px 4px;margin-bottom:0;font-size:13px;line-height:18px;color:#333333;text-align:center;text-shadow:0 1px 1px rgba(255, 255, 255, 0.75);vertical-align:middle;background-color:#f5f5f5;background-image:-moz-linear-gradient(top, #ffffff, #e6e6e6);background-image:-ms-linear-gradient(top, #ffffff, #e6e6e6);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));background-image:-webkit-linear-gradient(top, #ffffff, #e6e6e6);background-image:-o-linear-gradient(top, #ffffff, #e6e6e6);background-image:linear-gradient(top, #ffffff, #e6e6e6);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0);border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);filter:progid:dximagetransform.microsoft.gradient(enabled=false);border:1px solid #cccccc;border-bottom-color:#b3b3b3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);cursor:pointer;*margin-left:.3em;}.btn:hover,.btn:active,.btn.active,.btn.disabled,.btn[disabled]{background-color:#e6e6e6;} +.btn:active,.btn.active{background-color:#cccccc \9;} +.btn:first-child{*margin-left:0;} +.btn:hover{color:#333333;text-decoration:none;background-color:#e6e6e6;background-position:0 -15px;-webkit-transition:background-position 0.1s linear;-moz-transition:background-position 0.1s linear;-ms-transition:background-position 0.1s linear;-o-transition:background-position 0.1s linear;transition:background-position 0.1s linear;} +.btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;} +.btn.active,.btn:active{background-image:none;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);background-color:#e6e6e6;background-color:#d9d9d9 \9;outline:0;} +.btn.disabled,.btn[disabled]{cursor:default;background-image:none;background-color:#e6e6e6;opacity:0.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;} +.btn-large{padding:9px 14px;font-size:15px;line-height:normal;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;} +.btn-large [class^="icon-"]{margin-top:1px;} +.btn-small{padding:5px 9px;font-size:11px;line-height:16px;} +.btn-small [class^="icon-"]{margin-top:-1px;} +.btn-mini{padding:2px 6px;font-size:11px;line-height:14px;} +.btn-primary,.btn-primary:hover,.btn-warning,.btn-warning:hover,.btn-danger,.btn-danger:hover,.btn-success,.btn-success:hover,.btn-info,.btn-info:hover,.btn-inverse,.btn-inverse:hover{text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);color:#ffffff;} +.btn-primary.active,.btn-warning.active,.btn-danger.active,.btn-success.active,.btn-info.active,.btn-inverse.active{color:rgba(255, 255, 255, 0.75);} +.btn-primary{background-color:#0074cc;background-image:-moz-linear-gradient(top, #0088cc, #0055cc);background-image:-ms-linear-gradient(top, #0088cc, #0055cc);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0055cc));background-image:-webkit-linear-gradient(top, #0088cc, #0055cc);background-image:-o-linear-gradient(top, #0088cc, #0055cc);background-image:linear-gradient(top, #0088cc, #0055cc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0055cc', GradientType=0);border-color:#0055cc #0055cc #003580;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);filter:progid:dximagetransform.microsoft.gradient(enabled=false);}.btn-primary:hover,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled]{background-color:#0055cc;} +.btn-primary:active,.btn-primary.active{background-color:#004099 \9;} +.btn-warning{background-color:#faa732;background-image:-moz-linear-gradient(top, #fbb450, #f89406);background-image:-ms-linear-gradient(top, #fbb450, #f89406);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));background-image:-webkit-linear-gradient(top, #fbb450, #f89406);background-image:-o-linear-gradient(top, #fbb450, #f89406);background-image:linear-gradient(top, #fbb450, #f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fbb450', endColorstr='#f89406', GradientType=0);border-color:#f89406 #f89406 #ad6704;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);filter:progid:dximagetransform.microsoft.gradient(enabled=false);}.btn-warning:hover,.btn-warning:active,.btn-warning.active,.btn-warning.disabled,.btn-warning[disabled]{background-color:#f89406;} +.btn-warning:active,.btn-warning.active{background-color:#c67605 \9;} +.btn-danger{background-color:#da4f49;background-image:-moz-linear-gradient(top, #ee5f5b, #bd362f);background-image:-ms-linear-gradient(top, #ee5f5b, #bd362f);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f));background-image:-webkit-linear-gradient(top, #ee5f5b, #bd362f);background-image:-o-linear-gradient(top, #ee5f5b, #bd362f);background-image:linear-gradient(top, #ee5f5b, #bd362f);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#bd362f', GradientType=0);border-color:#bd362f #bd362f #802420;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);filter:progid:dximagetransform.microsoft.gradient(enabled=false);}.btn-danger:hover,.btn-danger:active,.btn-danger.active,.btn-danger.disabled,.btn-danger[disabled]{background-color:#bd362f;} +.btn-danger:active,.btn-danger.active{background-color:#942a25 \9;} +.btn-success{background-color:#5bb75b;background-image:-moz-linear-gradient(top, #62c462, #51a351);background-image:-ms-linear-gradient(top, #62c462, #51a351);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351));background-image:-webkit-linear-gradient(top, #62c462, #51a351);background-image:-o-linear-gradient(top, #62c462, #51a351);background-image:linear-gradient(top, #62c462, #51a351);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#51a351', GradientType=0);border-color:#51a351 #51a351 #387038;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);filter:progid:dximagetransform.microsoft.gradient(enabled=false);}.btn-success:hover,.btn-success:active,.btn-success.active,.btn-success.disabled,.btn-success[disabled]{background-color:#51a351;} +.btn-success:active,.btn-success.active{background-color:#408140 \9;} +.btn-info{background-color:#49afcd;background-image:-moz-linear-gradient(top, #5bc0de, #2f96b4);background-image:-ms-linear-gradient(top, #5bc0de, #2f96b4);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4));background-image:-webkit-linear-gradient(top, #5bc0de, #2f96b4);background-image:-o-linear-gradient(top, #5bc0de, #2f96b4);background-image:linear-gradient(top, #5bc0de, #2f96b4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#2f96b4', GradientType=0);border-color:#2f96b4 #2f96b4 #1f6377;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);filter:progid:dximagetransform.microsoft.gradient(enabled=false);}.btn-info:hover,.btn-info:active,.btn-info.active,.btn-info.disabled,.btn-info[disabled]{background-color:#2f96b4;} +.btn-info:active,.btn-info.active{background-color:#24748c \9;} +.btn-inverse{background-color:#414141;background-image:-moz-linear-gradient(top, #555555, #222222);background-image:-ms-linear-gradient(top, #555555, #222222);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#555555), to(#222222));background-image:-webkit-linear-gradient(top, #555555, #222222);background-image:-o-linear-gradient(top, #555555, #222222);background-image:linear-gradient(top, #555555, #222222);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#555555', endColorstr='#222222', GradientType=0);border-color:#222222 #222222 #000000;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);filter:progid:dximagetransform.microsoft.gradient(enabled=false);}.btn-inverse:hover,.btn-inverse:active,.btn-inverse.active,.btn-inverse.disabled,.btn-inverse[disabled]{background-color:#222222;} +.btn-inverse:active,.btn-inverse.active{background-color:#080808 \9;} +button.btn,input[type="submit"].btn{*padding-top:2px;*padding-bottom:2px;}button.btn::-moz-focus-inner,input[type="submit"].btn::-moz-focus-inner{padding:0;border:0;} +button.btn.btn-large,input[type="submit"].btn.btn-large{*padding-top:7px;*padding-bottom:7px;} +button.btn.btn-small,input[type="submit"].btn.btn-small{*padding-top:3px;*padding-bottom:3px;} +button.btn.btn-mini,input[type="submit"].btn.btn-mini{*padding-top:1px;*padding-bottom:1px;} +.btn-group{position:relative;*zoom:1;*margin-left:.3em;}.btn-group:before,.btn-group:after{display:table;content:"";} +.btn-group:after{clear:both;} +.btn-group:first-child{*margin-left:0;} +.btn-group+.btn-group{margin-left:5px;} +.btn-toolbar{margin-top:9px;margin-bottom:9px;}.btn-toolbar .btn-group{display:inline-block;*display:inline;*zoom:1;} +.btn-group .btn{position:relative;float:left;margin-left:-1px;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} +.btn-group .btn:first-child{margin-left:0;-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px;border-top-left-radius:4px;-webkit-border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px;border-bottom-left-radius:4px;} +.btn-group .btn:last-child,.btn-group .dropdown-toggle{-webkit-border-top-right-radius:4px;-moz-border-radius-topright:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px;border-bottom-right-radius:4px;} +.btn-group .btn.large:first-child{margin-left:0;-webkit-border-top-left-radius:6px;-moz-border-radius-topleft:6px;border-top-left-radius:6px;-webkit-border-bottom-left-radius:6px;-moz-border-radius-bottomleft:6px;border-bottom-left-radius:6px;} +.btn-group .btn.large:last-child,.btn-group .large.dropdown-toggle{-webkit-border-top-right-radius:6px;-moz-border-radius-topright:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;-moz-border-radius-bottomright:6px;border-bottom-right-radius:6px;} +.btn-group .btn:hover,.btn-group .btn:focus,.btn-group .btn:active,.btn-group .btn.active{z-index:2;} +.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0;} +.btn-group .dropdown-toggle{padding-left:8px;padding-right:8px;-webkit-box-shadow:inset 1px 0 0 rgba(255, 255, 255, 0.125),inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 1px 0 0 rgba(255, 255, 255, 0.125),inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 1px 0 0 rgba(255, 255, 255, 0.125),inset 0 1px 0 rgba(255, 255, 255, 0.2),0 1px 2px rgba(0, 0, 0, 0.05);*padding-top:3px;*padding-bottom:3px;} +.btn-group .btn-mini.dropdown-toggle{padding-left:5px;padding-right:5px;*padding-top:1px;*padding-bottom:1px;} +.btn-group .btn-small.dropdown-toggle{*padding-top:4px;*padding-bottom:4px;} +.btn-group .btn-large.dropdown-toggle{padding-left:12px;padding-right:12px;} +.btn-group.open{*z-index:1000;}.btn-group.open .dropdown-menu{display:block;margin-top:1px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;} +.btn-group.open .dropdown-toggle{background-image:none;-webkit-box-shadow:inset 0 1px 6px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 6px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 6px rgba(0, 0, 0, 0.15),0 1px 2px rgba(0, 0, 0, 0.05);} +.btn .caret{margin-top:7px;margin-left:0;} +.btn:hover .caret,.open.btn-group .caret{opacity:1;filter:alpha(opacity=100);} +.btn-mini .caret{margin-top:5px;} +.btn-small .caret{margin-top:6px;} +.btn-large .caret{margin-top:6px;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #000000;} +.btn-primary .caret,.btn-warning .caret,.btn-danger .caret,.btn-info .caret,.btn-success .caret,.btn-inverse .caret{border-top-color:#ffffff;border-bottom-color:#ffffff;opacity:0.75;filter:alpha(opacity=75);} +.alert{padding:8px 35px 8px 14px;margin-bottom:18px;text-shadow:0 1px 0 rgba(255, 255, 255, 0.5);background-color:#fcf8e3;border:1px solid #fbeed5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;color:#c09853;} +.alert-heading{color:inherit;} +.alert .close{position:relative;top:-2px;right:-21px;line-height:18px;} +.alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#468847;} +.alert-danger,.alert-error{background-color:#f2dede;border-color:#eed3d7;color:#b94a48;} +.alert-info{background-color:#d9edf7;border-color:#bce8f1;color:#3a87ad;} +.alert-block{padding-top:14px;padding-bottom:14px;} +.alert-block>p,.alert-block>ul{margin-bottom:0;} +.alert-block p+p{margin-top:5px;} +.nav{margin-left:0;margin-bottom:18px;list-style:none;} +.nav>li>a{display:block;} +.nav>li>a:hover{text-decoration:none;background-color:#eeeeee;} +.nav .nav-header{display:block;padding:3px 15px;font-size:11px;font-weight:bold;line-height:18px;color:#999999;text-shadow:0 1px 0 rgba(255, 255, 255, 0.5);text-transform:uppercase;} +.nav li+.nav-header{margin-top:9px;} +.nav-list{padding-left:15px;padding-right:15px;margin-bottom:0;} +.nav-list>li>a,.nav-list .nav-header{margin-left:-15px;margin-right:-15px;text-shadow:0 1px 0 rgba(255, 255, 255, 0.5);} +.nav-list>li>a{padding:3px 15px;} +.nav-list>.active>a,.nav-list>.active>a:hover{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.2);background-color:#0088cc;} +.nav-list [class^="icon-"]{margin-right:2px;} +.nav-list .divider{height:1px;margin:8px 1px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #ffffff;*width:100%;*margin:-5px 0 5px;} +.nav-tabs,.nav-pills{*zoom:1;}.nav-tabs:before,.nav-pills:before,.nav-tabs:after,.nav-pills:after{display:table;content:"";} +.nav-tabs:after,.nav-pills:after{clear:both;} +.nav-tabs>li,.nav-pills>li{float:left;} +.nav-tabs>li>a,.nav-pills>li>a{padding-right:12px;padding-left:12px;margin-right:2px;line-height:14px;} +.nav-tabs{border-bottom:1px solid #ddd;} +.nav-tabs>li{margin-bottom:-1px;} +.nav-tabs>li>a{padding-top:8px;padding-bottom:8px;line-height:18px;border:1px solid transparent;-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0;}.nav-tabs>li>a:hover{border-color:#eeeeee #eeeeee #dddddd;} +.nav-tabs>.active>a,.nav-tabs>.active>a:hover{color:#555555;background-color:#ffffff;border:1px solid #ddd;border-bottom-color:transparent;cursor:default;} +.nav-pills>li>a{padding-top:8px;padding-bottom:8px;margin-top:2px;margin-bottom:2px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;} +.nav-pills>.active>a,.nav-pills>.active>a:hover{color:#ffffff;background-color:#0088cc;} +.nav-stacked>li{float:none;} +.nav-stacked>li>a{margin-right:0;} +.nav-tabs.nav-stacked{border-bottom:0;} +.nav-tabs.nav-stacked>li>a{border:1px solid #ddd;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} +.nav-tabs.nav-stacked>li:first-child>a{-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0;} +.nav-tabs.nav-stacked>li:last-child>a{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px;} +.nav-tabs.nav-stacked>li>a:hover{border-color:#ddd;z-index:2;} +.nav-pills.nav-stacked>li>a{margin-bottom:3px;} +.nav-pills.nav-stacked>li:last-child>a{margin-bottom:1px;} +.nav-tabs .dropdown-menu,.nav-pills .dropdown-menu{margin-top:1px;border-width:1px;} +.nav-pills .dropdown-menu{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} +.nav-tabs .dropdown-toggle .caret,.nav-pills .dropdown-toggle .caret{border-top-color:#0088cc;border-bottom-color:#0088cc;margin-top:6px;} +.nav-tabs .dropdown-toggle:hover .caret,.nav-pills .dropdown-toggle:hover .caret{border-top-color:#005580;border-bottom-color:#005580;} +.nav-tabs .active .dropdown-toggle .caret,.nav-pills .active .dropdown-toggle .caret{border-top-color:#333333;border-bottom-color:#333333;} +.nav>.dropdown.active>a:hover{color:#000000;cursor:pointer;} +.nav-tabs .open .dropdown-toggle,.nav-pills .open .dropdown-toggle,.nav>.open.active>a:hover{color:#ffffff;background-color:#999999;border-color:#999999;} +.nav .open .caret,.nav .open.active .caret,.nav .open a:hover .caret{border-top-color:#ffffff;border-bottom-color:#ffffff;opacity:1;filter:alpha(opacity=100);} +.tabs-stacked .open>a:hover{border-color:#999999;} +.tabbable{*zoom:1;}.tabbable:before,.tabbable:after{display:table;content:"";} +.tabbable:after{clear:both;} +.tab-content{display:table;width:100%;} +.tabs-below .nav-tabs,.tabs-right .nav-tabs,.tabs-left .nav-tabs{border-bottom:0;} +.tab-content>.tab-pane,.pill-content>.pill-pane{display:none;} +.tab-content>.active,.pill-content>.active{display:block;} +.tabs-below .nav-tabs{border-top:1px solid #ddd;} +.tabs-below .nav-tabs>li{margin-top:-1px;margin-bottom:0;} +.tabs-below .nav-tabs>li>a{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px;}.tabs-below .nav-tabs>li>a:hover{border-bottom-color:transparent;border-top-color:#ddd;} +.tabs-below .nav-tabs .active>a,.tabs-below .nav-tabs .active>a:hover{border-color:transparent #ddd #ddd #ddd;} +.tabs-left .nav-tabs>li,.tabs-right .nav-tabs>li{float:none;} +.tabs-left .nav-tabs>li>a,.tabs-right .nav-tabs>li>a{min-width:74px;margin-right:0;margin-bottom:3px;} +.tabs-left .nav-tabs{float:left;margin-right:19px;border-right:1px solid #ddd;} +.tabs-left .nav-tabs>li>a{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px;} +.tabs-left .nav-tabs>li>a:hover{border-color:#eeeeee #dddddd #eeeeee #eeeeee;} +.tabs-left .nav-tabs .active>a,.tabs-left .nav-tabs .active>a:hover{border-color:#ddd transparent #ddd #ddd;*border-right-color:#ffffff;} +.tabs-right .nav-tabs{float:right;margin-left:19px;border-left:1px solid #ddd;} +.tabs-right .nav-tabs>li>a{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0;} +.tabs-right .nav-tabs>li>a:hover{border-color:#eeeeee #eeeeee #eeeeee #dddddd;} +.tabs-right .nav-tabs .active>a,.tabs-right .nav-tabs .active>a:hover{border-color:#ddd #ddd #ddd transparent;*border-left-color:#ffffff;} +.navbar{*position:relative;*z-index:2;overflow:visible;margin-bottom:18px;} +.navbar-inner{padding-left:20px;padding-right:20px;background-color:#2c2c2c;background-image:-moz-linear-gradient(top, #333333, #222222);background-image:-ms-linear-gradient(top, #333333, #222222);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#333333), to(#222222));background-image:-webkit-linear-gradient(top, #333333, #222222);background-image:-o-linear-gradient(top, #333333, #222222);background-image:linear-gradient(top, #333333, #222222);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 3px rgba(0, 0, 0, 0.25),inset 0 -1px 0 rgba(0, 0, 0, 0.1);-moz-box-shadow:0 1px 3px rgba(0, 0, 0, 0.25),inset 0 -1px 0 rgba(0, 0, 0, 0.1);box-shadow:0 1px 3px rgba(0, 0, 0, 0.25),inset 0 -1px 0 rgba(0, 0, 0, 0.1);} +.navbar .container{width:auto;} +.btn-navbar{display:none;float:right;padding:7px 10px;margin-left:5px;margin-right:5px;background-color:#2c2c2c;background-image:-moz-linear-gradient(top, #333333, #222222);background-image:-ms-linear-gradient(top, #333333, #222222);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#333333), to(#222222));background-image:-webkit-linear-gradient(top, #333333, #222222);background-image:-o-linear-gradient(top, #333333, #222222);background-image:linear-gradient(top, #333333, #222222);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0);border-color:#222222 #222222 #000000;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);filter:progid:dximagetransform.microsoft.gradient(enabled=false);-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.1),0 1px 0 rgba(255, 255, 255, 0.075);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.1),0 1px 0 rgba(255, 255, 255, 0.075);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.1),0 1px 0 rgba(255, 255, 255, 0.075);}.btn-navbar:hover,.btn-navbar:active,.btn-navbar.active,.btn-navbar.disabled,.btn-navbar[disabled]{background-color:#222222;} +.btn-navbar:active,.btn-navbar.active{background-color:#080808 \9;} +.btn-navbar .icon-bar{display:block;width:18px;height:2px;background-color:#f5f5f5;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;-webkit-box-shadow:0 1px 0 rgba(0, 0, 0, 0.25);-moz-box-shadow:0 1px 0 rgba(0, 0, 0, 0.25);box-shadow:0 1px 0 rgba(0, 0, 0, 0.25);} +.btn-navbar .icon-bar+.icon-bar{margin-top:3px;} +.nav-collapse.collapse{height:auto;} +.navbar{color:#999999;}.navbar .brand:hover{text-decoration:none;} +.navbar .brand{float:left;display:block;padding:8px 20px 12px;margin-left:-20px;font-size:20px;font-weight:200;line-height:1;color:#ffffff;} +.navbar .navbar-text{margin-bottom:0;line-height:40px;} +.navbar .btn,.navbar .btn-group{margin-top:5px;} +.navbar .btn-group .btn{margin-top:0;} +.navbar-form{margin-bottom:0;*zoom:1;}.navbar-form:before,.navbar-form:after{display:table;content:"";} +.navbar-form:after{clear:both;} +.navbar-form input,.navbar-form select,.navbar-form .radio,.navbar-form .checkbox{margin-top:5px;} +.navbar-form input,.navbar-form select{display:inline-block;margin-bottom:0;} +.navbar-form input[type="image"],.navbar-form input[type="checkbox"],.navbar-form input[type="radio"]{margin-top:3px;} +.navbar-form .input-append,.navbar-form .input-prepend{margin-top:6px;white-space:nowrap;}.navbar-form .input-append input,.navbar-form .input-prepend input{margin-top:0;} +.navbar-search{position:relative;float:left;margin-top:6px;margin-bottom:0;}.navbar-search .search-query{padding:4px 9px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:1;color:#ffffff;background-color:#626262;border:1px solid #151515;-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1),0 1px 0px rgba(255, 255, 255, 0.15);-moz-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1),0 1px 0px rgba(255, 255, 255, 0.15);box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1),0 1px 0px rgba(255, 255, 255, 0.15);-webkit-transition:none;-moz-transition:none;-ms-transition:none;-o-transition:none;transition:none;}.navbar-search .search-query:-moz-placeholder{color:#cccccc;} +.navbar-search .search-query::-webkit-input-placeholder{color:#cccccc;} +.navbar-search .search-query:focus,.navbar-search .search-query.focused{padding:5px 10px;color:#333333;text-shadow:0 1px 0 #ffffff;background-color:#ffffff;border:0;-webkit-box-shadow:0 0 3px rgba(0, 0, 0, 0.15);-moz-box-shadow:0 0 3px rgba(0, 0, 0, 0.15);box-shadow:0 0 3px rgba(0, 0, 0, 0.15);outline:0;} +.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030;margin-bottom:0;} +.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding-left:0;padding-right:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;} +.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px;} +.navbar-fixed-top{top:0;} +.navbar-fixed-bottom{bottom:0;} +.navbar .nav{position:relative;left:0;display:block;float:left;margin:0 10px 0 0;} +.navbar .nav.pull-right{float:right;} +.navbar .nav>li{display:block;float:left;} +.navbar .nav>li>a{float:none;padding:10px 10px 11px;line-height:19px;color:#999999;text-decoration:none;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);} +.navbar .nav>li>a:hover{background-color:transparent;color:#ffffff;text-decoration:none;} +.navbar .nav .active>a,.navbar .nav .active>a:hover{color:#ffffff;text-decoration:none;background-color:#222222;} +.navbar .divider-vertical{height:40px;width:1px;margin:0 9px;overflow:hidden;background-color:#222222;border-right:1px solid #333333;} +.navbar .nav.pull-right{margin-left:10px;margin-right:0;} +.navbar .dropdown-menu{margin-top:1px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}.navbar .dropdown-menu:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-bottom-color:rgba(0, 0, 0, 0.2);position:absolute;top:-7px;left:9px;} +.navbar .dropdown-menu:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #ffffff;position:absolute;top:-6px;left:10px;} +.navbar-fixed-bottom .dropdown-menu:before{border-top:7px solid #ccc;border-top-color:rgba(0, 0, 0, 0.2);border-bottom:0;bottom:-7px;top:auto;} +.navbar-fixed-bottom .dropdown-menu:after{border-top:6px solid #ffffff;border-bottom:0;bottom:-6px;top:auto;} +.navbar .nav .dropdown-toggle .caret,.navbar .nav .open.dropdown .caret{border-top-color:#ffffff;border-bottom-color:#ffffff;} +.navbar .nav .active .caret{opacity:1;filter:alpha(opacity=100);} +.navbar .nav .open>.dropdown-toggle,.navbar .nav .active>.dropdown-toggle,.navbar .nav .open.active>.dropdown-toggle{background-color:transparent;} +.navbar .nav .active>.dropdown-toggle:hover{color:#ffffff;} +.navbar .nav.pull-right .dropdown-menu,.navbar .nav .dropdown-menu.pull-right{left:auto;right:0;}.navbar .nav.pull-right .dropdown-menu:before,.navbar .nav .dropdown-menu.pull-right:before{left:auto;right:12px;} +.navbar .nav.pull-right .dropdown-menu:after,.navbar .nav .dropdown-menu.pull-right:after{left:auto;right:13px;} +.breadcrumb{padding:7px 14px;margin:0 0 18px;list-style:none;background-color:#fbfbfb;background-image:-moz-linear-gradient(top, #ffffff, #f5f5f5);background-image:-ms-linear-gradient(top, #ffffff, #f5f5f5);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f5f5f5));background-image:-webkit-linear-gradient(top, #ffffff, #f5f5f5);background-image:-o-linear-gradient(top, #ffffff, #f5f5f5);background-image:linear-gradient(top, #ffffff, #f5f5f5);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f5f5f5', GradientType=0);border:1px solid #ddd;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 #ffffff;-moz-box-shadow:inset 0 1px 0 #ffffff;box-shadow:inset 0 1px 0 #ffffff;}.breadcrumb li{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 0 #ffffff;} +.breadcrumb .divider{padding:0 5px;color:#999999;} +.breadcrumb .active a{color:#333333;} +.pagination{height:36px;margin:18px 0;} +.pagination ul{display:inline-block;*display:inline;*zoom:1;margin-left:0;margin-bottom:0;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:0 1px 2px rgba(0, 0, 0, 0.05);} +.pagination li{display:inline;} +.pagination a{float:left;padding:0 14px;line-height:34px;text-decoration:none;border:1px solid #ddd;border-left-width:0;} +.pagination a:hover,.pagination .active a{background-color:#f5f5f5;} +.pagination .active a{color:#999999;cursor:default;} +.pagination .disabled span,.pagination .disabled a,.pagination .disabled a:hover{color:#999999;background-color:transparent;cursor:default;} +.pagination li:first-child a{border-left-width:1px;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;} +.pagination li:last-child a{-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0;} +.pagination-centered{text-align:center;} +.pagination-right{text-align:right;} +.pager{margin-left:0;margin-bottom:18px;list-style:none;text-align:center;*zoom:1;}.pager:before,.pager:after{display:table;content:"";} +.pager:after{clear:both;} +.pager li{display:inline;} +.pager a{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px;} +.pager a:hover{text-decoration:none;background-color:#f5f5f5;} +.pager .next a{float:right;} +.pager .previous a{float:left;} +.pager .disabled a,.pager .disabled a:hover{color:#999999;background-color:#fff;cursor:default;} +.modal-open .dropdown-menu{z-index:2050;} +.modal-open .dropdown.open{*z-index:2050;} +.modal-open .popover{z-index:2060;} +.modal-open .tooltip{z-index:2070;} +.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000000;}.modal-backdrop.fade{opacity:0;} +.modal-backdrop,.modal-backdrop.fade.in{opacity:0.8;filter:alpha(opacity=80);} +.modal{position:fixed;top:50%;left:50%;z-index:1050;overflow:auto;width:560px;margin:-250px 0 0 -280px;background-color:#ffffff;border:1px solid #999;border:1px solid rgba(0, 0, 0, 0.3);*border:1px solid #999;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box;}.modal.fade{-webkit-transition:opacity .3s linear, top .3s ease-out;-moz-transition:opacity .3s linear, top .3s ease-out;-ms-transition:opacity .3s linear, top .3s ease-out;-o-transition:opacity .3s linear, top .3s ease-out;transition:opacity .3s linear, top .3s ease-out;top:-25%;} +.modal.fade.in{top:50%;} +.modal-header{padding:9px 15px;border-bottom:1px solid #eee;}.modal-header .close{margin-top:2px;} +.modal-body{overflow-y:auto;max-height:400px;padding:15px;} +.modal-form{margin-bottom:0;} +.modal-footer{padding:14px 15px 15px;margin-bottom:0;text-align:right;background-color:#f5f5f5;border-top:1px solid #ddd;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;-webkit-box-shadow:inset 0 1px 0 #ffffff;-moz-box-shadow:inset 0 1px 0 #ffffff;box-shadow:inset 0 1px 0 #ffffff;*zoom:1;}.modal-footer:before,.modal-footer:after{display:table;content:"";} +.modal-footer:after{clear:both;} +.modal-footer .btn+.btn{margin-left:5px;margin-bottom:0;} +.modal-footer .btn-group .btn+.btn{margin-left:-1px;} +.tooltip{position:absolute;z-index:1020;display:block;visibility:visible;padding:5px;font-size:11px;opacity:0;filter:alpha(opacity=0);}.tooltip.in{opacity:0.8;filter:alpha(opacity=80);} +.tooltip.top{margin-top:-2px;} +.tooltip.right{margin-left:2px;} +.tooltip.bottom{margin-top:2px;} +.tooltip.left{margin-left:-2px;} +.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #000000;} +.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid #000000;} +.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid #000000;} +.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-right:5px solid #000000;} +.tooltip-inner{max-width:200px;padding:3px 8px;color:#ffffff;text-align:center;text-decoration:none;background-color:#000000;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} +.tooltip-arrow{position:absolute;width:0;height:0;} +.popover{position:absolute;top:0;left:0;z-index:1010;display:none;padding:5px;}.popover.top{margin-top:-5px;} +.popover.right{margin-left:5px;} +.popover.bottom{margin-top:5px;} +.popover.left{margin-left:-5px;} +.popover.top .arrow{bottom:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #000000;} +.popover.right .arrow{top:50%;left:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-right:5px solid #000000;} +.popover.bottom .arrow{top:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid #000000;} +.popover.left .arrow{top:50%;right:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid #000000;} +.popover .arrow{position:absolute;width:0;height:0;} +.popover-inner{padding:3px;width:280px;overflow:hidden;background:#000000;background:rgba(0, 0, 0, 0.8);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);} +.popover-title{padding:9px 15px;line-height:1;background-color:#f5f5f5;border-bottom:1px solid #eee;-webkit-border-radius:3px 3px 0 0;-moz-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0;} +.popover-content{padding:14px;background-color:#ffffff;-webkit-border-radius:0 0 3px 3px;-moz-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box;}.popover-content p,.popover-content ul,.popover-content ol{margin-bottom:0;} +.thumbnails{margin-left:-20px;list-style:none;*zoom:1;}.thumbnails:before,.thumbnails:after{display:table;content:"";} +.thumbnails:after{clear:both;} +.thumbnails>li{float:left;margin:0 0 18px 20px;} +.thumbnail{display:block;padding:4px;line-height:1;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:0 1px 1px rgba(0, 0, 0, 0.075);} +a.thumbnail:hover{border-color:#0088cc;-webkit-box-shadow:0 1px 4px rgba(0, 105, 214, 0.25);-moz-box-shadow:0 1px 4px rgba(0, 105, 214, 0.25);box-shadow:0 1px 4px rgba(0, 105, 214, 0.25);} +.thumbnail>img{display:block;max-width:100%;margin-left:auto;margin-right:auto;} +.thumbnail .caption{padding:9px;} +.label{padding:1px 4px 2px;font-size:10.998px;font-weight:bold;line-height:13px;color:#ffffff;vertical-align:middle;white-space:nowrap;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#999999;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} +.label:hover{color:#ffffff;text-decoration:none;} +.label-important{background-color:#b94a48;} +.label-important:hover{background-color:#953b39;} +.label-warning{background-color:#f89406;} +.label-warning:hover{background-color:#c67605;} +.label-success{background-color:#468847;} +.label-success:hover{background-color:#356635;} +.label-info{background-color:#3a87ad;} +.label-info:hover{background-color:#2d6987;} +.label-inverse{background-color:#333333;} +.label-inverse:hover{background-color:#1a1a1a;} +.badge{padding:1px 9px 2px;font-size:12.025px;font-weight:bold;white-space:nowrap;color:#ffffff;background-color:#999999;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px;} +.badge:hover{color:#ffffff;text-decoration:none;cursor:pointer;} +.badge-error{background-color:#b94a48;} +.badge-error:hover{background-color:#953b39;} +.badge-warning{background-color:#f89406;} +.badge-warning:hover{background-color:#c67605;} +.badge-success{background-color:#468847;} +.badge-success:hover{background-color:#356635;} +.badge-info{background-color:#3a87ad;} +.badge-info:hover{background-color:#2d6987;} +.badge-inverse{background-color:#333333;} +.badge-inverse:hover{background-color:#1a1a1a;} +@-webkit-keyframes progress-bar-stripes{from{background-position:0 0;} to{background-position:40px 0;}}@-moz-keyframes progress-bar-stripes{from{background-position:0 0;} to{background-position:40px 0;}}@-ms-keyframes progress-bar-stripes{from{background-position:0 0;} to{background-position:40px 0;}}@keyframes progress-bar-stripes{from{background-position:0 0;} to{background-position:40px 0;}}.progress{overflow:hidden;height:18px;margin-bottom:18px;background-color:#f7f7f7;background-image:-moz-linear-gradient(top, #f5f5f5, #f9f9f9);background-image:-ms-linear-gradient(top, #f5f5f5, #f9f9f9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#f5f5f5), to(#f9f9f9));background-image:-webkit-linear-gradient(top, #f5f5f5, #f9f9f9);background-image:-o-linear-gradient(top, #f5f5f5, #f9f9f9);background-image:linear-gradient(top, #f5f5f5, #f9f9f9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f5f5f5', endColorstr='#f9f9f9', GradientType=0);-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1);-moz-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1);box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} +.progress .bar{width:0%;height:18px;color:#ffffff;font-size:12px;text-align:center;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#0e90d2;background-image:-moz-linear-gradient(top, #149bdf, #0480be);background-image:-ms-linear-gradient(top, #149bdf, #0480be);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#149bdf), to(#0480be));background-image:-webkit-linear-gradient(top, #149bdf, #0480be);background-image:-o-linear-gradient(top, #149bdf, #0480be);background-image:linear-gradient(top, #149bdf, #0480be);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#149bdf', endColorstr='#0480be', GradientType=0);-webkit-box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.15);-moz-box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.15);box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.15);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width 0.6s ease;-moz-transition:width 0.6s ease;-ms-transition:width 0.6s ease;-o-transition:width 0.6s ease;transition:width 0.6s ease;} +.progress-striped .bar{background-color:#149bdf;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);-webkit-background-size:40px 40px;-moz-background-size:40px 40px;-o-background-size:40px 40px;background-size:40px 40px;} +.progress.active .bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-moz-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite;} +.progress-danger .bar{background-color:#dd514c;background-image:-moz-linear-gradient(top, #ee5f5b, #c43c35);background-image:-ms-linear-gradient(top, #ee5f5b, #c43c35);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#c43c35));background-image:-webkit-linear-gradient(top, #ee5f5b, #c43c35);background-image:-o-linear-gradient(top, #ee5f5b, #c43c35);background-image:linear-gradient(top, #ee5f5b, #c43c35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#c43c35', GradientType=0);} +.progress-danger.progress-striped .bar{background-color:#ee5f5b;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);} +.progress-success .bar{background-color:#5eb95e;background-image:-moz-linear-gradient(top, #62c462, #57a957);background-image:-ms-linear-gradient(top, #62c462, #57a957);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#57a957));background-image:-webkit-linear-gradient(top, #62c462, #57a957);background-image:-o-linear-gradient(top, #62c462, #57a957);background-image:linear-gradient(top, #62c462, #57a957);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#57a957', GradientType=0);} +.progress-success.progress-striped .bar{background-color:#62c462;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);} +.progress-info .bar{background-color:#4bb1cf;background-image:-moz-linear-gradient(top, #5bc0de, #339bb9);background-image:-ms-linear-gradient(top, #5bc0de, #339bb9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#339bb9));background-image:-webkit-linear-gradient(top, #5bc0de, #339bb9);background-image:-o-linear-gradient(top, #5bc0de, #339bb9);background-image:linear-gradient(top, #5bc0de, #339bb9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#339bb9', GradientType=0);} +.progress-info.progress-striped .bar{background-color:#5bc0de;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);} +.progress-warning .bar{background-color:#faa732;background-image:-moz-linear-gradient(top, #fbb450, #f89406);background-image:-ms-linear-gradient(top, #fbb450, #f89406);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));background-image:-webkit-linear-gradient(top, #fbb450, #f89406);background-image:-o-linear-gradient(top, #fbb450, #f89406);background-image:linear-gradient(top, #fbb450, #f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fbb450', endColorstr='#f89406', GradientType=0);} +.progress-warning.progress-striped .bar{background-color:#fbb450;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);} +.accordion{margin-bottom:18px;} +.accordion-group{margin-bottom:2px;border:1px solid #e5e5e5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} +.accordion-heading{border-bottom:0;} +.accordion-heading .accordion-toggle{display:block;padding:8px 15px;} +.accordion-inner{padding:9px 15px;border-top:1px solid #e5e5e5;} +.carousel{position:relative;margin-bottom:18px;line-height:1;} +.carousel-inner{overflow:hidden;width:100%;position:relative;} +.carousel .item{display:none;position:relative;-webkit-transition:0.6s ease-in-out left;-moz-transition:0.6s ease-in-out left;-ms-transition:0.6s ease-in-out left;-o-transition:0.6s ease-in-out left;transition:0.6s ease-in-out left;} +.carousel .item>img{display:block;line-height:1;} +.carousel .active,.carousel .next,.carousel .prev{display:block;} +.carousel .active{left:0;} +.carousel .next,.carousel .prev{position:absolute;top:0;width:100%;} +.carousel .next{left:100%;} +.carousel .prev{left:-100%;} +.carousel .next.left,.carousel .prev.right{left:0;} +.carousel .active.left{left:-100%;} +.carousel .active.right{left:100%;} +.carousel-control{position:absolute;top:40%;left:15px;width:40px;height:40px;margin-top:-20px;font-size:60px;font-weight:100;line-height:30px;color:#ffffff;text-align:center;background:#222222;border:3px solid #ffffff;-webkit-border-radius:23px;-moz-border-radius:23px;border-radius:23px;opacity:0.5;filter:alpha(opacity=50);}.carousel-control.right{left:auto;right:15px;} +.carousel-control:hover{color:#ffffff;text-decoration:none;opacity:0.9;filter:alpha(opacity=90);} +.carousel-caption{position:absolute;left:0;right:0;bottom:0;padding:10px 15px 5px;background:#333333;background:rgba(0, 0, 0, 0.75);} +.carousel-caption h4,.carousel-caption p{color:#ffffff;} +.hero-unit{padding:60px;margin-bottom:30px;background-color:#eeeeee;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;}.hero-unit h1{margin-bottom:0;font-size:60px;line-height:1;color:inherit;letter-spacing:-1px;} +.hero-unit p{font-size:18px;font-weight:200;line-height:27px;color:inherit;} +.pull-right{float:right;} +.pull-left{float:left;} +.hide{display:none;} +.show{display:block;} +.invisible{visibility:hidden;} diff --git a/doc/resources/ace/skeleton/csses/prettify.css b/doc/resources/ace/skeleton/csses/prettify.css new file mode 100644 index 00000000..2cd13649 --- /dev/null +++ b/doc/resources/ace/skeleton/csses/prettify.css @@ -0,0 +1,52 @@ +/* Pretty printing styles. Used with prettify.js. */ + +/* SPAN elements with the classes below are added by prettyprint. */ +.pln { color: #000 } /* plain text */ + +@media screen { + .str { color: #2e6a40 } /* string content */ + .kwd { color: #214afc } /* a keyword */ + .com { color: #4c886b } /* a comment */ + .typ { color: #1130ad } /* a type name */ + .lit { color: #1130ad } /* a literal value */ + /* punctuation, lisp open bracket, lisp close bracket */ + .pun, .opn, .clo { color: #2d0603 } + .tag { color: #008 } /* a markup tag name */ + .atn { color: #606 } /* a markup attribute name */ + .atv { color: #080 } /* a markup attribute value */ + .dec, .var { color: #606 } /* a declaration; a variable name */ + .fun { color: #1130ad } /* a function name */ +} + +/* Use higher contrast and text-weight for printable form. */ +@media print, projection { + .str { color: #060 } + .kwd { color: #006; font-weight: bold } + .com { color: #600; font-style: italic } + .typ { color: #404; font-weight: bold } + .lit { color: #044 } + .pun, .opn, .clo { color: #440 } + .tag { color: #006; font-weight: bold } + .atn { color: #404 } + .atv { color: #060 } +} + +/* Put a border around prettyprinted code snippets. */ +/*pre.prettyprint { padding: 2px; }*/ + +/* Specify class=linenums on a pre to get line numbering */ +ol.linenums { margin-top: 0; margin-bottom: 0 } /* IE indents via margin-left */` +li.L0, +li.L1, +li.L2, +li.L3, +li.L5, +li.L6, +li.L7, +li.L8 { list-style-type: none } +/* Alternate shading for lines */ +li.L1, +li.L3, +li.L5, +li.L7, +li.L9 { background: #eee } diff --git a/doc/resources/ace/skeleton/images/Ace_ERD.svg b/doc/resources/ace/skeleton/images/Ace_ERD.svg new file mode 100644 index 00000000..ba386287 --- /dev/null +++ b/doc/resources/ace/skeleton/images/Ace_ERD.svg @@ -0,0 +1,4 @@ + + + + diff --git a/doc/template/resources/images/ace_logo.png b/doc/resources/ace/skeleton/images/ace_logo.png similarity index 100% rename from doc/template/resources/images/ace_logo.png rename to doc/resources/ace/skeleton/images/ace_logo.png diff --git a/doc/template/resources/images/ace_logo_menu.png b/doc/resources/ace/skeleton/images/ace_logo_menu.png similarity index 100% rename from doc/template/resources/images/ace_logo_menu.png rename to doc/resources/ace/skeleton/images/ace_logo_menu.png diff --git a/doc/template/resources/images/c9-log-footer.png b/doc/resources/ace/skeleton/images/c9-log-footer.png similarity index 100% rename from doc/template/resources/images/c9-log-footer.png rename to doc/resources/ace/skeleton/images/c9-log-footer.png diff --git a/doc/template/resources/images/c9-sponsor.png b/doc/resources/ace/skeleton/images/c9-sponsor.png similarity index 100% rename from doc/template/resources/images/c9-sponsor.png rename to doc/resources/ace/skeleton/images/c9-sponsor.png diff --git a/doc/template/resources/images/cloud9-logo.png b/doc/resources/ace/skeleton/images/cloud9-logo.png similarity index 100% rename from doc/template/resources/images/cloud9-logo.png rename to doc/resources/ace/skeleton/images/cloud9-logo.png diff --git a/doc/template/resources/images/content-top.png b/doc/resources/ace/skeleton/images/content-top.png similarity index 100% rename from doc/template/resources/images/content-top.png rename to doc/resources/ace/skeleton/images/content-top.png diff --git a/doc/template/resources/images/content_bg.png b/doc/resources/ace/skeleton/images/content_bg.png similarity index 100% rename from doc/template/resources/images/content_bg.png rename to doc/resources/ace/skeleton/images/content_bg.png diff --git a/doc/template/resources/images/content_top_bg.png b/doc/resources/ace/skeleton/images/content_top_bg.png similarity index 100% rename from doc/template/resources/images/content_top_bg.png rename to doc/resources/ace/skeleton/images/content_top_bg.png diff --git a/doc/template/resources/images/dashed_back.png b/doc/resources/ace/skeleton/images/dashed_back.png similarity index 100% rename from doc/template/resources/images/dashed_back.png rename to doc/resources/ace/skeleton/images/dashed_back.png diff --git a/doc/resources/ace/skeleton/images/favicon.ico b/doc/resources/ace/skeleton/images/favicon.ico new file mode 100644 index 00000000..e97c70f6 Binary files /dev/null and b/doc/resources/ace/skeleton/images/favicon.ico differ diff --git a/doc/template/resources/images/footer-bg.png b/doc/resources/ace/skeleton/images/footer-bg.png similarity index 100% rename from doc/template/resources/images/footer-bg.png rename to doc/resources/ace/skeleton/images/footer-bg.png diff --git a/doc/template/resources/images/main_bg.png b/doc/resources/ace/skeleton/images/main_bg.png similarity index 100% rename from doc/template/resources/images/main_bg.png rename to doc/resources/ace/skeleton/images/main_bg.png diff --git a/doc/template/resources/images/member-sprites.png b/doc/resources/ace/skeleton/images/member-sprites.png similarity index 100% rename from doc/template/resources/images/member-sprites.png rename to doc/resources/ace/skeleton/images/member-sprites.png diff --git a/doc/template/resources/images/menu_disc.png b/doc/resources/ace/skeleton/images/menu_disc.png similarity index 100% rename from doc/template/resources/images/menu_disc.png rename to doc/resources/ace/skeleton/images/menu_disc.png diff --git a/doc/template/resources/images/method_bg.png b/doc/resources/ace/skeleton/images/method_bg.png similarity index 100% rename from doc/template/resources/images/method_bg.png rename to doc/resources/ace/skeleton/images/method_bg.png diff --git a/doc/template/resources/images/scrolled-heading-shadow.png b/doc/resources/ace/skeleton/images/scrolled-heading-shadow.png similarity index 100% rename from doc/template/resources/images/scrolled-heading-shadow.png rename to doc/resources/ace/skeleton/images/scrolled-heading-shadow.png diff --git a/doc/template/resources/images/sidebar-top-bg.png b/doc/resources/ace/skeleton/images/sidebar-top-bg.png similarity index 100% rename from doc/template/resources/images/sidebar-top-bg.png rename to doc/resources/ace/skeleton/images/sidebar-top-bg.png diff --git a/doc/template/resources/images/sidebar_border.png b/doc/resources/ace/skeleton/images/sidebar_border.png similarity index 100% rename from doc/template/resources/images/sidebar_border.png rename to doc/resources/ace/skeleton/images/sidebar_border.png diff --git a/doc/template/resources/images/swirl_divider.png b/doc/resources/ace/skeleton/images/swirl_divider.png similarity index 100% rename from doc/template/resources/images/swirl_divider.png rename to doc/resources/ace/skeleton/images/swirl_divider.png diff --git a/doc/resources/ace/skeleton/javascripts/bootstrap-dropdown.js b/doc/resources/ace/skeleton/javascripts/bootstrap-dropdown.js new file mode 100644 index 00000000..54b61c5e --- /dev/null +++ b/doc/resources/ace/skeleton/javascripts/bootstrap-dropdown.js @@ -0,0 +1,92 @@ +/* ============================================================ + * bootstrap-dropdown.js v2.0.2 + * http://twitter.github.com/bootstrap/javascript.html#dropdowns + * ============================================================ + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================ */ + + +!function( $ ){ + + "use strict" + + /* DROPDOWN CLASS DEFINITION + * ========================= */ + + var toggle = '[data-toggle="dropdown"]' + , Dropdown = function ( element ) { + var $el = $(element).on('click.dropdown.data-api', this.toggle) + $('html').on('click.dropdown.data-api', function () { + $el.parent().removeClass('open') + }) + } + + Dropdown.prototype = { + + constructor: Dropdown + + , toggle: function ( e ) { + var $this = $(this) + , selector = $this.attr('data-target') + , $parent + , isActive + + if (!selector) { + selector = $this.attr('href') + selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 + } + + $parent = $(selector) + $parent.length || ($parent = $this.parent()) + + isActive = $parent.hasClass('open') + + clearMenus() + !isActive && $parent.toggleClass('open') + + return false + } + + } + + function clearMenus() { + $(toggle).parent().removeClass('open') + } + + + /* DROPDOWN PLUGIN DEFINITION + * ========================== */ + + $.fn.dropdown = function ( option ) { + return this.each(function () { + var $this = $(this) + , data = $this.data('dropdown') + if (!data) $this.data('dropdown', (data = new Dropdown(this))) + if (typeof option == 'string') data[option].call($this) + }) + } + + $.fn.dropdown.Constructor = Dropdown + + + /* APPLY TO STANDARD DROPDOWN ELEMENTS + * =================================== */ + + $(function () { + $('html').on('click.dropdown.data-api', clearMenus) + $('body').on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle) + }) + +}( window.jQuery ); \ No newline at end of file diff --git a/doc/resources/ace/skeleton/javascripts/clicker.js b/doc/resources/ace/skeleton/javascripts/clicker.js new file mode 100644 index 00000000..5fe3dca2 --- /dev/null +++ b/doc/resources/ace/skeleton/javascripts/clicker.js @@ -0,0 +1,35 @@ +$(function() { + // when hovering over arrow, add highlight (only if inactive) + $("h3.methodToggle").hover(function () { + if (!$("h3.methodToggle").hasClass('active')) + $(this).addClass("methodToggleHover"); + }, + function () { + $(this).removeClass("methodToggleHover"); + } + ); + + // after expanding the hidden description, hide the ellipsis + $('.signature-call, .signature-returns', '.signature').click(function() { + var $article = $(this).closest('.article'), + $arrow = $('h3.methodClicker', $article); + + if (!$article.hasClass('methodToggleOpen') || this.force) { + $article.addClass('methodToggleOpen'); + $arrow.removeClass('inactive').addClass('active'); + + var data = location.hash = $arrow[0].id.replace(/^js_/, ""); + scrollTo(null, data); + } + else { + $article.removeClass('methodToggleOpen'); + $arrow.removeClass('active').addClass('inactive'); + } + + }); + + $('.related-to', '.metaInfo').click(function(){ + location.hash = $(this).find('a').attr('href').split('#')[1]; + }); +}); + diff --git a/doc/resources/ace/skeleton/javascripts/disqus-ext.js b/doc/resources/ace/skeleton/javascripts/disqus-ext.js new file mode 100644 index 00000000..6f966cc6 --- /dev/null +++ b/doc/resources/ace/skeleton/javascripts/disqus-ext.js @@ -0,0 +1,12 @@ +var disqus_shortname = 'aceapi'; + +var paths = window.location.pathname.split("/"); +var fileName = paths[paths.length - 2] + "/" + paths[paths.length - 1]; + +var disqus_identifier = fileName; + + (function() { + var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; + dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js'; + (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); + })(); \ No newline at end of file diff --git a/doc/resources/ace/skeleton/javascripts/ga.js b/doc/resources/ace/skeleton/javascripts/ga.js new file mode 100644 index 00000000..e381972d --- /dev/null +++ b/doc/resources/ace/skeleton/javascripts/ga.js @@ -0,0 +1,9 @@ + var _gaq = _gaq || []; + _gaq.push(['_setAccount', 'UA-31998201-1']); + _gaq.push(['_trackPageview']); + + (function() { + var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; + ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; + var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); + })(); \ No newline at end of file diff --git a/doc/template/resources/javascripts/jquery-scrollspy.js b/doc/resources/ace/skeleton/javascripts/jquery-scrollspy.js similarity index 100% rename from doc/template/resources/javascripts/jquery-scrollspy.js rename to doc/resources/ace/skeleton/javascripts/jquery-scrollspy.js diff --git a/doc/template/resources/javascripts/jquery.collapse.js b/doc/resources/ace/skeleton/javascripts/jquery.collapse.js similarity index 100% rename from doc/template/resources/javascripts/jquery.collapse.js rename to doc/resources/ace/skeleton/javascripts/jquery.collapse.js diff --git a/doc/template/resources/javascripts/jquery.cookie.js b/doc/resources/ace/skeleton/javascripts/jquery.cookie.js similarity index 100% rename from doc/template/resources/javascripts/jquery.cookie.js rename to doc/resources/ace/skeleton/javascripts/jquery.cookie.js diff --git a/doc/resources/ace/skeleton/javascripts/jquery.js b/doc/resources/ace/skeleton/javascripts/jquery.js new file mode 100644 index 00000000..3ca5e0f5 --- /dev/null +++ b/doc/resources/ace/skeleton/javascripts/jquery.js @@ -0,0 +1,4 @@ +/*! jQuery v1.7 jquery.com | jquery.org/license */ +(function(a,b){function cA(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cx(a){if(!cm[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cn||(cn=c.createElement("iframe"),cn.frameBorder=cn.width=cn.height=0),b.appendChild(cn);if(!co||!cn.createElement)co=(cn.contentWindow||cn.contentDocument).document,co.write((c.compatMode==="CSS1Compat"?"":"")+""),co.close();d=co.createElement(a),co.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cn)}cm[a]=e}return cm[a]}function cw(a,b){var c={};f.each(cs.concat.apply([],cs.slice(0,b)),function(){c[this]=a});return c}function cv(){ct=b}function cu(){setTimeout(cv,0);return ct=f.now()}function cl(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ck(){try{return new a.XMLHttpRequest}catch(b){}}function ce(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bB(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function br(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bi,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bq(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bp(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bp)}function bp(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bo(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bn(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bm(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d=0===c})}function V(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function N(){return!0}function M(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z]|[0-9])/ig,x=/^-ms-/,y=function(a,b){return(b+"").toUpperCase()},z=d.userAgent,A,B,C,D=Object.prototype.toString,E=Object.prototype.hasOwnProperty,F=Array.prototype.push,G=Array.prototype.slice,H=String.prototype.trim,I=Array.prototype.indexOf,J={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7",length:0,size:function(){return this.length},toArray:function(){return G.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?F.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),B.add(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(G.apply(this,arguments),"slice",G.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:F,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;B.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!B){B=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",C,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",C),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&K()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return a!=null&&m.test(a)&&!isNaN(a)},type:function(a){return a==null?String(a):J[D.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!E.call(a,"constructor")&&!E.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||E.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(x,"ms-").replace(w,y)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
                                                                                                                                                                                                                                                                                                                                                                                                                                                              a",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,unknownElems:!!a.getElementsByTagName("nav").length,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",enctype:!!c.createElement("form").enctype,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.lastChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},m&&f.extend(p,{position:"absolute",left:"-999px",top:"-999px"});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
                                                                                                                                                                                                                                                                                                                                                                                                                                                              t
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;f(function(){var a,b,d,e,g,h,i=1,j="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",l="visibility:hidden;border:0;",n="style='"+j+"border:5px solid #000;padding:0;'",p="
                                                                                                                                                                                                                                                                                                                                                                                                                                                              "+""+"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ";m=c.getElementsByTagName("body")[0];!m||(a=c.createElement("div"),a.style.cssText=l+"width:0;height:0;position:static;top:0;margin-top:"+i+"px",m.insertBefore(a,m.firstChild),o=c.createElement("div"),o.style.cssText=j+l,o.innerHTML=p,a.appendChild(o),b=o.firstChild,d=b.firstChild,g=b.nextSibling.firstChild.firstChild,h={doesNotAddBorder:d.offsetTop!==5,doesAddBorderForTableAndCells:g.offsetTop===5},d.style.position="fixed",d.style.top="20px",h.fixedPosition=d.offsetTop===20||d.offsetTop===15,d.style.position=d.style.top="",b.style.overflow="hidden",b.style.position="relative",h.subtractsBorderForOverflowNotVisible=d.offsetTop===-5,h.doesNotIncludeMarginInBodyOffset=m.offsetTop!==i,m.removeChild(a),o=a=null,f.extend(k,h))}),o.innerHTML="",n.removeChild(o),o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[f.expando]:a[f.expando]&&f.expando,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[f.expando]=n=++f.uuid:n=f.expando),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[f.expando]:f.expando;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)?b=b:b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" "));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];if(!arguments.length){if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}return b}e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!a||j===3||j===8||j===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g},removeAttr:function(a,b){var c,d,e,g,h=0;if(a.nodeType===1){d=(b||"").split(p),g=d.length;for(;h=0}})});var z=/\.(.*)$/,A=/^(?:textarea|input|select)$/i,B=/\./g,C=/ /g,D=/[^\w\s.|`]/g,E=/^([^\.]*)?(?:\.(.+))?$/,F=/\bhover(\.\S+)?/,G=/^key/,H=/^(?:mouse|contextmenu)|click/,I=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,J=function(a){var b=I.exec(a);b&& +(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},K=function(a,b){return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||a.id===b[2])&&(!b[3]||b[3].test(a.className))},L=function(a){return f.event.special.hover?a:a.replace(F,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=L(c).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"",(g||!e)&&c.preventDefault();if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,n=null;for(m=e.parentNode;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l=0:t===b&&(t=o[s]=r.quick?K(m,r.quick):f(m).is(s)),t&&q.push(r);q.length&&j.push({elem:m,matches:q})}d.length>e&&j.push({elem:this,matches:d.slice(e)});for(k=0;k0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),G.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),H.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

                                                                                                                                                                                                                                                                                                                                                                                                                                                              ";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(V(c[0])||V(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=S.call(arguments);O.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!U[a]?f.unique(e):e,(this.length>1||Q.test(d))&&P.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var Y="abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",Z=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,_=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,ba=/<([\w:]+)/,bb=/",""],legend:[1,"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ","
                                                                                                                                                                                                                                                                                                                                                                                                                                                              "],thead:[1,"","
                                                                                                                                                                                                                                                                                                                                                                                                                                                              "],tr:[2,"","
                                                                                                                                                                                                                                                                                                                                                                                                                                                              "],td:[3,"","
                                                                                                                                                                                                                                                                                                                                                                                                                                                              "],col:[2,"","
                                                                                                                                                                                                                                                                                                                                                                                                                                                              "],area:[1,"",""],_default:[0,"",""]},bk=X(c);bj.optgroup=bj.option,bj.tbody=bj.tfoot=bj.colgroup=bj.caption=bj.thead,bj.th=bj.td,f.support.htmlSerialize||(bj._default=[1,"div
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ","
                                                                                                                                                                                                                                                                                                                                                                                                                                                              "]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after" +,arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Z,""):null;if(typeof a=="string"&&!bd.test(a)&&(f.support.leadingWhitespace||!$.test(a))&&!bj[(ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(_,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bn(a,d),e=bo(a),g=bo(d);for(h=0;e[h];++h)g[h]&&bn(e[h],g[h])}if(b){bm(a,d);if(c){e=bo(a),g=bo(d);for(h=0;e[h];++h)bm(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!bc.test(k))k=b.createTextNode(k);else{k=k.replace(_,"<$1>");var l=(ba.exec(k)||["",""])[1].toLowerCase(),m=bj[l]||bj._default,n=m[0],o=b.createElement("div");b===c?bk.appendChild(o):X(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=bb.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&$.test(k)&&o.insertBefore(b.createTextNode($.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bt.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bs,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bs.test(g)?g.replace(bs,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bB(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bC=function(a,c){var d,e,g;c=c.replace(bu,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bD=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bv.test(f)&&bw.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bB=bC||bD,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bF=/%20/g,bG=/\[\]$/,bH=/\r?\n/g,bI=/#.*$/,bJ=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bK=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bL=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bM=/^(?:GET|HEAD)$/,bN=/^\/\//,bO=/\?/,bP=/)<[^<]*)*<\/script>/gi,bQ=/^(?:select|textarea)/i,bR=/\s+/,bS=/([?&])_=[^&]*/,bT=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bU=f.fn.load,bV={},bW={},bX,bY,bZ=["*/"]+["*"];try{bX=e.href}catch(b$){bX=c.createElement("a"),bX.href="",bX=bX.href}bY=bT.exec(bX.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bU)return bU.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ").append(c.replace(bP,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bQ.test(this.nodeName)||bK.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bH,"\r\n")}}):{name:b.name,value:c.replace(bH,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?cb(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),cb(a,b);return a},ajaxSettings:{url:bX,isLocal:bL.test(bY[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bZ},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:b_(bV),ajaxTransport:b_(bW),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cd(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=ce(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bJ.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bI,"").replace(bN,bY[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bR),d.crossDomain==null&&(r=bT.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bY[1]&&r[2]==bY[2]&&(r[3]||(r[1]==="http:"?80:443))==(bY[3]||(bY[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),ca(bV,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bM.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bO.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bS,"$1_="+x);d.url=y+(y===d.url?(bO.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bZ+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=ca(bW,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){s<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)cc(g,a[g],c,e);return d.join("&").replace(bF,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cf=f.now(),cg=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cf++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cg.test(b.url)||e&&cg.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cg,l),b.url===j&&(e&&(k=k.replace(cg,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ch=a.ActiveXObject?function(){for(var a in cj)cj[a](0,1)}:!1,ci=0,cj;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ck()||cl()}:ck,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ch&&delete cj[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++ci,ch&&(cj||(cj={},f(a).unload(ch)),cj[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cm={},cn,co,cp=/^(?:toggle|show|hide)$/,cq=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cr,cs=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],ct;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cw("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cz.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cz.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cA(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cA(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window); \ No newline at end of file diff --git a/doc/template/resources/javascripts/plugins.js b/doc/resources/ace/skeleton/javascripts/plugins.js similarity index 100% rename from doc/template/resources/javascripts/plugins.js rename to doc/resources/ace/skeleton/javascripts/plugins.js diff --git a/doc/template/resources/javascripts/prettify-extension.js b/doc/resources/ace/skeleton/javascripts/prettify-extension.js similarity index 100% rename from doc/template/resources/javascripts/prettify-extension.js rename to doc/resources/ace/skeleton/javascripts/prettify-extension.js diff --git a/doc/template/resources/javascripts/prettify.js b/doc/resources/ace/skeleton/javascripts/prettify.js similarity index 100% rename from doc/template/resources/javascripts/prettify.js rename to doc/resources/ace/skeleton/javascripts/prettify.js diff --git a/doc/resources/ace/skeleton/javascripts/ux.js b/doc/resources/ace/skeleton/javascripts/ux.js new file mode 100644 index 00000000..1d03e091 --- /dev/null +++ b/doc/resources/ace/skeleton/javascripts/ux.js @@ -0,0 +1,207 @@ +$(function () { + 'use strict'; + + var baseTitle = document.title, + // base (general) part of title + pathName = window.location.pathname, + fileName = pathName.substring(window.location.pathname.lastIndexOf("/") + 1); + + if (window.addEventListener) window.addEventListener('load', loadCallback, true); + else window.attachEvent('load', loadCallback, true); + + function loadCallback(evt) { + var form = document.getElementById("searchbox"); + var input = form.query; + form.onsubmit = function (evt) { + var query = input.value; + if (query) { + input.value = ""; + input.blur(); + var currentVersion = $('#currentVersion').text(); + var url = "https://www.google.com/search?q=" + encodeURIComponent("site:ace.ajax.org/api" + " " + query); + window.open(url); + } + return false; + }; + } + + var fileNameRE = new RegExp("^" + fileName, "i"); + + $('a.menuLink').each(function (index) { + if ($(this).attr("href").match(fileNameRE)) { + $(this).addClass("currentItem"); + return false; + } + }); + + // init search + $('#search') + // prevent from form submit + .on('submit', function () { + return false; + }).find('input'); + + // init prettyprint + $('pre > code').addClass('prettyprint'); + prettyPrint(); +}); + +$(document).ready(function () { + var d = 'a.menu, .dropdown-toggle' + + function clearMenus() { + $(d).parent('li').each(function () { + $(this).removeClass('open') + }); + } + + var s, sx; + + // scrolling offset calculation via www.quirksmode.org + if (window.pageYOffset || window.pageXOffset) { + s = window.pageYOffset; + sx = window.pageXOffset; + } + else if (document.documentElement && (document.documentElement.scrollTop || document.documentElement.scrollLeft)) { + s = document.documentElement.scrollTop; + sx = document.documentElement.scrollLeft; + } + else if (document.body) { + s = document.body.scrollTop; + sx = document.body.scrollLeft; + } + + if (document.documentElement.offsetWidth < 1010) { + if (sx <= 0) sx = 0; + else if (sx + document.documentElement.offsetWidth > 1010) sx = 1010 - document.documentElement.offsetWidth; + } + else sx = 0; + + $('.members').each(function (i) { + var position = $(this).position(); + var $classContent = $(this).closest('.classContent'); + + $(this).scrollspy({ + min: $classContent.position().top - 35, + max: $classContent.position().top + $classContent.height(), + onEnter: function (element, position) { + var $pagination = $(element); + var $paginationContent = $('.membersContent pos' + i); + var $tabs = $('.tabs pos' + i); + + $paginationContent.css('left', -1 * sx); + $paginationContent.css('top', 0); + + $pagination.addClass('shadow').stop().css({ + height: 31, + 'top': 33 + }).closest('.classContent').addClass('srolled'); + + $tabs.addClass('tabsSansBorder'); + }, + onLeave: function (element, position) { + var $pagination = $(element); + var $paginationContent = $('.membersContent pos' + i); + var $tabs = $('.tabs pos' + i); + + $paginationContent.stop().css({ + top: 11 + }); + $pagination.css({ + 'position': 'absolute', + 'top': 193 + }); + $pagination.stop().removeClass('shadow').css({ + height: 42 + }); + + $paginationContent.css('left', 0); + // setTimeout(function () { + $paginationContent.css({ + 'top': '' + }); + $pagination.css({ + 'position': '', + 'top': '' + }); + $paginationContent.css('left', 0); + $pagination.closest('.classContent').removeClass('srolled') + $tabs.removeClass('tabsSansBorder'); + // }, 300); + } + }); + }); + + $('span.methodClicker, article.article, h3.methodClicker').each(function () { + var a = $(this); + var constructorPos = a.attr("id").indexOf("new "); + + var objName = a.attr("id"); + if (constructorPos >= 0) { + objName = objName.substring(constructorPos + 4); + objName += ".new"; + } + + a.attr("id", objName); + }); + + $('.brand').parent('.dropdown').hover( + + function () { + $(this).addClass('open'); + }, function () { + clearMenus(); + }); + + $('.versions').hover( + + function () { + $(this).addClass('open'); + }, function () { + clearMenus(); + }); + + function showMethodContent() { + if (!location.hash) return; + + var $clickerEl = $('span#' + location.hash.replace(/^#/, '').replace(/\./g, '\\.')); + if ($clickerEl.length > 0 && $clickerEl.hasClass('methodClicker')) { + var p = $clickerEl.parent(); + p[0].force = true; + p.trigger('click'); + p[0].force = false; + } + } + + if (location.hash) { + showMethodContent(); + var data = location.hash; + scrollTo(null, data.substr(1)); + } + + window.onhashchange = function () { + showMethodContent(); + } +}); + +function scrollTo(el, data) { + if (!data) { + data = el.getAttribute("data-id"); + location.hash = data; + } + var el = $("span#" + data.replace(/\./g, "\\."))[0]; + if (!el) return; + + var article = $(el).closest('.article')[0]; + + var top = article.offsetTop - 100; + + if (document.body.scrollTop > top || document.body.scrollTop != top && document.body.scrollTop + (window.innerHeight || document.documentElement.offsetHeight) < top + article.offsetHeight) { + $('body').animate({ + scrollTop: top + }, { + duration: 200, + easing: "swing" + }); + } +} \ No newline at end of file diff --git a/doc/resources/ace/templates/ace_menu.jade b/doc/resources/ace/templates/ace_menu.jade new file mode 100755 index 00000000..d325887c --- /dev/null +++ b/doc/resources/ace/templates/ace_menu.jade @@ -0,0 +1,61 @@ +div#well + + h3 Ace Reference + + div.swirl_divider + + ul.menu + li + div.menu-item + a(class="menuLink namespace", href="ace.html") Ace + li + div.menu-item + a(class="menuLink namespace", href="anchor.html") Anchor + li + div.menu-item + a(class="menuLink namespace", href="background_tokenizer.html") BackgroundTokenizer + li + div.menu-item + a(class="menuLink namespace", href="document.html") Document + li + div.menu-item + a(class="menuLink namespace", href="edit_session.html") EditSession + li + div.menu-item + a(class="menuLink namespace", href="editor.html") Editor + + //- probably not needing doc a(class="menuLink namespace", href="multi_select.html") MultiSelect + + //- not actually doc'ed yet a(class="menuLink namespace", href="placeholder.html") PlaceHolder + + li + div.menu-item + a(class="menuLink namespace", href="range.html") Range + + //- not actually doc'ed yet a(class="menuLink namespace", href="renderloop.html") RenderLoop + + + li + div.menu-item + a(class="menuLink namespace", href="scrollbar.html") Scrollbar + li + div.menu-item + a(class="menuLink namespace", href="search.html") Search + li + div.menu-item + a(class="menuLink namespace", href="selection.html") Selection + + //- not actually doc'ed yet a(class="menuLink namespace", href="split.html") Split + + li + div.menu-item + a(class="menuLink namespace", href="token_iterator.html") TokenIterator + li + div.menu-item + a(class="menuLink namespace", href="tokenizer.html") Tokenizer + li + div.menu-item + a(class="menuLink namespace", href="undomanager.html") UndoManager + li + div.menu-item + a(class="menuLink namespace", href="virtual_renderer.html") VirtualRenderer \ No newline at end of file diff --git a/doc/resources/ace/templates/layout.jade b/doc/resources/ace/templates/layout.jade new file mode 100644 index 00000000..88847947 --- /dev/null +++ b/doc/resources/ace/templates/layout.jade @@ -0,0 +1,30 @@ +include ../../common_layout +include lib + +mixin doctype + +html(xmlns="http://www.w3.org/1999/xhtml") + head + mixin head + + body + mixin navBar + #nonFooter + #wrapper + .content + .row.centerpiece + .span3#sidebarContainer + #sidebar + include ace_menu.jade + .span9#mainContent + #documentation + -if (isIndex) + != content + -else + mixin api() + + div(id="disqus_thread") + .push + mixin footer + + mixin endingScripts \ No newline at end of file diff --git a/doc/resources/ace/templates/lib.jade b/doc/resources/ace/templates/lib.jade new file mode 100644 index 00000000..d8437979 --- /dev/null +++ b/doc/resources/ace/templates/lib.jade @@ -0,0 +1,256 @@ +- var methodSection = constructorSection = propertySection = eventSection = false; + +-function renameMemberTitle(title, count) + if title.indexOf("ethods") >= 0 + span Functions (#{count}) + else if title.indexOf("ropert") >= 0 + span Properties (#{count}) + else + span #{title} (#{count}) + +mixin article(obj, parents) + if typeof obj === 'string' + obj = list[obj] + + title = obj.id + (obj.type ? ' (' + obj.type + ')' : '') + article.article(id=obj.path, data-title=title) + + if obj.type === 'section' || obj.type === 'namespace' || obj.type === 'class' || obj.type === 'mixin' + + if obj.description + .section.description + .memberContent + mixin markdown(obj.description) + + collection = obj.children.filter(function(x){return x.type === 'namespace'}); + if collection.length + .section.namespaces + // + h3 Namespaces + .memberContent + mixin short_description_list(collection) + + collection = obj.children.filter(function(x){return x.type === 'mixin'}); + if collection.length + .section.mixins + // + h3 Mixins + .memberContent + mixin short_description_list(collection) + + if obj.type === 'class' + + if obj.superclass + .section.superclass + // h3 + Superclass + .memberContent + mixin link(obj.superclass) + + if obj.subclasses.length + .section.subclasses + // h3 + Subclasses + .memberContent + mixin links(obj.subclasses) + + if obj.included_mixins + .section.mixins + // h3 + Includes + .memberContent + mixin links(obj.included_mixins) + + collection = obj.children.filter(function(x){return x.type === 'utility'}) + if collection.length + .section.utilities + // h3 + Utilities + .memberContent + mixin links(collection) + + else + + .section.method + .memberContent + if obj.signatures + div.title + ul.signatures + -var loops = 0; + for sig in obj.signatures + li.signature + ul + li.signature-call!= signature(obj, sig, ["methodClicker"]) + if sig.returns + li.signature-returns + ul.argument-types + for ret in sig.returns + li.argument-type!= returnLink(obj, ret, []) + -if (loops == 0) + -loops = 1 // ensure that we only print ONE meta info UL per signature (some methods have multiple signatures) + ul.metaInfo + if obj.readonly + li + span.label.read-only Read-Only + if obj.chainable + li + span.label.chainable Chainable + if obj.internal + li + span.label.internal Internal + if obj.deprecated + li + span.label.deprecated + | Deprecated + if obj.deprecated.from + |   (since #{obj.deprecated.from}) + if obj.deprecated.off + |  and will be removed on #{obj.deprecated.off} + if obj.alias_of + li + span.label.alias.single + | Aliased as: + != link(obj.alias_of) + else if obj.aliases.length + li + span.label.alias.multiple + | Aliased as: + ul.alias + for alias in obj.aliases + li + mixin link(alias) + + if obj.related_to + li + span.label.related-to + | Related to + mixin link(obj.related_to) + + div.sideToggler + + div(id='ellipsis_#{obj.id}', class='ellipsis_description') + mixin markdown(obj.short_description) + + h3(id='#{obj.id}', class='methodToggle methodClicker inactive') +     + div.description + + mixin markdown(obj.description) + + if obj.bound && ~obj.bound.indexOf('#') + p.note.methodized + | This method can be called either as an + != link(obj.bound, ['link-short'], 'instance method') + | or as a generic method. If calling as generic, pass the instance in as the first argument. + else if obj.bound && !~obj.bound.indexOf('#') + p.note.functionalized + | This method can be called either as an instance method or as a + != link(obj.bound, ['link-short'], 'generic method') + |. If calling as generic, pass the instance in as the first argument. + + if obj.arguments + h4 Arguments + != argumentTable(obj.arguments, ["argument-list", "table", "table-striped", "table-bordered"]) + + if obj.retDesc + h4 Returns + != returnTable(obj.retDesc, ["return-list", "table", "table-striped", "table-bordered"]) + + //- children + for child in obj.children.filter(function(x){return x.type === 'section'}) + mixin article(child, parents.concat(obj)) + for child in obj.children.filter(function(x){return x.type === 'utility'}) + mixin article(child, parents.concat(obj)) + + for child in obj.children.filter(function(x){return x.type === 'constructor'}) + - if (!constructorSection) + - constructorSection = true + h3.sectionHeader Constructors + mixin article(child, parents.concat(obj)) + + for child in obj.children.filter(function(x){return x.type === 'namespace' || x.type === 'class' || x.type === 'mixin'}) + mixin article(child, parents.concat(obj)) + + for child in obj.children.filter(function(x){return x.type === 'event'}) + - if (!eventSection) + - eventSection = true + h3.sectionHeader Events + mixin article(child, parents.concat(obj), 'event') + + for child in obj.children.filter(function(x){return x.type === 'class method'}) + - if (!methodSection) + - methodSection = true + h3.sectionHeader Methods + mixin article(child, parents.concat(obj)) + + for child in obj.children.filter(function(x){return x.type === 'class property'}) + - if (!propertySection) + - propertySection = true + h3.sectionHeader Properties + mixin article(child, parents.concat(obj)) + + for child in obj.children.filter(function(x){return x.type === 'instance method'}) + mixin article(child, parents.concat(obj)) + for child in obj.children.filter(function(x){return x.type === 'instance property'}) + mixin article(child, parents.concat(obj)) + for child in obj.children.filter(function(x){return x.type === 'constant'}) + mixin article(child, parents.concat(obj)) + + + +mixin api() + -pos = 0 + for obj in tree.children + .classContent + .membersBackground + div(class=' members pos#{pos}') + div(class=' membersContent pos#{pos}') + h1.memberHeader + -var heading = obj.path + span.name #{heading} + span.editInC9 + mixin formatGHHref(obj.href, 'nodejs_ref_guide') + + -if (true || obj.filename.indexOf("index") < 0) + ul(class='nav tabs pos#{pos}', data-tabs='tabs') + for selector, title in {'Events': ['event', 'events'], 'Constructors': ['constructor', 'constructors'], 'Class methods': ['class method', 'class_methods'], 'Class properties': ['class property', 'class_properties'], 'Instance methods': ['instance method', 'instance_methods'], 'Instance properties': ['instance property', 'instance_properties'], 'Constants': ['constant', 'constants']} + members = obj.children.filter(function(x){return x.type === selector[0]}) + li(class="dropdown", data-dropdown="dropdown") + if members.length + a(href="\#", class="dropdown-toggle", data-toggle="dropdown") + != renameMemberTitle(title, members.length) + b.caret + ul.dropdown-menu + for m in members + li(data-id='#{m.id}', class='memberLink') + mixin link(m, [], true) + -pos++ + mixin article(obj, []) + + +mixin short_description_list(collection) + ul.method-details-list + for obj in collection + if typeof obj === 'string' + obj = list[obj] + li.method-description + h4 + mixin link(obj) + if obj.short_description + mixin markdown(obj.short_description) + +mixin link(obj, classes, short) + l = link(obj, classes, short) + != l + +mixin links(collection) + ul.method-list + for obj in collection + li + mixin link(obj) + +mixin formatGHHref(url, type) + url = url.substring(url.indexOf("ace/lib")) + + -url = url.replace(/\/{2,}/g, "/").replace(/\//g,"%2F") + [edit] \ No newline at end of file diff --git a/doc/resources/common_layout.jade b/doc/resources/common_layout.jade new file mode 100644 index 00000000..fb19e158 --- /dev/null +++ b/doc/resources/common_layout.jade @@ -0,0 +1,86 @@ +-var dirPrefix = "./"; +-var landingPage = 'false' +-var versions = [] + +mixin doctype + !!! 5 + + + + + + +mixin head + meta(charset="utf-8") + //- N.B. http://blog.yjl.im/2011/01/bad-value-x-ua-compatible-for-attribute.html + meta(http-equiv="X-UA-Compatible", content="IE=edge,chrome=1") + + -if (isIndex) + title #{title} + -else + title #{classId} - #{title} + + meta(name="generator", content="c9-doc-build") + meta(name="description", content="Ace API documentation for the online code editor.") + meta(name="author", content="Garen J. Torikian") + + meta(name="viewport", content="width=device-width,initial-scale=1") + + link(rel="stylesheet", href="#{dirPrefix}resources/csses/bootstrap.min.css") + link(rel="stylesheet", href="#{dirPrefix}resources/csses/prettify.css") + link(rel="stylesheet", href="#{dirPrefix}resources/csses/ace_api.css") + + link(href="#{dirPrefix}resources/images/favicon.ico", rel="icon", type="image/x-icon") + + script(src="#{dirPrefix}resources/javascripts/jquery.js") + script(src="#{dirPrefix}resources/javascripts/clicker.js") + script(src="#{dirPrefix}resources/javascripts/jquery.collapse.js") + script(src="#{dirPrefix}resources/javascripts/jquery.cookie.js") + script(src="#{dirPrefix}resources/javascripts/bootstrap-dropdown.js") + script(src="#{dirPrefix}resources/javascripts/jquery-scrollspy.js") + script(script src="#{dirPrefix}resources/javascripts/prettify-extension.js") + +mixin navBar + div.navbar.navbar-fixed-top + div.navbar-inner + div#topSection.container + span.brand + + ul.nav.topLinks + li#ace_site + a(href='../index.html') Ace + li#ace_api.active + a(href='index.html') Ace API Reference + form(id='searchbox', action='', class='navbar-search pull-right') + input(class='search-query span3', name='query', type='text', placeholder="Search the API", title="Search across all the documentation") + +mixin footer + div#footer + .footerInner + .footer-text.pull-right + p + About Cloud9 | Ace & Cloud9 IDE are © Ajax.org 2012 + +mixin endingScripts + // scripts concatenated and minified via ant build script + + + + + + + //- + // end scripts + + //if lt IE 7 + script(src="//ajax.googleapis.com/ajax/libs/chrome-frame/1.0.3/CFInstall.min.js") + script + window.attachEvent('onload',function(){CFInstall.check({mode:'overlay'})}) + + +mixin identifyBuild(tree, type) + landingPage = 'true' + -dirPrefix = './' + +mixin markdown(text, inline) + != markdown(text, inline) \ No newline at end of file diff --git a/doc/site/images/ac-logo.png b/doc/site/images/ac-logo.png deleted file mode 100644 index 6ca069a3..00000000 Binary files a/doc/site/images/ac-logo.png and /dev/null differ diff --git a/doc/site/images/ace-logo.png b/doc/site/images/ace-logo.png deleted file mode 100644 index 886a8df31..00000000 Binary files a/doc/site/images/ace-logo.png and /dev/null differ diff --git a/doc/site/images/ace-tab.png b/doc/site/images/ace-tab.png deleted file mode 100644 index 50298c10..00000000 Binary files a/doc/site/images/ace-tab.png and /dev/null differ diff --git a/doc/site/images/cloud9-logo.png b/doc/site/images/cloud9-logo.png deleted file mode 100644 index 5466cf7e..00000000 Binary files a/doc/site/images/cloud9-logo.png and /dev/null differ diff --git a/doc/site/images/codecademy-logo.png b/doc/site/images/codecademy-logo.png deleted file mode 100644 index e27947ae..00000000 Binary files a/doc/site/images/codecademy-logo.png and /dev/null differ diff --git a/doc/site/images/codiad.png b/doc/site/images/codiad.png deleted file mode 100644 index c77a446c..00000000 Binary files a/doc/site/images/codiad.png and /dev/null differ diff --git a/doc/site/images/crunchapp-logo.png b/doc/site/images/crunchapp-logo.png deleted file mode 100644 index 1ed8d2f7..00000000 Binary files a/doc/site/images/crunchapp-logo.png and /dev/null differ diff --git a/doc/site/images/empty-logo.png b/doc/site/images/empty-logo.png deleted file mode 100644 index c0bbbbe3..00000000 Binary files a/doc/site/images/empty-logo.png and /dev/null differ diff --git a/doc/site/images/firefox-logo.png b/doc/site/images/firefox-logo.png deleted file mode 100644 index 711fad62..00000000 Binary files a/doc/site/images/firefox-logo.png and /dev/null differ diff --git a/doc/site/images/github-logo.png b/doc/site/images/github-logo.png deleted file mode 100644 index 9456846a..00000000 Binary files a/doc/site/images/github-logo.png and /dev/null differ diff --git a/doc/site/images/habitat-logo.svg b/doc/site/images/habitat-logo.svg deleted file mode 100644 index 986c3687..00000000 --- a/doc/site/images/habitat-logo.svg +++ /dev/null @@ -1 +0,0 @@ -Slice 1 \ No newline at end of file diff --git a/doc/site/images/header-bg.png b/doc/site/images/header-bg.png deleted file mode 100644 index aaab9e3e..00000000 Binary files a/doc/site/images/header-bg.png and /dev/null differ diff --git a/doc/site/images/ideone-logo.png b/doc/site/images/ideone-logo.png deleted file mode 100644 index cbee7fad..00000000 Binary files a/doc/site/images/ideone-logo.png and /dev/null differ diff --git a/doc/site/images/khan-logo.png b/doc/site/images/khan-logo.png deleted file mode 100644 index 3c389f8e..00000000 Binary files a/doc/site/images/khan-logo.png and /dev/null differ diff --git a/doc/site/images/modx-logo-4.png b/doc/site/images/modx-logo-4.png deleted file mode 100644 index a640ef23..00000000 Binary files a/doc/site/images/modx-logo-4.png and /dev/null differ diff --git a/doc/site/images/pixie-logo.png b/doc/site/images/pixie-logo.png deleted file mode 100644 index 99968c46..00000000 Binary files a/doc/site/images/pixie-logo.png and /dev/null differ diff --git a/doc/site/images/plunker.png b/doc/site/images/plunker.png deleted file mode 100644 index e8388db6..00000000 Binary files a/doc/site/images/plunker.png and /dev/null differ diff --git a/doc/site/images/processwire-logo.svg b/doc/site/images/processwire-logo.svg deleted file mode 100644 index 8f64d71c..00000000 --- a/doc/site/images/processwire-logo.svg +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - image/svg+xml - - - - - - - - - - - - diff --git a/doc/site/images/repl.it-logo.png b/doc/site/images/repl.it-logo.png deleted file mode 100644 index bf383a62..00000000 Binary files a/doc/site/images/repl.it-logo.png and /dev/null differ diff --git a/doc/site/images/rstudio_logo_64.png b/doc/site/images/rstudio_logo_64.png deleted file mode 100644 index 3d402a21..00000000 Binary files a/doc/site/images/rstudio_logo_64.png and /dev/null differ diff --git a/doc/site/images/sassmeister-logo.png b/doc/site/images/sassmeister-logo.png deleted file mode 100644 index 7ecc8939..00000000 Binary files a/doc/site/images/sassmeister-logo.png and /dev/null differ diff --git a/doc/site/images/shiftedit-logo.png b/doc/site/images/shiftedit-logo.png deleted file mode 100644 index b505f9df..00000000 Binary files a/doc/site/images/shiftedit-logo.png and /dev/null differ diff --git a/doc/site/images/spandexio-logo.png b/doc/site/images/spandexio-logo.png deleted file mode 100644 index e2fdb79d..00000000 Binary files a/doc/site/images/spandexio-logo.png and /dev/null differ diff --git a/doc/site/images/stypi-logo.png b/doc/site/images/stypi-logo.png deleted file mode 100644 index ef1af148..00000000 Binary files a/doc/site/images/stypi-logo.png and /dev/null differ diff --git a/doc/site/images/sx-logo.png b/doc/site/images/sx-logo.png deleted file mode 100644 index 0604d279..00000000 Binary files a/doc/site/images/sx-logo.png and /dev/null differ diff --git a/doc/site/images/textimage.png b/doc/site/images/textimage.png deleted file mode 100644 index 6f7d3130..00000000 Binary files a/doc/site/images/textimage.png and /dev/null differ diff --git a/doc/site/images/weecod-logo.png b/doc/site/images/weecod-logo.png deleted file mode 100644 index c4970727..00000000 Binary files a/doc/site/images/weecod-logo.png and /dev/null differ diff --git a/doc/site/images/wolf_3d_logo_trans.png b/doc/site/images/wolf_3d_logo_trans.png deleted file mode 100644 index fe61b9b4..00000000 Binary files a/doc/site/images/wolf_3d_logo_trans.png and /dev/null differ diff --git a/doc/site/images/zorba-logo.png b/doc/site/images/zorba-logo.png deleted file mode 100644 index ad2c22f6..00000000 Binary files a/doc/site/images/zorba-logo.png and /dev/null differ diff --git a/doc/site/iphone.css b/doc/site/iphone.css index dd90db03..f1c2ba03 100644 --- a/doc/site/iphone.css +++ b/doc/site/iphone.css @@ -22,4 +22,4 @@ UL.menu-footer LI { PRE{ font-size:22px; -} \ No newline at end of file +} diff --git a/doc/site/js/main.js b/doc/site/js/main.js deleted file mode 100644 index 39dc202d..00000000 --- a/doc/site/js/main.js +++ /dev/null @@ -1,187 +0,0 @@ -var editor; -var embedded_editor; -$(function() { - if (typeof ace !== "undefined") { - ace.config.set("workerPath", "build/src-min"); - editor = ace.edit("ace_editor_demo"); - editor.container.style.opacity = ""; - embedded_editor = ace.edit("embedded_ace_code"); - embedded_editor.container.style.opacity = ""; - embedded_editor.session.setMode("ace/mode/html"); - embedded_editor.setAutoScrollEditorIntoView(true); - embedded_editor.setOption("maxLines", 40); - - editor.setOptions({ - maxLines: 30, - mode: "ace/mode/javascript", - autoScrollEditorIntoView: true - }); - - ace.config.loadModule("ace/ext/emmet", function() { - ace.require("ace/lib/net").loadScript("http://cloud9ide.github.io/emmet-core/emmet.js", function() { - embedded_editor.setOption("enableEmmet", true); - editor.setOption("enableEmmet", true); - }); - }); - - ace.config.loadModule("ace/ext/language_tools", function() { - embedded_editor.setOptions({ - enableSnippets: true, - enableBasicAutocompletion: true - }); - editor.setOptions({ - enableSnippets: true, - enableBasicAutocompletion: true - }); - }); - } else { - document.body.insertAdjacentHTML("afterbegin", '
                                                                                                                                                                                                                                                                                                                                                                                                                                                              \ -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              \ - \ - Oh No! Couldn\'t load build/src/ace.js.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              \ - You can build it by running node Makefile.dryice.js
                                                                                                                                                                                                                                                                                                                                                                                                                                                              \ - Or download older version by running git submodule update --init --recursive
                                                                                                                                                                                                                                                                                                                                                                                                                                                              \ -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              \ -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              '); - } - $("ul.menu-list").mousedown(function(e) { - if (e.button === 1) { - e.preventDefault(); - } - }); - - $("ul.menu-list li").click(function(e) { - if (e.target.tagName !== "A") { - var href = $(this).find("a").attr("href"); - if (e.button == 1) - window.open(href, "_blank"); - else - window.location = href; - } - }); - - // used when page is access directly - function magicClickInterceptor(e) { - e.preventDefault(); - - var state = {}; - state.api = $(this).attr("href").substring(6, $(this).attr("href").length - 5); - $.bbq.pushState(state); - - var _self = $(this); - $("#apiHolder").load($(this).attr("href") + " #documentation", function(){ - $("#apiHolder").removeClass("apiIntro").removeClass("span9"); - $("#documentation").removeClass("span9").addClass("span7"); - ux(); - setupClicker(); - - // handles dropping in from new link - var section = $.bbq.getState("section"); - if (section) { - $("li#dropdown_" + section.replace(/\./g, '\\.') + " a").triggerHandler('click'); - } - - //setupDisqus(_self.attr("href")); - }); - } - - $('.menu-item a').click(magicClickInterceptor); - $('a.argument').click(magicClickInterceptor); - - $('a.external').click(function(e) { - e.preventDefault(); - }); - - var tabs = $("#tabnav"), - tab_a_selector = "a"; - - var firstLoad = true; - - tabs.find(tab_a_selector).click(function(e) { - e.preventDefault(); - if ($(this).attr("href") === "/") { - window.location = "http://ace.ajax.org"; - return; - } - if ($(this).attr("href").indexOf("#api") === 0) { - $("#top_container").addClass("collapse"); - scrollIntoPosition(null, 0); - } - else if ($(this).is(":visible")) { - if (firstLoad) { - firstLoad = false; - setTimeout(function() { - $("#top_container").removeClass("collapse"); - scrollIntoPosition(e.target); - }, 700); - } - else { - $("#top_container").removeClass("collapse"); - scrollIntoPosition(e.target); - } - } - - function scrollIntoPosition(el, overridePosition) { - if (typeof overridePosition !== "undefined") { - $("body").stop().animate({ - scrollTop: overridePosition - }, 400); - } - else if ($("body").scrollTop() > 345) { - $("body").stop().animate({ - scrollTop: ($(el).offset().top - 10) - }, 400); - } - } - - $(this).tab("show"); - - var state = {}; - state.nav = $(this).attr("href").substr(1); - $.bbq.pushState(state); - }); - - $('#tabnav a[data-toggle="tab"]').on('shown', function (e) { - $(".tab-content .tab-pane.active .ace_editor").each(function(i, el){ - el.env.onResize(); - }); - }); - - $(window).on("hashchange", function(e) { - _gaq.push(['_trackPageview',location.pathname + location.search + location.hash]); - tabs.each(function() { - var idx = $.bbq.getState("nav") || "about"; - var section = e.fragment.split("&")[1] || ""; - $(this).find(tab_a_selector + "[href='#" + idx + "']").triggerHandler('click'); - - // handles dropping in from new link - var api = $.bbq.getState("api"); - if (api) { - $(tab_a_selector + "[href='./api/" + api + ".html']").triggerHandler('click'); - } - }); - }).trigger("hashchange"); - - highlight(); -}); - - - -function highlight() { - var highlighter = ace.require("ace/ext/static_highlight") - var dom = ace.require("ace/lib/dom") - function qsa(sel) { - var els = document.querySelectorAll(sel); - var result = []; - for (var i = 0, l = els.length; i < l; i++) - result[i] = els[i]; - return result; - } - - qsa("code[class]").forEach(function(el) { - var m = el.className.match(/language-(\w+)|(javascript)/); - if (!m) return - var mode = "ace/mode/" + (m[1] || m[2]); - highlighter.highlight(el, {mode: mode, theme: "ace/theme/xcode"}) - }); -} \ No newline at end of file diff --git a/doc/site/style.css b/doc/site/style.css index 1167340a..9076d529 100644 --- a/doc/site/style.css +++ b/doc/site/style.css @@ -2,35 +2,16 @@ body { margin:0; padding:0; background-color:#e6f5fc; - font-family: Helvetica, Arial; + } - - -#ace_editor_demo, #embedded_ace_code { - height: 275px; - border: 1px solid #DDD; - border-radius: 4px; - border-bottom-right-radius: 0px; - margin-top: 5px; -} - -#embedded_ace_code { - height: 525px; -} - -h1, h2, h3, h4, h5, h6 { - font-family: Helvetica; - font-weight: 100; +H2, H3, H4 { + font-family:Trebuchet MS; + font-weight:bold; margin:0; padding:0; } -h2, h3, h4, h5, h6 { - padding-top: 30px; - border-bottom: 1px solid #bedaea; -} - H2 { font-size:28px; color:#263842; @@ -38,29 +19,39 @@ H2 { } H3 { + font-family:Trebuchet MS; + font-weight:bold; font-size:22px; color:#253741; + margin-top:43px; margin-bottom:8px; } H4 { + font-family:Trebuchet MS; + font-weight:bold; font-size:21px; color:#222222; - margin-bottom:8px; + margin-bottom:4px; } P { padding:13px 0; margin:0; - line-height:21px; - font-size: 15px; + line-height:22px; } UL{ - font-size: 15px; + line-height : 22px; } -#header { +PRE{ + background : #333; + color : white; + padding : 10px; +} + + #header { height: 93px; position: relative; background: url(images/background.png) repeat-x 0 0; @@ -108,7 +99,7 @@ UL{ } #wrapper { - background:url(images/body_background.png) repeat-x 0 -15px; + background:url(images/body_background.png) repeat-x 0 0; min-height:250px; } @@ -116,7 +107,7 @@ UL{ font-family:Arial; font-size:14px; color:#222222; - width: 960px; + width:1000px; } #wrapper .content .column1 { @@ -131,44 +122,8 @@ UL{ position:relative; overflow:hidden; float:left; - /*width:600px;*/ -} - -#top_container h1 { - font-size: 68px; - line-height: 60px; - width: 515px; - float: left; - font-weight: 100; - font-family: Helvetica; - padding: 65px 0 0 14px; - color: #333; -} - -#top_container { - background: url(images/header-bg.png) 0 0; - overflow: hidden; - padding: 11px 36px 19px 40px; - height: 267px; - -webkit-transition: height 0.4s ease-out, opacity 0.4s ease-out, padding 0.4s ease-out, margin 0.4s ease-out; - -moz-transition: height 0.4s ease-out, opacity 0.4s ease-out, padding 0.4s ease-out, margin 0.4s ease-out; - opacity: 1; - margin-top: 25px; -} - -#top_container.collapse { - padding: 0px; - height: 0px; - opacity: 0; - margin: 0; -} - -#page_logo { - padding: 35px 0 15px 0; - width: 350px; - float: right; - text-align: center; - height: 220px; + width:600px; + padding-top:47px; } .fork_on_github { @@ -186,132 +141,36 @@ UL{ } .divider { - height: 1px; + height:3px; background-color:#bedaea; margin-bottom:3px; } .menu, .site-menu { - padding: 25px 0 0 35px; + padding:23px 0 0 24px; } UL.content-list { - padding: 15px 0 15px 20px; + padding:15px; margin:0; } -UL.content-list li { - padding-left: 10px; - padding-bottom: 3px; +UL.menu-list { + padding:0; + margin:0 0 20px 0; + list-style-type:none; + line-height : 16px; } -ul.menu-list { - padding: 15px 0; - margin: 0 0 20px 0; - list-style-type: none; - line-height: 16px; - overflow: auto; +UL.menu-list LI { + color:#2557b4; + font-family:Trebuchet MS; + font-size:12px; + padding:1px 0; } -ul.menu-list li { - color: #2557B4; - font-family: Helvetica, Trebuchet MS; - font-size: 12px; - padding: 5px; - cursor: pointer; - display: block; - float: left; - margin-right: 15px; - margin-bottom: 20px; - width: 100px; - height: 90px; - border-radius: 5px; - position: relative; - background: rgba(255, 255, 255, 0.7); - margin-left: 22px; - margin-top: 20px; - box-shadow: 0 0 4px rgba(0, 0, 0, 0.1); - -moz-box-shadow: 0 0 4px rgba(0, 0, 0, 0.1); - -webkit-transition: box-shadow 0.4s; - -moz-transition: box-shadow 0.4s; - border: 1px solid #999; - background-image: -webkit-repeating-linear-gradient(left, hsla(0,0%,100%,0) 0%, hsla(0,0%,100%,0) 6%, hsla(0,0%,100%, .1) 7.5%), - -webkit-repeating-linear-gradient(left, hsla(0,0%, 0%,0) 0%, hsla(0,0%, 0%,0) 4%, hsla(0,0%, 0%,.03) 4.5%), - -webkit-repeating-linear-gradient(left, hsla(0,0%,100%,0) 0%, hsla(0,0%,100%,0) 1.2%, hsla(0,0%,100%,.15) 2.2%), - - -webkit-linear-gradient(-90deg, hsl(0,0%,78%) 0%, - hsl(0,0%,90%) 47%, - hsl(0,0%,78%) 53%, - hsl(0,0%,70%)100%); - background-image: -moz-repeating-linear-gradient(left, hsla(0,0%,100%,0) 0%, hsla(0,0%,100%,0) 6%, hsla(0,0%,100%, .1) 7.5%), - -moz-repeating-linear-gradient(left, hsla(0,0%, 0%,0) 0%, hsla(0,0%, 0%,0) 4%, hsla(0,0%, 0%,.03) 4.5%), - -moz-repeating-linear-gradient(left, hsla(0,0%,100%,0) 0%, hsla(0,0%,100%,0) 1.2%, hsla(0,0%,100%,.15) 2.2%), - - -moz-linear-gradient(-90deg, hsl(0,0%,78%) 0%, - hsl(0,0%,90%) 47%, - hsl(0,0%,78%) 53%, - hsl(0,0%,70%)100%); -} - -ul.menu-list li:hover { - box-shadow: 0 0 4px rgba(0, 0, 0, 0.5); - -moz-box-shadow: 0 0 4px rgba(0, 0, 0, 0.5); -} - -ul.menu-list li a { - position: absolute; - bottom: 0px; - left: 0px; - color: white; - text-align: center; - font-weight: bold; - text-shadow: 0px 0px 4px rgba(0, 0, 0, 0.8); - width: 100%; - display: block; - background: rgba(0, 0, 0, 0.6); - line-height: 12px; - padding: 4px 0; -} - -UL.menu-list LI a:hover { - text-decoration: none; -} - -li#add_your_site p { - font-size: 32px; - border: 3px solid #34A034; - color: #34A034; - border-radius: 34px; - padding: 3px 4px 4px 5px; - width: 20px; - height: 22px; - line-height: 18px; - position: relative; - left: 33px; - top: 22px; - background: #fff; -} - -ul.menu-list li#add_your_site a { - color: #A3EEA3; -} - -/* This is the animation code. */ -@-webkit-keyframes example { - 0% { -webkit-transform: rotate(0deg); } - 25% { -webkit-transform: rotate(3deg); } - 50% { -webkit-transform: rotate(0deg); } - 75% { -webkit-transform: rotate(-3deg); } -} - -/* This is the element that we apply the animation to. */ -li#add_your_site { - -webkit-animation-name: example; - -webkit-animation-duration: 0.4s; - -webkit-animation-timing-function: ease; /* ease is the default */ - -webkit-animation-delay: 0s; /* 0 is the default */ - -webkit-animation-iteration-count: infinite; /* 1 is the default */ - -webkit-animation-direction: alternate; /* normal is the default */ +UL.menu-list LI:last-child { + border-bottom:0; } A { @@ -323,6 +182,14 @@ A:hover { text-decoration:underline; } +P#first{ + background : rgba(255,255,255,0.5); + padding : 20px; + font-size : 16px; + line-height : 24px; + margin : 0 0 20px 0; +} + #footer { height:40px; position:relative; @@ -356,154 +223,6 @@ UL.menu-footer LI A:hover { text-decoration:underline; } -.nav-pills.nav { - margin: 10px 0 25px 0; - padding: 0; - border-radius: 5px; - border: 1px solid #d7d7d7; - background: #eeeeee; - background: -moz-linear-gradient(top, #eeeeee 0%, #cccccc 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#eeeeee), color-stop(100%,#cccccc)); - background: -webkit-linear-gradient(top, #eeeeee 0%,#cccccc 100%); - background: -o-linear-gradient(top, #eeeeee 0%,#cccccc 100%); - background: -ms-linear-gradient(top, #eeeeee 0%,#cccccc 100%); - background: linear-gradient(to bottom, #eeeeee 0%,#cccccc 100%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#cccccc',GradientType=0 ); - overflow: hidden; -} - -.nav-pills > .active > a, .nav-pills > .active > a:hover { - color: white; - background-color: #555; - box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.8); - text-shadow: 0px 0px 3px #000; -} - -.nav-tabs > li > a, .nav-pills > li > a { - padding-right: 17px; - padding-left: 17px; - border-right: 1px solid #bbb; - border-radius: 0; - margin: 0; - line-height: 25px; - font-size: 14px; - color: #333; - text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.3); - box-shadow: 0 0 1px rgba(255, 255, 255, 1); - -moz-box-shadow: 0 0 1px rgba(255, 255, 255, 1); - -webkit-transition: background 0.2s; - -moz-transition: background 0.2s; -} - -.nav.nav-pills li:first-child > a { - padding-left: 28px; - padding-right: 28px; -} - -.nav.nav-pills li:first-child > a > img { - width: 34px; -} - -.nav.nav-pills li:last-child > a { - border-right: none; - box-shadow: none; - -moz-box-shadow: none; -} - -.tab-content { - margin-bottom: 50px; -} - -.tab-content > .active, .pill-content > .active { - padding: 25px 30px; -} - -#top_container, .tab-content > .active, .pill-content > .active { - border: 1px solid #DDD; - border-radius: 5px; - -moz-border-radius: 5px; -} - -.tab-content > .active, .pill-content > .active { - background: rgba(255, 255, 255, 0.7); -} - -pre .xml .javascript, pre .xml .css { - opacity: 1; -} - -#embed_link { - text-align: right; - padding-top: 0; -} -#embed_link a { - color: #059C05; - font-weight: 100; - font-family: helvetica; - font-size: 13px; - display: inline-block; - padding: 2px 10px; - background: #f4f4f4; - border: 1px solid #ddd; - border-top: none; - border-bottom-left-radius: 4px; - border-bottom-right-radius: 4px; - text-shadow: 0px 1px 0px rgba(255, 255, 255, 1); - text-decoration: none; -} - -p.highlight_note { - padding: 8px 35px 8px 14px; - margin-top: 10px; - color: #A0762E; - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); - background-color: #FCF8E3; - border: 1px solid #CA9C44; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; -} - -p.highlight_note a { - color: #537CC7; -} - -.prod_no_image { - position: relative; left: -10px; top: -12px; -} -#api { - padding: 0; -} -/*https://github.com/twitter/bootstrap/issues/5262*/ -img { - max-width: none; -} - -.text-logo{ - color: black; - font-size: 24px; - font-weight: lighter; - margin-top: 23px; - text-align: center; - text-shadow: 1px 17px 2px gray, 1px 1px 2px gray; -} - -.menu-list>li>img { - position: relative; -} - -.rotating-logo { - -webkit-transform: rotate(0deg); - transform: rotate(0deg); - -webkit-transition: all 0.5s ease-out; - transition: all 0.5s ease-out; -} -.rotating-logo:hover { - -webkit-transform: rotate(360deg); - transform: rotate(360deg); - -webkit-transition: all 0.5s ease-in-out; - transition: all 0.5s ease-in-out; -} \ No newline at end of file diff --git a/doc/template/jade/common_layout.jade b/doc/template/jade/common_layout.jade deleted file mode 100644 index bb665600..00000000 --- a/doc/template/jade/common_layout.jade +++ /dev/null @@ -1,55 +0,0 @@ --var dirPrefix = "./"; --var sitePrefix = "../doc/site/"; --var landingPage = 'false' --var versions = [] - -mixin doctype - !!! 5 - - - - - - -mixin head - meta(http-equiv='Content-Type', content='text/html; charset=UTF-8') - - -if (isIndex) - title #{title} - -else - title #{classId} - #{title} - - meta(name="generator", content="panino-doc-build") - meta(name="description", content="Ace API documentation for the online code editor") - meta(name="author", content="Garen J. Torikian") - - script(src='#{sitePrefix}/js/main.js') - link(rel='stylesheet', media='all and (max-device-width: 480px)', href='doc/site/iphone.css') - link(rel='stylesheet', media='all and (min-device-width: 481px) and (max-device-width: 1024px)', href='doc/site/iphone.css') - link(href='#{dirPrefix}resources/ace/skeleton/images/favicon.ico', rel='icon', type='image/x-icon') - - link(href='#{sitePrefix}/style.css', rel='stylesheet', type='text/css') - link(rel="stylesheet", href="#{dirPrefix}resources/csses/ace_api.css") - link(rel="stylesheet", href="#{dirPrefix}resources/csses/font-awesome.css") - - link(href="#{dirPrefix}resources/images/favicon.ico", rel="icon", type="image/x-icon") - - script(src='#{dirPrefix}resources/javascripts/bbq.js') - script(src="#{dirPrefix}resources/javascripts/jquery.collapse.js") - script(src="#{dirPrefix}resources/javascripts/jquery.cookie.js") - script(src="#{dirPrefix}resources/javascripts/bootstrap.js") - - -mixin endingScripts - script(defer, src="#{dirPrefix}resources/javascripts/ux.js") - script(src="#{dirPrefix}resources/javascripts/clicker.js") - script(src="#{dirPrefix}resources/javascripts/jquery-scrollspy.js") - script(defer, src="#{dirPrefix}resources/javascripts/disqus-ext.js") - script(defer, src="#{dirPrefix}resources/javascripts/ga.js") - -mixin identifyBuild(tree, type) - landingPage = 'true' - -dirPrefix = './' - -mixin markdown(text, inline) - != markdown(text, inline) \ No newline at end of file diff --git a/doc/template/jade/layout.jade b/doc/template/jade/layout.jade deleted file mode 100644 index c2911c69..00000000 --- a/doc/template/jade/layout.jade +++ /dev/null @@ -1,12 +0,0 @@ -include common_layout -include lib - -#documentation.span9 - -if (isIndex) - != indexContent - -else - mixin api() - - mixin endingScripts - - div(id="disqus_thread") \ No newline at end of file diff --git a/doc/template/jade/lib.jade b/doc/template/jade/lib.jade deleted file mode 100644 index 62ee92d2..00000000 --- a/doc/template/jade/lib.jade +++ /dev/null @@ -1,217 +0,0 @@ -- var methodSection, constructorSection, propertySection, eventSection; - --function renameMemberTitle(title, count) - if title.indexOf("ethods") >= 0 - span Functions (#{count}) - else if title.indexOf("ropert") >= 0 - span Properties (#{count}) - else - span #{title} (#{count}) - -mixin article(obj, parents) - if typeof obj === 'string' - obj = list[obj] - - if (obj.private !== true && obj.name.charAt(0) !== "$") - title = obj.path + (obj.type ? ' (' + obj.type + ')' : '') - article.article(id=obj.path, data-title=title) - if obj.type === 'section' || obj.type === 'namespace' || obj.type === 'class' || obj.type === 'mixin' - - if obj.stability - mixin markdown(">" + obj.stability) - - if obj.description - .section.description - .memberContent - mixin markdown(obj.description) - - else - .section.method - .memberContent - if obj.signatures - div.title - i(id='#{obj.path}', class='methodToggle methodClicker inactive icon-caret-right') - ul.signatures - -var loops = 0; - for sig in obj.signatures - li.signature - ul - li.signature-call!= signature(obj, sig, ["methodClicker"]) - if sig.returns - li.signature-returns - ul.argument-types - for ret in sig.returns - li.argument-type!= returnLink(obj, ret, []) - -if (loops == 0) - -loops = 1 // ensure that we only print ONE meta info UL per signature (some methods have multiple signatures) - ul.metaInfo - if obj.undocumented - li - span.label.undocumented Undocumented - if obj.experimental - li - span.label.experimental Experimental - if obj.readonly - li - span.label.read-only Read-Only - if obj.chainable - li - span.label.chainable Chainable - if obj.internal - li - span.label.internal Internal - if obj.deprecated - li - span.label.deprecated - | Deprecated - if obj.deprecated.from - |   (since #{obj.deprecated.from}) - if obj.deprecated.off - |  and will be removed on #{obj.deprecated.off} - if obj.alias_of - li - span.label.alias.single - | Aliased as: - != link(obj.alias_of) - else if obj.aliases.length - li - span.label.alias.multiple - | Aliased as: - ul.alias - for alias in obj.aliases - li - mixin link(alias) - - if obj.related_to - li - span.label.related-to - | Related to - mixin link(obj.related_to, ["relatedToLink"]) - - div.sideToggler - - div(id='ellipsis_#{obj.path}', class='ellipsis_description') - mixin markdown(obj.short_description) - - - div.description - - mixin markdown(obj.description) - - if obj.bound && ~obj.bound.indexOf('#') - p.note.methodized - | This method can be called either as an - != link(obj.bound, ['link-short'], 'instance method') - | or as a generic method. If calling as generic, pass the instance in as the first argument. - else if obj.bound && !~obj.bound.indexOf('#') - p.note.functionalized - | This method can be called either as an instance method or as a - != link(obj.bound, ['link-short'], 'generic method') - |. If calling as generic, pass the instance in as the first argument. - - if obj.arguments && obj.arguments.length - h4 Arguments - != argumentTable(obj.arguments, ["argument-list", "table", "table-striped", "table-bordered"]) - - if obj.returns && obj.returns.length - h4 Returns - != returnTable(obj.returns, ["return-list", "table", "table-striped", "table-bordered"]) - - //- children - for child in obj.children.filter(function(x){return x.type === 'section'}) - mixin article(child, parents.concat(obj)) - for child in obj.children.filter(function(x){return x.type === 'utility'}) - mixin article(child, parents.concat(obj)) - - for child in obj.children.filter(function(x){return x.type === 'constructor'}) - - if (!constructorSection) - - constructorSection = true - h3.sectionHeader Constructors - mixin article(child, parents.concat(obj)) - - for child in obj.children.filter(function(x){return x.type === 'event'}) - - if (!eventSection) - - eventSection = true - h3.sectionHeader Events - mixin article(child, parents.concat(obj), 'event') - - for child in obj.children.filter(function(x){return x.type === 'class method'}) - - if (!methodSection) - - methodSection = true - h3.sectionHeader Methods - mixin article(child, parents.concat(obj)) - - for child in obj.children.filter(function(x){return x.type === 'class property'}) - - if (!propertySection) - - propertySection = true - h3.sectionHeader Properties - mixin article(child, parents.concat(obj)) - - for child in obj.children.filter(function(x){return x.type === 'instance method'}) - mixin article(child, parents.concat(obj)) - for child in obj.children.filter(function(x){return x.type === 'instance property'}) - mixin article(child, parents.concat(obj)) - for child in obj.children.filter(function(x){return x.type === 'constant'}) - mixin article(child, parents.concat(obj)) - - - -mixin api() - -pos = 0 - for obj in tree.children - -if (obj.subclasses.length == 0) - mixin render_starting_tabs(obj, pos) - -else - mixin render_starting_tabs(obj, pos) - for child in obj.children.filter(function(x){return x.type === 'namespace' || x.type === 'class' || x.type === 'mixin'}) - -pos++ - mixin render_starting_tabs(child, pos) - - -mixin render_starting_tabs(obj, pos) - .classContent - .membersBackground - - div(class=' members pos#{pos}') - div(class=' membersContent pos#{pos}') - h1.memberHeader - -var heading = obj.path - span.name #{heading} - - -if (true || obj.filename.indexOf("index") < 0) - ul(class='nav tabs pos#{pos}', data-tabs='tabs') - for selector, title in {'Events': ['event', 'events'], 'Constructors': ['constructor', 'constructors'], 'Class methods': ['class method', 'class_methods'], 'Class properties': ['class property', 'class_properties'], 'Instance methods': ['instance method', 'instance_methods'], 'Instance properties': ['instance property', 'instance_properties'], 'Constants': ['constant', 'constants']} - members = obj.children.filter(function(x){return x.type === selector[0]}) - li(class="dropdown", data-dropdown="dropdown") - if members.length - a(href="\#", class="dropdown-toggle", data-toggle="dropdown") - != renameMemberTitle(title, members.length) - b.caret - ul.dropdown-menu - for m in members - if (m.private !== true && m.name.charAt(0) !== "$") - li(id='dropdown_#{m.path}', data-id='#{m.path}', class='memberLink') - mixin link(m, [], true) - -methodSection = constructorSection = propertySection = eventSection = false; - mixin article(obj, []) - -mixin short_description_list(collection) - ul.method-details-list - for obj in collection - if typeof obj === 'string' - obj = list[obj] - li.method-description - h4 - mixin link(obj) - if obj.short_description - mixin markdown(obj.short_description) - -mixin link(obj, classes, short) - l = link(obj, classes, short) - != l - -mixin links(collection) - ul.method-list - for obj in collection - li - mixin link(obj) \ No newline at end of file diff --git a/doc/template/resources/font/fontawesome-webfont.eot b/doc/template/resources/font/fontawesome-webfont.eot deleted file mode 100644 index 89070c1e..00000000 Binary files a/doc/template/resources/font/fontawesome-webfont.eot and /dev/null differ diff --git a/doc/template/resources/font/fontawesome-webfont.svg b/doc/template/resources/font/fontawesome-webfont.svg deleted file mode 100644 index 1245f92c..00000000 --- a/doc/template/resources/font/fontawesome-webfont.svg +++ /dev/null @@ -1,255 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/doc/template/resources/font/fontawesome-webfont.ttf b/doc/template/resources/font/fontawesome-webfont.ttf deleted file mode 100644 index c17e9f8d..00000000 Binary files a/doc/template/resources/font/fontawesome-webfont.ttf and /dev/null differ diff --git a/doc/template/resources/font/fontawesome-webfont.woff b/doc/template/resources/font/fontawesome-webfont.woff deleted file mode 100644 index 09f2469a..00000000 Binary files a/doc/template/resources/font/fontawesome-webfont.woff and /dev/null differ diff --git a/doc/template/resources/images/Ace_ERD.png b/doc/template/resources/images/Ace_ERD.png deleted file mode 100644 index 78fb8dab..00000000 Binary files a/doc/template/resources/images/Ace_ERD.png and /dev/null differ diff --git a/doc/template/resources/javascripts/bbq.js b/doc/template/resources/javascripts/bbq.js deleted file mode 100644 index bcbf2483..00000000 --- a/doc/template/resources/javascripts/bbq.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * jQuery BBQ: Back Button & Query Library - v1.2.1 - 2/17/2010 - * http://benalman.com/projects/jquery-bbq-plugin/ - * - * Copyright (c) 2010 "Cowboy" Ben Alman - * Dual licensed under the MIT and GPL licenses. - * http://benalman.com/about/license/ - */ -(function($,p){var i,m=Array.prototype.slice,r=decodeURIComponent,a=$.param,c,l,v,b=$.bbq=$.bbq||{},q,u,j,e=$.event.special,d="hashchange",A="querystring",D="fragment",y="elemUrlAttr",g="location",k="href",t="src",x=/^.*\?|#.*$/g,w=/^.*\#/,h,C={};function E(F){return typeof F==="string"}function B(G){var F=m.call(arguments,1);return function(){return G.apply(this,F.concat(m.call(arguments)))}}function n(F){return F.replace(/^[^#]*#?(.*)$/,"$1")}function o(F){return F.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")}function f(H,M,F,I,G){var O,L,K,N,J;if(I!==i){K=F.match(H?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);J=K[3]||"";if(G===2&&E(I)){L=I.replace(H?w:x,"")}else{N=l(K[2]);I=E(I)?l[H?D:A](I):I;L=G===2?I:G===1?$.extend({},I,N):$.extend({},N,I);L=a(L);if(H){L=L.replace(h,r)}}O=K[1]+(H?"#":L||!K[1]?"?":"")+L+J}else{O=M(F!==i?F:p[g][k])}return O}a[A]=B(f,0,o);a[D]=c=B(f,1,n);c.noEscape=function(G){G=G||"";var F=$.map(G.split(""),encodeURIComponent);h=new RegExp(F.join("|"),"g")};c.noEscape(",/");$.deparam=l=function(I,F){var H={},G={"true":!0,"false":!1,"null":null};$.each(I.replace(/\+/g," ").split("&"),function(L,Q){var K=Q.split("="),P=r(K[0]),J,O=H,M=0,R=P.split("]["),N=R.length-1;if(/\[/.test(R[0])&&/\]$/.test(R[N])){R[N]=R[N].replace(/\]$/,"");R=R.shift().split("[").concat(R);N=R.length-1}else{N=0}if(K.length===2){J=r(K[1]);if(F){J=J&&!isNaN(J)?+J:J==="undefined"?i:G[J]!==i?G[J]:J}if(N){for(;M<=N;M++){P=R[M]===""?O.length:R[M];O=O[P]=M').hide().insertAfter("body")[0].contentWindow;q=function(){return a(n.document[c][l])};o=function(u,s){if(u!==s){var t=n.document;t.open().close();t[c].hash="#"+u}};o(a())}}m.start=function(){if(r){return}var t=a();o||p();(function s(){var v=a(),u=q(t);if(v!==t){o(t=v,u);$(i).trigger(d)}else{if(u!==t){i[c][l]=i[c][l].replace(/#.*/,"")+"#"+u}}r=setTimeout(s,$[d+"Delay"])})()};m.stop=function(){if(!n){r&&clearTimeout(r);r=0}};return m})()})(jQuery,this); \ No newline at end of file diff --git a/doc/template/resources/javascripts/bootstrap.js b/doc/template/resources/javascripts/bootstrap.js deleted file mode 100644 index 79241e74..00000000 --- a/doc/template/resources/javascripts/bootstrap.js +++ /dev/null @@ -1,389 +0,0 @@ -/* ============================================================ - * bootstrap-dropdown.js v2.1.1 - * http://twitter.github.com/bootstrap/javascript.html#dropdowns - * ============================================================ - * Copyright 2012 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================ */ - - -!function ($) { - - "use strict"; // jshint ;_; - - - /* DROPDOWN CLASS DEFINITION - * ========================= */ - - var toggle = '[data-toggle=dropdown]' - , Dropdown = function (element) { - var $el = $(element).on('click.dropdown.data-api', this.toggle) - $('html').on('click.dropdown.data-api', function () { - $el.parent().removeClass('open') - }) - } - - Dropdown.prototype = { - - constructor: Dropdown - - , toggle: function (e) { - var $this = $(this) - , $parent - , isActive - - if ($this.is('.disabled, :disabled')) return - - $parent = getParent($this) - - isActive = $parent.hasClass('open') - - clearMenus() - - if (!isActive) { - $parent.toggleClass('open') - $this.focus() - } - - return false - } - - , keydown: function (e) { - var $this - , $items - , $active - , $parent - , isActive - , index - - if (!/(38|40|27)/.test(e.keyCode)) return - - $this = $(this) - - e.preventDefault() - e.stopPropagation() - - if ($this.is('.disabled, :disabled')) return - - $parent = getParent($this) - - isActive = $parent.hasClass('open') - - if (!isActive || (isActive && e.keyCode == 27)) return $this.click() - - $items = $('[role=menu] li:not(.divider) a', $parent) - - if (!$items.length) return - - index = $items.index($items.filter(':focus')) - - if (e.keyCode == 38 && index > 0) index-- // up - if (e.keyCode == 40 && index < $items.length - 1) index++ // down - if (!~index) index = 0 - - $items - .eq(index) - .focus() - } - - } - - function clearMenus() { - getParent($(toggle)) - .removeClass('open') - } - - function getParent($this) { - var selector = $this.attr('data-target') - , $parent - - if (!selector) { - selector = $this.attr('href') - selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 - } - - $parent = $(selector) - $parent.length || ($parent = $this.parent()) - - return $parent - } - - - /* DROPDOWN PLUGIN DEFINITION - * ========================== */ - - $.fn.dropdown = function (option) { - return this.each(function () { - var $this = $(this) - , data = $this.data('dropdown') - if (!data) $this.data('dropdown', (data = new Dropdown(this))) - if (typeof option == 'string') data[option].call($this) - }) - } - - $.fn.dropdown.Constructor = Dropdown - - - /* APPLY TO STANDARD DROPDOWN ELEMENTS - * =================================== */ - - $(function () { - $('html') - .on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus) - $('body') - .on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) - .on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle) - .on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown) - }) - -}(window.jQuery); -/* ======================================================== - * bootstrap-tab.js v2.1.1 - * http://twitter.github.com/bootstrap/javascript.html#tabs - * ======================================================== - * Copyright 2012 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ======================================================== */ - - -!function ($) { - - "use strict"; // jshint ;_; - - - /* TAB CLASS DEFINITION - * ==================== */ - - var Tab = function (element) { - this.element = $(element) - } - - Tab.prototype = { - - constructor: Tab - - , show: function () { - var $this = this.element - , $ul = $this.closest('ul:not(.dropdown-menu)') - , selector = $this.attr('data-target') - , previous - , $target - , e - - if (!selector) { - selector = $this.attr('href') - selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 - } - - if ( $this.parent('li').hasClass('active') ) return - - previous = $ul.find('.active a').last()[0] - - e = $.Event('show', { - relatedTarget: previous - }) - - $this.trigger(e) - - if (e.isDefaultPrevented()) return - - $target = $(selector) - - this.activate($this.parent('li'), $ul) - this.activate($target, $target.parent(), function () { - $this.trigger({ - type: 'shown' - , relatedTarget: previous - }) - }) - } - - , activate: function ( element, container, callback) { - var $active = container.find('> .active') - , transition = callback - && $.support.transition - && $active.hasClass('fade') - - function next() { - $active - .removeClass('active') - .find('> .dropdown-menu > .active') - .removeClass('active') - - element.addClass('active') - - if (transition) { - element[0].offsetWidth // reflow for transition - element.addClass('in') - } else { - element.removeClass('fade') - } - - if ( element.parent('.dropdown-menu') ) { - element.closest('li.dropdown').addClass('active') - } - - callback && callback() - } - - transition ? - $active.one($.support.transition.end, next) : - next() - - $active.removeClass('in') - } - } - - - /* TAB PLUGIN DEFINITION - * ===================== */ - - $.fn.tab = function ( option ) { - return this.each(function () { - var $this = $(this) - , data = $this.data('tab') - if (!data) $this.data('tab', (data = new Tab(this))) - if (typeof option == 'string') data[option]() - }) - } - - $.fn.tab.Constructor = Tab - - - /* TAB DATA-API - * ============ */ - - $(function () { - $('body').on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) { - e.preventDefault() - $(this).tab('show') - }) - }) - -}(window.jQuery); -/* ========================================================== - * bootstrap-affix.js v2.1.1 - * http://twitter.github.com/bootstrap/javascript.html#affix - * ========================================================== - * Copyright 2012 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ========================================================== */ - - -!function ($) { - - "use strict"; // jshint ;_; - - - /* AFFIX CLASS DEFINITION - * ====================== */ - - var Affix = function (element, options) { - this.options = $.extend({}, $.fn.affix.defaults, options) - this.$window = $(window).on('scroll.affix.data-api', $.proxy(this.checkPosition, this)) - this.$element = $(element) - this.checkPosition() - } - - Affix.prototype.checkPosition = function () { - if (!this.$element.is(':visible')) return - - var scrollHeight = $(document).height() - , scrollTop = this.$window.scrollTop() - , position = this.$element.offset() - , offset = this.options.offset - , offsetBottom = offset.bottom - , offsetTop = offset.top - , reset = 'affix affix-top affix-bottom' - , affix - - if (typeof offset != 'object') offsetBottom = offsetTop = offset - if (typeof offsetTop == 'function') offsetTop = offset.top() - if (typeof offsetBottom == 'function') offsetBottom = offset.bottom() - - affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? - false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? - 'bottom' : offsetTop != null && scrollTop <= offsetTop ? - 'top' : false - - if (this.affixed === affix) return - - this.affixed = affix - this.unpin = affix == 'bottom' ? position.top - scrollTop : null - - this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : '')) - } - - - /* AFFIX PLUGIN DEFINITION - * ======================= */ - - $.fn.affix = function (option) { - return this.each(function () { - var $this = $(this) - , data = $this.data('affix') - , options = typeof option == 'object' && option - if (!data) $this.data('affix', (data = new Affix(this, options))) - if (typeof option == 'string') data[option]() - }) - } - - $.fn.affix.Constructor = Affix - - $.fn.affix.defaults = { - offset: 0 - } - - - /* AFFIX DATA-API - * ============== */ - - $(window).on('load', function () { - $('[data-spy="affix"]').each(function () { - var $spy = $(this) - , data = $spy.data() - - data.offset = data.offset || {} - - data.offsetBottom && (data.offset.bottom = data.offsetBottom) - data.offsetTop && (data.offset.top = data.offsetTop) - - $spy.affix(data) - }) - }) - - -}(window.jQuery); \ No newline at end of file diff --git a/doc/template/resources/javascripts/clicker.js b/doc/template/resources/javascripts/clicker.js deleted file mode 100644 index 90e7e12c..00000000 --- a/doc/template/resources/javascripts/clicker.js +++ /dev/null @@ -1,69 +0,0 @@ -function setupClicker() { - // when hovering over arrow, add highlight (only if inactive) - $("i.methodToggle").hover(function () { - if (!$("i.methodToggle").hasClass('active')) - $(this).addClass("methodToggleHover"); - }, - function () { - $(this).removeClass("methodToggleHover"); - } - ); - - function handleClick(e, linkHref) { - //if (linkHref.indexOf("nav=api&api=") >= 0) - // return; - if (linkHref == "api") - return; - - e.preventDefault(); - - var dstElem; - if (linkHref) { - dstElem = $("article[id='" + linkHref + "']"); - } - - var $article = (dstElem || $(this)).closest('.article'), - $arrow = $('i.methodClicker', $article); - - if (!$article.hasClass('methodToggleOpen') || this.force) { - $article.addClass('methodToggleOpen'); - $arrow.removeClass('inactive').addClass('active'); - - if (!$arrow[0]) - return; - - var data = $arrow[0].id.replace(/^js_/, ""); - //var state = {}; - //state.section = data; - //$.bbq.pushState(state); - - scrollTo(null, data); - } - else { - $article.removeClass('methodToggleOpen'); - $arrow.removeClass('active').addClass('inactive'); - } - } - - function transformHash(e) { - // some bs to figure out link hash - var hashId = (e.srcElement ? e.srcElement.href : (e.hash || e.target.href)) || e.currentTarget.hash; - - handleClick(e, hashId.substring(hashId.indexOf("#") + 1)); - } - - // for the arrow - $("i.methodToggle").click(handleClick); - - // for the signature - $('.member-name').click(handleClick); - - // for the top dropdown - $('li.memberLink a').click(transformHash); - - //$('a[href^="#"]').click(transformHash); - - $('.related-to', '.metaInfo').click(function(){ - location.hash = $(this).find('a').attr('href').split('#')[1]; - }); -} \ No newline at end of file diff --git a/doc/template/resources/javascripts/disqus-ext.js b/doc/template/resources/javascripts/disqus-ext.js deleted file mode 100644 index 6bb7ff4e..00000000 --- a/doc/template/resources/javascripts/disqus-ext.js +++ /dev/null @@ -1,17 +0,0 @@ -function setupDisqus(href) { - var disqus_shortname = 'aceapi'; - - //var paths = window.location.pathname.split("/"); - //var fileName = paths[paths.length - 2] + "/" + paths[paths.length - 1]; - - //var disqus_identifier = fileName; - var disqus_identifier = href.substring(2); - - (function() { - if (document.getElementById("disqusScript") === null) { - var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; - dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js'; - (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); - } - })(); -} \ No newline at end of file diff --git a/doc/template/resources/javascripts/ux.js b/doc/template/resources/javascripts/ux.js deleted file mode 100644 index 3bb07cf4..00000000 --- a/doc/template/resources/javascripts/ux.js +++ /dev/null @@ -1,135 +0,0 @@ -$(function () { - 'use strict'; - - var pagePath = document.location.pathname.substring(document.location.pathname.lastIndexOf("/") + 1); - - // select current page in sidenav and set up prev/next links if they exist - var $selNavLink = $('#sidebar').find('a[href="' + pagePath + '"]'); - if ($selNavLink.length) { - //$selListItem = $selNavLink.closest('li'); - - $selNavLink.addClass('currentItem'); - } - - if (window.addEventListener) window.addEventListener('load', loadCallback, true); - else window.attachEvent('load', loadCallback, true); - - function loadCallback(evt) { - var form = document.getElementById("searchbox"); - - if (form) { - var input = form.query; - form.onsubmit = function (evt) { - var query = input.value; - if (query) { - input.value = ""; - input.blur(); - var url = "https://www.google.com/search?q=" + encodeURIComponent("site:ace.ajax.org" + " " + query); - window.open(url); - } - return false; - }; - } - } - - // init search - $('#search') - // prevent from form submit - .on('submit', function () { - return false; - }).find('input'); -}); - -function ux() { - var d = 'a.menu, .dropdown-toggle' - - function clearMenus() { - $(d).parent('li').each(function () { - $(this).removeClass('open') - }); - } - - var s, sx; - - // scrolling offset calculation via www.quirksmode.org - if (window.pageYOffset || window.pageXOffset) { - s = window.pageYOffset; - sx = window.pageXOffset; - } - else if (document.documentElement && (document.documentElement.scrollTop || document.documentElement.scrollLeft)) { - s = document.documentElement.scrollTop; - sx = document.documentElement.scrollLeft; - } - else if (document.body) { - s = document.body.scrollTop; - sx = document.body.scrollLeft; - } - - if (document.documentElement.offsetWidth < 1010) { - if (sx <= 0) sx = 0; - else if (sx + document.documentElement.offsetWidth > 1010) sx = 1010 - document.documentElement.offsetWidth; - } - else sx = 0; - - $('span.methodClicker, article.article, i.methodClicker').each(function () { - var a = $(this); - var constructorPos = a.attr("id").indexOf("new "); - - var objName = a.attr("id"); - if (constructorPos >= 0) { - objName = objName.substring(constructorPos + 4); - objName += ".new"; - } - - a.attr("id", objName); - }); - - function showMethodContent() { - var locationHash = location.hash.replace(/^#/, '').replace(/\./g, '\\.'); - var equalsPos = location.hash.indexOf("="); - - if (equalsPos >=0) { - locationHash = locationHash.substring(0, location.hash.indexOf("=")); - } - - var $clickerEl = $('span#' + locationHash); - if ($clickerEl.length > 0 && $clickerEl.hasClass('methodClicker')) { - var p = $clickerEl.parent(); - p[0].force = true; - p.trigger('click'); - p[0].force = false; - } - } - - if (location.hash.indexOf("section") >= 1) { - showMethodContent(); - var data = location.hash; - scrollTo(null, data.substr(1)); - } - - window.onhashchange = function () { - showMethodContent(); - } -}; - -function scrollTo(el, data) { - if (!data) { - data = el.getAttribute("data-id"); - //location.hash = data; - } - var el = $("span#" + data.replace(/\./g, "\\."))[0]; - if (!el) return; - - var article = $(el).closest('.article')[0]; - - var top = article.offsetTop - 100; - - if (document.body.scrollTop > top || document.body.scrollTop != top && document.body.scrollTop + (window.innerHeight || document.documentElement.offsetHeight) < top + article.offsetHeight) { - $('body').animate({ - scrollTop: top - }, { - duration: 200, - easing: "swing" - }); - } -} \ No newline at end of file diff --git a/experiments/debug_mem_leak.html b/experiments/debug_mem_leak.html deleted file mode 100644 index b8ee8726..00000000 --- a/experiments/debug_mem_leak.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - - - \ No newline at end of file diff --git a/index.html b/index.html index e2440eb1..5031e00f 100644 --- a/index.html +++ b/index.html @@ -1,1345 +1,145 @@ - - - - Ace - The High Performance Code Editor for the Web - - - - - - - - - - - - - Fork me on GitHub - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              The high performance code editor for the web.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Built for Code

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Ace is an embeddable code editor written in JavaScript. - It matches the features and performance of native - editors such as Sublime, Vim and TextMate. It can be easily embedded - in any web page and JavaScript application. Ace is maintained as the - primary editor for Cloud9 IDE - and is the successor of the Mozilla Skywriter (Bespin) project. -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              /**
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * In fact, you're looking at ACE right now. Go ahead and play with it!
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - *
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * We are currently showing off the JavaScript mode. ACE has support for 45
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * language modes and 24 color themes!
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - */
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -function add(x, y) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    var resultString = "Hello, ACE! The result of your math is: ";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    var result = x + y;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    return resultString + result;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var addResult = add(3, 2);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -console.log(addResult);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Looking for a more full-featured demo? Check out the - kitchen sink. -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Features

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • Syntax highlighting for over 110 languages (TextMate/Sublime Text.tmlanguage files can be imported)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • Over 20 themes (TextMate/Sublime Text .tmtheme files can be imported)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • Automatic indent and outdent
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • An optional command line
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • Handles huge documents (four million lines seems to be the limit!)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • Fully customizable key bindings including vim and Emacs modes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • Search and replace with regular expressions
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • Highlight matching parentheses
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • Toggle between soft tabs and real tabs
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • Displays hidden characters
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • Drag and drop text using the mouse
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • Line wrapping
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • Code folding
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • Multiple cursors and selections
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • Live syntax checker (currently JavaScript/CoffeeScript/CSS/XQuery)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • Cut, copy, and paste functionality
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Get the Open-Source Code

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Ace is a community project. We actively encourage and support - contributions! The Ace source code is hosted on GitHub - and released under the BSD license ‐ - very simple and friendly to all kinds of projects, whether open-source - or not. Take charge of your editor and add your favorite language - highlighting and keybindings! -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              git clone git://github.com/ajaxorg/ace.git
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              History

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Skywriter/Bespin and Ace started - as two independent projects both aiming to build a no compromise - code editor component for the web. Bespin started as part of - Mozilla Labs and was based on the <canvas> tag, while Ace is - the editor component of Cloud9 IDE - and uses the DOM for rendering. After the release of Ace at - JSConf.eu 2010 - in Berlin the Skywriter team decided to merge Ace with a simplified - version of Skywriter's plugin system and some of Skywriter's - extensibility points. All these changes have been merged back to Ace - now, which supersedes Skywriter. Both Cloud9 IDE - and Mozilla are actively developing and - maintaining Ace. -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Related Projects

                                                                                                                                                                                                                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Embedding Ace in Your Site

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Ace can be easily embedded into a web page. Get prebuilt version of ace from - ace-builds repository and use the code below:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              <!DOCTYPE html>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<html lang="en">
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<head>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<title>ACE in Action</title>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<style type="text/css" media="screen">
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    #editor { 
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        position: absolute;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        top: 0;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        right: 0;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        bottom: 0;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        left: 0;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -</style>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -</head>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<body>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<div id="editor">function foo(items) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    var x = "All this is syntax highlighted";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    return x;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}</div>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<script src="/ace-builds/src-noconflict/ace.js" type="text/javascript" charset="utf-8"></script>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -<script>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    var editor = ace.edit("editor");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    editor.setTheme("ace/theme/monokai");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    editor.getSession().setMode("ace/mode/javascript");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -</script>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -</body>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -</html>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Now check out the How-To Guide for instructions on - common operations, such as setting a different language mode or - getting the contents from the editor. -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Loading Ace from a Local URL

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              If you want to clone and host Ace locally you can - use one of the pre-packaged versions. Just copy - one of src* subdirectories somewhere into your project, or use RequireJS to load the - contents of lib/ace folder as ace: -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              The packaged version can also be loaded from CDN's such as jsDelivr or cdnjs. -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Working with Ace

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              In all of these examples Ace has been invoked - as shown in the embedding guide. -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Setting Themes

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Themes are loaded on demand; all you have to do is pass the string name:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              editor.setTheme("ace/theme/twilight");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              > See all themes

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Setting the Programming Language Mode

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              By default, the editor supports plain text mode. All other language modes are available as separate modules, loaded on demand like this:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              editor.getSession().setMode("ace/mode/javascript");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Common Operations

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Set and get content:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              editor.setValue("the new text here"); // or session.setValue
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -editor.getValue(); // or session.getValue
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Get selected text:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              editor.session.getTextRange(editor.getSelectionRange());
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Insert at cursor:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              editor.insert("Something cool");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Get the current cursor line and column:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              editor.selection.getCursor();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Go to a line:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              editor.gotoLine(lineNumber);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Get total number of lines:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              editor.session.getLength();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Set the default tab size:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              editor.getSession().setTabSize(4);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Use soft tabs:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              editor.getSession().setUseSoftTabs(true);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Set the font size:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              document.getElementById('editor').style.fontSize='12px';
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Toggle word wrapping:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              editor.getSession().setUseWrapMode(true);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Set line highlighting:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              editor.setHighlightActiveLine(false);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Set the print margin visibility:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              editor.setShowPrintMargin(false);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Set the editor to read-only:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              editor.setReadOnly(true);  // false to make it editable
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Triggering Resizes

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Ace only resizes itself on window events. If you resize the editor div in another manner, and need Ace to resize, use the following:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              editor.resize()
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Searching

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              editor.find('needle',{
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    backwards: false,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    wrap: false,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    caseSensitive: false,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    wholeWord: false,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    regExp: false
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -editor.findNext();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -editor.findPrevious();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              The following options are available to you for your search parameters:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • - 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. -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Here's how you can perform a replace:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              editor.find('foo');
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -editor.replace('bar');
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              And here's a replace all:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              editor.replaceAll('bar');
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              (editor.replaceAll uses the needle set earlier by editor.find('needle', ...)

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Listening to Events

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              To listen for an onchange:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              editor.getSession().on('change', function(e) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    // e.type, etc
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              To listen for an selection change:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              editor.getSession().selection.on('changeSelection', function(e) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              To listen for a cursor change:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              editor.getSession().selection.on('changeCursor', function(e) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Adding New Commands and Keybindings

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              To assign key bindings to a custom function:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              editor.commands.addCommand({
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    name: 'myCommand',
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    bindKey: {win: 'Ctrl-M',  mac: 'Command-M'},
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    exec: function(editor) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        //...
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    },
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    readOnly: true // false if this command should not apply in readOnly mode
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Creating a Syntax Highlighter for Ace

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Creating a new syntax highlighter for Ace is extremly simple. You'll need to define two pieces of code: a new mode, and a new set of highlighting rules.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Where to Start

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              We recommend using the the Ace Mode Creator when defining your highlighter. This allows you to inspect your code's tokens, as well as providing a live preview of the syntax highlighter in action.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Defining a Mode

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Every language needs a mode. A mode contains the paths to a language's syntax highlighting rules, indentation rules, and code folding rules. Without defining a mode, Ace won't know anything about the finer aspects of your language.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Here is the starter template we'll use to create a new mode:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              define(function(require, exports, module) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -"use strict";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var oop = require("../lib/oop");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -// defines the parent mode
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var TextMode = require("./text").Mode;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var Tokenizer = require("../tokenizer").Tokenizer;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -// defines the language specific highlighters and folding rules
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var MyNewHighlightRules = require("./mynew_highlight_rules").MyNewHighlightRules;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var MyNewFoldMode = require("./folding/mynew").MyNewFoldMode;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var Mode = function() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    // set everything up
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    this.HighlightRules = MyNewHighlightRules;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    this.$outdent = new MatchingBraceOutdent();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    this.foldingRules = new MyNewFoldMode();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -};
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -oop.inherits(Mode, TextMode);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -(function() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    // configure comment start/end characters
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    this.lineCommentStart = "//";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    this.blockComment = {start: "/*", end: "*/"};
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    // special logic for indent/outdent. 
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    // By default ace keeps indentation of previous line
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    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);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    };
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    // create worker for live syntax checking
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    this.createWorker = function(session) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        var worker = new WorkerClient(["ace"], "ace/mode/mynew_worker", "NewWorker");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        worker.attachToDocument(session.getDocument());
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        worker.on("errors", function(e) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            session.setAnnotations(e.data);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        });
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        return worker;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    };
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}).call(Mode.prototype);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -exports.Mode = Mode;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              What's going on here? First, you're defining the path to TextMode (more on this later). Then you're pointing the mode to your definitions for the highlighting rules, as well as your rules for code folding. Finally, you're setting everything up to find those rules, and exporting the Mode so that it can be consumed. That's it!

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Regarding TextMode, you'll notice that it's only being used once: oop.inherits(Mode, TextMode);. If your new language depends on the rules of another language, you can choose to inherit the same rules, while expanding on it with your language's own requirements. For example, PHP inherits from HTML, since it can be embedded directly inside .html pages. You can either inherit from TextMode, or any other existing mode, if it already relates to your language.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              All Ace modes can be found in the lib/ace/mode folder.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Defining Syntax Highlighting Rules

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              The Ace highlighter can be considered to be a state machine. Regular expressions define the tokens for the current state, as well as the transitions into another state. Let's define mynew_highlight_rules.js, which our mode above uses.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              All syntax highlighters start off looking something like this:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              define(function(require, exports, module) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -"use strict";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var oop = require("../lib/oop");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var MyNewHighlightRules = function() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    // regexp must not have capturing parentheses. Use (?:) instead.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    // regexps are ordered -> the first match is used
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -   this.$rules = {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        "start" : [
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                token: <token>, // String, Array, or Function: the CSS token to apply
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                regex: <regex>, // String or RegExp: the regexp to match
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -                next:  <next>   // [Optional] String: next state to enter
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -            }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        ]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    };
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -};
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -oop.inherits(MyNewHighlightRules, TextHighlightRules);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -exports.MyNewHighlightRules = MyNewHighlightRules;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              The token state machine operates on whatever is defined in this.$rules. The highlighter always begins at the start state, and progresses down the list, looking for a matching regex. When one is found, the resulting text is wrapped within a <span class="ace_<token>"> tag, where <token> is defined as the token property. Note that all tokens are preceded by the ace_ prefix when they're rendered on the page.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Once again, we're inheriting from TextHighlightRules here. We could choose to make this any other language set we want, if our new language requires previously defined syntaxes. For more information on extending languages, see "extending Highlighters" below.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Defining Tokens

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              The Ace highlighting system is heavily inspired by the TextMate language grammar. Most tokens will follow the conventions of TextMate when naming grammars. A thorough (albeit incomplete) list of tokens can be found on the Ace Wiki.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              For the complete list of tokens, see tool/tmtheme.js. It is possible to add new token names, but the scope of that knowledge is outside of this document.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Multiple tokens can be applied to the same text by adding dots in the token, e.g. token: support.function wraps the text in a <span class="ace_support ace_function"> tag.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Defining Regular Expressions

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Regular expressions can either be a RegExp or String definition

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              If you're using a regular expression, remember to start and end the line with the / character, like this:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    token : "constant.language.escape",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    regex : /\$[\w\d]+/
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              A caveat of using stringed regular expressions is that any \ character must be escaped. That means that even an innocuous regular expression like this:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              regex: "function\s*\(\w+\)"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Must actually be written like this:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              regex: "function\\s*\(\\w+\)"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Groupings

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              You can also include flat regexps--(var)--or have matching groups--((a+)(b+)). There is a strict requirement whereby matching groups must cover the entire matched string; thus, (hel)lo is invalid. If you want to create a non-matching group, simply start the group with the ?: predicate; thus, (hel)(?:lo) is okay. You can, of course, create longer non-matching groups. For example:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    token : "constant.language.boolean",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    regex : /(?:true|false)\b/
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -},
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              For flat regular expression matches, token can be a String, or a Function that takes a single argument (the match) and returns a string token. For example, using a function might look like this:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              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("|")
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -...
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -{
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    token: function(value) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        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_\\-]*"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              If token is a function,it should take the same number of arguments as there are groups, and return an array of tokens.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              For grouped regular expressions, token can be a String, in which case all matched groups are given that same token, like this:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    token: "identifier",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    regex: "(\\w+\\s*:)(\\w*)"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              More commonly, though, token is an Array (of the same length as the number of groups), whereby matches are given the token of the same alignment as in the match. For a complicated regular expression, like defining a function, that might look something like this:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    token : ["storage.type", "text", "entity.name.function"],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    regex : "(function)(\\s+)([a-zA-Z_][a-zA-Z0-9_]*\\b)"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Defining States

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              The syntax highlighting state machine stays in the start state, until you define a next state for it to advance to. At that point, the tokenizer stays in that new state, until it advances to another state. Afterwards, you should return to the original start state.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Here's an example:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              this.$rules = {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    "start" : [ {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        token : "text",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        regex : "<\\!\\[CDATA\\[",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        next : "cdata"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    },
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    "cdata" : [ {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        token : "text",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        regex : "\\]\\]>",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        next : "start"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    }, {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        defaultToken : "text"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    } ]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -};
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              In this extremly short sample, we're defining some highlighting rules for when Ace detectes a <![CDATA tag. When one is encountered, the tokenizer moves from start into the cdata state. It remains there, applying the text token to any string it encounters. Finally, when it hits a closing ]> symbol, it returns to the start state and continues to tokenize anything else.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Using the TMLanguage Tool

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              There is a tool that - will take an existing tmlanguage file and do its best to convert it into Javascript for Ace to consume. Here's what you need to get started: -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              1. In the Ace repository, navigate to the tools folder.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              2. -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              3. Run npm install to install required dependencies.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              4. -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              5. Run node tmlanguage.js <path_to_tmlanguage_file>; for example, node <path_to_tmlanguage_file> /Users/Elrond/elven.tmLanguage
                                                                                                                                                                                                                                                                                                                                                                                                                                                              6. -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Two files are created and placed in lib/ace/mode: one for the language mode, and one for the set of highlight rules. You will still need to add the code into ace/ext/modelist.js, and add a sample file for testing.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              A Note on Accuracy

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Your .tmlanguage file will then be converted to the best of the converter’s ability. It is an understatement to say that the tool is imperfect. Probably, language mode creation will never be able to be fully autogenerated. There's a list of non-determinable items; for example:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • The use of regular expression lookbehinds
                                                                                                                                                                                                                                                                                                                                                                                                                                                                This is a concept that JavaScript simply does not have and needs to be faked
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • Deciding which state to transition to
                                                                                                                                                                                                                                                                                                                                                                                                                                                                While the tool does create new states correctly, it labels them with generic terms like state_2, state_10, e.t.c.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • Extending modes
                                                                                                                                                                                                                                                                                                                                                                                                                                                                Many modes say something like include source.c, to mean, “add all the rules in C highlighting.” That syntax does not make sense to Ace or this tool (though of course you can extending existing highlighters).
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • Rule preference order
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • Gathering keywords
                                                                                                                                                                                                                                                                                                                                                                                                                                                                Most likely, you’ll need to take keywords from your language file and run them through createKeywordMapper()
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              However, the tool is an excellent way to get a quick start, if you already possess a tmlanguage file for you language.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Extending Highlighters

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Suppose you're working on a LuaPage, PHP embedded in HTML, or a Django template. You'll need to create a syntax highlighter that takes all the rules from the original language (Lua, PHP, or Python) and extends it with some additional identifiers (<?lua, <?php, {%, for example). Ace allows you to easily extend a highlighter using a few helper functions.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Getting Existing Rules

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              To get the existing syntax highlighting rules for a particular language, use the getRules() function. For example:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -this.$rules = new HtmlHighlightRules().getRules();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -/*
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    this.$rules == Same this.$rules as HTML highlighting
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -*/
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Extending a Highlighter

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              The addRules method does one thing, and it does one thing well: it adds new rules to an existing rule set, and prefixes any state with a given tag. For example, let's say you've got two sets of rules, defined like this:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              this.$rules = {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    "start": [ /* ... */ ]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -};
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var newRules = {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    "start": [ /* ... */ ]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              If you want to incorporate newRules into this.$rules, you'd do something like this:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              this.addRules(newRules, "new-");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -/*
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    this.$rules = {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        "start": [ ... ],
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        "new-start": [ ... ]
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    };
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -*/
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Extending Two Highlighters

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              The last function available to you combines both of these concepts, and it's called embedRules. It takes three parameters:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              1. An existing rule set to embed with
                                                                                                                                                                                                                                                                                                                                                                                                                                                              2. -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              3. A prefix to apply for each state in the existing rule set
                                                                                                                                                                                                                                                                                                                                                                                                                                                              4. -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              5. A set of new states to add
                                                                                                                                                                                                                                                                                                                                                                                                                                                              6. -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Like addRules, embedRules adds on to the existing this.$rules object.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              To explain this visually, let's take a look at the syntax highlighter for Lua pages, which combines all of these concepts:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              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"
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    ]);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -};
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Here, this.$rules starts off as a set of HTML highlighting rules. To this set, we add two new checks for <%= and <?lua=. We also delegate that if one of these rules are matched, we should move onto the lua-start state. Next, embedRules takes the already existing set of LuaHighlightRules and applies the lua- prefix to each state there. Finally, it adds two new checks for %> and ?>, allowing the state machine to return to start.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Code Folding

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Adding new folding rules to your mode can be a little tricky. First, insert the following lines of code into your mode definition:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              var MyFoldMode = require("./folding/newrules").FoldMode;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -...
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var MyMode = function() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    ...
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    this.foldingRules = new MyFoldMode();
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -};
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              You'll be defining your code folding rules into the lib/ace/mode/folding folder. Here's a template that you can use to get started:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              define(function(require, exports, module) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -"use strict";
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var oop = require("../../lib/oop");
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var Range = require("../../range").Range;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var BaseFoldMode = require("./fold_mode").FoldMode;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -var FoldMode = exports.FoldMode = function() {};
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -oop.inherits(FoldMode, BaseFoldMode);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -(function() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    // regular expressions that identify starting and stopping points
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    this.foldingStartMarker; 
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    this.foldingStopMarker;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    this.getFoldWidgetRange = function(session, foldStyle, row) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        var line = session.getLine(row);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -        // test each line, and return a range of segments to collapse
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    };
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}).call(FoldMode.prototype);
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -});
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Just like with TextMode for syntax highlighting, BaseFoldMode contains the starting point for code folding logic. foldingStartMarker defines your opening folding point, while foldingStopMarker defines the stopping point. For example, for a C-style folding system, these values might look like this:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              These regular expressions identify various symbols--{, [, //--to pay attention to. getFoldWidgetRange matches on these regular expressions, and when found, returns the range of relevant folding points. For more information on the Range object, see the Ace API documentation.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Again, for a C-style folding mechanism, a range to return for the starting fold might look like this:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              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;
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Let's say we stumble across the code block hello_world() {. Our range object here becomes:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  startRow: 0,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  endRow: 0,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  startColumn: 0,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  endColumn: 13
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Testing Your Highlighter

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              The best way to test your tokenizer is to see it live, right? To do that, you'll want to modify the live Ace demo to preview your changes. You can find this file in the root Ace directory with the name kitchen-sink.html.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              1. - add an entry to supportedModes in ace/ext/modelist.js -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              2. -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              3. -

                                                                                                                                                                                                                                                                                                                                                                                                                                                                add a sample file to demo/kitchen-sink/docs/ with same name as the mode file -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              4. -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Once you set this up, you should be able to witness a live demonstration of your new highlighter.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Adding Automated Tests

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Adding automated tests for a highlighter is trivial so you are not required to do it, but it can help during development.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              In lib/ace/mode/_test create a file named

                                                                                                                                                                                                                                                                                                                                                                                                                                                              text_<modeName>.txt
                                                                                                                                                                                                                                                                                                                                                                                                                                                              with some example code. (You can skip this if the document you have added in demo/docs both looks good and covers various edge cases in your language syntax). -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Run node highlight_rules_test.js -gen to preserve current output of your tokenizer in tokens_<modeName>.json -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              After this running highlight_rules_test.js optionalLanguageName will compare output of your tokenizer with the correct output you've created. -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Any files ending with the _test.js suffix are automatically run by Ace's Travis CI server.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Ace API Reference

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Welcome to the Ace API Reference!

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              On the left, you'll find a list of all of our currently documented classes. - These is not a complete set of classes, but rather, the "core" set. For more - information on how to work with Ace, check out the embedding guide. -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Below is an ERD diagram describing some fundamentals about how the internals of Ace works:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Projects Using Ace

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Ace is used all over the web in all kinds of production applications. Here is - just a small sampling:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Support and User Resources

                                                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Aside from our GitHub page, here's a list of places you can find help for Ace:

                                                                                                                                                                                                                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + + + + ACE - Ajax.org Cloud9 Editor + + + + + + + + + + + Fork me on GitHub + + - - - - - - - - + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Ace is a standalone code editor written in JavaScript. Our goal is to create a web based code editor that matches and extends the features, usability and performance of existing native editors such as TextMate, Vim or Eclipse. It can be easily embedded in any web page and JavaScript application. Ace is developed as the primary editor for Cloud9 IDE and the successor of the Mozilla Skywriter (Bespin) Project.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Features

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • Syntax highlighting
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • Auto indentation and outdent
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • An optional command line
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • Work with huge documents (100,000 lines and more are no problem)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • Fully customizable key bindings including VI and Emacs modes
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • Themes (TextMate themes can be imported)
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • Search and replace with regular expressions
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • Highlight matching parentheses
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • Toggle between soft tabs and real tabs
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • Displays hidden characters
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • Highlight selected word
                                                                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Take Ace for a spin!

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Check out the Ace live demo or get a Cloud9 IDE account to experience Ace while editing one of your own GitHub projects.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              History

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Previously known as “Bespin” or lately “Skywriter” it’s now known as Ace (Ajax.org Cloud9 Editor)! Bespin and Ace started as two independent projects both aiming to build a no compromise code editor component for the web. Bespin started as part of Mozilla Labs and was based on the <canvas> tag, while Ace is the Editor component of the Cloud9 IDE and is using the DOM for rendering. After the release of Ace at JSConf.eu 2010 in Berlin the Skywriter team decided to merge Ace with a simplified version of Skywriter's plugin system and some of Skywriter's extensibility points. All these changes have been merged back to Ace now, which supersedes Skywriter. Both Ajax.org and Mozilla are actively developing and maintaining Ace.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              + + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Getting the code

                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Ace is a community project. We actively encourage and support contributions. The Ace source code is hosted on GitHub. It is released under the Mozilla tri-license (MPL/GPL/LGPL). This is the same license used by Firefox. This license is friendly to all kinds of projects, whether open source or not. Take charge of your editor and add your favorite language highlighting and keybindings! +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              git clone git://github.com/ajaxorg/ace.git

                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + + + + diff --git a/install.js b/install.js new file mode 100644 index 00000000..4789e48f --- /dev/null +++ b/install.js @@ -0,0 +1,53 @@ +#!/usr/bin/env node +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * Julian Viereck + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +var buildAce = require("./Makefile.dryice").buildAce; + +try { + buildAce({ + compress: false, + noconflict: false, + suffix: "", + name: "ace" + }); +} catch (e) { + console.log("--- Ace Build error ---"); + console.log(e); + process.exit(0); +} diff --git a/kitchen-sink.html b/kitchen-sink.html index a8e1fb7b..825a6194 100644 --- a/kitchen-sink.html +++ b/kitchen-sink.html @@ -1,4 +1,5 @@ - + @@ -6,24 +7,25 @@ Ace Kitchen Sink - - + + + - + -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - - - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - + + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -69,10 +100,8 @@ - - @@ -113,7 +142,7 @@ - +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -57,7 +59,36 @@
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -149,8 +178,6 @@ @@ -205,65 +232,11 @@ - - - - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - - - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - - - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - - - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - - - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - - - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - - - - - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -283,7 +255,7 @@ - + diff --git a/lib/ace/ace.js b/lib/ace/ace.js index 6c8a6126..5573abdb 100644 --- a/lib/ace/ace.js +++ b/lib/ace/ace.js @@ -1,37 +1,46 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Mozilla Skywriter. + * + * The Initial Developer of the Original Code is + * Mozilla. + * Portions created by the Initial Developer are Copyright (C) 2009 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Kevin Dangoor (kdangoor@mozilla.com) + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ /** + * class Ace + * * The main class required to set up an Ace instance in the browser. * - * @class Ace + * **/ define(function(require, exports, module) { @@ -39,91 +48,56 @@ define(function(require, exports, module) { require("./lib/fixoldbrowsers"); -var dom = require("./lib/dom"); -var event = require("./lib/event"); +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"); -require("./multi_select"); -require("./mode/folding/fold_mode"); -require("./theme/textmate"); -require("./ext/error_marker"); - exports.config = require("./config"); - -/** - * Provides access to require in packed noconflict mode - * @param {String} moduleName - * @returns {Object} - * - **/ -exports.require = require; - -/** - * Embeds the Ace editor into the DOM, at the element provided by `el`. - * @param {String | DOMElement} el Either the id of an element, or the element itself - * - **/ + /** + * Ace.edit(el) -> Editor + * - el (String | DOMElement): Either the id of an element, or the element itself + * + * This method embeds the Ace editor into the DOM, at the element provided by `el`. + * + **/ exports.edit = function(el) { if (typeof(el) == "string") { - var _id = el; - el = document.getElementById(_id); - if (!el) - throw new Error("ace.edit can't find div #" + _id); + el = document.getElementById(el); } - if (el && el.env && el.env.editor instanceof Editor) + if (el.env && el.env.editor instanceof Editor) return el.env.editor; - var value = ""; - if (el && /input|textarea/i.test(el.tagName)) { - var oldNode = el; - value = oldNode.value; - el = dom.createElement("pre"); - oldNode.parentNode.replaceChild(el, oldNode); - } else { - value = dom.getInnerText(el); - el.innerHTML = ''; - } + var doc = new EditSession(Dom.getInnerText(el)); + doc.setUndoManager(new UndoManager()); + el.innerHTML = ''; - var doc = exports.createEditSession(value); - - var editor = new Editor(new Renderer(el)); + var editor = new Editor(new Renderer(el, require("./theme/textmate"))); + new MultiSelect(editor); editor.setSession(doc); - var env = { - document: doc, - editor: editor, - onResize: editor.resize.bind(editor, null) - }; - if (oldNode) env.textarea = oldNode; - event.addListener(window, "resize", env.onResize); - editor.on("destroy", function() { - event.removeListener(window, "resize", env.onResize); - env.editor.container.env = null; // prevent memory leak on old ie + var env = {}; + env.document = doc; + env.editor = editor; + editor.resize(); + Event.addListener(window, "resize", function() { + editor.resize(); }); - editor.container.env = editor.env = env; + el.env = env; + // Store env on editor such that it can be accessed later on from + // the returned object. + editor.env = env; return editor; }; -/** - * Creates a new [[EditSession]], and returns the associated [[Document]]. - * @param {Document | String} text {:textParam} - * @param {TextMode} mode {:modeParam} - * - **/ -exports.createEditSession = function(text, mode) { - var doc = new EditSession(text, mode); - doc.setUndoManager(new UndoManager()); - return doc; -} -exports.EditSession = EditSession; -exports.UndoManager = UndoManager; }); diff --git a/lib/ace/anchor.js b/lib/ace/anchor.js index 39b78e0f..11809bc0 100644 --- a/lib/ace/anchor.js +++ b/lib/ace/anchor.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. * - * 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. + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -35,126 +42,143 @@ var oop = require("./lib/oop"); var EventEmitter = require("./lib/event_emitter").EventEmitter; /** + * class Anchor * - * Defines a floating pointer in the document. Whenever text is inserted or deleted before the cursor, the position of the anchor is updated. + * Defines the floating pointer in the document. Whenever text is inserted or deleted before the cursor, the position of the cursor is updated * - * @class Anchor **/ /** + * 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. * - * @param {Document} doc The document to associate with the anchor - * @param {Number} row The starting row position - * @param {Number} column The starting column position - * - * @constructor **/ var Anchor = exports.Anchor = function(doc, row, column) { - this.$onChange = this.onChange.bind(this); - this.attach(doc); + 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); - + /** + * Anchor.getPosition() -> Object + * * Returns an object identifying the `row` and `column` position of the current anchor. - * @returns {Object} + * **/ + this.getPosition = function() { return this.$clipPositionToDocument(this.row, this.column); }; - - /** + + /** + * Anchor.getDocument() -> Document * * Returns the current document. - * @returns {Document} + * **/ + this.getDocument = function() { return this.document; }; - - /** - * experimental: allows anchor to stick to the next on the left - */ - this.$insertRight = false; - /** - * Fires whenever the anchor position changes. - * - * Both of these objects have a `row` and `column` property corresponding to the position. - * - * Events that can trigger this function include [[Anchor.setPosition `setPosition()`]]. - * - * @event change - * @param {Object} e An object containing information about the anchor position. It has two properties: - * - `old`: An object describing the old Anchor position - * - `value`: An object describing the new Anchor position - * - **/ - this.onChange = function(delta) { - if (delta.start.row == delta.end.row && delta.start.row != this.row) - return; - - if (delta.start.row > this.row) - return; - - var point = $getTransformedPoint(delta, {row: this.row, column: this.column}, this.$insertRight); - this.setPosition(point.row, point.column, true); - }; - function $pointsInOrder(point1, point2, equalPointsInOrder) { - var bColIsAfter = equalPointsInOrder ? point1.column <= point2.column : point1.column < point2.column; - return (point1.row < point2.row) || (point1.row == point2.row && bColIsAfter); - } - - function $getTransformedPoint(delta, point, moveIfEqual) { - // Get delta info. - var deltaIsInsert = delta.action == "insert"; - var deltaRowShift = (deltaIsInsert ? 1 : -1) * (delta.end.row - delta.start.row); - var deltaColShift = (deltaIsInsert ? 1 : -1) * (delta.end.column - delta.start.column); - var deltaStart = delta.start; - var deltaEnd = deltaIsInsert ? deltaStart : delta.end; // Collapse insert range. - - // DELTA AFTER POINT: No change needed. - if ($pointsInOrder(point, deltaStart, moveIfEqual)) { - return { - row: point.row, - column: point.column - }; - } - - // DELTA BEFORE POINT: Move point by delta shift. - if ($pointsInOrder(deltaEnd, point, !moveIfEqual)) { - return { - row: point.row + deltaRowShift, - column: point.column + (point.row == deltaEnd.row ? deltaColShift : 0) - }; - } - - // DELTA ENVELOPS POINT (delete only): Move point to delta start. - // TODO warn if delta.action != "remove" ? - - return { - row: deltaStart.row, - column: deltaStart.column - }; - } - - /** - * Sets the anchor position to the specified row and column. If `noClip` is `true`, the position is not clipped. - * @param {Number} row The row index to move the anchor to - * @param {Number} column The column index to move the anchor to - * @param {Boolean} noClip Identifies if you want the position to be clipped + /** + * Anchor@change(e) + * - e (Event): Contains data about the event + * + * Fires whenever the anchor position changes. Events that can trigger this function include `'insertText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. * **/ + + 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); + }; + + /** + * Anchor.setPosition(row, column, noClip) + * - row (Number): The row index to move the anchor to + * - column (Number): The column index to move the anchor to + * - noClip (Boolean): Identifies if you want the position to be clipped + * + * Sets the anchor position to the specified row and column. If `noClip` is `true`, the position is not clipped. + * + **/ + this.setPosition = function(row, column, noClip) { var pos; if (noClip) { @@ -162,47 +186,50 @@ var Anchor = exports.Anchor = function(doc, row, column) { row: row, column: column }; - } else { + } + 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._signal("change", { + this._emit("change", { old: old, value: pos }); }; - + /** - * When called, the `"change"` event listener is removed. + * Anchor.detach() + * + * When called, the `'change'` event listener is removed. * **/ + this.detach = function() { this.document.removeEventListener("change", this.$onChange); }; - this.attach = function(doc) { - this.document = doc || this.document; - this.document.on("change", this.$onChange); - }; - - /** + + /** internal, hide + * Anchor.clipPositionToDocument(row, column) + * - row (Number): The row index to clip the anchor to + * - column (Number): The column index to clip the anchor to + * * Clips the anchor position to the specified row and column. - * @param {Number} row The row index to clip the anchor to - * @param {Number} column The column index to clip the anchor to * **/ + 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; @@ -215,13 +242,13 @@ var Anchor = exports.Anchor = function(doc, row, column) { 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); }); diff --git a/lib/ace/anchor_test.js b/lib/ace/anchor_test.js index c0b97273..62511c70 100644 --- a/lib/ace/anchor_test.js +++ b/lib/ace/anchor_test.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -57,55 +64,20 @@ module.exports = { doc.insert({row: 1, column: 1}, "123"); assert.position(anchor.getPosition(), 1, 7); }, - - "test insert text at anchor should not move anchor when insertRight is true": function() { - var doc = new Document("juhu\nkinners"); - var anchor = new Anchor(doc, 1, 4); - anchor.$insertRight = true; - - doc.insert({row: 1, column: 4}, "123"); - assert.position(anchor.getPosition(), 1, 4); - }, "test insert lines before cursor should move anchor row": function() { var doc = new Document("juhu\nkinners"); var anchor = new Anchor(doc, 1, 4); - doc.insertFullLines(1, ["123", "456"]); + doc.insertLines(1, ["123", "456"]); assert.position(anchor.getPosition(), 3, 4); }, - - "test insert lines at anchor position should move anchor down": function() { - var doc = new Document("juhu\nkinners"); - var anchor = new Anchor(doc, 1, 0); - - doc.insertLines(1, ["line"]); - assert.position(anchor.getPosition(), 2, 0); - }, - - "test insert lines at anchor position should not move anchor down when insertRight is true and column is 0": function() { - var doc = new Document("juhu\nkinners"); - var anchor = new Anchor(doc, 1, 0); - anchor.$insertRight = true; - - doc.insertLines(1, ["line"]); - assert.position(anchor.getPosition(), 1, 0); - }, - - "test insert lines at anchor row should move anchor down when column > 0": function() { - var doc = new Document("juhu\nkinners"); - var anchor = new Anchor(doc, 1, 2); - anchor.$insertRight = true; - - doc.insertLines(1, ["line"]); - assert.position(anchor.getPosition(), 2, 2); - }, "test insert new line before cursor should move anchor column": function() { var doc = new Document("juhu\nkinners"); var anchor = new Anchor(doc, 1, 4); - doc.insertMergedLines({row: 0, column: 0}, ['', '']); + doc.insertNewLine({row: 0, column: 0}); assert.position(anchor.getPosition(), 2, 4); }, @@ -113,7 +85,7 @@ module.exports = { var doc = new Document("juhu\nkinners"); var anchor = new Anchor(doc, 1, 4); - doc.insertMergedLines({row: 1, column: 2}, ['', '']); + doc.insertNewLine({row: 1, column: 2}); assert.position(anchor.getPosition(), 2, 2); }, @@ -145,7 +117,7 @@ module.exports = { var doc = new Document("juhu\n1\n2\nkinners"); var anchor = new Anchor(doc, 3, 4); - doc.removeFullLines(1, 2); + doc.removeLines(1, 2); assert.position(anchor.getPosition(), 1, 4); }, @@ -169,7 +141,7 @@ module.exports = { var doc = new Document("juhu\nkinners\n123"); var anchor = new Anchor(doc, 1, 5); - doc.removeFullLines(1, 1); + doc.removeLines(1, 1); assert.position(anchor.getPosition(), 1, 0); }, @@ -202,17 +174,6 @@ module.exports = { }); doc.remove(new Range(2, 0, 2, 1)); - }, - - "test insert/remove lines at the end of the document": function() { - var doc = new Document("juhu\nkinners\n123"); - var anchor = new Anchor(doc, 2, 4); - - doc.removeFullLines(0, 3); - assert.position(anchor.getPosition(), 0, 0); - doc.insertFullLines(0, ["a", "b", "c"]); - assert.position(anchor.getPosition(), 3, 0); - assert.equal(doc.getValue(), "a\nb\nc\n"); } }; diff --git a/lib/ace/apply_delta.js b/lib/ace/apply_delta.js deleted file mode 100644 index 98bfe148..00000000 --- a/lib/ace/apply_delta.js +++ /dev/null @@ -1,108 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -function throwDeltaError(delta, errorText){ - console.log("Invalid Delta:", delta); - throw "Invalid Delta: " + errorText; -} - -function positionInDocument(docLines, position) { - return position.row >= 0 && position.row < docLines.length && - position.column >= 0 && position.column <= docLines[position.row].length; -} - -function validateDelta(docLines, delta) { - // Validate action string. - if (delta.action != "insert" && delta.action != "remove") - throwDeltaError(delta, "delta.action must be 'insert' or 'remove'"); - - // Validate lines type. - if (!(delta.lines instanceof Array)) - throwDeltaError(delta, "delta.lines must be an Array"); - - // Validate range type. - if (!delta.start || !delta.end) - throwDeltaError(delta, "delta.start/end must be an present"); - - // Validate that the start point is contained in the document. - var start = delta.start; - if (!positionInDocument(docLines, delta.start)) - throwDeltaError(delta, "delta.start must be contained in document"); - - // Validate that the end point is contained in the document (remove deltas only). - var end = delta.end; - if (delta.action == "remove" && !positionInDocument(docLines, end)) - throwDeltaError(delta, "delta.end must contained in document for 'remove' actions"); - - // Validate that the .range size matches the .lines size. - var numRangeRows = end.row - start.row; - var numRangeLastLineChars = (end.column - (numRangeRows == 0 ? start.column : 0)); - if (numRangeRows != delta.lines.length - 1 || delta.lines[numRangeRows].length != numRangeLastLineChars) - throwDeltaError(delta, "delta.range must match delta lines"); -} - -exports.applyDelta = function(docLines, delta, doNotValidate) { - // disabled validation since it breaks autocompletion popup - // if (!doNotValidate) - // validateDelta(docLines, delta); - - var row = delta.start.row; - var startColumn = delta.start.column; - var line = docLines[row] || ""; - switch (delta.action) { - case "insert": - var lines = delta.lines; - if (lines.length === 1) { - docLines[row] = line.substring(0, startColumn) + delta.lines[0] + line.substring(startColumn); - } else { - var args = [row, 1].concat(delta.lines); - docLines.splice.apply(docLines, args); - docLines[row] = line.substring(0, startColumn) + docLines[row]; - docLines[row + delta.lines.length - 1] += line.substring(startColumn); - } - break; - case "remove": - var endColumn = delta.end.column; - var endRow = delta.end.row; - if (row === endRow) { - docLines[row] = line.substring(0, startColumn) + line.substring(endColumn); - } else { - docLines.splice( - row, endRow - row + 1, - line.substring(0, startColumn) + docLines[endRow].substring(endColumn) - ); - } - break; - } -} -}); diff --git a/lib/ace/autocomplete.js b/lib/ace/autocomplete.js deleted file mode 100644 index 8e121f35..00000000 --- a/lib/ace/autocomplete.js +++ /dev/null @@ -1,497 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var HashHandler = require("./keyboard/hash_handler").HashHandler; -var AcePopup = require("./autocomplete/popup").AcePopup; -var util = require("./autocomplete/util"); -var event = require("./lib/event"); -var lang = require("./lib/lang"); -var dom = require("./lib/dom"); -var snippetManager = require("./snippets").snippetManager; - -var Autocomplete = function() { - this.autoInsert = false; - this.autoSelect = true; - this.exactMatch = false; - this.gatherCompletionsId = 0; - this.keyboardHandler = new HashHandler(); - this.keyboardHandler.bindKeys(this.commands); - - this.blurListener = this.blurListener.bind(this); - this.changeListener = this.changeListener.bind(this); - this.mousedownListener = this.mousedownListener.bind(this); - this.mousewheelListener = this.mousewheelListener.bind(this); - - this.changeTimer = lang.delayedCall(function() { - this.updateCompletions(true); - }.bind(this)); - - this.tooltipTimer = lang.delayedCall(this.updateDocTooltip.bind(this), 50); -}; - -(function() { - - this.$init = function() { - this.popup = new AcePopup(document.body || document.documentElement); - this.popup.on("click", function(e) { - this.insertMatch(); - e.stop(); - }.bind(this)); - this.popup.focus = this.editor.focus.bind(this.editor); - this.popup.on("show", this.tooltipTimer.bind(null, null)); - this.popup.on("select", this.tooltipTimer.bind(null, null)); - this.popup.on("changeHoverMarker", this.tooltipTimer.bind(null, null)); - return this.popup; - }; - - this.getPopup = function() { - return this.popup || this.$init(); - }; - - this.openPopup = function(editor, prefix, keepPopupPosition) { - if (!this.popup) - this.$init(); - - this.popup.setData(this.completions.filtered); - - editor.keyBinding.addKeyboardHandler(this.keyboardHandler); - - var renderer = editor.renderer; - this.popup.setRow(this.autoSelect ? 0 : -1); - if (!keepPopupPosition) { - this.popup.setTheme(editor.getTheme()); - this.popup.setFontSize(editor.getFontSize()); - - var lineHeight = renderer.layerConfig.lineHeight; - - var pos = renderer.$cursorLayer.getPixelPosition(this.base, true); - pos.left -= this.popup.getTextLeftOffset(); - - var rect = editor.container.getBoundingClientRect(); - pos.top += rect.top - renderer.layerConfig.offset; - pos.left += rect.left - editor.renderer.scrollLeft; - pos.left += renderer.gutterWidth; - - this.popup.show(pos, lineHeight); - } else if (keepPopupPosition && !prefix) { - this.detach(); - } - }; - - this.detach = function() { - this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler); - this.editor.off("changeSelection", this.changeListener); - this.editor.off("blur", this.blurListener); - this.editor.off("mousedown", this.mousedownListener); - this.editor.off("mousewheel", this.mousewheelListener); - this.changeTimer.cancel(); - this.hideDocTooltip(); - - this.gatherCompletionsId += 1; - if (this.popup && this.popup.isOpen) - this.popup.hide(); - - if (this.base) - this.base.detach(); - this.activated = false; - this.completions = this.base = null; - }; - - this.changeListener = function(e) { - var cursor = this.editor.selection.lead; - if (cursor.row != this.base.row || cursor.column < this.base.column) { - this.detach(); - } - if (this.activated) - this.changeTimer.schedule(); - else - this.detach(); - }; - - this.blurListener = function(e) { - // we have to check if activeElement is a child of popup because - // on IE preventDefault doesn't stop scrollbar from being focussed - var el = document.activeElement; - var text = this.editor.textInput.getElement(); - var fromTooltip = e.relatedTarget && e.relatedTarget == this.tooltipNode; - var container = this.popup && this.popup.container; - if (el != text && el.parentNode != container && !fromTooltip - && el != this.tooltipNode && e.relatedTarget != text - ) { - this.detach(); - } - }; - - this.mousedownListener = function(e) { - this.detach(); - }; - - this.mousewheelListener = function(e) { - this.detach(); - }; - - this.goTo = function(where) { - var row = this.popup.getRow(); - var max = this.popup.session.getLength() - 1; - - switch(where) { - case "up": row = row <= 0 ? max : row - 1; break; - case "down": row = row >= max ? -1 : row + 1; break; - case "start": row = 0; break; - case "end": row = max; break; - } - - this.popup.setRow(row); - }; - - this.insertMatch = function(data) { - if (!data) - data = this.popup.getData(this.popup.getRow()); - if (!data) - return false; - - if (data.completer && data.completer.insertMatch) { - data.completer.insertMatch(this.editor, data); - } else { - if (this.completions.filterText) { - var ranges = this.editor.selection.getAllRanges(); - for (var i = 0, range; range = ranges[i]; i++) { - range.start.column -= this.completions.filterText.length; - this.editor.session.remove(range); - } - } - if (data.snippet) - snippetManager.insertSnippet(this.editor, data.snippet); - else - this.editor.execCommand("insertstring", data.value || data); - } - this.detach(); - }; - - - this.commands = { - "Up": function(editor) { editor.completer.goTo("up"); }, - "Down": function(editor) { editor.completer.goTo("down"); }, - "Ctrl-Up|Ctrl-Home": function(editor) { editor.completer.goTo("start"); }, - "Ctrl-Down|Ctrl-End": function(editor) { editor.completer.goTo("end"); }, - - "Esc": function(editor) { editor.completer.detach(); }, - "Return": function(editor) { return editor.completer.insertMatch(); }, - "Shift-Return": function(editor) { editor.completer.insertMatch(true); }, - "Tab": function(editor) { - var result = editor.completer.insertMatch(); - if (!result && !editor.tabstopManager) - editor.completer.goTo("down"); - else - return result; - }, - - "PageUp": function(editor) { editor.completer.popup.gotoPageUp(); }, - "PageDown": function(editor) { editor.completer.popup.gotoPageDown(); } - }; - - this.gatherCompletions = function(editor, callback) { - var session = editor.getSession(); - var pos = editor.getCursorPosition(); - - var line = session.getLine(pos.row); - var prefix = util.retrievePrecedingIdentifier(line, pos.column); - - this.base = session.doc.createAnchor(pos.row, pos.column - prefix.length); - this.base.$insertRight = true; - - var matches = []; - var total = editor.completers.length; - editor.completers.forEach(function(completer, i) { - completer.getCompletions(editor, session, pos, prefix, function(err, results) { - if (!err) - matches = matches.concat(results); - // Fetch prefix again, because they may have changed by now - var pos = editor.getCursorPosition(); - var line = session.getLine(pos.row); - callback(null, { - prefix: util.retrievePrecedingIdentifier(line, pos.column, results[0] && results[0].identifierRegex), - matches: matches, - finished: (--total === 0) - }); - }); - }); - return true; - }; - - this.showPopup = function(editor) { - if (this.editor) - this.detach(); - - this.activated = true; - - this.editor = editor; - if (editor.completer != this) { - if (editor.completer) - editor.completer.detach(); - editor.completer = this; - } - - editor.on("changeSelection", this.changeListener); - editor.on("blur", this.blurListener); - editor.on("mousedown", this.mousedownListener); - editor.on("mousewheel", this.mousewheelListener); - - this.updateCompletions(); - }; - - this.updateCompletions = function(keepPopupPosition) { - if (keepPopupPosition && this.base && this.completions) { - var pos = this.editor.getCursorPosition(); - var prefix = this.editor.session.getTextRange({start: this.base, end: pos}); - if (prefix == this.completions.filterText) - return; - this.completions.setFilter(prefix); - if (!this.completions.filtered.length) - return this.detach(); - if (this.completions.filtered.length == 1 - && this.completions.filtered[0].value == prefix - && !this.completions.filtered[0].snippet) - return this.detach(); - this.openPopup(this.editor, prefix, keepPopupPosition); - return; - } - - // Save current gatherCompletions session, session is close when a match is insert - var _id = this.gatherCompletionsId; - this.gatherCompletions(this.editor, function(err, results) { - // Only detach if result gathering is finished - var detachIfFinished = function() { - if (!results.finished) return; - return this.detach(); - }.bind(this); - - var prefix = results.prefix; - var matches = results && results.matches; - - if (!matches || !matches.length) - return detachIfFinished(); - - // Wrong prefix or wrong session -> ignore - if (prefix.indexOf(results.prefix) !== 0 || _id != this.gatherCompletionsId) - return; - - this.completions = new FilteredList(matches); - - if (this.exactMatch) - this.completions.exactMatch = true; - - this.completions.setFilter(prefix); - var filtered = this.completions.filtered; - - // No results - if (!filtered.length) - return detachIfFinished(); - - // One result equals to the prefix - if (filtered.length == 1 && filtered[0].value == prefix && !filtered[0].snippet) - return detachIfFinished(); - - // Autoinsert if one result - if (this.autoInsert && filtered.length == 1 && results.finished) - return this.insertMatch(filtered[0]); - - this.openPopup(this.editor, prefix, keepPopupPosition); - }.bind(this)); - }; - - this.cancelContextMenu = function() { - this.editor.$mouseHandler.cancelContextMenu(); - }; - - this.updateDocTooltip = function() { - var popup = this.popup; - var all = popup.data; - var selected = all && (all[popup.getHoveredRow()] || all[popup.getRow()]); - var doc = null; - if (!selected || !this.editor || !this.popup.isOpen) - return this.hideDocTooltip(); - this.editor.completers.some(function(completer) { - if (completer.getDocTooltip) - doc = completer.getDocTooltip(selected); - return doc; - }); - if (!doc) - doc = selected; - - if (typeof doc == "string") - doc = {docText: doc}; - if (!doc || !(doc.docHTML || doc.docText)) - return this.hideDocTooltip(); - this.showDocTooltip(doc); - }; - - this.showDocTooltip = function(item) { - if (!this.tooltipNode) { - this.tooltipNode = dom.createElement("div"); - this.tooltipNode.className = "ace_tooltip ace_doc-tooltip"; - this.tooltipNode.style.margin = 0; - this.tooltipNode.style.pointerEvents = "auto"; - this.tooltipNode.tabIndex = -1; - this.tooltipNode.onblur = this.blurListener.bind(this); - } - - var tooltipNode = this.tooltipNode; - if (item.docHTML) { - tooltipNode.innerHTML = item.docHTML; - } else if (item.docText) { - tooltipNode.textContent = item.docText; - } - - if (!tooltipNode.parentNode) - document.body.appendChild(tooltipNode); - var popup = this.popup; - var rect = popup.container.getBoundingClientRect(); - tooltipNode.style.top = popup.container.style.top; - tooltipNode.style.bottom = popup.container.style.bottom; - - if (window.innerWidth - rect.right < 320) { - tooltipNode.style.right = window.innerWidth - rect.left + "px"; - tooltipNode.style.left = ""; - } else { - tooltipNode.style.left = (rect.right + 1) + "px"; - tooltipNode.style.right = ""; - } - tooltipNode.style.display = "block"; - }; - - this.hideDocTooltip = function() { - this.tooltipTimer.cancel(); - if (!this.tooltipNode) return; - var el = this.tooltipNode; - if (!this.editor.isFocused() && document.activeElement == el) - this.editor.focus(); - this.tooltipNode = null; - if (el.parentNode) - el.parentNode.removeChild(el); - }; - -}).call(Autocomplete.prototype); - -Autocomplete.startCommand = { - name: "startAutocomplete", - exec: function(editor) { - if (!editor.completer) - editor.completer = new Autocomplete(); - editor.completer.autoInsert = false; - editor.completer.autoSelect = true; - editor.completer.showPopup(editor); - // prevent ctrl-space opening context menu on firefox on mac - editor.completer.cancelContextMenu(); - }, - bindKey: "Ctrl-Space|Ctrl-Shift-Space|Alt-Space" -}; - -var FilteredList = function(array, filterText) { - this.all = array; - this.filtered = array; - this.filterText = filterText || ""; - this.exactMatch = false; -}; -(function(){ - this.setFilter = function(str) { - if (str.length > this.filterText && str.lastIndexOf(this.filterText, 0) === 0) - var matches = this.filtered; - else - var matches = this.all; - - this.filterText = str; - matches = this.filterCompletions(matches, this.filterText); - matches = matches.sort(function(a, b) { - return b.exactMatch - a.exactMatch || b.score - a.score; - }); - - // make unique - var prev = null; - matches = matches.filter(function(item){ - var caption = item.snippet || item.caption || item.value; - if (caption === prev) return false; - prev = caption; - return true; - }); - - this.filtered = matches; - }; - this.filterCompletions = function(items, needle) { - var results = []; - var upper = needle.toUpperCase(); - var lower = needle.toLowerCase(); - loop: for (var i = 0, item; item = items[i]; i++) { - var caption = item.value || item.caption || item.snippet; - if (!caption) continue; - var lastIndex = -1; - var matchMask = 0; - var penalty = 0; - var index, distance; - - if (this.exactMatch) { - if (needle !== caption.substr(0, needle.length)) - continue loop; - }else{ - // caption char iteration is faster in Chrome but slower in Firefox, so lets use indexOf - for (var j = 0; j < needle.length; j++) { - // TODO add penalty on case mismatch - var i1 = caption.indexOf(lower[j], lastIndex + 1); - var i2 = caption.indexOf(upper[j], lastIndex + 1); - index = (i1 >= 0) ? ((i2 < 0 || i1 < i2) ? i1 : i2) : i2; - if (index < 0) - continue loop; - distance = index - lastIndex - 1; - if (distance > 0) { - // first char mismatch should be more sensitive - if (lastIndex === -1) - penalty += 10; - penalty += distance; - } - matchMask = matchMask | (1 << index); - lastIndex = index; - } - } - item.matchMask = matchMask; - item.exactMatch = penalty ? 0 : 1; - item.score = (item.score || 0) - penalty; - results.push(item); - } - return results; - }; -}).call(FilteredList.prototype); - -exports.Autocomplete = Autocomplete; -exports.FilteredList = FilteredList; - -}); diff --git a/lib/ace/autocomplete/popup.js b/lib/ace/autocomplete/popup.js deleted file mode 100644 index 6c480b38..00000000 --- a/lib/ace/autocomplete/popup.js +++ /dev/null @@ -1,344 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var Renderer = require("../virtual_renderer").VirtualRenderer; -var Editor = require("../editor").Editor; -var Range = require("../range").Range; -var event = require("../lib/event"); -var lang = require("../lib/lang"); -var dom = require("../lib/dom"); - -var $singleLineEditor = function(el) { - var renderer = new Renderer(el); - - renderer.$maxLines = 4; - - var editor = new Editor(renderer); - - editor.setHighlightActiveLine(false); - editor.setShowPrintMargin(false); - editor.renderer.setShowGutter(false); - editor.renderer.setHighlightGutterLine(false); - - editor.$mouseHandler.$focusWaitTimout = 0; - editor.$highlightTagPending = true; - - return editor; -}; - -var AcePopup = function(parentNode) { - var el = dom.createElement("div"); - var popup = new $singleLineEditor(el); - - if (parentNode) - parentNode.appendChild(el); - el.style.display = "none"; - popup.renderer.content.style.cursor = "default"; - popup.renderer.setStyle("ace_autocomplete"); - - popup.setOption("displayIndentGuides", false); - popup.setOption("dragDelay", 150); - - var noop = function(){}; - - popup.focus = noop; - popup.$isFocused = true; - - popup.renderer.$cursorLayer.restartTimer = noop; - popup.renderer.$cursorLayer.element.style.opacity = 0; - - popup.renderer.$maxLines = 8; - popup.renderer.$keepTextAreaAtCursor = false; - - popup.setHighlightActiveLine(false); - // set default highlight color - popup.session.highlight(""); - popup.session.$searchHighlight.clazz = "ace_highlight-marker"; - - popup.on("mousedown", function(e) { - var pos = e.getDocumentPosition(); - popup.selection.moveToPosition(pos); - selectionMarker.start.row = selectionMarker.end.row = pos.row; - e.stop(); - }); - - var lastMouseEvent; - var hoverMarker = new Range(-1,0,-1,Infinity); - var selectionMarker = new Range(-1,0,-1,Infinity); - selectionMarker.id = popup.session.addMarker(selectionMarker, "ace_active-line", "fullLine"); - popup.setSelectOnHover = function(val) { - if (!val) { - hoverMarker.id = popup.session.addMarker(hoverMarker, "ace_line-hover", "fullLine"); - } else if (hoverMarker.id) { - popup.session.removeMarker(hoverMarker.id); - hoverMarker.id = null; - } - }; - popup.setSelectOnHover(false); - popup.on("mousemove", function(e) { - if (!lastMouseEvent) { - lastMouseEvent = e; - return; - } - if (lastMouseEvent.x == e.x && lastMouseEvent.y == e.y) { - return; - } - lastMouseEvent = e; - lastMouseEvent.scrollTop = popup.renderer.scrollTop; - var row = lastMouseEvent.getDocumentPosition().row; - if (hoverMarker.start.row != row) { - if (!hoverMarker.id) - popup.setRow(row); - setHoverMarker(row); - } - }); - popup.renderer.on("beforeRender", function() { - if (lastMouseEvent && hoverMarker.start.row != -1) { - lastMouseEvent.$pos = null; - var row = lastMouseEvent.getDocumentPosition().row; - if (!hoverMarker.id) - popup.setRow(row); - setHoverMarker(row, true); - } - }); - popup.renderer.on("afterRender", function() { - var row = popup.getRow(); - var t = popup.renderer.$textLayer; - var selected = t.element.childNodes[row - t.config.firstRow]; - if (selected == t.selectedNode) - return; - if (t.selectedNode) - dom.removeCssClass(t.selectedNode, "ace_selected"); - t.selectedNode = selected; - if (selected) - dom.addCssClass(selected, "ace_selected"); - }); - var hideHoverMarker = function() { setHoverMarker(-1) }; - var setHoverMarker = function(row, suppressRedraw) { - if (row !== hoverMarker.start.row) { - hoverMarker.start.row = hoverMarker.end.row = row; - if (!suppressRedraw) - popup.session._emit("changeBackMarker"); - popup._emit("changeHoverMarker"); - } - }; - popup.getHoveredRow = function() { - return hoverMarker.start.row; - }; - - event.addListener(popup.container, "mouseout", hideHoverMarker); - popup.on("hide", hideHoverMarker); - popup.on("changeSelection", hideHoverMarker); - - popup.session.doc.getLength = function() { - return popup.data.length; - }; - popup.session.doc.getLine = function(i) { - var data = popup.data[i]; - if (typeof data == "string") - return data; - return (data && data.value) || ""; - }; - - var bgTokenizer = popup.session.bgTokenizer; - bgTokenizer.$tokenizeRow = function(row) { - var data = popup.data[row]; - var tokens = []; - if (!data) - return tokens; - if (typeof data == "string") - data = {value: data}; - if (!data.caption) - data.caption = data.value || data.name; - - var last = -1; - var flag, c; - for (var i = 0; i < data.caption.length; i++) { - c = data.caption[i]; - flag = data.matchMask & (1 << i) ? 1 : 0; - if (last !== flag) { - tokens.push({type: data.className || "" + ( flag ? "completion-highlight" : ""), value: c}); - last = flag; - } else { - tokens[tokens.length - 1].value += c; - } - } - - if (data.meta) { - var maxW = popup.renderer.$size.scrollerWidth / popup.renderer.layerConfig.characterWidth; - var metaData = data.meta; - if (metaData.length + data.caption.length > maxW - 2) { - // trim meta to fit this popup and add ellipsis - metaData = metaData.substr(0, maxW - data.caption.length - 3) + "\u2026" - } - tokens.push({type: "rightAlignedText", value: metaData}); - } - return tokens; - }; - bgTokenizer.$updateOnChange = noop; - bgTokenizer.start = noop; - - popup.session.$computeWidth = function() { - return this.screenWidth = 0; - }; - - popup.$blockScrolling = Infinity; - - // public - popup.isOpen = false; - popup.isTopdown = false; - - popup.data = []; - popup.setData = function(list) { - popup.setValue(lang.stringRepeat("\n", list.length), -1); - popup.data = list || []; - popup.setRow(0); - }; - popup.getData = function(row) { - return popup.data[row]; - }; - - popup.getRow = function() { - return selectionMarker.start.row; - }; - popup.setRow = function(line) { - line = Math.max(-1, Math.min(this.data.length, line)); - if (selectionMarker.start.row != line) { - popup.selection.clearSelection(); - selectionMarker.start.row = selectionMarker.end.row = line || 0; - popup.session._emit("changeBackMarker"); - popup.moveCursorTo(line || 0, 0); - if (popup.isOpen) - popup._signal("select"); - } - }; - - popup.on("changeSelection", function() { - if (popup.isOpen) - popup.setRow(popup.selection.lead.row); - popup.renderer.scrollCursorIntoView(); - }); - - popup.hide = function() { - this.container.style.display = "none"; - this._signal("hide"); - popup.isOpen = false; - }; - popup.show = function(pos, lineHeight, topdownOnly) { - var el = this.container; - var screenHeight = window.innerHeight; - var screenWidth = window.innerWidth; - var renderer = this.renderer; - // var maxLines = Math.min(renderer.$maxLines, this.session.getLength()); - var maxH = renderer.$maxLines * lineHeight * 1.4; - var top = pos.top + this.$borderSize; - if (top + maxH > screenHeight - lineHeight && !topdownOnly) { - el.style.top = ""; - el.style.bottom = screenHeight - top + "px"; - popup.isTopdown = false; - } else { - top += lineHeight; - el.style.top = top + "px"; - el.style.bottom = ""; - popup.isTopdown = true; - } - - el.style.display = ""; - this.renderer.$textLayer.checkForSizeChanges(); - - var left = pos.left; - if (left + el.offsetWidth > screenWidth) - left = screenWidth - el.offsetWidth; - - el.style.left = left + "px"; - - this._signal("show"); - lastMouseEvent = null; - popup.isOpen = true; - }; - - popup.getTextLeftOffset = function() { - return this.$borderSize + this.renderer.$padding + this.$imageSize; - }; - - popup.$imageSize = 0; - popup.$borderSize = 1; - - return popup; -}; - -dom.importCssString("\ -.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\ - background-color: #CAD6FA;\ - z-index: 1;\ -}\ -.ace_editor.ace_autocomplete .ace_line-hover {\ - border: 1px solid #abbffe;\ - margin-top: -1px;\ - background: rgba(233,233,253,0.4);\ -}\ -.ace_editor.ace_autocomplete .ace_line-hover {\ - position: absolute;\ - z-index: 2;\ -}\ -.ace_editor.ace_autocomplete .ace_scroller {\ - background: none;\ - border: none;\ - box-shadow: none;\ -}\ -.ace_rightAlignedText {\ - color: gray;\ - display: inline-block;\ - position: absolute;\ - right: 4px;\ - text-align: right;\ - z-index: -1;\ -}\ -.ace_editor.ace_autocomplete .ace_completion-highlight{\ - color: #000;\ - text-shadow: 0 0 0.01em;\ -}\ -.ace_editor.ace_autocomplete {\ - width: 280px;\ - z-index: 200000;\ - background: #fbfbfb;\ - color: #444;\ - border: 1px lightgray solid;\ - position: fixed;\ - box-shadow: 2px 3px 5px rgba(0,0,0,.2);\ - line-height: 1.4;\ -}"); - -exports.AcePopup = AcePopup; - -}); diff --git a/lib/ace/autocomplete/text_completer.js b/lib/ace/autocomplete/text_completer.js deleted file mode 100644 index 17a4bdad..00000000 --- a/lib/ace/autocomplete/text_completer.js +++ /dev/null @@ -1,78 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - var Range = require("../range").Range; - - var splitRegex = /[^a-zA-Z_0-9\$\-\u00C0-\u1FFF\u2C00-\uD7FF\w]+/; - - function getWordIndex(doc, pos) { - var textBefore = doc.getTextRange(Range.fromPoints({row: 0, column:0}, pos)); - return textBefore.split(splitRegex).length - 1; - } - - /** - * Does a distance analysis of the word `prefix` at position `pos` in `doc`. - * @return Map - */ - function wordDistance(doc, pos) { - var prefixPos = getWordIndex(doc, pos); - var words = doc.getValue().split(splitRegex); - var wordScores = Object.create(null); - - var currentWord = words[prefixPos]; - - words.forEach(function(word, idx) { - if (!word || word === currentWord) return; - - var distance = Math.abs(prefixPos - idx); - var score = words.length - distance; - if (wordScores[word]) { - wordScores[word] = Math.max(score, wordScores[word]); - } else { - wordScores[word] = score; - } - }); - return wordScores; - } - - exports.getCompletions = function(editor, session, pos, prefix, callback) { - var wordScore = wordDistance(session, pos, prefix); - var wordList = Object.keys(wordScore); - callback(null, wordList.map(function(word) { - return { - caption: word, - value: word, - score: wordScore[word], - meta: "local" - }; - })); - }; -}); diff --git a/lib/ace/autocomplete/util.js b/lib/ace/autocomplete/util.js deleted file mode 100644 index 767b983e..00000000 --- a/lib/ace/autocomplete/util.js +++ /dev/null @@ -1,74 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -exports.parForEach = function(array, fn, callback) { - var completed = 0; - var arLength = array.length; - if (arLength === 0) - callback(); - for (var i = 0; i < arLength; i++) { - fn(array[i], function(result, err) { - completed++; - if (completed === arLength) - callback(result, err); - }); - } -}; - -var ID_REGEX = /[a-zA-Z_0-9\$\-\u00A2-\uFFFF]/; - -exports.retrievePrecedingIdentifier = function(text, pos, regex) { - regex = regex || ID_REGEX; - var buf = []; - for (var i = pos-1; i >= 0; i--) { - if (regex.test(text[i])) - buf.push(text[i]); - else - break; - } - return buf.reverse().join(""); -}; - -exports.retrieveFollowingIdentifier = function(text, pos, regex) { - regex = regex || ID_REGEX; - var buf = []; - for (var i = pos; i < text.length; i++) { - if (regex.test(text[i])) - buf.push(text[i]); - else - break; - } - return buf; -}; - -}); diff --git a/lib/ace/background_tokenizer.js b/lib/ace/background_tokenizer.js index ea4ddd0f..7422d36d 100644 --- a/lib/ace/background_tokenizer.js +++ b/lib/ace/background_tokenizer.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -34,21 +41,24 @@ define(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; /** - * Tokenizes the current [[Document `Document`]] in the background, and caches the tokenized rows for future use. - * - * If a certain row is changed, everything below that row is re-tokenized. + * class BackgroundTokenizer + * + * Tokenizes the current [[Document `Document`]] in the background, and caches the tokenized rows for future use. If a certain row is changed, everything below that row is re-tokenized. * - * @class BackgroundTokenizer **/ /** - * Creates a new `BackgroundTokenizer` object. - * @param {Tokenizer} tokenizer The tokenizer to use - * @param {Editor} editor The editor to associate with + * new BackgroundTokenizer(tokenizer, editor) + * - tokenizer (Tokenizer): The tokenizer to use + * - editor (Editor): The editor to associate with + * + * Creates a new `BackgroundTokenizer` object. + * * - * @constructor **/ var BackgroundTokenizer = function(tokenizer, editor) { @@ -64,35 +74,29 @@ var BackgroundTokenizer = function(tokenizer, editor) { if (!self.running) { return; } var workerStart = new Date(); - var currentLine = self.currentLine; - var endLine = -1; + var startLine = self.currentLine; var doc = self.doc; - var startLine = currentLine; - while (self.lines[currentLine]) - currentLine++; - - var len = doc.getLength(); var processedLines = 0; - self.running = false; - while (currentLine < len) { - self.$tokenizeRow(currentLine); - endLine = currentLine; - do { - currentLine++; - } while (self.lines[currentLine]); + + 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) { + if ((processedLines % 5 == 0) && (new Date() - workerStart) > 20) { + self.fireUpdateEvent(startLine, self.currentLine-1); self.running = setTimeout(self.$worker, 20); - break; + return; } } - self.currentLine = currentLine; - - if (startLine <= endLine) - self.fireUpdateEvent(startLine, endLine); + + self.running = false; + + self.fireUpdateEvent(startLine, len - 1); }; }; @@ -101,9 +105,10 @@ var BackgroundTokenizer = function(tokenizer, editor) { oop.implement(this, EventEmitter); /** - * Sets a new tokenizer for this object. + * BackgroundTokenizer.setTokenizer(tokenizer) + * - tokenizer (Tokenizer): The new tokenizer to use * - * @param {Tokenizer} tokenizer The new tokenizer to use + * Sets a new tokenizer for this object. * **/ this.setTokenizer = function(tokenizer) { @@ -115,8 +120,11 @@ var BackgroundTokenizer = function(tokenizer, editor) { }; /** + * BackgroundTokenizer.setDocument(doc) + * - doc (Document): The new document to associate with + * * Sets a new document to associate with this object. - * @param {Document} doc The new document to associate with + * **/ this.setDocument = function(doc) { this.doc = doc; @@ -126,17 +134,12 @@ var BackgroundTokenizer = function(tokenizer, editor) { this.stop(); }; - /** - * Fires whenever the background tokeniziers between a range of rows are going to be updated. - * - * @event update - * @param {Object} e An object containing two properties, `first` and `last`, which indicate the rows of the region being updated. - * - **/ /** + * BackgroundTokenizer.fireUpdateEvent(firstRow, lastRow) + * - firstRow (Number): The starting row region + * - lastRow (Number): The final row region + * * Emits the `'update'` event. `firstRow` and `lastRow` are used to define the boundaries of the region to be updated. - * @param {Number} firstRow The starting row region - * @param {Number} lastRow The final row region * **/ this.fireUpdateEvent = function(firstRow, lastRow) { @@ -144,13 +147,14 @@ var BackgroundTokenizer = function(tokenizer, editor) { first: firstRow, last: lastRow }; - this._signal("update", {data: data}); + this._emit("update", {data: data}); }; /** - * Starts tokenizing at the row indicated. + * BackgroundTokenizer.start(startRow) + * - startRow (Number): The row to start at * - * @param {Number} startRow The row to start at + * Starts tokenizing at the row indicated. * **/ this.start = function(startRow) { @@ -164,19 +168,15 @@ var BackgroundTokenizer = function(tokenizer, editor) { // pretty long delay to prevent the tokenizer from interfering with the user this.running = setTimeout(this.$worker, 700); }; - - this.scheduleStart = function() { - if (!this.running) - this.running = setTimeout(this.$worker, 700); - } this.$updateOnChange = function(delta) { - var startRow = delta.start.row; - var len = delta.end.row - startRow; + 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 == "remove") { + } else if (delta.action == "removeText" || delta.action == "removeLines") { this.lines.splice(startRow, len + 1, null); this.states.splice(startRow, len + 1, null); } else { @@ -189,9 +189,13 @@ var BackgroundTokenizer = function(tokenizer, editor) { 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); }; /** + * BackgroundTokenizer.stop() + * * Stops tokenizing. * **/ @@ -202,11 +206,10 @@ var BackgroundTokenizer = function(tokenizer, editor) { }; /** - * Gives list of tokens of the row. (tokens are cached) - * - * @param {Number} row The row to get tokens at + * BackgroundTokenizer.getTokens(row) -> [Object] + * - row (Number): The row to get tokens at * - * + * Gives list of tokens of the row. (tokens are cached) * **/ this.getTokens = function(row) { @@ -214,9 +217,10 @@ var BackgroundTokenizer = function(tokenizer, editor) { }; /** - * [Returns the state of tokenization at the end of a row.]{: #BackgroundTokenizer.getState} + * BackgroundTokenizer.getState(row) -> String + * - row (Number): The row to get state at * - * @param {Number} row The row to get state at + * [Returns the state of tokenization at the end of a row.]{: #BackgroundTokenizer.getState} **/ this.getState = function(row) { if (this.currentLine == row) @@ -228,9 +232,17 @@ var BackgroundTokenizer = function(tokenizer, editor) { var line = this.doc.getLine(row); var state = this.states[row - 1]; - var data = this.tokenizer.getLineTokens(line, state, row); + 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 + "") { + if (this.states[row] !== data.state) { this.states[row] = data.state; this.lines[row + 1] = null; if (this.currentLine > row + 1) diff --git a/lib/ace/background_tokenizer_test.js b/lib/ace/background_tokenizer_test.js index fd738d06..5b93a371 100644 --- a/lib/ace/background_tokenizer_test.js +++ b/lib/ace/background_tokenizer_test.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Harutyun Amirjanyan + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -62,62 +69,19 @@ module.exports = { doc.setMode("./mode/javascript") forceTokenize(doc) - testStates(doc, ["comment_regex_allowed", "start", "no_regex"]) + testStates(doc, ["comment", "start", "start"]) doc.remove(new Range(0,2,1,2)) - testStates(doc, [null, "no_regex"]) + testStates(doc, [null, "start"]) forceTokenize(doc) - testStates(doc, ["comment_regex_allowed", "comment_regex_allowed"]) + testStates(doc, ["comment", "comment"]) doc.insert({row:0, column:2}, "\n*/") - testStates(doc, [undefined, undefined, "comment_regex_allowed"]) + testStates(doc, [undefined, undefined, "comment"]) forceTokenize(doc) - testStates(doc, ["comment_regex_allowed", "start", "no_regex"]) - }, - "test background tokenizer sends update event" : function() { - var doc = new EditSession([ - "/*", - "var", - "juhu", - "*/" - ]); - doc.setMode("./mode/javascript"); - - var updateEvent = null; - doc.bgTokenizer.on("update", function(e) { - updateEvent = e.data; - }); - function checkEvent(first, last) { - assert.ok(!updateEvent, "unneccessary update event"); - doc.bgTokenizer.running = 1; - doc.bgTokenizer.$worker(); - assert.ok(updateEvent); - assert.equal([first, last] + "", - [updateEvent.first, updateEvent.last] + "") - updateEvent = null; - } - - forceTokenize(doc); - var comment = "comment_regex_allowed"; - testStates(doc, [comment, comment, comment, "start"]); - - doc.remove(new Range(0,0,0,2)); - testStates(doc, [comment, comment, comment, "start"]); - - checkEvent(0, 3); - testStates(doc, ["start", "no_regex", "no_regex", "regex"]); - - // insert /* and and press down several times quickly - doc.insert({row:0, column:0}, "/*"); - doc.getTokens(0); - doc.getTokens(1); - doc.getTokens(2); - checkEvent(0, 3); - - forceTokenize(doc); - testStates(doc, [comment, comment, comment, "start"]); + testStates(doc, ["comment", "start", "start"]) } }; diff --git a/lib/ace/commands/command_manager.js b/lib/ace/commands/command_manager.js index df30ef9b..ee7c8561 100644 --- a/lib/ace/commands/command_manager.js +++ b/lib/ace/commands/command_manager.js @@ -2,44 +2,47 @@ define(function(require, exports, module) { "use strict"; var oop = require("../lib/oop"); -var MultiHashHandler = require("../keyboard/hash_handler").MultiHashHandler; +var HashHandler = require("../keyboard/hash_handler").HashHandler; var EventEmitter = require("../lib/event_emitter").EventEmitter; /** - * @class CommandManager + * class CommandManager + * + * + * * **/ /** * new CommandManager(platform, commands) - * @param {String} platform Identifier for the platform; must be either `"mac"` or `"win"` - * @param {Array} commands A list of 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) { - MultiHashHandler.call(this, commands, platform); - this.byName = this.commands; + this.platform = platform; + this.commands = {}; + this.commmandKeyBinding = {}; + + this.addCommands(commands); + this.setDefaultHandler("exec", function(e) { return e.command.exec(e.editor, e.args || {}); }); }; -oop.inherits(CommandManager, MultiHashHandler); +oop.inherits(CommandManager, HashHandler); (function() { oop.implement(this, EventEmitter); this.exec = function(command, editor, args) { - if (Array.isArray(command)) { - for (var i = command.length; i--; ) { - if (this.exec(command[i], editor, args)) return true; - } - return false; - } - - if (typeof command === "string") + if (typeof command === 'string') command = this.commands[command]; if (!command) @@ -48,11 +51,13 @@ oop.inherits(CommandManager, MultiHashHandler); if (editor && editor.$readOnly && !command.readOnly) return false; - var e = {editor: editor, command: command, args: args}; - e.returnValue = this._emit("exec", e); - this._signal("afterExec", e); + var retvalue = this._emit("exec", { + editor: editor, + command: command, + args: args + }); - return e.returnValue === false ? false : true; + return retvalue === false ? false : true; }; this.toggleRecording = function(editor) { diff --git a/lib/ace/commands/command_manager_test.js b/lib/ace/commands/command_manager_test.js index 902600be..71a37117 100644 --- a/lib/ace/commands/command_manager_test.js +++ b/lib/ace/commands/command_manager_test.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -61,20 +68,20 @@ module.exports = { }, "test: mac hotkeys": function() { - var command = this.cm.findKeyCommand(keys.KEY_MODS.command, "l"); + var command = this.cm.findKeyCommand(keys.KEY_MODS.command, "L"); assert.equal(command, this.command); - var command = this.cm.findKeyCommand(keys.KEY_MODS.ctrl, "l"); + var command = this.cm.findKeyCommand(keys.KEY_MODS.ctrl, "L"); assert.equal(command, undefined); }, "test: win hotkeys": function() { var cm = new CommandManager("win", [this.command]); - var command = cm.findKeyCommand(keys.KEY_MODS.command, "l"); + var command = cm.findKeyCommand(keys.KEY_MODS.command, "L"); assert.equal(command, undefined); - var command = cm.findKeyCommand(keys.KEY_MODS.ctrl, "l"); + var command = cm.findKeyCommand(keys.KEY_MODS.ctrl, "L"); assert.equal(command, this.command); }, @@ -84,7 +91,7 @@ module.exports = { this.cm.exec("gotoline"); assert.ok(!this.command.called); - var command = this.cm.findKeyCommand(keys.KEY_MODS.command, "l"); + var command = this.cm.findKeyCommand(keys.KEY_MODS.command, "L"); assert.equal(command, null); }, @@ -94,7 +101,7 @@ module.exports = { this.cm.exec("gotoline"); assert.ok(!this.command.called); - var command = this.cm.findKeyCommand(keys.KEY_MODS.command, "l"); + var command = this.cm.findKeyCommand(keys.KEY_MODS.command, "L"); assert.equal(command, null); }, @@ -114,7 +121,7 @@ module.exports = { assert.ok(command.called); assert.ok(!this.command.called); - assert.equal(this.cm.findKeyCommand(keys.KEY_MODS.command, "l"), command); + assert.equal(this.cm.findKeyCommand(keys.KEY_MODS.command, "L"), command); }, "test: adding commands and recording a macro": function() { @@ -154,41 +161,33 @@ module.exports = { }, "test: bindkeys": function() { + var called = ""; + this.cm.addCommands({ + cm1: function(editor, arg) { + called += "1" + (arg || ""); + }, + cm2: function(editor) { + called += "2"; + } + }); + this.cm.bindKeys({ "Ctrl-L|Command-C": "cm1", "Ctrl-R": "cm2" }); - var command = this.cm.findKeyCommand(keys.KEY_MODS.command, "c"); + var command = this.cm.findKeyCommand(keys.KEY_MODS.command, "C"); assert.equal(command, "cm1"); - var command = this.cm.findKeyCommand(keys.KEY_MODS.ctrl, "r"); + var command = this.cm.findKeyCommand(keys.KEY_MODS.ctrl, "R"); assert.equal(command, "cm2"); this.cm.bindKeys({ "Ctrl-R": null }); - var command = this.cm.findKeyCommand(keys.KEY_MODS.ctrl, "r"); + var command = this.cm.findKeyCommand(keys.KEY_MODS.ctrl, "R"); assert.equal(command, null); - }, - - "test: binding keys without modifiers": function() { - this.cm.bindKeys({ - "R": "cm1", - "Shift-r": "cm2", - "Return": "cm4", - "Enter": "cm3" - }); - - var command = this.cm.findKeyCommand(-1, "r"); - assert.equal(command, "cm1"); - - var command = this.cm.findKeyCommand(-1, "R"); - assert.equal(command, "cm2"); - - var command = this.cm.findKeyCommand(0, "return"); - assert.equal(command + "", ["cm4", "cm3"] + ""); } }; diff --git a/lib/ace/commands/default_commands.js b/lib/ace/commands/default_commands.js index de14df85..1811c34c 100644 --- a/lib/ace/commands/default_commands.js +++ b/lib/ace/commands/default_commands.js @@ -1,30 +1,40 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: +/* vim:ts=4:sts=4:sw=4: + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * Julian Viereck + * Mihai Sucan + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,48 +42,15 @@ define(function(require, exports, module) { "use strict"; var lang = require("../lib/lang"); -var config = require("../config"); -var Range = require("../range").Range; function bindKey(win, mac) { - return {win: win, mac: mac}; + return { + win: win, + mac: mac + }; } -/* - multiSelectAction: "forEach"|"forEachLine"|function|undefined, - scrollIntoView: true|"cursor"|"center"|"selectionPart" -*/ exports.commands = [{ - name: "showSettingsMenu", - bindKey: bindKey("Ctrl-,", "Command-,"), - exec: function(editor) { - config.loadModule("ace/ext/settings_menu", function(module) { - module.init(editor); - editor.showSettingsMenu(); - }); - }, - readOnly: true -}, { - name: "goToNextError", - bindKey: bindKey("Alt-E", "Ctrl-E"), - exec: function(editor) { - config.loadModule("ace/ext/error_marker", function(module) { - module.showErrorMarker(editor, 1); - }); - }, - scrollIntoView: "animate", - readOnly: true -}, { - name: "goToPreviousError", - bindKey: bindKey("Alt-Shift-E", "Ctrl-Shift-E"), - exec: function(editor) { - config.loadModule("ace/ext/error_marker", function(module) { - module.showErrorMarker(editor, -1); - }); - }, - scrollIntoView: "animate", - readOnly: true -}, { name: "selectall", bindKey: bindKey("Ctrl-A", "Command-A"), exec: function(editor) { editor.selectAll(); }, @@ -97,90 +74,38 @@ exports.commands = [{ name: "fold", bindKey: bindKey("Alt-L|Ctrl-F1", "Command-Alt-L|Command-F1"), exec: function(editor) { editor.session.toggleFold(false); }, - multiSelectAction: "forEach", - scrollIntoView: "center", 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); }, - multiSelectAction: "forEach", - scrollIntoView: "center", - readOnly: true -}, { - name: "toggleFoldWidget", - bindKey: bindKey("F2", "F2"), - exec: function(editor) { editor.session.toggleFoldWidget(); }, - multiSelectAction: "forEach", - scrollIntoView: "center", - readOnly: true -}, { - name: "toggleParentFoldWidget", - bindKey: bindKey("Alt-F2", "Alt-F2"), - exec: function(editor) { editor.session.toggleFoldWidget(true); }, - multiSelectAction: "forEach", - scrollIntoView: "center", readOnly: true }, { name: "foldall", - bindKey: bindKey(null, "Ctrl-Command-Option-0"), - exec: function(editor) { editor.session.foldAll(); }, - scrollIntoView: "center", - readOnly: true -}, { - name: "foldOther", bindKey: bindKey("Alt-0", "Command-Option-0"), - exec: function(editor) { - editor.session.foldAll(); - editor.session.unfold(editor.selection.getAllRanges()); - }, - scrollIntoView: "center", + 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(); }, - scrollIntoView: "center", readOnly: true }, { name: "findnext", bindKey: bindKey("Ctrl-K", "Command-G"), exec: function(editor) { editor.findNext(); }, - multiSelectAction: "forEach", - scrollIntoView: "center", readOnly: true }, { name: "findprevious", bindKey: bindKey("Ctrl-Shift-K", "Command-Shift-G"), exec: function(editor) { editor.findPrevious(); }, - multiSelectAction: "forEach", - scrollIntoView: "center", - readOnly: true -}, { - name: "selectOrFindNext", - bindKey: bindKey("Alt-K", "Ctrl-G"), - exec: function(editor) { - if (editor.selection.isEmpty()) - editor.selection.selectWord(); - else - editor.findNext(); - }, - readOnly: true -}, { - name: "selectOrFindPrevious", - bindKey: bindKey("Alt-Shift-K", "Ctrl-Shift-G"), - exec: function(editor) { - if (editor.selection.isEmpty()) - editor.selection.selectWord(); - else - editor.findPrevious(); - }, readOnly: true }, { name: "find", bindKey: bindKey("Ctrl-F", "Command-F"), exec: function(editor) { - config.loadModule("ace/ext/searchbox", function(e) {e.Search(editor)}); + var needle = prompt("Find:", editor.getCopyText()); + editor.find(needle); }, readOnly: true }, { @@ -193,144 +118,120 @@ exports.commands = [{ bindKey: bindKey("Ctrl-Shift-Home", "Command-Shift-Up"), exec: function(editor) { editor.getSelection().selectFileStart(); }, multiSelectAction: "forEach", - readOnly: true, - scrollIntoView: "animate", - aceCommandGroup: "fileJump" + readOnly: true }, { name: "gotostart", bindKey: bindKey("Ctrl-Home", "Command-Home|Command-Up"), exec: function(editor) { editor.navigateFileStart(); }, multiSelectAction: "forEach", - readOnly: true, - scrollIntoView: "animate", - aceCommandGroup: "fileJump" + readOnly: true }, { name: "selectup", bindKey: bindKey("Shift-Up", "Shift-Up"), exec: function(editor) { editor.getSelection().selectUp(); }, multiSelectAction: "forEach", - scrollIntoView: "cursor", readOnly: true }, { name: "golineup", bindKey: bindKey("Up", "Up|Ctrl-P"), exec: function(editor, args) { editor.navigateUp(args.times); }, multiSelectAction: "forEach", - scrollIntoView: "cursor", readOnly: true }, { name: "selecttoend", bindKey: bindKey("Ctrl-Shift-End", "Command-Shift-Down"), exec: function(editor) { editor.getSelection().selectFileEnd(); }, multiSelectAction: "forEach", - readOnly: true, - scrollIntoView: "animate", - aceCommandGroup: "fileJump" + readOnly: true }, { name: "gotoend", bindKey: bindKey("Ctrl-End", "Command-End|Command-Down"), exec: function(editor) { editor.navigateFileEnd(); }, multiSelectAction: "forEach", - readOnly: true, - scrollIntoView: "animate", - aceCommandGroup: "fileJump" + readOnly: true }, { name: "selectdown", bindKey: bindKey("Shift-Down", "Shift-Down"), exec: function(editor) { editor.getSelection().selectDown(); }, multiSelectAction: "forEach", - scrollIntoView: "cursor", readOnly: true }, { name: "golinedown", bindKey: bindKey("Down", "Down|Ctrl-N"), exec: function(editor, args) { editor.navigateDown(args.times); }, multiSelectAction: "forEach", - scrollIntoView: "cursor", readOnly: true }, { name: "selectwordleft", bindKey: bindKey("Ctrl-Shift-Left", "Option-Shift-Left"), exec: function(editor) { editor.getSelection().selectWordLeft(); }, multiSelectAction: "forEach", - scrollIntoView: "cursor", readOnly: true }, { name: "gotowordleft", bindKey: bindKey("Ctrl-Left", "Option-Left"), exec: function(editor) { editor.navigateWordLeft(); }, multiSelectAction: "forEach", - scrollIntoView: "cursor", readOnly: true }, { name: "selecttolinestart", bindKey: bindKey("Alt-Shift-Left", "Command-Shift-Left"), exec: function(editor) { editor.getSelection().selectLineStart(); }, multiSelectAction: "forEach", - scrollIntoView: "cursor", readOnly: true }, { name: "gotolinestart", bindKey: bindKey("Alt-Left|Home", "Command-Left|Home|Ctrl-A"), exec: function(editor) { editor.navigateLineStart(); }, multiSelectAction: "forEach", - scrollIntoView: "cursor", readOnly: true }, { name: "selectleft", bindKey: bindKey("Shift-Left", "Shift-Left"), exec: function(editor) { editor.getSelection().selectLeft(); }, multiSelectAction: "forEach", - scrollIntoView: "cursor", readOnly: true }, { name: "gotoleft", bindKey: bindKey("Left", "Left|Ctrl-B"), exec: function(editor, args) { editor.navigateLeft(args.times); }, multiSelectAction: "forEach", - scrollIntoView: "cursor", readOnly: true }, { name: "selectwordright", bindKey: bindKey("Ctrl-Shift-Right", "Option-Shift-Right"), exec: function(editor) { editor.getSelection().selectWordRight(); }, multiSelectAction: "forEach", - scrollIntoView: "cursor", readOnly: true }, { name: "gotowordright", bindKey: bindKey("Ctrl-Right", "Option-Right"), exec: function(editor) { editor.navigateWordRight(); }, multiSelectAction: "forEach", - scrollIntoView: "cursor", readOnly: true }, { name: "selecttolineend", bindKey: bindKey("Alt-Shift-Right", "Command-Shift-Right"), exec: function(editor) { editor.getSelection().selectLineEnd(); }, multiSelectAction: "forEach", - scrollIntoView: "cursor", readOnly: true }, { name: "gotolineend", bindKey: bindKey("Alt-Right|End", "Command-Right|End|Ctrl-E"), exec: function(editor) { editor.navigateLineEnd(); }, multiSelectAction: "forEach", - scrollIntoView: "cursor", readOnly: true }, { name: "selectright", bindKey: bindKey("Shift-Right", "Shift-Right"), exec: function(editor) { editor.getSelection().selectRight(); }, multiSelectAction: "forEach", - scrollIntoView: "cursor", readOnly: true }, { name: "gotoright", bindKey: bindKey("Right", "Right|Ctrl-F"), exec: function(editor, args) { editor.navigateRight(args.times); }, multiSelectAction: "forEach", - scrollIntoView: "cursor", readOnly: true }, { name: "selectpagedown", @@ -377,14 +278,12 @@ exports.commands = [{ bindKey: "Shift-Home", exec: function(editor) { editor.getSelection().selectLineStart(); }, multiSelectAction: "forEach", - scrollIntoView: "cursor", readOnly: true }, { name: "selectlineend", bindKey: "Shift-End", exec: function(editor) { editor.getSelection().selectLineEnd(); }, multiSelectAction: "forEach", - scrollIntoView: "cursor", readOnly: true }, { name: "togglerecording", @@ -398,38 +297,16 @@ exports.commands = [{ readOnly: true }, { name: "jumptomatching", - bindKey: bindKey("Ctrl-P", "Ctrl-P"), + bindKey: bindKey("Ctrl-P", "Ctrl-Shift-P"), exec: function(editor) { editor.jumpToMatching(); }, multiSelectAction: "forEach", - scrollIntoView: "animate", readOnly: true }, { name: "selecttomatching", - bindKey: bindKey("Ctrl-Shift-P", "Ctrl-Shift-P"), + bindKey: bindKey("Ctrl-Shift-P", null), exec: function(editor) { editor.jumpToMatching(true); }, - multiSelectAction: "forEach", - scrollIntoView: "animate", readOnly: true -}, { - name: "expandToMatching", - bindKey: bindKey("Ctrl-Shift-M", "Ctrl-Shift-M"), - exec: function(editor) { editor.jumpToMatching(true, true); }, - multiSelectAction: "forEach", - scrollIntoView: "animate", - readOnly: true -}, { - name: "passKeysToBrowser", - bindKey: bindKey(null, null), - exec: function() {}, - passEvent: true, - readOnly: true -}, { - name: "copy", - exec: function(editor) { - // placeholder for replay macro - }, - readOnly: true -}, +}, // commands disabled in readOnly mode { @@ -443,61 +320,45 @@ exports.commands = [{ editor.clearSelection(); } }, - scrollIntoView: "cursor", multiSelectAction: "forEach" -}, { - name: "paste", - exec: function(editor, args) { - editor.$handlePaste(args); - }, - scrollIntoView: "cursor" }, { name: "removeline", bindKey: bindKey("Ctrl-D", "Command-D"), exec: function(editor) { editor.removeLines(); }, - scrollIntoView: "cursor", - multiSelectAction: "forEachLine" + multiSelectAction: "forEach" }, { name: "duplicateSelection", bindKey: bindKey("Ctrl-Shift-D", "Command-Shift-D"), exec: function(editor) { editor.duplicateSelection(); }, - scrollIntoView: "cursor", multiSelectAction: "forEach" -}, { - name: "sortlines", - bindKey: bindKey("Ctrl-Alt-S", "Command-Alt-S"), - exec: function(editor) { editor.sortLines(); }, - scrollIntoView: "selection", - multiSelectAction: "forEachLine" }, { name: "togglecomment", bindKey: bindKey("Ctrl-/", "Command-/"), exec: function(editor) { editor.toggleCommentLines(); }, - multiSelectAction: "forEachLine", - scrollIntoView: "selectionPart" -}, { - name: "toggleBlockComment", - bindKey: bindKey("Ctrl-Shift-/", "Command-Shift-/"), - exec: function(editor) { editor.toggleBlockComment(); }, - multiSelectAction: "forEach", - scrollIntoView: "selectionPart" -}, { - name: "modifyNumberUp", - bindKey: bindKey("Ctrl-Shift-Up", "Alt-Shift-Up"), - exec: function(editor) { editor.modifyNumber(1); }, - scrollIntoView: "cursor", - multiSelectAction: "forEach" -}, { - name: "modifyNumberDown", - bindKey: bindKey("Ctrl-Shift-Down", "Alt-Shift-Down"), - exec: function(editor) { editor.modifyNumber(-1); }, - scrollIntoView: "cursor", multiSelectAction: "forEach" }, { name: "replace", - bindKey: bindKey("Ctrl-H", "Command-Option-F"), + bindKey: bindKey("Ctrl-R", "Command-Option-F"), exec: function(editor) { - config.loadModule("ace/ext/searchbox", function(e) {e.Search(editor, true)}); + 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", @@ -510,228 +371,92 @@ exports.commands = [{ }, { name: "copylinesup", bindKey: bindKey("Alt-Shift-Up", "Command-Option-Up"), - exec: function(editor) { editor.copyLinesUp(); }, - scrollIntoView: "cursor" + exec: function(editor) { editor.copyLinesUp(); } }, { name: "movelinesup", bindKey: bindKey("Alt-Up", "Option-Up"), - exec: function(editor) { editor.moveLinesUp(); }, - scrollIntoView: "cursor" + exec: function(editor) { editor.moveLinesUp(); } }, { name: "copylinesdown", bindKey: bindKey("Alt-Shift-Down", "Command-Option-Down"), - exec: function(editor) { editor.copyLinesDown(); }, - scrollIntoView: "cursor" + exec: function(editor) { editor.copyLinesDown(); } }, { name: "movelinesdown", bindKey: bindKey("Alt-Down", "Option-Down"), - exec: function(editor) { editor.moveLinesDown(); }, - scrollIntoView: "cursor" + exec: function(editor) { editor.moveLinesDown(); } }, { name: "del", - bindKey: bindKey("Delete", "Delete|Ctrl-D|Shift-Delete"), + bindKey: bindKey("Delete", "Delete|Ctrl-D"), exec: function(editor) { editor.remove("right"); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" + multiSelectAction: "forEach" }, { name: "backspace", bindKey: bindKey( - "Shift-Backspace|Backspace", - "Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H" + "Command-Backspace|Option-Backspace|Shift-Backspace|Backspace", + "Ctrl-Backspace|Command-Backspace|Shift-Backspace|Backspace|Ctrl-H" ), exec: function(editor) { editor.remove("left"); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "cut_or_delete", - bindKey: bindKey("Shift-Delete", null), - exec: function(editor) { - if (editor.selection.isEmpty()) { - editor.remove("left"); - } else { - return false; - } - }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" + multiSelectAction: "forEach" }, { name: "removetolinestart", bindKey: bindKey("Alt-Backspace", "Command-Backspace"), exec: function(editor) { editor.removeToLineStart(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" + multiSelectAction: "forEach" }, { name: "removetolineend", bindKey: bindKey("Alt-Delete", "Ctrl-K"), exec: function(editor) { editor.removeToLineEnd(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" + multiSelectAction: "forEach" }, { name: "removewordleft", bindKey: bindKey("Ctrl-Backspace", "Alt-Backspace|Ctrl-Alt-Backspace"), exec: function(editor) { editor.removeWordLeft(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" + multiSelectAction: "forEach" }, { name: "removewordright", bindKey: bindKey("Ctrl-Delete", "Alt-Delete"), exec: function(editor) { editor.removeWordRight(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" + multiSelectAction: "forEach" }, { name: "outdent", bindKey: bindKey("Shift-Tab", "Shift-Tab"), exec: function(editor) { editor.blockOutdent(); }, - multiSelectAction: "forEach", - scrollIntoView: "selectionPart" + multiSelectAction: "forEach" }, { name: "indent", bindKey: bindKey("Tab", "Tab"), exec: function(editor) { editor.indent(); }, - multiSelectAction: "forEach", - scrollIntoView: "selectionPart" -}, { - name: "blockoutdent", - bindKey: bindKey("Ctrl-[", "Ctrl-["), - exec: function(editor) { editor.blockOutdent(); }, - multiSelectAction: "forEachLine", - scrollIntoView: "selectionPart" -}, { - name: "blockindent", - bindKey: bindKey("Ctrl-]", "Ctrl-]"), - exec: function(editor) { editor.blockIndent(); }, - multiSelectAction: "forEachLine", - scrollIntoView: "selectionPart" + multiSelectAction: "forEach" }, { name: "insertstring", exec: function(editor, str) { editor.insert(str); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" + multiSelectAction: "forEach" }, { name: "inserttext", exec: function(editor, args) { editor.insert(lang.stringRepeat(args.text || "", args.times || 1)); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" + multiSelectAction: "forEach" }, { name: "splitline", bindKey: bindKey(null, "Ctrl-O"), exec: function(editor) { editor.splitLine(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" + multiSelectAction: "forEach" }, { name: "transposeletters", bindKey: bindKey("Ctrl-T", "Ctrl-T"), exec: function(editor) { editor.transposeLetters(); }, - multiSelectAction: function(editor) {editor.transposeSelections(1); }, - scrollIntoView: "cursor" + multiSelectAction: function(editor) {editor.transposeSelections(1); } }, { name: "touppercase", bindKey: bindKey("Ctrl-U", "Ctrl-U"), exec: function(editor) { editor.toUpperCase(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" + multiSelectAction: "forEach" }, { name: "tolowercase", bindKey: bindKey("Ctrl-Shift-U", "Ctrl-Shift-U"), exec: function(editor) { editor.toLowerCase(); }, - multiSelectAction: "forEach", - scrollIntoView: "cursor" -}, { - name: "expandtoline", - bindKey: bindKey("Ctrl-Shift-L", "Command-Shift-L"), - exec: function(editor) { - var range = editor.selection.getRange(); - - range.start.column = range.end.column = 0; - range.end.row++; - editor.selection.setRange(range, false); - }, - multiSelectAction: "forEach", - scrollIntoView: "cursor", - readOnly: true -}, { - name: "joinlines", - bindKey: bindKey(null, null), - exec: function(editor) { - var isBackwards = editor.selection.isBackwards(); - var selectionStart = isBackwards ? editor.selection.getSelectionLead() : editor.selection.getSelectionAnchor(); - var selectionEnd = isBackwards ? editor.selection.getSelectionAnchor() : editor.selection.getSelectionLead(); - var firstLineEndCol = editor.session.doc.getLine(selectionStart.row).length; - var selectedText = editor.session.doc.getTextRange(editor.selection.getRange()); - var selectedCount = selectedText.replace(/\n\s*/, " ").length; - var insertLine = editor.session.doc.getLine(selectionStart.row); - - for (var i = selectionStart.row + 1; i <= selectionEnd.row + 1; i++) { - var curLine = lang.stringTrimLeft(lang.stringTrimRight(editor.session.doc.getLine(i))); - if (curLine.length !== 0) { - curLine = " " + curLine; - } - insertLine += curLine; - } - - if (selectionEnd.row + 1 < (editor.session.doc.getLength() - 1)) { - // Don't insert a newline at the end of the document - insertLine += editor.session.doc.getNewLineCharacter(); - } - - editor.clearSelection(); - editor.session.doc.replace(new Range(selectionStart.row, 0, selectionEnd.row + 2, 0), insertLine); - - if (selectedCount > 0) { - // Select the text that was previously selected - editor.selection.moveCursorTo(selectionStart.row, selectionStart.column); - editor.selection.selectTo(selectionStart.row, selectionStart.column + selectedCount); - } else { - // If the joined line had something in it, start the cursor at that something - firstLineEndCol = editor.session.doc.getLine(selectionStart.row).length > firstLineEndCol ? (firstLineEndCol + 1) : firstLineEndCol; - editor.selection.moveCursorTo(selectionStart.row, firstLineEndCol); - } - }, - multiSelectAction: "forEach", - readOnly: true -}, { - name: "invertSelection", - bindKey: bindKey(null, null), - exec: function(editor) { - var endRow = editor.session.doc.getLength() - 1; - var endCol = editor.session.doc.getLine(endRow).length; - var ranges = editor.selection.rangeList.ranges; - var newRanges = []; - - // If multiple selections don't exist, rangeList will return 0 so replace with single range - if (ranges.length < 1) { - ranges = [editor.selection.getRange()]; - } - - for (var i = 0; i < ranges.length; i++) { - if (i == (ranges.length - 1)) { - // The last selection must connect to the end of the document, unless it already does - if (!(ranges[i].end.row === endRow && ranges[i].end.column === endCol)) { - newRanges.push(new Range(ranges[i].end.row, ranges[i].end.column, endRow, endCol)); - } - } - - if (i === 0) { - // The first selection must connect to the start of the document, unless it already does - if (!(ranges[i].start.row === 0 && ranges[i].start.column === 0)) { - newRanges.push(new Range(0, 0, ranges[i].start.row, ranges[i].start.column)); - } - } else { - newRanges.push(new Range(ranges[i-1].end.row, ranges[i-1].end.column, ranges[i].start.row, ranges[i].start.column)); - } - } - - editor.exitMultiSelectMode(); - editor.clearSelection(); - - for(var i = 0; i < newRanges.length; i++) { - editor.selection.addRange(newRanges[i], false); - } - }, - readOnly: true, - scrollIntoView: "none" + multiSelectAction: "forEach" }]; }); diff --git a/lib/ace/commands/incremental_search_commands.js b/lib/ace/commands/incremental_search_commands.js deleted file mode 100644 index 59083a85..00000000 --- a/lib/ace/commands/incremental_search_commands.js +++ /dev/null @@ -1,213 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -var config = require("../config"); -var oop = require("../lib/oop"); -var HashHandler = require("../keyboard/hash_handler").HashHandler; -var occurStartCommand = require("./occur_commands").occurStartCommand; - -// These commands can be installed in a normal key handler to start iSearch: -exports.iSearchStartCommands = [{ - name: "iSearch", - bindKey: {win: "Ctrl-F", mac: "Command-F"}, - exec: function(editor, options) { - config.loadModule(["core", "ace/incremental_search"], function(e) { - var iSearch = e.iSearch = e.iSearch || new e.IncrementalSearch(); - iSearch.activate(editor, options.backwards); - if (options.jumpToFirstMatch) iSearch.next(options); - }); - }, - readOnly: true -}, { - name: "iSearchBackwards", - exec: function(editor, jumpToNext) { editor.execCommand('iSearch', {backwards: true}); }, - readOnly: true -}, { - name: "iSearchAndGo", - bindKey: {win: "Ctrl-K", mac: "Command-G"}, - exec: function(editor, jumpToNext) { editor.execCommand('iSearch', {jumpToFirstMatch: true, useCurrentOrPrevSearch: true}); }, - readOnly: true -}, { - name: "iSearchBackwardsAndGo", - bindKey: {win: "Ctrl-Shift-K", mac: "Command-Shift-G"}, - exec: function(editor) { editor.execCommand('iSearch', {jumpToFirstMatch: true, backwards: true, useCurrentOrPrevSearch: true}); }, - readOnly: true -}]; - -// These commands are only available when incremental search mode is active: -exports.iSearchCommands = [{ - name: "restartSearch", - bindKey: {win: "Ctrl-F", mac: "Command-F"}, - exec: function(iSearch) { - iSearch.cancelSearch(true); - } -}, { - name: "searchForward", - bindKey: {win: "Ctrl-S|Ctrl-K", mac: "Ctrl-S|Command-G"}, - exec: function(iSearch, options) { - options.useCurrentOrPrevSearch = true; - iSearch.next(options); - } -}, { - name: "searchBackward", - bindKey: {win: "Ctrl-R|Ctrl-Shift-K", mac: "Ctrl-R|Command-Shift-G"}, - exec: function(iSearch, options) { - options.useCurrentOrPrevSearch = true; - options.backwards = true; - iSearch.next(options); - } -}, { - name: "extendSearchTerm", - exec: function(iSearch, string) { - iSearch.addString(string); - } -}, { - name: "extendSearchTermSpace", - bindKey: "space", - exec: function(iSearch) { iSearch.addString(' '); } -}, { - name: "shrinkSearchTerm", - bindKey: "backspace", - exec: function(iSearch) { - iSearch.removeChar(); - } -}, { - name: 'confirmSearch', - bindKey: 'return', - exec: function(iSearch) { iSearch.deactivate(); } -}, { - name: 'cancelSearch', - bindKey: 'esc|Ctrl-G', - exec: function(iSearch) { iSearch.deactivate(true); } -}, { - name: 'occurisearch', - bindKey: 'Ctrl-O', - exec: function(iSearch) { - var options = oop.mixin({}, iSearch.$options); - iSearch.deactivate(); - occurStartCommand.exec(iSearch.$editor, options); - } -}, { - name: "yankNextWord", - bindKey: "Ctrl-w", - exec: function(iSearch) { - var ed = iSearch.$editor, - range = ed.selection.getRangeOfMovements(function(sel) { sel.moveCursorWordRight(); }), - string = ed.session.getTextRange(range); - iSearch.addString(string); - } -}, { - name: "yankNextChar", - bindKey: "Ctrl-Alt-y", - exec: function(iSearch) { - var ed = iSearch.$editor, - range = ed.selection.getRangeOfMovements(function(sel) { sel.moveCursorRight(); }), - string = ed.session.getTextRange(range); - iSearch.addString(string); - } -}, { - name: 'recenterTopBottom', - bindKey: 'Ctrl-l', - exec: function(iSearch) { iSearch.$editor.execCommand('recenterTopBottom'); } -}, { - name: 'selectAllMatches', - bindKey: 'Ctrl-space', - exec: function(iSearch) { - var ed = iSearch.$editor, - hl = ed.session.$isearchHighlight, - ranges = hl && hl.cache ? hl.cache - .reduce(function(ranges, ea) { - return ranges.concat(ea ? ea : []); }, []) : []; - iSearch.deactivate(false); - ranges.forEach(ed.selection.addRange.bind(ed.selection)); - } -}, { - name: 'searchAsRegExp', - bindKey: 'Alt-r', - exec: function(iSearch) { - iSearch.convertNeedleToRegExp(); - } -}].map(function(cmd) { - cmd.readOnly = true; - cmd.isIncrementalSearchCommand = true; - cmd.scrollIntoView = "animate-cursor"; - return cmd; -}); - -function IncrementalSearchKeyboardHandler(iSearch) { - this.$iSearch = iSearch; -} - -oop.inherits(IncrementalSearchKeyboardHandler, HashHandler); - -(function() { - - this.attach = function(editor) { - var iSearch = this.$iSearch; - HashHandler.call(this, exports.iSearchCommands, editor.commands.platform); - this.$commandExecHandler = editor.commands.addEventListener('exec', function(e) { - if (!e.command.isIncrementalSearchCommand) return undefined; - e.stopPropagation(); - e.preventDefault(); - var scrollTop = editor.session.getScrollTop(); - var result = e.command.exec(iSearch, e.args || {}); - editor.renderer.scrollCursorIntoView(null, 0.5); - editor.renderer.animateScrolling(scrollTop); - return result; - }); - }; - - this.detach = function(editor) { - if (!this.$commandExecHandler) return; - editor.commands.removeEventListener('exec', this.$commandExecHandler); - delete this.$commandExecHandler; - }; - - var handleKeyboard$super = this.handleKeyboard; - this.handleKeyboard = function(data, hashId, key, keyCode) { - if (((hashId === 1/*ctrl*/ || hashId === 8/*command*/) && key === 'v') - || (hashId === 1/*ctrl*/ && key === 'y')) return null; - var cmd = handleKeyboard$super.call(this, data, hashId, key, keyCode); - if (cmd.command) { return cmd; } - if (hashId == -1) { - var extendCmd = this.commands.extendSearchTerm; - if (extendCmd) { return {command: extendCmd, args: key}; } - } - return {command: "null", passEvent: hashId == 0 || hashId == 4}; - }; - -}).call(IncrementalSearchKeyboardHandler.prototype); - - -exports.IncrementalSearchKeyboardHandler = IncrementalSearchKeyboardHandler; - -}); diff --git a/lib/ace/commands/multi_select_commands.js b/lib/ace/commands/multi_select_commands.js index ba6392bc..ebac5cc7 100644 --- a/lib/ace/commands/multi_select_commands.js +++ b/lib/ace/commands/multi_select_commands.js @@ -1,30 +1,38 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: +/* vim:ts=4:sts=4:sw=4: + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Harutyun Amirjanyan + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -35,74 +43,54 @@ exports.defaultCommands = [{ name: "addCursorAbove", exec: function(editor) { editor.selectMoreLines(-1); }, bindKey: {win: "Ctrl-Alt-Up", mac: "Ctrl-Alt-Up"}, - scrollIntoView: "cursor", readonly: true }, { name: "addCursorBelow", exec: function(editor) { editor.selectMoreLines(1); }, bindKey: {win: "Ctrl-Alt-Down", mac: "Ctrl-Alt-Down"}, - scrollIntoView: "cursor", readonly: true }, { name: "addCursorAboveSkipCurrent", exec: function(editor) { editor.selectMoreLines(-1, true); }, bindKey: {win: "Ctrl-Alt-Shift-Up", mac: "Ctrl-Alt-Shift-Up"}, - scrollIntoView: "cursor", readonly: true }, { name: "addCursorBelowSkipCurrent", exec: function(editor) { editor.selectMoreLines(1, true); }, bindKey: {win: "Ctrl-Alt-Shift-Down", mac: "Ctrl-Alt-Shift-Down"}, - scrollIntoView: "cursor", readonly: true }, { name: "selectMoreBefore", exec: function(editor) { editor.selectMore(-1); }, bindKey: {win: "Ctrl-Alt-Left", mac: "Ctrl-Alt-Left"}, - scrollIntoView: "cursor", readonly: true }, { name: "selectMoreAfter", exec: function(editor) { editor.selectMore(1); }, bindKey: {win: "Ctrl-Alt-Right", mac: "Ctrl-Alt-Right"}, - scrollIntoView: "cursor", readonly: true }, { name: "selectNextBefore", exec: function(editor) { editor.selectMore(-1, true); }, bindKey: {win: "Ctrl-Alt-Shift-Left", mac: "Ctrl-Alt-Shift-Left"}, - scrollIntoView: "cursor", readonly: true }, { name: "selectNextAfter", exec: function(editor) { editor.selectMore(1, true); }, bindKey: {win: "Ctrl-Alt-Shift-Right", mac: "Ctrl-Alt-Shift-Right"}, - scrollIntoView: "cursor", 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"}, - scrollIntoView: "cursor" -}, { - name: "findAll", - exec: function(editor) { editor.findAll(); }, - bindKey: {win: "Ctrl-Alt-K", mac: "Ctrl-Alt-G"}, - scrollIntoView: "cursor", + bindKey: {win: "Ctrl-Shift-L", mac: "Ctrl-Shift-L"}, readonly: true }]; -// commands active only in multiselect mode +// commands active in multiselect mode exports.multiSelectCommands = [{ name: "singleSelection", bindKey: "esc", exec: function(editor) { editor.exitMultiSelectMode(); }, - scrollIntoView: "cursor", readonly: true, isAvailable: function(editor) {return editor && editor.inMultiSelectMode} }]; diff --git a/lib/ace/commands/occur_commands.js b/lib/ace/commands/occur_commands.js deleted file mode 100644 index b45fbf61..00000000 --- a/lib/ace/commands/occur_commands.js +++ /dev/null @@ -1,110 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -var config = require("../config"), - Occur = require("../occur").Occur; - -// These commands can be installed in a normal command handler to start occur: -var occurStartCommand = { - name: "occur", - exec: function(editor, options) { - var alreadyInOccur = !!editor.session.$occur; - var occurSessionActive = new Occur().enter(editor, options); - if (occurSessionActive && !alreadyInOccur) - OccurKeyboardHandler.installIn(editor); - }, - readOnly: true -}; - -var occurCommands = [{ - name: "occurexit", - bindKey: 'esc|Ctrl-G', - exec: function(editor) { - var occur = editor.session.$occur; - if (!occur) return; - occur.exit(editor, {}); - if (!editor.session.$occur) OccurKeyboardHandler.uninstallFrom(editor); - }, - readOnly: true -}, { - name: "occuraccept", - bindKey: 'enter', - exec: function(editor) { - var occur = editor.session.$occur; - if (!occur) return; - occur.exit(editor, {translatePosition: true}); - if (!editor.session.$occur) OccurKeyboardHandler.uninstallFrom(editor); - }, - readOnly: true -}]; - -var HashHandler = require("../keyboard/hash_handler").HashHandler; -var oop = require("../lib/oop"); - - -function OccurKeyboardHandler() {} - -oop.inherits(OccurKeyboardHandler, HashHandler); - -;(function() { - - this.isOccurHandler = true; - - this.attach = function(editor) { - HashHandler.call(this, occurCommands, editor.commands.platform); - this.$editor = editor; - } - - var handleKeyboard$super = this.handleKeyboard; - this.handleKeyboard = function(data, hashId, key, keyCode) { - var cmd = handleKeyboard$super.call(this, data, hashId, key, keyCode); - return (cmd && cmd.command) ? cmd : undefined; - } - -}).call(OccurKeyboardHandler.prototype); - -OccurKeyboardHandler.installIn = function(editor) { - var handler = new this(); - editor.keyBinding.addKeyboardHandler(handler); - editor.commands.addCommands(occurCommands); -} - -OccurKeyboardHandler.uninstallFrom = function(editor) { - editor.commands.removeCommands(occurCommands); - var handler = editor.getKeyboardHandler(); - if (handler.isOccurHandler) - editor.keyBinding.removeKeyboardHandler(handler); -} - -exports.occurStartCommand = occurStartCommand; - -}); diff --git a/lib/ace/config.js b/lib/ace/config.js index fe9312fd..dccbb484 100644 --- a/lib/ace/config.js +++ b/lib/ace/config.js @@ -1,30 +1,38 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: +/* vim:ts=4:sts=4:sw=4: + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,22 +40,16 @@ define(function(require, exports, module) { "no use strict"; var lang = require("./lib/lang"); -var oop = require("./lib/oop"); -var net = require("./lib/net"); -var AppConfig = require("./lib/app_config").AppConfig; - -module.exports = exports = new AppConfig(); var global = (function() { - return this || typeof window != "undefined" && window; + return this; })(); var options = { packaged: false, - workerPath: null, - modePath: null, - themePath: null, - basePath: "", + workerPath: "", + modePath: "", + themePath: "", suffix: ".js", $moduleUrls: {} }; @@ -70,81 +72,25 @@ exports.all = function() { return lang.copyObject(options); }; -// module loading exports.moduleUrl = function(name, component) { if (options.$moduleUrls[name]) return options.$moduleUrls[name]; var parts = name.split("/"); component = component || parts[parts.length - 2] || ""; - - // todo make this configurable or get rid of '-' - var sep = component == "snippets" ? "/" : "-"; - var base = parts[parts.length - 1]; - if (component == "worker" && sep == "-") { - var re = new RegExp("^" + component + "[\\-_]|[\\-_]" + component + "$", "g"); - base = base.replace(re, ""); - } + var base = parts[parts.length - 1].replace(component, "").replace(/(^[\-_])|([\-_]$)/, ""); - if ((!base || base == component) && parts.length > 1) + if (!base && parts.length > 1) base = parts[parts.length - 2]; - var path = options[component + "Path"]; - if (path == null) { - path = options.basePath; - } else if (sep == "/") { - component = sep = ""; - } - if (path && path.slice(-1) != "/") - path += "/"; - return path + component + sep + base + this.get("suffix"); + return this.get(component + "Path") + "/" + component + "-" + base + this.get("suffix"); }; exports.setModuleUrl = function(name, subst) { return options.$moduleUrls[name] = subst; }; -exports.$loading = {}; -exports.loadModule = function(moduleName, onLoad) { - var module, moduleType; - if (Array.isArray(moduleName)) { - moduleType = moduleName[0]; - moduleName = moduleName[1]; - } - - try { - module = require(moduleName); - } catch (e) {} - // require(moduleName) can return empty object if called after require([moduleName], callback) - if (module && !exports.$loading[moduleName]) - return onLoad && onLoad(module); - - if (!exports.$loading[moduleName]) - exports.$loading[moduleName] = []; - - exports.$loading[moduleName].push(onLoad); - - if (exports.$loading[moduleName].length > 1) - return; - - var afterLoad = function() { - require([moduleName], function(module) { - exports._emit("load.module", {name: moduleName, module: module}); - var listeners = exports.$loading[moduleName]; - exports.$loading[moduleName] = null; - listeners.forEach(function(onLoad) { - onLoad && onLoad(module); - }); - }); - }; - - if (!exports.get("packaged")) - return afterLoad(); - net.loadScript(exports.moduleUrl(moduleName, moduleType), afterLoad); -}; - -// initialization -function init(packaged) { - options.packaged = packaged || require.packaged || module.packaged || (global.define && define.packaged); +exports.init = function() { + options.packaged = require.packaged || module.packaged || (global.define && define.packaged); if (!global.document) return ""; @@ -152,17 +98,14 @@ function init(packaged) { var scriptOptions = {}; var scriptUrl = ""; - // Use currentScript.ownerDocument in case this file was loaded from imported document. (HTML Imports) - var currentScript = (document.currentScript || document._currentScript ); // native or polyfill - var currentDocument = currentScript && currentScript.ownerDocument || document; - - var scripts = currentDocument.getElementsByTagName("script"); + var scripts = document.getElementsByTagName("script"); for (var i=0; i .ace_gutter-cell { @@ -315,46 +256,46 @@ } .ace_fold-widget { + box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; - box-sizing: border-box; margin: 0 -12px 0 1px; - display: none; + display: inline-block; + height: 100%; width: 11px; - vertical-align: top; + vertical-align: bottom; - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg=="); + 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"); background-repeat: no-repeat; background-position: center; border-radius: 3px; border: 1px solid transparent; - cursor: pointer; } -.ace_folding-enabled .ace_fold-widget { - display: inline-block; +.ace_fold-widget.end { + 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"); } -.ace_fold-widget.ace_end { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg=="); -} - -.ace_fold-widget.ace_closed { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA=="); +.ace_fold-widget.closed { + 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"); } .ace_fold-widget:hover { border: 1px solid rgba(0, 0, 0, 0.3); background-color: rgba(255, 255, 255, 0.2); + -moz-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7); + -webkit-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7); box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7); } .ace_fold-widget:active { border: 1px solid rgba(0, 0, 0, 0.4); background-color: rgba(0, 0, 0, 0.05); + -moz-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8); + -webkit-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8); box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8); } /** @@ -363,10 +304,10 @@ .ace_dark .ace_fold-widget { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC"); } -.ace_dark .ace_fold-widget.ace_end { +.ace_dark .ace_fold-widget.end { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg=="); } -.ace_dark .ace_fold-widget.ace_closed { +.ace_dark .ace_fold-widget.closed { background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg=="); } .ace_dark .ace_fold-widget:hover { @@ -374,78 +315,32 @@ background-color: rgba(255, 255, 255, 0.1); } .ace_dark .ace_fold-widget:active { + -moz-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2); + -webkit-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2); box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2); } - -.ace_fold-widget.ace_invalid { + + + +.ace_fold-widget.invalid { background-color: #FFB4B4; border-color: #DE5555; } .ace_fade-fold-widgets .ace_fold-widget { + -moz-transition: opacity 0.4s ease 0.05s; -webkit-transition: opacity 0.4s ease 0.05s; + -o-transition: opacity 0.4s ease 0.05s; + -ms-transition: opacity 0.4s ease 0.05s; transition: opacity 0.4s ease 0.05s; opacity: 0; } .ace_fade-fold-widgets:hover .ace_fold-widget { + -moz-transition: opacity 0.05s ease 0.05s; -webkit-transition: opacity 0.05s ease 0.05s; + -o-transition: opacity 0.05s ease 0.05s; + -ms-transition: opacity 0.05s ease 0.05s; transition: opacity 0.05s ease 0.05s; opacity:1; } - -.ace_underline { - text-decoration: underline; -} - -.ace_bold { - font-weight: bold; -} - -.ace_nobold .ace_bold { - font-weight: normal; -} - -.ace_italic { - font-style: italic; -} - - -.ace_error-marker { - background-color: rgba(255, 0, 0,0.2); - position: absolute; - z-index: 9; -} - -.ace_highlight-marker { - background-color: rgba(255, 255, 0,0.2); - position: absolute; - z-index: 8; -} - -/* -styles = [] -for (var i = 1; i < 16; i++) { - styles.push(".ace_br" + i + "{" + ( - ["top-left", "top-right", "bottom-right", "bottom-left"] - ).map(function(x, j) { - return i & (1< + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,36 +39,36 @@ define(function(require, exports, module) { "use strict"; var oop = require("./lib/oop"); -var applyDelta = require("./apply_delta").applyDelta; var EventEmitter = require("./lib/event_emitter").EventEmitter; var Range = require("./range").Range; var Anchor = require("./anchor").Anchor; /** - * Contains the text of the document. Document can be attached to several [[EditSession `EditSession`]]s. - * At its core, `Document`s are just an array of strings, with each row in the document matching up to the array index. + * class Document + * + * Contains the text of the document. Document can be attached to several [[EditSession `EditSession`]]s. At its core, `Document`s are just an array of strings, with each row in the document matching up to the array index. + * * - * @class Document **/ -/** + /** + * 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. - * @param {String | Array} text The starting text - * @constructor + * **/ - -var Document = function(textOrLines) { - this.$lines = [""]; +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 (textOrLines.length === 0) { + if (text.length == 0) { this.$lines = [""]; - } else if (Array.isArray(textOrLines)) { - this.insertMergedLines({row: 0, column: 0}, textOrLines); + } else if (Array.isArray(text)) { + this.insertLines(0, text); } else { - this.insert({row: 0, column:0}, textOrLines); + this.insert({row: 0, column:0}, text); } }; @@ -70,104 +77,126 @@ var Document = function(textOrLines) { oop.implement(this, EventEmitter); /** - * Replaces all the lines in the current `Document` with the value of `text`. + * Document.setValue(text) -> Void + * - text (String): The text to use * - * @param {String} text The text to use + * Replaces all the lines in the current `Document` with the value of `text`. **/ this.setValue = function(text) { - var len = this.getLength() - 1; - this.remove(new Range(0, 0, len, this.getLine(len).length)); - this.insert({row: 0, column: 0}, text); + var len = this.getLength(); + this.remove(new Range(0, 0, len, this.getLine(len-1).length)); + this.insert({row: 0, column:0}, text); }; /** - * Returns all the lines in the document as a single string, joined by the new line character. + * Document.getValue() -> String + * + * Returns all the lines in the document as a single string, split by the new line character. **/ this.getValue = function() { return this.getAllLines().join(this.getNewLineCharacter()); }; /** - * Creates a new `Anchor` to define a floating point in the document. - * @param {Number} row The row number to use - * @param {Number} column The column number to use + * Document.createAnchor(row, column) -> Anchor + * - row (Number): The row number to use + * - column (Number): The column number to use * + * Creates a new `Anchor` to define a floating point in the document. **/ this.createAnchor = function(row, column) { return new Anchor(this, row, column); }; - /** - * Splits a string of text on any newline (`\n`) or carriage-return (`\r`) characters. + /** internal, hide + * Document.$split(text) -> [String] + * - text (String): The text to work with + * + ([String]): A String array, with each index containing a piece of the original `text` string. + * + * Splits a string of text on any newline (`\n`) or carriage-return ('\r') characters. * - * @method $split - * @param {String} text The text to work with - * @returns {String} A String array, with each index containing a piece of the original `text` string. * **/ // check for IE split bug - if ("aaa".split(/a/).length === 0) { + if ("aaa".split(/a/).length == 0) this.$split = function(text) { return text.replace(/\r\n|\r/g, "\n").split("\n"); - }; - } else { + } + else this.$split = function(text) { return text.split(/\r\n|\r|\n/); }; - } + /** internal, hide + * Document.$detectNewLine(text) -> Void + * + * + **/ this.$detectNewLine = function(text) { var match = text.match(/^.*?(\r\n|\r|\n)/m); - this.$autoNewLine = match ? match[1] : "\n"; - this._signal("changeNewLineMode"); - }; - - /** - * Returns the newline character that's being used, depending on the value of `newLineMode`. - * @returns {String} If `newLineMode == windows`, `\r\n` is returned. - * If `newLineMode == unix`, `\n` is returned. - * If `newLineMode == auto`, the value of `autoNewLine` is returned. - * - **/ - this.getNewLineCharacter = function() { - switch (this.$newLineMode) { - case "windows": - return "\r\n"; - case "unix": - return "\n"; - default: - return this.$autoNewLine || "\n"; + if (match) { + this.$autoNewLine = match[1]; + } else { + this.$autoNewLine = "\n"; } }; - this.$autoNewLine = ""; + /** + * Document.getNewLineCharacter() -> String + * + (String): If `newLineMode == windows`, `\r\n` is returned.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * If `newLineMode == unix`, `\n` is returned.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * If `newLineMode == auto`, the value of `autoNewLine` is returned. + * + * Returns the newline character that's being used, depending on the value of `newLineMode`. + * + * + * + **/ + 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"; /** + * Document.setNewLineMode(newLineMode) -> Void + * - newLineMode(String): [The newline mode to use; can be either `windows`, `unix`, or `auto`]{: #Document.setNewLineMode.param} + * * [Sets the new line mode.]{: #Document.setNewLineMode.desc} - * @param {String} newLineMode [The newline mode to use; can be either `windows`, `unix`, or `auto`]{: #Document.setNewLineMode.param} - * **/ this.setNewLineMode = function(newLineMode) { if (this.$newLineMode === newLineMode) return; this.$newLineMode = newLineMode; - this._signal("changeNewLineMode"); }; /** + * Document.getNewLineMode() -> String + * * [Returns the type of newlines being used; either `windows`, `unix`, or `auto`]{: #Document.getNewLineMode} - * @returns {String} + * **/ this.getNewLineMode = function() { return this.$newLineMode; }; /** + * Document.isNewLine(text) -> Boolean + * - text (String): The text to check + * * Returns `true` if `text` is a newline character (either `\r\n`, `\r`, or `\n`). - * @param {String} text The text to check * **/ this.isNewLine = function(text) { @@ -175,8 +204,10 @@ var Document = function(textOrLines) { }; /** + * Document.getLine(row) -> String + * - row (Number): The row index to retrieve + * * Returns a verbatim copy of the given line as it is in the document - * @param {Number} row The row index to retrieve * **/ this.getLine = function(row) { @@ -184,9 +215,11 @@ var Document = function(textOrLines) { }; /** + * Document.getLines(firstRow, lastRow) -> [String] + * - firstRow (Number): The first row index to retrieve + * - lastRow (Number): The final row index to retrieve + * * Returns an array of strings of the rows between `firstRow` and `lastRow`. This function is inclusive of `lastRow`. - * @param {Number} firstRow The first row index to retrieve - * @param {Number} lastRow The final row index to retrieve * **/ this.getLines = function(firstRow, lastRow) { @@ -194,13 +227,17 @@ var Document = function(textOrLines) { }; /** - * Returns all lines in the document as string array. + * Document.getAllLines() -> [String] + * + * Returns all lines in the document as string array. Warning: The caller should not modify this array! **/ this.getAllLines = function() { return this.getLines(0, this.getLength()); }; /** + * Document.getLength() -> Number + * * Returns the number of rows in the document. **/ this.getLength = function() { @@ -208,322 +245,311 @@ var Document = function(textOrLines) { }; /** - * Returns all the text within `range` as a single string. - * @param {Range} range The range to work with. + * Document.getTextRange(range) -> String + * - range (Range): The range to work with * - * @returns {String} + * [Given a range within the document, this function returns all the text within that range as a single string.]{: #Document.getTextRange.desc} **/ this.getTextRange = function(range) { - return this.getLinesForRange(range).join(this.getNewLineCharacter()); - }; - - /** - * Returns all the text within `range` as an array of lines. - * @param {Range} range The range to work with. - * - * @returns {Array} - **/ - this.getLinesForRange = function(range) { - var lines; - if (range.start.row === range.end.row) { - // Handle a single-line range. - lines = [this.getLine(range.start.row).substring(range.start.column, range.end.column)]; - } else { - // Handle a multi-line range. - lines = this.getLines(range.start.row, range.end.row); - lines[0] = (lines[0] || "").substring(range.start.column); - var l = lines.length - 1; - if (range.end.row - range.start.row == l) - lines[l] = lines[l].substring(0, range.end.column); + 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()); } - return lines; }; - // Deprecated methods retained for backwards compatibility. - this.insertLines = function(row, lines) { - console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."); - return this.insertFullLines(row, lines); - }; - this.removeLines = function(firstRow, lastRow) { - console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."); - return this.removeFullLines(firstRow, lastRow); - }; - this.insertNewLine = function(position) { - console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, [\'\', \'\']) instead."); - return this.insertMergedLines(position, ["", ""]); - }; - - /** - * Inserts a block of `text` at the indicated `position`. - * @param {Object} position The position to start inserting at; it's an object that looks like `{ row: row, column: column}` - * @param {String} text A chunk of text to insert - * @returns {Object} The position ({row, column}) of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. - * - **/ - this.insert = function(position, text) { - // Only detect new lines if the document has no line break yet. - if (this.getLength() <= 1) - this.$detectNewLine(text); - - return this.insertMergedLines(position, this.$split(text)); - }; - - /** - * Inserts `text` into the `position` at the current row. This method also triggers the `"change"` event. + /** internal, hide + * Document.$clipPosition(position) -> Number * - * This differs from the `insert` method in two ways: - * 1. This does NOT handle newline characters (single-line text only). - * 2. This is faster than the `insert` method for single-line text insertions. * - * @param {Object} position The position to insert at; it's an object that looks like `{ row: row, column: column}` - * @param {String} text A chunk of text - * @returns {Object} Returns an object containing the final row and column, like this: - * ``` - * {row: endRow, column: 0} - * ``` **/ - this.insertInLine = function(position, text) { - var start = this.clippedPos(position.row, position.column); - var end = this.pos(position.row, position.column + text.length); - - this.applyDelta({ - start: start, - end: end, - action: "insert", - lines: [text] - }, true); - - return this.clonePos(end); - }; - - this.clippedPos = function(row, column) { - var length = this.getLength(); - if (row === undefined) { - row = length; - } else if (row < 0) { - row = 0; - } else if (row >= length) { - row = length - 1; - column = undefined; - } - var line = this.getLine(row); - if (column == undefined) - column = line.length; - column = Math.min(Math.max(column, 0), line.length); - return {row: row, column: column}; - }; - - this.clonePos = function(pos) { - return {row: pos.row, column: pos.column}; - }; - - this.pos = function(row, column) { - return {row: row, column: column}; - }; - 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; - } else { - position.row = Math.max(0, position.row); - position.column = Math.min(Math.max(position.column, 0), this.getLine(position.row).length); + position.column = this.getLine(length-1).length; } return position; }; /** - * 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: - * - * * `"insert"` - * * `range`: the [[Range]] of the change within the document - * * `lines`: the lines being added - * * `"remove"` - * * `range`: the [[Range]] of the change within the document - * * `lines`: the lines being removed - * - * @event change - * @param {Object} e Contains at least one property called `"action"`. `"action"` indicates the action that triggered the change. Each action also has a set of additional properties. + * Document.insert(position, text) -> Number + * - position (Number): The position to start inserting at + * - text (String): A chunk of text to insert + * + (Number): The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. + * Inserts a block of `text` and the indicated `position`. * + * **/ - - /** - * Inserts the elements in `lines` into the document as full lines (does not merge with existing line), starting at the row index given by `row`. This method also triggers the `"change"` event. - * @param {Number} row The index of the row to insert at - * @param {Array} lines An array of strings - * @returns {Object} Contains the final row and column, like this: - * ``` - * {row: endRow, column: 0} - * ``` - * If `lines` is empty, this function returns an object containing the current row, and column, like this: - * ``` - * {row: row, column: 0} - * ``` - * - **/ - this.insertFullLines = function(row, lines) { - // Clip to document. - // Allow one past the document end. - row = Math.min(Math.max(row, 0), this.getLength()); - - // Calculate insertion point. - var column = 0; - if (row < this.getLength()) { - // Insert before the specified row. - lines = lines.concat([""]); - column = 0; - } else { - // Insert after the last row in the document. - lines = [""].concat(lines); - row--; - column = this.$lines[row].length; + 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 || ""); } - - // Insert. - this.insertMergedLines({row: row, column: column}, lines); + return position; }; /** - * Inserts the elements in `lines` into the document, starting at the position index given by `row`. This method also triggers the `"change"` event. - * @param {Number} row The index of the row to insert at - * @param {Array} lines An array of strings - * @returns {Object} Contains the final row and column, like this: - * ``` - * {row: endRow, column: 0} - * ``` - * If `lines` is empty, this function returns an object containing the current row, and column, like this: - * ``` - * {row: row, column: 0} - * ``` + * Document.insertLines(row, lines) -> Object + * - row (Number): The index of the row to insert at + * - lines (Array): An array of strings + * + (Object): Returns an object containing the final row and column, like this:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * ```{row: endRow, column: 0}```
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * If `lines` is empty, this function returns an object containing the current row, and column, like this:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * ```{row: row, column: 0}``` * - **/ - this.insertMergedLines = function(position, lines) { - var start = this.clippedPos(position.row, position.column); - var end = { - row: start.row + lines.length - 1, - column: (lines.length == 1 ? start.column : 0) + lines[lines.length - 1].length - }; - - this.applyDelta({ - start: start, - end: end, - action: "insert", + * Inserts the elements in `lines` into the document, starting at the row index given by `row`. This method also triggers the `'change'` event. + * + * + **/ + 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 - }); - - return this.clonePos(end); + }; + this._emit("change", { data: delta }); + return end || range.end; }; /** + * Document.insertNewLine(position) -> Object + * - position (String): The position to insert at + * + (Object): Returns an object containing the final row and column, like this:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * ```{row: endRow, column: 0}``` + * + * Inserts a new line into the document at the current row's `position`. This method also triggers the `'change'` event. + * + * + * + **/ + 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; + }; + + /** + * Document.insertInLine(position, text) -> Object | Number + * - position (Number): The position to insert at + * - text (String): A chunk of text + * + (Object): Returns an object containing the final row and column, like this:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * ```{row: endRow, column: 0}``` + * + (Number): If `text` is empty, this function returns the value of `position` + * + * Inserts `text` into the `position` at the current row. This method also triggers the `'change'` event. + * + * + * + **/ + 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; + }; + + /** + * Document.remove(range) -> Object + * - range (Range): A specified Range to remove + * + (Object): Returns the new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. + * * Removes the `range` from the document. - * @param {Range} range A specified Range to remove - * @returns {Object} Returns the new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. + * * **/ this.remove = function(range) { - var start = this.clippedPos(range.start.row, range.start.column); - var end = this.clippedPos(range.end.row, range.end.column); - this.applyDelta({ - start: start, - end: end, - action: "remove", - lines: this.getLinesForRange({start: start, end: end}) - }); - return this.clonePos(start); + // 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; }; /** - * Removes the specified columns from the `row`. This method also triggers a `"change"` event. - * @param {Number} row The row to remove from - * @param {Number} startColumn The column to start removing at - * @param {Number} endColumn The column to stop removing at - * @returns {Object} Returns an object containing `startRow` and `startColumn`, indicating the new row and column values.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              If `startColumn` is equal to `endColumn`, this function returns nothing. - * - **/ + * Document.removeInLine(row, startColumn, endColumn) -> Object + * - row (Number): The row to remove from + * - startColumn (Number): The column to start removing at + * - endColumn (Number): The column to stop removing at + * + (Object): Returns an object containing `startRow` and `startColumn`, indicating the new row and column values.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              If `startColumn` is equal to `endColumn`, this function returns nothing. + * + * Removes the specified columns from the `row`. This method also triggers the `'change'` event. + * + * + **/ this.removeInLine = function(row, startColumn, endColumn) { - var start = this.clippedPos(row, startColumn); - var end = this.clippedPos(row, endColumn); - - this.applyDelta({ - start: start, - end: end, - action: "remove", - lines: this.getLinesForRange({start: start, end: end}) - }, true); - - return this.clonePos(start); + 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; }; /** - * Removes a range of full lines. This method also triggers the `"change"` event. - * @param {Number} firstRow The first row to be removed - * @param {Number} lastRow The last row to be removed - * @returns {[String]} Returns all the removed lines. + * Document.removeLines(firstRow, lastRow) -> [String] + * - firstRow (Number): The first row to be removed + * - lastRow (Number): The last row to be removed + * + ([String]): Returns all the removed lines. + * + * Removes a range of full lines. This method also triggers the `'change'` event. + * * **/ - this.removeFullLines = function(firstRow, lastRow) { - // Clip to document. - firstRow = Math.min(Math.max(0, firstRow), this.getLength() - 1); - lastRow = Math.min(Math.max(0, lastRow ), this.getLength() - 1); - - // Calculate deletion range. - // Delete the ending new line unless we're at the end of the document. - // If we're at the end of the document, delete the starting new line. - var deleteFirstNewLine = lastRow == this.getLength() - 1 && firstRow > 0; - var deleteLastNewLine = lastRow < this.getLength() - 1; - var startRow = ( deleteFirstNewLine ? firstRow - 1 : firstRow ); - var startCol = ( deleteFirstNewLine ? this.getLine(startRow).length : 0 ); - var endRow = ( deleteLastNewLine ? lastRow + 1 : lastRow ); - var endCol = ( deleteLastNewLine ? 0 : this.getLine(endRow).length ); - var range = new Range(startRow, startCol, endRow, endCol); - - // Store delelted lines with bounding newlines ommitted (maintains previous behavior). - var deletedLines = this.$lines.slice(firstRow, lastRow + 1); - - this.applyDelta({ - start: range.start, - end: range.end, - action: "remove", - lines: this.getLinesForRange(range) - }); - - // Return the deleted lines. - return deletedLines; + 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; }; /** - * Removes the new line between `row` and the row immediately following it. This method also triggers the `"change"` event. - * @param {Number} row The row to check + * Document.removeNewLine(row) -> Void + * - row (Number): The row to check + * + * Removes the new line between `row` and the row immediately following it. This method also triggers the `'change'` event. * **/ this.removeNewLine = function(row) { - if (row < this.getLength() - 1 && row >= 0) { - this.applyDelta({ - start: this.pos(row, this.getLine(row).length), - end: this.pos(row + 1, 0), - action: "remove", - lines: ["", ""] - }); - } + 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 }); }; /** - * Replaces a range in the document with the new `text`. - * @param {Range} range A specified Range to replace - * @param {String} text The new text to use as a replacement - * @returns {Object} Returns an object containing the final row and column, like this: + * Document.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: * {row: endRow, column: 0} * If the text and range are empty, this function returns an object containing the current `range.start` value. * 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) { - if (!range instanceof Range) - range = Range.fromPoints(range.start, range.end); - if (text.length === 0 && range.isEmpty()) + if (text.length == 0 && range.isEmpty()) return range.start; // Shortcut: If the text we want to insert is the same as it is already @@ -532,158 +558,57 @@ var Document = function(textOrLines) { return range.end; this.remove(range); - var end; if (text) { - end = this.insert(range.start, text); + var end = this.insert(range.start, text); } else { end = range.start; } - + return end; }; /** - * Applies all changes in `deltas` to the document. - * @param {Array} deltas An array of delta objects (can include "insert" and "remove" actions) + * Document.applyDeltas(deltas) -> Void + * + * Applies all the changes previously accumulated. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. **/ this.applyDeltas = function(deltas) { for (var i=0; i Void + * + * Reverts any changes previously applied. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`. **/ this.revertDeltas = function(deltas) { for (var i=deltas.length-1; i>=0; i--) { - this.revertDelta(deltas[i]); - } - }; - - /** - * Applies `delta` to the document. - * @param {Object} delta A delta object (can include "insert" and "remove" actions) - **/ - this.applyDelta = function(delta, doNotValidate) { - var isInsert = delta.action == "insert"; - // An empty range is a NOOP. - if (isInsert ? delta.lines.length <= 1 && !delta.lines[0] - : !Range.comparePoints(delta.start, delta.end)) { - return; - } - - if (isInsert && delta.lines.length > 20000) - this.$splitAndapplyLargeDelta(delta, 20000); - - // Apply. - applyDelta(this.$lines, delta, doNotValidate); - this._signal("change", delta); - }; - - this.$splitAndapplyLargeDelta = function(delta, MAX) { - // Split large insert deltas. This is necessary because: - // 1. We need to support splicing delta lines into the document via $lines.splice.apply(...) - // 2. fn.apply() doesn't work for a large number of params. The smallest threshold is on chrome 40 ~42000. - // we use 20000 to leave some space for actual stack - // - // To Do: Ideally we'd be consistent and also split 'delete' deltas. We don't do this now, because delete - // delta handling is too slow. If we make delete delta handling faster we can split all large deltas - // as shown in https://gist.github.com/aldendaniels/8367109#file-document-snippet-js - // If we do this, update validateDelta() to limit the number of lines in a delete delta. - var lines = delta.lines; - var l = lines.length; - var row = delta.start.row; - var column = delta.start.column; - var from = 0, to = 0; - do { - from = to; - to += MAX - 1; - var chunk = lines.slice(from, to); - if (to > l) { - // Update remaining delta. - delta.lines = chunk; - delta.start.row = row + from; - delta.start.column = column; - break; - } - chunk.push(""); - this.applyDelta({ - start: this.pos(row + from, column), - end: this.pos(row + to, column = 0), - action: delta.action, - lines: chunk - }, true); - } while(true); - }; - - /** - * Reverts `delta` from the document. - * @param {Object} delta A delta object (can include "insert" and "remove" actions) - **/ - this.revertDelta = function(delta) { - this.applyDelta({ - start: this.clonePos(delta.start), - end: this.clonePos(delta.end), - action: (delta.action == "insert" ? "remove" : "insert"), - lines: delta.lines.slice() - }); - }; - - /** - * Converts an index position in a document to a `{row, column}` object. - * - * Index refers to the "absolute position" of a character in the document. For example: - * - * ```javascript - * var x = 0; // 10 characters, plus one for newline - * var y = -1; - * ``` - * - * Here, `y` is an index 15: 11 characters for the first row, and 5 characters until `y` in the second. - * - * @param {Number} index An index to convert - * @param {Number} startRow=0 The row from which to start the conversion - * @returns {Object} A `{row, column}` object of the `index` position - */ - this.indexToPosition = function(index, startRow) { - var lines = this.$lines || this.getAllLines(); - var newlineLength = this.getNewLineCharacter().length; - for (var i = startRow || 0, l = lines.length; i < l; i++) { - index -= lines[i].length + newlineLength; - if (index < 0) - return {row: i, column: index + lines[i].length + newlineLength}; - } - return {row: l-1, column: lines[l-1].length}; - }; + var delta = deltas[i]; - /** - * Converts the `{row, column}` position in a document to the character's index. - * - * Index refers to the "absolute position" of a character in the document. For example: - * - * ```javascript - * var x = 0; // 10 characters, plus one for newline - * var y = -1; - * ``` - * - * Here, `y` is an index 15: 11 characters for the first row, and 5 characters until `y` in the second. - * - * @param {Object} pos The `{row, column}` to convert - * @param {Number} startRow=0 The row from which to start the conversion - * @returns {Number} The index position in the document - */ - this.positionToIndex = function(pos, startRow) { - var lines = this.$lines || this.getAllLines(); - var newlineLength = this.getNewLineCharacter().length; - var index = 0; - var row = Math.min(pos.row, lines.length); - for (var i = startRow || 0; i < row; ++i) - index += lines[i].length + newlineLength; + var range = Range.fromPoints(delta.range.start, delta.range.end); - return index + pos.column; + 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); diff --git a/lib/ace/document_test.js b/lib/ace/document_test.js index ada56cd2..f140e3d4 100644 --- a/lib/ace/document_test.js +++ b/lib/ace/document_test.js @@ -1,30 +1,38 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * Julian Viereck + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -46,7 +54,7 @@ module.exports = { var doc = new Document(["12", "34"]); var deltas = []; - doc.on("change", function(e) { deltas.push(e); }); + doc.on("change", function(e) { deltas.push(e.data); }); doc.insert({row: 0, column: 1}, "juhu"); assert.equal(doc.getValue(), ["1juhu2", "34"].join("\n")); @@ -63,9 +71,9 @@ module.exports = { var doc = new Document(["12", "34"]); var deltas = []; - doc.on("change", function(e) { deltas.push(e); }); + doc.on("change", function(e) { deltas.push(e.data); }); - doc.insertMergedLines({row: 0, column: 1}, ['', '']); + doc.insertNewLine({row: 0, column: 1}); assert.equal(doc.getValue(), ["1", "2", "34"].join("\n")); var d = deltas.concat(); @@ -80,9 +88,9 @@ module.exports = { var doc = new Document(["12", "34"]); var deltas = []; - doc.on("change", function(e) { deltas.push(e); }); + doc.on("change", function(e) { deltas.push(e.data); }); - doc.insertFullLines(0, ["aa", "bb"]); + doc.insertLines(0, ["aa", "bb"]); assert.equal(doc.getValue(), ["aa", "bb", "12", "34"].join("\n")); var d = deltas.concat(); @@ -97,9 +105,9 @@ module.exports = { var doc = new Document(["12", "34"]); var deltas = []; - doc.on("change", function(e) { deltas.push(e); }); + doc.on("change", function(e) { deltas.push(e.data); }); - doc.insertFullLines(2, ["aa", "bb"]); + doc.insertLines(2, ["aa", "bb"]); assert.equal(doc.getValue(), ["12", "34", "aa", "bb"].join("\n")); }, @@ -107,9 +115,9 @@ module.exports = { var doc = new Document(["12", "34"]); var deltas = []; - doc.on("change", function(e) { deltas.push(e); }); + doc.on("change", function(e) { deltas.push(e.data); }); - doc.insertFullLines(1, ["aa", "bb"]); + doc.insertLines(1, ["aa", "bb"]); assert.equal(doc.getValue(), ["12", "aa", "bb", "34"].join("\n")); var d = deltas.concat(); @@ -124,7 +132,7 @@ module.exports = { var doc = new Document(["12", "34"]); var deltas = []; - doc.on("change", function(e) { deltas.push(e); }); + doc.on("change", function(e) { deltas.push(e.data); }); doc.insert({row: 0, column: 0}, "aa\nbb\ncc"); assert.equal(doc.getValue(), ["aa", "bb", "cc12", "34"].join("\n")); @@ -141,9 +149,9 @@ module.exports = { var doc = new Document(["12", "34"]); var deltas = []; - doc.on("change", function(e) { deltas.push(e); }); + doc.on("change", function(e) { deltas.push(e.data); }); - doc.insert({row: 1, column: 2}, "aa\nbb\ncc"); + doc.insert({row: 2, column: 0}, "aa\nbb\ncc"); assert.equal(doc.getValue(), ["12", "34aa", "bb", "cc"].join("\n")); var d = deltas.concat(); @@ -158,7 +166,7 @@ module.exports = { var doc = new Document(["12", "34"]); var deltas = []; - doc.on("change", function(e) { deltas.push(e); }); + doc.on("change", function(e) { deltas.push(e.data); }); doc.insert({row: 0, column: 1}, "aa\nbb\ncc"); assert.equal(doc.getValue(), ["1aa", "bb", "cc2", "34"].join("\n")); @@ -175,7 +183,7 @@ module.exports = { var doc = new Document(["1234", "5678"]); var deltas = []; - doc.on("change", function(e) { deltas.push(e); }); + doc.on("change", function(e) { deltas.push(e.data); }); doc.remove(new Range(0, 1, 0, 3)); assert.equal(doc.getValue(), ["14", "5678"].join("\n")); @@ -192,7 +200,7 @@ module.exports = { var doc = new Document(["1234", "5678"]); var deltas = []; - doc.on("change", function(e) { deltas.push(e); }); + doc.on("change", function(e) { deltas.push(e.data); }); doc.remove(new Range(0, 4, 1, 0)); assert.equal(doc.getValue(), ["12345678"].join("\n")); @@ -209,7 +217,7 @@ module.exports = { var doc = new Document(["1234", "5678", "abcd"]); var deltas = []; - doc.on("change", function(e) { deltas.push(e); }); + doc.on("change", function(e) { deltas.push(e.data); }); doc.remove(new Range(0, 2, 2, 2)); assert.equal(doc.getValue(), ["12cd"].join("\n")); @@ -226,7 +234,7 @@ module.exports = { var doc = new Document(["1234", "5678", "abcd"]); var deltas = []; - doc.on("change", function(e) { deltas.push(e); }); + doc.on("change", function(e) { deltas.push(e.data); }); doc.remove(new Range(1, 0, 3, 0)); assert.equal(doc.getValue(), ["1234", ""].join("\n")); @@ -235,7 +243,7 @@ module.exports = { "test: remove lines should return the removed lines" : function() { var doc = new Document(["1234", "5678", "abcd"]); - var removed = doc.removeFullLines(1, 2); + var removed = doc.removeLines(1, 2); assert.equal(removed.join("\n"), ["5678", "abcd"].join("\n")); }, @@ -296,35 +304,6 @@ module.exports = { "test: empty document has to contain one line": function() { var doc = new Document(""); assert.equal(doc.$lines.length, 1); - }, - - "test: ignore empty delta": function() { - var doc = new Document(""); - doc.on("change", function() { - throw "should ignore empty delta"; - }) - doc.insert({row: 0, column: 0}, ""); - doc.insert({row: 1, column: 1}, ""); - doc.remove({start: {row: 1, column: 1}, end: {row: 1, column: 1}}); - }, - - "test: inserting huge delta": function() { - var doc = new Document(""); - var val = ""; - var MAX = 0xF000; - for (var i = 0; i < 10 * MAX; i++) { - val += i + "\n" - } - doc.setValue(val); - assert.equal(doc.getValue(), val); - - for (var i = 3 * MAX + 2; i >= 3 * MAX - 2; i--) { - val = doc.getLines(0, i).join("\n"); - doc.setValue("\nab"); - assert.equal(doc.getValue(), "\nab"); - doc.insert({row: 1, column: 1}, val); - assert.equal(doc.getValue(), "\na" + val + "b"); - } } }; diff --git a/lib/ace/edit_session.js b/lib/ace/edit_session.js index 2aa9b378..21d908b5 100644 --- a/lib/ace/edit_session.js +++ b/lib/ace/edit_session.js @@ -1,39 +1,50 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: +/* vim:ts=4:sts=4:sw=4: + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. * - * 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. + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * Mihai Sucan + * Julian Viereck + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ define(function(require, exports, module) { "use strict"; +var config = require("./config"); var oop = require("./lib/oop"); var lang = require("./lib/lang"); -var config = require("./config"); +var net = require("./lib/net"); var EventEmitter = require("./lib/event_emitter").EventEmitter; var Selection = require("./selection").Selection; var TextMode = require("./mode/text").Mode; @@ -43,127 +54,79 @@ var BackgroundTokenizer = require("./background_tokenizer").BackgroundTokenizer; var SearchHighlight = require("./search_highlight").SearchHighlight; /** - * Stores all the data about [[Editor `Editor`]] state providing easy way to change editors state. + * class EditSession + * + * Stores all the data about [[Editor `Editor`]] state providing easy way to change editors state. `EditSession` can be attached to only one [[Document `Document`]]. Same `Document` can be attached to several `EditSession`s. * - * `EditSession` can be attached to only one [[Document `Document`]]. Same `Document` can be attached to several `EditSession`s. - * @class EditSession **/ -//{ events +// events /** + * EditSession@change(e) * * Emitted when the document changes. - * @event change - * @param {Object} e An object containing a `delta` of information about the change. **/ /** - * Emitted when the tab size changes, via [[EditSession.setTabSize]]. + * EditSession@tokenizerUpdate(e) * - * @event changeTabSize - **/ -/** - * Emitted when the ability to overwrite text changes, via [[EditSession.setOverwrite]]. - * - * @event changeOverwrite - **/ -/** - * Emitted when the gutter changes, either by setting or removing breakpoints, or when the gutter decorations change. - * - * @event changeBreakpoint - **/ -/** - * Emitted when a front marker changes. - * - * @event changeFrontMarker - **/ -/** - * Emitted when a back marker changes. - * - * @event changeBackMarker - **/ -/** - * Emitted when an annotation changes, like through [[EditSession.setAnnotations]]. - * - * @event changeAnnotation - **/ -/** - * Emitted when a background tokenizer asynchronously processes new rows. - * @event tokenizerUpdate - * - * @param {Object} e An object containing one property, `"data"`, that contains information about the changing rows + * Emitted when a background tokenizer asynchronousely processes new rows. * **/ /** - * Emitted when the current mode changes. + * EditSession@changeFold(e) * - * @event changeMode - * - **/ -/** - * Emitted when the wrap mode changes. - * - * @event changeWrapMode - * - **/ -/** - * Emitted when the wrapping limit changes. - * - * @event changeWrapLimit - * - **/ -/** - * Emitted when a code fold is added or removed. - * - * @event changeFold + * Emitted when a code fold added or removed. * **/ /** + * EditSession@changeScrollTop() + * * Emitted when the scroll top changes. - * @event changeScrollTop - * - * @param {Number} scrollTop The new scroll top value **/ /** + * EditSession@changeScrollLeft() + * * Emitted when the scroll left changes. - * @event changeScrollLeft - * - * @param {Number} scrollLeft The new scroll left value **/ -//} - + + /** + * 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`. - * @param {Document | String} text [If `text` is a `Document`, it associates the `EditSession` with it. Otherwise, a new `Document` is created, with the initial text]{: #textParam} - * @param {TextMode} mode [The inital language mode to use for the document]{: #modeParam} * - * @constructor **/ var EditSession = function(text, mode) { + this.$modified = true; this.$breakpoints = []; this.$decorations = []; this.$frontMarkers = {}; this.$backMarkers = {}; this.$markerId = 1; - this.$undoSelect = true; - + this.$resetRowCache(0); + this.$wrapData = []; this.$foldData = []; + this.$rowLengthCache = []; + this.$undoSelect = true; this.$foldData.toString = function() { - return this.join("\n"); - }; - this.on("changeFold", this.onChangeFold.bind(this)); - this.$onChange = this.onChange.bind(this); + var str = ""; + this.forEach(function(foldLine) { + str += "\n" + foldLine.toString(); + }); + return str; + } - if (typeof text != "object" || !text.getLine) - text = new Document(text); + if (typeof text == "object" && text.getLine) { + this.setDocument(text); + } else { + this.setDocument(new Document(text)); + } - this.setDocument(text); this.selection = new Selection(this); - - config.resetOptions(this); this.setMode(mode); - config._signal("session", this); }; @@ -172,48 +135,55 @@ var EditSession = function(text, mode) { oop.implement(this, EventEmitter); /** - * Sets the `EditSession` to point to a new `Document`. If a `BackgroundTokenizer` exists, it also points to `doc`. + * EditSession.setDocument(doc) + * - doc (Document): The new `Document` to use * - * @param {Document} doc The new `Document` to use + * Sets the `EditSession` to point to a new `Document`. If a `BackgroundTokenizer` exists, it also points to `doc`. * **/ this.setDocument = function(doc) { if (this.doc) - this.doc.removeListener("change", this.$onChange); + throw new Error("Document is already set"); this.doc = doc; - doc.on("change", this.$onChange); + doc.on("change", this.onChange.bind(this)); + this.on("changeFold", this.onChangeFold.bind(this)); - if (this.bgTokenizer) + if (this.bgTokenizer) { this.bgTokenizer.setDocument(this.getDocument()); - - this.resetCaches(); + this.bgTokenizer.start(0); + } }; /** + * EditSession.getDocument() -> Document + * * Returns the `Document` associated with this session. - * @return {Document} + * **/ this.getDocument = function() { return this.doc; }; - /** - * @param {Number} row The row to work with + /** internal, hide + * EditSession.$resetRowCache(row) + * - row (Number): The row to work with + * + * * **/ - this.$resetRowCache = function(docRow) { - if (!docRow) { + this.$resetRowCache = function(docRrow) { + if (!docRrow) { this.$docRowCache = []; this.$screenRowCache = []; return; } + + var i = this.$getRowCacheIndex(this.$docRowCache, docRrow) + 1; var l = this.$docRowCache.length; - var i = this.$getRowCacheIndex(this.$docRowCache, docRow) + 1; - if (l > i) { - this.$docRowCache.splice(i, l); - this.$screenRowCache.splice(i, l); - } + this.$docRowCache.splice(i, l); + this.$screenRowCache.splice(i, l); + }; this.$getRowCacheIndex = function(cacheArray, val) { @@ -232,16 +202,7 @@ var EditSession = function(text, mode) { return mid; } - return low -1; - }; - - this.resetCaches = function() { - this.$modified = true; - this.$wrapData = []; - this.$rowLengthCache = []; - this.$resetRowCache(0); - if (this.bgTokenizer) - this.bgTokenizer.start(0); + return low && low -1; }; this.onChangeFold = function(e) { @@ -249,12 +210,13 @@ var EditSession = function(text, mode) { this.$resetRowCache(fold.start.row); }; - this.onChange = function(delta) { + this.onChange = function(e) { + var delta = e.data; this.$modified = true; - this.$resetRowCache(delta.start.row); + this.$resetRowCache(delta.range.start.row); - var removedFolds = this.$updateInternalDataOnChange(delta); + var removedFolds = this.$updateInternalDataOnChange(e); if (!this.$fromUndo && this.$undoManager && !delta.ignore) { this.$deltasDoc.push(delta); if (removedFolds && removedFolds.length != 0) { @@ -267,40 +229,40 @@ var EditSession = function(text, mode) { this.$informUndoManager.schedule(); } - this.bgTokenizer && this.bgTokenizer.$updateOnChange(delta); - this._signal("change", delta); + this.bgTokenizer.$updateOnChange(delta); + this._emit("change", e); }; /** + * EditSession.setValue(text) + * - text (String): The new text to place + * * Sets the session text. - * @param {String} text The new text to place * **/ this.setValue = function(text) { this.doc.setValue(text); - this.selection.moveTo(0, 0); + this.selection.moveCursorTo(0, 0); + this.selection.clearSelection(); this.$resetRowCache(0); this.$deltas = []; this.$deltasDoc = []; this.$deltasFold = []; - this.setUndoManager(this.$undoManager); this.getUndoManager().reset(); }; - /** + /** alias of: EditSession.toString + * EditSession.getValue() -> String + * * Returns the current [[Document `Document`]] as a string. - * @method toString - * @returns {String} - * @alias EditSession.getValue * **/ - - /** + /** alias of: EditSession.getValue + * EditSession.toString() -> String + * * Returns the current [[Document `Document`]] as a string. - * @method getValue - * @returns {String} - * @alias EditSession.toString + * **/ this.getValue = this.toString = function() { @@ -308,27 +270,30 @@ var EditSession = function(text, mode) { }; /** + * EditSession.getSelection() -> String + * * Returns the string of the current selection. **/ this.getSelection = function() { return this.selection; }; - /** - * {:BackgroundTokenizer.getState} - * @param {Number} row The row to start at + /** related to: BackgroundTokenizer.getState + * EditSession.getState(row) -> Array + * - row (Number): The row to start at + * + * {:BackgroundTokenizer.getState} * - * @related BackgroundTokenizer.getState **/ this.getState = function(row) { return this.bgTokenizer.getState(row); }; - /** + /** related to: BackgroundTokenizer.getTokens + * EditSession.getTokens(row) -> Array + * - row (Number): The row to start at + * * Starts tokenizing at the row indicated. Returns a list of objects of the tokenized rows. - * @param {Number} row The row to start at - * - * * **/ this.getTokens = function(row) { @@ -336,11 +301,11 @@ var EditSession = function(text, mode) { }; /** - * Returns an object indicating the token at the current row. The object has two properties: `index` and `start`. - * @param {Number} row The row number to retrieve from - * @param {Number} column The column number to retrieve from - * + * EditSession.getTokenAt(row, column) -> Array + * - row (Number): The row number to retrieve from + * - column (Number): The column number to retrieve from * + * Returns an array of tokens at the indicated row and column. **/ this.getTokenAt = function(row, column) { var tokens = this.bgTokenizer.getTokens(row); @@ -363,11 +328,18 @@ var EditSession = function(text, mode) { 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. - * @param {UndoManager} undoManager The new undo manager - * - * **/ this.setUndoManager = function(undoManager) { this.$undoManager = undoManager; @@ -380,7 +352,11 @@ var EditSession = function(text, mode) { if (undoManager) { var self = this; - + /** internal, hide + * EditSession.$syncInformUndoManager() + * + * + **/ this.$syncInformUndoManager = function() { self.$informUndoManager.cancel(); @@ -403,25 +379,17 @@ var EditSession = function(text, mode) { if (self.$deltas.length > 0) { undoManager.execute({ action: "aceupdate", - args: [self.$deltas, self], - merge: self.mergeUndoDeltas + args: [self.$deltas, self] }); } - self.mergeUndoDeltas = false; + self.$deltas = []; - }; - this.$informUndoManager = lang.delayedCall(this.$syncInformUndoManager); + } + this.$informUndoManager = + lang.deferredCall(this.$syncInformUndoManager); } }; - /** - * starts a new group in undo history - **/ - this.markUndoGroup = function() { - if (this.$syncInformUndoManager) - this.$syncInformUndoManager(); - }; - this.$defaultUndoManager = { undo: function() {}, redo: function() {}, @@ -429,13 +397,17 @@ var EditSession = function(text, mode) { }; /** + * EditSession.getUndoManager() -> UndoManager + * * Returns the current undo manager. **/ 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() { @@ -446,30 +418,49 @@ var EditSession = function(text, mode) { } }; + this.$useSoftTabs = true; /** - /** + * EditSession.setUseSoftTabs(useSoftTabs) + * - useSoftTabs (Boolean): Value indicating whether or not to use soft tabs + * * Pass `true` to enable the use of soft tabs. Soft tabs means you're using spaces instead of the tab character (`'\t'`). - * @param {Boolean} useSoftTabs Value indicating whether or not to use soft tabs + * **/ - this.setUseSoftTabs = function(val) { - this.setOption("useSoftTabs", val); + this.setUseSoftTabs = function(useSoftTabs) { + if (this.$useSoftTabs === useSoftTabs) return; + + this.$useSoftTabs = useSoftTabs; }; + /** + * EditSession.getUseSoftTabs() -> Boolean + * * Returns `true` if soft tabs are being used, `false` otherwise. - * @returns {Boolean} + * **/ this.getUseSoftTabs = function() { - // todo might need more general way for changing settings from mode, but this is ok for now - return this.$useSoftTabs && !this.$mode.$indentWithTabs; + return this.$useSoftTabs; }; + + this.$tabSize = 4; /** + * EditSession.setTabSize(tabSize) + * - tabSize (Number): The new tab size + * * Set the number of spaces that define a soft tab; for example, passing in `4` transforms the soft tabs to be equivalent to four spaces. This function also emits the `changeTabSize` event. - * @param {Number} tabSize The new tab size **/ this.setTabSize = function(tabSize) { - this.setOption("tabSize", tabSize); + if (isNaN(tabSize) || this.$tabSize === tabSize) return; + + this.$modified = true; + this.$rowLengthCache = []; + this.$tabSize = tabSize; + this._emit("changeTabSize"); }; + /** + * EditSession.getTabSize() -> Number + * * Returns the current tab size. **/ this.getTabSize = function() { @@ -477,30 +468,33 @@ var EditSession = function(text, mode) { }; /** + * EditSession.isTabStop(position) -> Boolean + * - position (Object): The position to check + * * Returns `true` if the character at the position is a soft tab. - * @param {Object} position The position to check - * - * **/ this.isTabStop = function(position) { - return this.$useSoftTabs && (position.column % this.$tabSize === 0); + return this.$useSoftTabs && (position.column % this.$tabSize == 0); }; this.$overwrite = false; /** - * Pass in `true` to enable overwrites in your session, or `false` to disable. - * - * If overwrites is enabled, any text you enter will type over any text after it. If the value of `overwrite` changes, this function also emites the `changeOverwrite` event. - * - * @param {Boolean} overwrite Defines wheter or not to set overwrites + * EditSession.setOverwrite(overwrite) + * - overwrite (Boolean): Defines wheter or not to set overwrites * + * Pass in `true` to enable overwrites in your session, or `false` to disable. If overwrites is enabled, any text you enter will type over any text after it. If the value of `overwrite` changes, this function also emites the `changeOverwrite` event. * **/ this.setOverwrite = function(overwrite) { - this.setOption("overwrite", overwrite); + if (this.$overwrite == overwrite) return; + + this.$overwrite = overwrite; + this._emit("changeOverwrite"); }; /** + * EditSession.getOverwrite() -> Boolean + * * Returns `true` if overwrites are enabled; `false` otherwise. **/ this.getOverwrite = function() { @@ -508,6 +502,8 @@ var EditSession = function(text, mode) { }; /** + * EditSession.toggleOverwrite() + * * Sets the value of overwrite to the opposite of whatever it currently is. **/ this.toggleOverwrite = function() { @@ -515,44 +511,45 @@ var EditSession = function(text, mode) { }; /** + * EditSession.addGutterDecoration(row, className) -> Void + * - row (Number): The row number + * - className (String): The class to add + * * Adds `className` to the `row`, to be used for CSS stylings and whatnot. - * @param {Number} row The row number - * @param {String} className The class to add - * - * **/ this.addGutterDecoration = function(row, className) { if (!this.$decorations[row]) this.$decorations[row] = ""; this.$decorations[row] += " " + className; - this._signal("changeBreakpoint", {}); + this._emit("changeBreakpoint", {}); }; /** + * EditSession.removeGutterDecoration(row, className)-> Void + * - row (Number): The row number + * - className (String): The class to add + * * Removes `className` from the `row`. - * @param {Number} row The row number - * @param {String} className The class to add - * - * **/ this.removeGutterDecoration = function(row, className) { this.$decorations[row] = (this.$decorations[row] || "").replace(" " + className, ""); - this._signal("changeBreakpoint", {}); + this._emit("changeBreakpoint", {}); }; - + /** + * EditSession.getBreakpoints() -> Array + * * Returns an array of numbers, indicating which rows have breakpoints. - * @returns {[Number]} **/ this.getBreakpoints = function() { return this.$breakpoints; }; /** + * EditSession.setBreakpoints(rows) + * - rows (Array): An array of row indicies + * * Sets a breakpoint on every row number given by `rows`. This function also emites the `'changeBreakpoint'` event. - * @param {Array} rows An array of row indices - * - * * **/ this.setBreakpoints = function(rows) { @@ -560,23 +557,25 @@ var EditSession = function(text, mode) { for (var i=0; i Number + * - range (Range): Define the range of the marker + * - clazz (String): Set the CSS class for the marker + * - type (Function | String): Identify the type of the marker + * - inFront (Boolean): Set to `true` to establish a front marker + * * Adds a new marker to the given `Range`. If `inFront` is `true`, a front marker is defined, and the `'changeFrontMarker'` event fires; otherwise, the `'changeBackMarker'` event fires. - * @param {Range} range Define the range of the marker - * @param {String} clazz Set the CSS class for the marker - * @param {Function | String} type Identify the type of the marker - * @param {Boolean} inFront Set to `true` to establish a front marker * - * - * @return {Number} The new marker id **/ this.addMarker = function(range, clazz, type, inFront) { var id = this.$markerId++; @@ -619,26 +618,25 @@ var EditSession = function(text, mode) { clazz : clazz, inFront: !!inFront, id: id - }; + } if (inFront) { this.$frontMarkers[id] = marker; - this._signal("changeFrontMarker"); + this._emit("changeFrontMarker") } else { this.$backMarkers[id] = marker; - this._signal("changeBackMarker"); + this._emit("changeBackMarker") } return id; }; /** + * EditSession.addDynamicMarker(marker, inFront) -> Object + * - marker (Object): object with update method + * - inFront (Boolean): Set to `true` to establish a front marker + * * Adds a dynamic marker to the session. - * @param {Object} marker object with update method - * @param {Boolean} inFront Set to `true` to establish a front marker - * - * - * @return {Object} The added marker **/ this.addDynamicMarker = function(marker, inFront) { if (!marker.update) @@ -649,20 +647,20 @@ var EditSession = function(text, mode) { if (inFront) { this.$frontMarkers[id] = marker; - this._signal("changeFrontMarker"); + this._emit("changeFrontMarker") } else { this.$backMarkers[id] = marker; - this._signal("changeBackMarker"); + this._emit("changeBackMarker") } return marker; }; /** + * EditSession.removeMarker(markerId) + * - markerId (Number): A number representing a marker + * * Removes the marker with the specified ID. If this marker was in front, the `'changeFrontMarker'` event is emitted. If the marker was in the back, the `'changeBackMarker'` event is emitted. - * @param {Number} markerId A number representing a marker - * - * * **/ this.removeMarker = function(markerId) { @@ -673,42 +671,21 @@ var EditSession = function(text, mode) { var markers = marker.inFront ? this.$frontMarkers : this.$backMarkers; if (marker) { delete (markers[markerId]); - this._signal(marker.inFront ? "changeFrontMarker" : "changeBackMarker"); + this._emit(marker.inFront ? "changeFrontMarker" : "changeBackMarker"); } }; /** - * Returns an object containing all of the markers, either front or back. - * @param {Boolean} inFront If `true`, indicates you only want front markers; `false` indicates only back markers + * EditSession.getMarkers(inFront) -> Array + * - inFront (Boolean): If `true`, indicates you only want front markers; `false` indicates only back markers + * + * Returns an array containing the IDs of all the markers, either front or back. * - * @returns {Object} **/ this.getMarkers = function(inFront) { return inFront ? this.$frontMarkers : this.$backMarkers; }; - 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); - }; - - // experimental - this.highlightLines = function(startRow, endRow, clazz, inFront) { - if (typeof endRow != "number") { - clazz = endRow; - endRow = startRow; - } - if (!clazz) - clazz = "ace_step"; - - var range = new Range(startRow, 0, endRow, Infinity); - range.id = this.addMarker(range, clazz, "fullLine", inFront); - return range; - }; - /* * Error: * { @@ -719,34 +696,48 @@ var EditSession = function(text, mode) { * } */ /** - * Sets annotations for the `EditSession`. This functions emits the `'changeAnnotation'` event. - * @param {Array} annotations A list of annotations + * 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 = annotations; - this._signal("changeAnnotation", {}); + this.$annotations = {}; + for (var i=0; i Object + * * Returns the annotations for the `EditSession`. - * @returns {Array} **/ this.getAnnotations = function() { - return this.$annotations || []; + return this.$annotations || {}; }; /** + * EditSession.clearAnnotations() + * * Clears all the annotations for this session. This function also triggers the `'changeAnnotation'` event. **/ this.clearAnnotations = function() { - this.setAnnotations([]); + this.$annotations = {}; + this._emit("changeAnnotation", {}); }; - /** - * If `text` contains either the newline (`\n`) or carriage-return ('\r') characters, `$autoNewLine` stores that value. - * @param {String} text A block of text + /** internal, hide + * EditSession.$detectNewLine(text) + * - text (String): A block of text * + * If `text` contains either the newline (`\n`) or carriage-return ('\r') characters, `$autoNewLine` stores that value. * **/ this.$detectNewLine = function(text) { @@ -759,11 +750,12 @@ var EditSession = function(text, mode) { }; /** - * Given a starting row and column, this method returns the `Range` of the first word boundary it finds. - * @param {Number} row The row to start at - * @param {Number} column The column to start at + * EditSession.getWordRange(row, column) -> Range + * - row (Number): The row to start at + * - column (Number): The column to start at + * + * Given a starting row and column, this method returns the `Range` of the first word boundary it finds. * - * @returns {Range} **/ this.getWordRange = function(row, column) { var line = this.getLine(row); @@ -774,7 +766,7 @@ var EditSession = function(text, mode) { 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))) @@ -800,11 +792,11 @@ var EditSession = function(text, mode) { }; /** - * Gets the range of a word, including its right whitespace. - * @param {Number} row The row number to start from - * @param {Number} column The column number to start from + * EditSession.getAWordRange(row, column) -> Range + * - row (Number): The row number to start from + * - column (Number): The column number to start from * - * @return {Range} + * Gets the range of a word, including its right whitespace. **/ this.getAWordRange = function(row, column) { var wordRange = this.getWordRange(row, column); @@ -816,107 +808,160 @@ var EditSession = function(text, mode) { return wordRange; }; - /** + /** related to: Document.setNewLineMode + * EditSession.setNewLineMode(newLineMode) + * - newLineMode (String): {:Document.setNewLineMode.param} + * * {:Document.setNewLineMode.desc} - * @param {String} newLineMode {:Document.setNewLineMode.param} - * - * - * @related Document.setNewLineMode **/ this.setNewLineMode = function(newLineMode) { this.doc.setNewLineMode(newLineMode); }; - /** + /** related to: Document.getNewLineMode + * EditSession.getNewLineMode() -> String * * Returns the current new line mode. - * @returns {String} - * @related Document.getNewLineMode **/ this.getNewLineMode = function() { return this.doc.getNewLineMode(); }; + this.$useWorker = true; + /** + * EditSession.setUseWorker(useWorker) + * - useWorker (Boolean): Set to `true` to use a worker + * * Identifies if you want to use a worker for the `EditSession`. - * @param {Boolean} useWorker Set to `true` to use a worker * **/ - this.setUseWorker = function(useWorker) { this.setOption("useWorker", useWorker); }; + this.setUseWorker = function(useWorker) { + if (this.$useWorker == useWorker) + return; + + this.$useWorker = useWorker; + + this.$stopWorker(); + if (useWorker) + this.$startWorker(); + }; /** + * EditSession.getUseWorker() -> Boolean + * * Returns `true` if workers are being used. **/ - this.getUseWorker = function() { return this.$useWorker; }; + this.getUseWorker = function() { + return this.$useWorker; + }; /** + * EditSession.onReloadTokenizer(e) + * * Reloads all the tokens on the current session. This function calls [[BackgroundTokenizer.start `BackgroundTokenizer.start ()`]] to all the rows; it also emits the `'tokenizerUpdate'` event. **/ this.onReloadTokenizer = function(e) { var rows = e.data; this.bgTokenizer.start(rows.first); - this._signal("tokenizerUpdate", e); + 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; + }; /** + * EditSession.setMode(mode) + * - mode (TextMode): Set a new text mode + * * Sets a new text mode for the `EditSession`. This method also emits the `'changeMode'` event. If a [[BackgroundTokenizer `BackgroundTokenizer`]] is set, the `'tokenizerUpdate'` event is also emitted. - * @param {TextMode} mode Set a new text mode - * @param {cb} optional callback * **/ this.$mode = null; this.$modeId = null; - this.setMode = function(mode, cb) { - if (mode && typeof mode === "object") { - if (mode.getTokenizer) - return this.$onChangeMode(mode); - var options = mode; - var path = options.path; - } else { - path = mode || "ace/mode/text"; - } - - // this is needed if ace isn't on require path (e.g tests in node) - if (!this.$modes["ace/mode/text"]) - this.$modes["ace/mode/text"] = new TextMode(); - - if (this.$modes[path] && !options) { - this.$onChangeMode(this.$modes[path]); - cb && cb(); - return; - } + this.setMode = function(mode) { + mode = mode || "null"; // load on demand - this.$modeId = path; - config.loadModule(["mode", path], function(m) { - if (this.$modeId !== path) - return cb && cb(); - if (this.$modes[path] && !options) { - this.$onChangeMode(this.$modes[path]); - } else if (m && m.Mode) { - m = new m.Mode(options); - if (!options) { - this.$modes[path] = m; - m.$id = path; - } - this.$onChangeMode(m); - } - cb && cb(); - }.bind(this)); + if (typeof mode === "string") { + if (this.$modeId == mode) + return; - // set mode to text until loading is finished - if (!this.$mode) - this.$onChangeMode(this.$modes["ace/mode/text"], true); - }; + this.$modeId = mode; + var _self = this; + this._loadMode(mode, function(module) { + if (_self.$modeId !== mode) + return; - this.$onChangeMode = function(mode, $isPlaceholder) { - if (!$isPlaceholder) - this.$modeId = mode.$id; - if (this.$mode === mode) + _self.setMode(module); + }); return; + } + if (this.$mode === mode) return; this.$mode = mode; + this.$modeId = mode.$id; this.$stopWorker(); @@ -934,48 +979,58 @@ var EditSession = function(text, mode) { this.bgTokenizer = new BackgroundTokenizer(tokenizer); var _self = this; this.bgTokenizer.addEventListener("update", function(e) { - _self._signal("tokenizerUpdate", 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; - - if (!$isPlaceholder) { - // experimental method, used by c9 findiniles - if (mode.attachToSession) - mode.attachToSession(this); - this.$options.wrapMethod.set.call(this, this.$wrapMethod); - this.$setFolding(mode.foldingRules); - this.bgTokenizer.start(0); - this._emit("changeMode"); - } + this.$setFolding(mode.foldingRules); + + this._emit("changeMode"); }; + /** internal, hide + * EditSession.stopWorker() + * + * + **/ this.$stopWorker = function() { - if (this.$worker) { + if (this.$worker) this.$worker.terminate(); - this.$worker = null; - } + + this.$worker = null; }; + /** internal, hide + * EditSession.$startWorker() + * + * + **/ this.$startWorker = function() { - try { - this.$worker = this.$mode.createWorker(this); - } catch (e) { - config.warn("Could not load worker", e); - this.$worker = null; + 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; }; /** + * EditSession.getMode() -> TextMode + * * Returns the current text mode. - * @returns {TextMode} The current text mode **/ this.getMode = function() { return this.$mode; @@ -983,22 +1038,24 @@ var EditSession = function(text, mode) { this.$scrollTop = 0; /** - * This function sets the scroll top value. It also emits the `'changeScrollTop'` event. - * @param {Number} scrollTop The new scroll top value + * EditSession.setScrollTop(scrollTop) + * - scrollTop (Number): The new scroll top value * + * This function sets the scroll top value. It also emits the `'changeScrollTop'` event. **/ this.setScrollTop = function(scrollTop) { - // TODO: should we force integer lineheight instead? scrollTop = Math.round(scrollTop); - if (this.$scrollTop === scrollTop || isNaN(scrollTop)) + scrollTop = Math.round(Math.max(0, scrollTop)); + if (this.$scrollTop === scrollTop) return; this.$scrollTop = scrollTop; - this._signal("changeScrollTop", scrollTop); + this._emit("changeScrollTop", scrollTop); }; /** + * EditSession.getScrollTop() -> Number + * * [Returns the value of the distance between the top of the editor and the topmost part of the visible content.]{: #EditSession.getScrollTop} - * @returns {Number} **/ this.getScrollTop = function() { return this.$scrollTop; @@ -1006,45 +1063,37 @@ var EditSession = function(text, mode) { this.$scrollLeft = 0; /** + * EditSession.setScrollLeft(scrollLeft) + * * [Sets the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.setScrollLeft} **/ this.setScrollLeft = function(scrollLeft) { - // scrollLeft = Math.round(scrollLeft); - if (this.$scrollLeft === scrollLeft || isNaN(scrollLeft)) + scrollLeft = Math.round(Math.max(0, scrollLeft)); + if (this.$scrollLeft === scrollLeft) return; this.$scrollLeft = scrollLeft; - this._signal("changeScrollLeft", scrollLeft); + this._emit("changeScrollLeft", scrollLeft); }; /** + * EditSession.getScrollLeft() -> Number + * * [Returns the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.getScrollLeft} - * @returns {Number} **/ this.getScrollLeft = function() { return this.$scrollLeft; }; /** + * EditSession.getScreenWidth() -> Number + * * Returns the width of the screen. - * @returns {Number} **/ this.getScreenWidth = function() { this.$computeWidth(); - if (this.lineWidgets) - return Math.max(this.getLineWidgetMaxWidth(), this.screenWidth); return this.screenWidth; }; - - this.getLineWidgetMaxWidth = function() { - if (this.lineWidgetsWidth != null) return this.lineWidgetsWidth; - var width = 0; - this.lineWidgets.forEach(function(w) { - if (w && w.screenWidth > width) - width = w.screenWidth; - }); - return this.lineWidgetWidth = width; - }; this.$computeWidth = function(force) { if (this.$modified || force) { @@ -1080,92 +1129,81 @@ var EditSession = function(text, mode) { } }; - /** - * Returns a verbatim copy of the given line as it is in the document - * @param {Number} row The row to retrieve from - * + /** related to: Document.getLine + * EditSession.getLine(row) -> String + * - row (Number): The row to retrieve from * - * @returns {String} + * Returns a verbatim copy of the given line as it is in the document * **/ this.getLine = function(row) { return this.doc.getLine(row); }; - /** - * Returns an array of strings of the rows between `firstRow` and `lastRow`. This function is inclusive of `lastRow`. - * @param {Number} firstRow The first row index to retrieve - * @param {Number} lastRow The final row index to retrieve - * - * @returns {[String]} - * - **/ + /** related to: Document.getLines + * EditSession.getLines(firstRow, lastRow) -> Array + * - firstRow (Number): The first row index to retrieve + * - lastRow (Number): The final row index to retrieve + * + * Returns an array of strings of the rows between `firstRow` and `lastRow`. This function is inclusive of `lastRow`. + * + **/ this.getLines = function(firstRow, lastRow) { return this.doc.getLines(firstRow, lastRow); }; - /** - * Returns the number of rows in the document. - * @returns {Number} - **/ + /** related to: Document.getLength + * EditSession.getLength()-> Number + * + * Returns the number of rows in the document. + **/ this.getLength = function() { return this.doc.getLength(); }; - /** - * {:Document.getTextRange.desc} - * @param {Range} range The range to work with - * - * @returns {String} - **/ + /** related to: Document.getTextRange + * EditSession.getTextRange(range) -> Array + * - range (String): The range to work with + * + * {:Document.getTextRange.desc} + **/ this.getTextRange = function(range) { return this.doc.getTextRange(range || this.selection.getRange()); }; - /** - * Inserts a block of `text` and the indicated `position`. - * @param {Object} position The position {row, column} to start inserting at - * @param {String} text A chunk of text to insert - * @returns {Object} The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. - * - * - **/ + /** related to: Document.insert + * EditSession.insert(position, text) -> Number + * - position (Number): The position to start inserting at + * - text (String): A chunk of text to insert + * + (Number): The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`. + * + * Inserts a block of `text` and the indicated `position`. + * + * + **/ this.insert = function(position, text) { return this.doc.insert(position, text); }; - /** - * Removes the `range` from the document. - * @param {Range} range A specified Range to remove - * @returns {Object} The new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. - * - * @related Document.remove - * - **/ + /** related to: Document.remove + * EditSession.remove(range) -> Object + * - range (Range): A specified Range to remove + * + (Object): The new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`. + * + * Removes the `range` from the document. + * + * + **/ this.remove = function(range) { return this.doc.remove(range); }; - - /** - * Removes a range of full lines. This method also triggers the `'change'` event. - * @param {Number} firstRow The first row to be removed - * @param {Number} lastRow The last row to be removed - * @returns {[String]} Returns all the removed lines. - * - * @related Document.removeFullLines - * - **/ - this.removeFullLines = function(firstRow, lastRow){ - return this.doc.removeFullLines(firstRow, lastRow); - }; /** - * Reverts previous changes to your document. - * @param {Array} deltas An array of previous changes - * @param {Boolean} dontSelect [If `true`, doesn't select the range of where the change occured]{: #dontSelect} + * EditSession.undoChanges(deltas, dontSelect) -> Range + * - deltas (Array): An array of previous changes + * - dontSelect (Boolean): [If `true`, doesn't select the range of where the change occured]{: #dontSelect} * - * - * @returns {Range} + * Reverts previous changes to your document. **/ this.undoChanges = function(deltas, dontSelect) { if (!deltas.length) @@ -1194,12 +1232,11 @@ var EditSession = function(text, mode) { }; /** - * Re-implements a previously undone change to your document. - * @param {Array} deltas An array of previous changes - * @param {Boolean} dontSelect {:dontSelect} - * + * EditSession.redoChanges(deltas, dontSelect) -> Range + * - deltas (Array): An array of previous changes + * - dontSelect (Boolean): {:dontSelect} * - * @returns {Range} + * Re-implements a previously undone change to your document. **/ this.redoChanges = function(deltas, dontSelect) { if (!deltas.length) @@ -1224,46 +1261,55 @@ var EditSession = function(text, mode) { }; /** - * Enables or disables highlighting of the range where an undo occured. - * @param {Boolean} enable If `true`, selects the range of the reinserted change + * EditSession.setUndoSelect(enable) + * - enable (Boolean): If `true`, selects the range of the reinserted change * + * ENables or disables highlighting of the range where an undo occured. **/ this.setUndoSelect = function(enable) { this.$undoSelect = enable; }; + /** internal, hide + * EditSession.$getUndoSelection(deltas, isUndo, lastUndoRange) -> Range + * + * + **/ this.$getUndoSelection = function(deltas, isUndo, lastUndoRange) { function isInsert(delta) { - return isUndo ? delta.action !== "insert" : delta.action === "insert"; + 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 = Range.fromPoints(delta.start, delta.end); + range = delta.range.clone(); lastDeltaIsInsert = true; } else { - range = Range.fromPoints(delta.start, delta.start); + 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.start; + point = delta.range.start; if (range.compare(point.row, point.column) == -1) { - range.setStart(point); + range.setStart(delta.range.start); } - point = delta.end; + point = delta.range.end; if (range.compare(point.row, point.column) == 1) { - range.setEnd(point); + range.setEnd(delta.range.end); } lastDeltaIsInsert = true; } else { - point = delta.start; + point = delta.range.start; if (range.compare(point.row, point.column) == -1) { - range = Range.fromPoints(delta.start, delta.start); + range = + Range.fromPoints(delta.range.start, delta.range.start); } lastDeltaIsInsert = false; } @@ -1272,11 +1318,6 @@ var EditSession = function(text, mode) { // Check if this range and the last undo range has something in common. // If true, merge the ranges. if (lastUndoRange != null) { - if (Range.comparePoints(lastUndoRange.start, range.start) === 0) { - lastUndoRange.start.column += range.end.column - range.start.column; - lastUndoRange.end.column += range.end.column - range.start.column; - } - var cmp = lastUndoRange.compareRange(range); if (cmp == 1) { range.setStart(lastUndoRange.start); @@ -1286,24 +1327,20 @@ var EditSession = function(text, mode) { } return range; - }; + }, - /** - * Replaces a range in the document with the new `text`. - * - * @param {Range} range A specified Range to replace - * @param {String} text The new text to use as a replacement - * @returns {Object} An object containing the final row and column, like this: - * ``` - * {row: endRow, column: 0} - * ``` - * If the text and range are empty, this function returns an object containing the current `range.start` value. + /** 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:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * ```{row: endRow, column: 0}```
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * If the text and range are empty, this function returns an object containing the current `range.start` value.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              * 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`. * * - * @related Document.replace - * * **/ this.replace = function(range, text) { @@ -1311,79 +1348,69 @@ var EditSession = function(text, mode) { }; /** + * EditSession.moveText(fromRange, toPosition) -> Range + * - fromRange (Range): The range of text you want moved within the document + * - toPosition (Object): The location (row and column) where you want to move the text to + * + (Range): The new range where the text was moved to. * Moves a range of text from the given range to the given position. `toPosition` is an object that looks like this: - * ```json + * * { row: newRowLocation, column: newColumnLocation } - * ``` - * @param {Range} fromRange The range of text you want moved within the document - * @param {Object} toPosition The location (row and column) where you want to move the text to - * @returns {Range} The new range where the text was moved to. * * * **/ - this.moveText = function(fromRange, toPosition, copy) { + this.moveText = function(fromRange, toPosition) { var text = this.getTextRange(fromRange); - var folds = this.getFoldsInRange(fromRange); + this.remove(fromRange); - var toRange = Range.fromPoints(toPosition, toPosition); - if (!copy) { - this.remove(fromRange); - var rowDiff = fromRange.start.row - fromRange.end.row; - var collDiff = rowDiff ? -fromRange.end.column : fromRange.start.column - fromRange.end.column; - if (collDiff) { - if (toRange.start.row == fromRange.end.row && toRange.start.column > fromRange.end.column) - toRange.start.column += collDiff; - if (toRange.end.row == fromRange.end.row && toRange.end.column > fromRange.end.column) - toRange.end.column += collDiff; - } - if (rowDiff && toRange.start.row >= fromRange.end.row) { - toRange.start.row += rowDiff; - toRange.end.row += rowDiff; - } + 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; } - toRange.end = this.insert(toRange.start, text); - if (folds.length) { - var oldStart = fromRange.start; - var newStart = toRange.start; - var rowDiff = newStart.row - oldStart.row; - var collDiff = newStart.column - oldStart.column; - this.addFolds(folds.map(function(x) { - x = x.clone(); - if (x.start.row == oldStart.row) - x.start.column += collDiff; - if (x.end.row == oldStart.row) - x.end.column += collDiff; - x.start.row += rowDiff; - x.end.row += rowDiff; - return x; - })); - } + 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; }; /** + * EditSession.indentRows(startRow, endRow, indentString) + * - startRow (Number): Starting row + * - endRow (Number): Ending row + * - indentString (String): The indent token + * * Indents all the rows, from `startRow` to `endRow` (inclusive), by prefixing each row with the token in `indentString`. * * If `indentString` contains the `'\t'` character, it's replaced by whatever is defined by [[EditSession.getTabString `getTabString()`]]. - * @param {Number} startRow Starting row - * @param {Number} endRow Ending row - * @param {String} indentString The indent token - * * **/ this.indentRows = function(startRow, endRow, indentString) { indentString = indentString.replace(/\t/g, this.getTabString()); for (var row=startRow; row<=endRow; row++) - this.doc.insertInLine({row: row, column: 0}, indentString); + this.insert({row: row, column:0}, indentString); }; /** - * Outdents all the rows defined by the `start` and `end` properties of `range`. - * @param {Range} range A range of rows + * EditSession.outdentRows(range) + * - range (Range): A range of rows * + * Outdents all the rows defined by the `start` and `end` properties of `range`. * **/ this.outdentRows = function (range) { @@ -1410,69 +1437,61 @@ var EditSession = function(text, mode) { } }; - this.$moveLines = function(firstRow, lastRow, dir) { - firstRow = this.getRowFoldStart(firstRow); - lastRow = this.getRowFoldEnd(lastRow); - if (dir < 0) { - var row = this.getRowFoldStart(firstRow + dir); - if (row < 0) return 0; - var diff = row-firstRow; - } else if (dir > 0) { - var row = this.getRowFoldEnd(lastRow + dir); - if (row > this.doc.getLength()-1) return 0; - var diff = row-lastRow; - } else { - firstRow = this.$clipRowToDocument(firstRow); - lastRow = this.$clipRowToDocument(lastRow); - var diff = lastRow - firstRow + 1; - } - - var range = new Range(firstRow, 0, lastRow, Number.MAX_VALUE); - var folds = this.getFoldsInRange(range).map(function(x){ - x = x.clone(); - x.start.row += diff; - x.end.row += diff; - return x; - }); - - var lines = dir == 0 - ? this.doc.getLines(firstRow, lastRow) - : this.doc.removeFullLines(firstRow, lastRow); - this.doc.insertFullLines(firstRow+diff, lines); - folds.length && this.addFolds(folds); - return diff; - }; - /** + /** related to: Document.insertLines + * EditSession.moveLinesUp(firstRow, lastRow) -> Number + * - firstRow (Number): The starting row to move up + * - lastRow (Number): The final row to move up + * + (Number): If `firstRow` is less-than or equal to 0, this function returns 0. Otherwise, on success, it returns -1. + * * Shifts all the lines in the document up one, starting from `firstRow` and ending at `lastRow`. - * @param {Number} firstRow The starting row to move up - * @param {Number} lastRow The final row to move up - * @returns {Number} If `firstRow` is less-than or equal to 0, this function returns 0. Otherwise, on success, it returns -1. + * * **/ this.moveLinesUp = function(firstRow, lastRow) { - return this.$moveLines(firstRow, lastRow, -1); + if (firstRow <= 0) return 0; + + var removed = this.doc.removeLines(firstRow, lastRow); + this.doc.insertLines(firstRow - 1, removed); + return -1; }; - /** - * Shifts all the lines in the document down one, starting from `firstRow` and ending at `lastRow`. - * @param {Number} firstRow The starting row to move down - * @param {Number} lastRow The final row to move down - * @returns {Number} If `firstRow` is less-than or equal to 0, this function returns 0. Otherwise, on success, it returns -1. + /** related to: Document.insertLines + * EditSession.moveLinesDown(firstRow, lastRow) -> Number + * - firstRow (Number): The starting row to move down + * - lastRow (Number): The final row to move down + * + (Number): If `firstRow` is less-than or equal to 0, this function returns 0. Otherwise, on success, it returns -1. + * + * + * **/ this.moveLinesDown = function(firstRow, lastRow) { - return this.$moveLines(firstRow, lastRow, 1); + if (lastRow >= this.doc.getLength()-1) return 0; + + var removed = this.doc.removeLines(firstRow, lastRow); + this.doc.insertLines(firstRow+1, removed); + return 1; }; /** + * EditSession.duplicateLines(firstRow, lastRow) -> Number + * - firstRow (Number): The starting row to duplicate + * - lastRow (Number): The final row to duplicate + * + (Number): Returns the number of new rows added; in other words, `lastRow - firstRow + 1`. + * * Duplicates all the text between `firstRow` and `lastRow`. - * @param {Number} firstRow The starting row to duplicate - * @param {Number} lastRow The final row to duplicate - * @returns {Number} Returns the number of new rows added; in other words, `lastRow - firstRow + 1`. + * * * **/ this.duplicateLines = function(firstRow, lastRow) { - return this.$moveLines(firstRow, lastRow, 0); + 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; }; @@ -1542,10 +1561,10 @@ var EditSession = function(text, mode) { }; /** - * Sets whether or not line wrapping is enabled. If `useWrapMode` is different than the current value, the `'changeWrapMode'` event is emitted. - * @param {Boolean} useWrapMode Enable (or disable) wrap mode - * + * EditSession.setUseWrapMode(useWrapMode) + * - useWrapMode (Boolean): Enable (or disable) wrap mode * + * Sets whether or not line wrapping is enabled. If `useWrapMode` is different than the current value, the `'changeWrapMode'` event is emitted. **/ this.setUseWrapMode = function(useWrapMode) { if (useWrapMode != this.$useWrapMode) { @@ -1556,17 +1575,21 @@ var EditSession = function(text, mode) { // If wrapMode is activaed, the wrapData array has to be initialized. if (useWrapMode) { var len = this.getLength(); - this.$wrapData = Array(len); + this.$wrapData = []; + for (var i = 0; i < len; i++) { + this.$wrapData.push([]); + } this.$updateWrapData(0, len - 1); } - this._signal("changeWrapMode"); + this._emit("changeWrapMode"); } }; /** + * EditSession.getUseWrapMode() -> Boolean + * * Returns `true` if wrap mode is being used; `false` otherwise. - * @returns {Boolean} **/ this.getUseWrapMode = function() { return this.$useWrapMode; @@ -1577,81 +1600,77 @@ var EditSession = function(text, mode) { // in that direction. Or set both parameters to the same number to pin // the limit to that value. /** - * 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. - * @param {Number} min The minimum wrap value (the left side wrap) - * @param {Number} max The maximum wrap value (the right side wrap) - * + * 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, max: max }; + this.$wrapLimitRange.min = min; + this.$wrapLimitRange.max = max; this.$modified = true; // This will force a recalculation of the wrap limit - if (this.$useWrapMode) - this._signal("changeWrapMode"); + this._emit("changeWrapMode"); } }; - /** - * This should generally only be called by the renderer when a resize is detected. - * @param {Number} desiredLimit The new wrap limit - * @returns {Boolean} + /** internal, hide + * EditSession.adjustWrapLimit(desiredLimit) -> Boolean + * - desiredLimit (Number): The new wrap limit * - * @private + * This should generally only be called by the renderer when a resize is detected. **/ - this.adjustWrapLimit = function(desiredLimit, $printMargin) { - var limits = this.$wrapLimitRange; - if (limits.max < 0) - limits = {min: $printMargin, max: $printMargin}; - var wrapLimit = this.$constrainWrapLimit(desiredLimit, limits.min, limits.max); - if (wrapLimit != this.$wrapLimit && wrapLimit > 1) { + 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._signal("changeWrapLimit"); + this._emit("changeWrapLimit"); } return true; } return false; }; - this.$constrainWrapLimit = function(wrapLimit, min, max) { + /** internal, hide + * EditSession.$constrainWrapLimit(wrapLimit) + * + * + **/ + 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); - return wrapLimit; + // What would a limit of 0 even mean? + return Math.max(1, wrapLimit); }; /** + * EditSession.getWrapLimit() -> Number + * * Returns the value of wrap limit. - * @returns {Number} The wrap limit. **/ this.getWrapLimit = function() { return this.$wrapLimit; }; - - /** - * Sets the line length for soft wrap in the editor. Lines will break - * at a minimum of the given length minus 20 chars and at a maximum - * of the given number of chars. - * @param {number} limit The maximum line length in chars, for soft wrapping lines. - */ - this.setWrapLimit = function (limit) { - this.setWrapLimitRange(limit, limit); - }; - + /** + * EditSession.getWrapLimitRange() -> Object + * * Returns an object that defines the minimum and maximum of the wrap limit; it looks something like this: * * { min: wrapLimitRange_min, max: wrapLimitRange_max } * - * @returns {Object} **/ this.getWrapLimitRange = function() { // Avoid unexpected mutation by returning a copy @@ -1661,23 +1680,38 @@ var EditSession = function(text, mode) { }; }; - this.$updateInternalDataOnChange = function(delta) { + /** internal, hide + * EditSession.$updateInternalDataOnChange() + * + * + **/ + this.$updateInternalDataOnChange = function(e) { var useWrapMode = this.$useWrapMode; - var action = delta.action; - var start = delta.start; - var end = delta.end; - var firstRow = start.row; - var lastRow = end.row; - var len = lastRow - firstRow; + 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; - - this.$updating = true; + + 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 === "remove") { + if (action.indexOf("remove") != -1) { this[useWrapMode ? "$wrapData" : "$rowLengthCache"].splice(firstRow, len); var foldLines = this.$foldData; - removedFolds = this.getFoldsInRange(delta); + removedFolds = this.getFoldsInRange(e.data.range); this.removeFolds(removedFolds); var foldLine = this.getFoldLine(end.row); @@ -1703,10 +1737,16 @@ var EditSession = function(text, mode) { lastRow = firstRow; } else { - var args = Array(len); - args.unshift(firstRow, 0); - var arr = useWrapMode ? this.$wrapData : this.$rowLengthCache - arr.splice.apply(arr, args); + 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. @@ -1714,14 +1754,13 @@ var EditSession = function(text, mode) { var foldLine = this.getFoldLine(firstRow); var idx = 0; if (foldLine) { - var cmp = foldLine.range.compareInside(start.row, start.column); + 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); - if (foldLine) { - foldLine.shiftRow(len); - foldLine.addRemoveChars(lastRow, 0, end.column - 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) { @@ -1742,10 +1781,10 @@ var EditSession = function(text, mode) { } else { // Realign folds. E.g. if you add some new chars before a fold, the // fold should "move" to the right. - len = Math.abs(delta.start.column - delta.end.column); - if (action === "remove") { + 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(delta); + removedFolds = this.getFoldsInRange(e.data.range); this.removeFolds(removedFolds); len = -len; @@ -1759,7 +1798,6 @@ var EditSession = function(text, mode) { if (useWrapMode && this.$wrapData.length != this.doc.getLength()) { console.error("doc.getLength() and $wrapData.length have to be the same!"); } - this.$updating = false; if (useWrapMode) this.$updateWrapData(firstRow, lastRow); @@ -1770,10 +1808,16 @@ var EditSession = function(text, mode) { }; this.$updateRowLengthCache = function(firstRow, lastRow, b) { + //console.log(firstRow, lastRow, b) this.$rowLengthCache[firstRow] = null; this.$rowLengthCache[lastRow] = null; + //console.log(this.$rowLengthCache) }; + /** internal, hide + * EditSession.$updateWrapData(firstRow, lastRow) + * + **/ this.$updateWrapData = function(firstRow, lastRow) { var lines = this.doc.getAllLines(); var tabSize = this.getTabSize(); @@ -1787,14 +1831,15 @@ var EditSession = function(text, mode) { while (row <= lastRow) { foldLine = this.getFoldLine(row, foldLine); if (!foldLine) { - tokens = this.$getDisplayTokens(lines[row]); + tokens = this.$getDisplayTokens(lang.stringTrimRight(lines[row])); wrapData[row] = this.$computeWrapSplits(tokens, wrapLimit, tabSize); row ++; } else { tokens = []; - foldLine.walk(function(placeholder, row, column, lastColumn) { + foldLine.walk( + function(placeholder, row, column, lastColumn) { var walkTokens; - if (placeholder != null) { + if (placeholder) { walkTokens = this.$getDisplayTokens( placeholder, tokens.length); walkTokens[0] = PLACEHOLDER_START; @@ -1811,8 +1856,12 @@ var EditSession = function(text, mode) { 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); + wrapData[foldLine.start.row] + = this.$computeWrapSplits(tokens, wrapLimit, tabSize); row = foldLine.end.row + 1; } } @@ -1828,8 +1877,12 @@ var EditSession = function(text, mode) { TAB = 11, TAB_SPACE = 12; - - this.$computeWrapSplits = function(tokens, wrapLimit, tabSize) { + /** internal, hide + * EditSession.$computeWrapSplits(tokens, wrapLimit) -> Array + * + * + **/ + this.$computeWrapSplits = function(tokens, wrapLimit) { if (tokens.length == 0) { return []; } @@ -1838,33 +1891,6 @@ var EditSession = function(text, mode) { var displayLength = tokens.length; var lastSplit = 0, lastDocSplit = 0; - var isCode = this.$wrapAsCode; - - var indentedSoftWrap = this.$indentedSoftWrap; - var maxIndent = wrapLimit <= Math.max(2 * tabSize, 8) - || indentedSoftWrap === false ? 0 : Math.floor(wrapLimit / 2); - - function getWrapIndent() { - var indentation = 0; - if (maxIndent === 0) - return indentation; - if (indentedSoftWrap) { - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i]; - if (token == SPACE) - indentation += 1; - else if (token == TAB) - indentation += tabSize; - else if (token == TAB_SPACE) - continue; - else - break; - } - } - if (isCode && indentedSoftWrap !== false) - indentation += tabSize; - return Math.min(indentation, maxIndent); - } function addSplit(screenPos) { var displayed = tokens.slice(lastSplit, screenPos); @@ -1881,27 +1907,22 @@ var EditSession = function(text, mode) { len -= 1; }); - if (!splits.length) { - indent = getWrapIndent(); - splits.indent = indent; - } lastDocSplit += len; splits.push(lastDocSplit); lastSplit = screenPos; } - var indent = 0; - while (displayLength - lastSplit > wrapLimit - indent) { + + while (displayLength - lastSplit > wrapLimit) { // This is, where the split should be. - var split = lastSplit + wrapLimit - indent; + var split = lastSplit + wrapLimit; // If there is a space or tab at this split position, then making // a split is simple. - if (tokens[split - 1] >= SPACE && tokens[split] >= SPACE) { - /* disabled see https://github.com/ajaxorg/ace/issues/1186 + if (tokens[split] >= SPACE) { // Include all following spaces + tabs in this split as well. while (tokens[split] >= SPACE) { split ++; - } */ + } addSplit(split); continue; } @@ -1910,7 +1931,9 @@ var EditSession = function(text, mode) { // 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) { + 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. @@ -1934,7 +1957,8 @@ var EditSession = function(text, mode) { // 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) { + if (tokens[split] != PLACEHOLDER_BODY) + { break; } } @@ -1952,21 +1976,12 @@ var EditSession = function(text, mode) { // === ELSE === // Search for the first non space/tab/placeholder/punctuation token backwards. - var minSplit = Math.max(split - (wrapLimit -(wrapLimit>>2)), lastSplit - 1); + var minSplit = Math.max(split - 10, lastSplit - 1); while (split > minSplit && tokens[split] < PLACEHOLDER_START) { split --; } - if (isCode) { - while (split > minSplit && tokens[split] < PLACEHOLDER_START) { - split --; - } - while (split > minSplit && tokens[split] == PUNCTUATION) { - split --; - } - } else { - while (split > minSplit && tokens[split] < SPACE) { - split --; - } + while (split > minSplit && tokens[split] == PUNCTUATION) { + split --; } // If we found one, then add the split. if (split > minSplit) { @@ -1978,19 +1993,17 @@ var EditSession = function(text, mode) { split = lastSplit + wrapLimit; // The split is inside of a CHAR or CHAR_EXT token and no space // around -> force a split. - if (tokens[split] == CHAR_EXT) - split--; - addSplit(split - indent); + addSplit(split); } return splits; }; - /** + /** internal, hide + * EditSession.$getDisplayTokens(str, offset) -> Array + * - str (String): The string to check + * - offset (Number): The value to start at + * * Given a string, returns an array of the display characters, including tabs and spaces. - * @param {String} str The string to check - * @param {Number} offset The value to start at - * - * **/ this.$getDisplayTokens = function(str, offset) { var arr = []; @@ -2023,15 +2036,18 @@ var EditSession = function(text, mode) { return arr; }; - /** - * Calculates the width of the string `str` on the screen while assuming that the string starts at the first column on the screen. - * @param {String} str The string to calculate the screen width of - * @param {Number} maxScreenColumn - * @param {Number} screenColumn - * @returns {[Number]} Returns an `int[]` array with two elements:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + /** internal, hide + * EditSession.$getStringScreenWidth(str, maxScreenColumn, screenColumn) -> [Number] + * - str (String): The string to calculate the screen width of + * - maxScreenColumn (Number): + * - screenColumn (Number): + * + ([Number]): Returns an `int[]` array with two elements:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              * The first position indicates the number of columns for `str` on screen.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              * The second value contains the position of the document column that this function read until. * + * Calculates the width of the string `str` on the screen while assuming that the string starts at the first column on the screen. + * + * **/ this.$getStringScreenWidth = function(str, maxScreenColumn, screenColumn) { if (maxScreenColumn == 0) @@ -2061,25 +2077,14 @@ var EditSession = function(text, mode) { return [screenColumn, column]; }; - this.lineWidgets = null; /** - * Returns number of screenrows in a wrapped line. - * @param {Number} row The row number to check + * EditSession.getRowLength(row) -> Number + * - row (Number): The row number to check * - * @returns {Number} + * + * Returns number of screenrows in a wrapped line. **/ this.getRowLength = function(row) { - if (this.lineWidgets) - var h = this.lineWidgets[row] && this.lineWidgets[row].rowCount || 0; - else - h = 0 - if (!this.$useWrapMode || !this.$wrapData[row]) { - return 1 + h; - } else { - return this.$wrapData[row].length + 1 + h; - } - }; - this.getRowLineCount = function(row) { if (!this.$useWrapMode || !this.$wrapData[row]) { return 1; } else { @@ -2087,44 +2092,30 @@ var EditSession = function(text, mode) { } }; - this.getRowWrapIndent = function(screenRow) { - if (this.$useWrapMode) { - var pos = this.screenToDocumentPosition(screenRow, Number.MAX_VALUE); - var splits = this.$wrapData[pos.row]; - return splits.length && splits[0] < pos.column ? splits.indent : 0; - } else { - return 0; - } - } - - /** - * Returns the position (on screen) for the last character in the provided screen row. - * @param {Number} screenRow The screen row to check - * @returns {Number} - * - * @related EditSession.documentToScreenColumn + /** internal, hide, related to: EditSession.documentToScreenColumn + * EditSession.getScreenLastRowColumn(screenRow) -> Number + * - screenRow (Number): The screen row to check + * + * Returns the column position (on screen) for the last character in the provided row. **/ this.getScreenLastRowColumn = function(screenRow) { var pos = this.screenToDocumentPosition(screenRow, Number.MAX_VALUE); return this.documentToScreenColumn(pos.row, pos.column); }; - /** - * For the given document row and column, this returns the column position of the last screen row. - * @param {Number} docRow + /** internal, hide + * EditSession.getDocumentLastRowColumn(docRow, docColumn) -> Number + * - docRow (Number): + * - docColumn (Number): * - * @param {Number} docColumn **/ this.getDocumentLastRowColumn = function(docRow, docColumn) { var screenRow = this.documentToScreenRow(docRow, docColumn); return this.getScreenLastRowColumn(screenRow); }; - /** - * For the given document row and column, this returns the document position of the last row. - * @param {Number} docRow - * @param {Number} docColumn - * + /** internal, hide + * EditSession.getDocumentLastRowColumnPosition(docRow, docColumn) -> Number * **/ this.getDocumentLastRowColumnPosition = function(docRow, docColumn) { @@ -2132,9 +2123,9 @@ var EditSession = function(text, mode) { return this.screenToDocumentPosition(screenRow, Number.MAX_VALUE / 10); }; - /** - * For the given row, this returns the split data. - * @returns {String} + /** internal, hide + * EditSession.getRowSplitData(row) -> undefined | String + * **/ this.getRowSplitData = function(row) { if (!this.$useWrapMode) { @@ -2145,35 +2136,42 @@ var EditSession = function(text, mode) { }; /** + * EditSession.getScreenTabSize(screenColumn) -> Number + * - screenColumn (Number): The screen column to check + * * The distance to the next tab stop at the specified screen column. - * @param {Number} screenColumn The screen column to check - * - * - * @returns {Number} **/ this.getScreenTabSize = function(screenColumn) { return this.$tabSize - screenColumn % this.$tabSize; }; - + /** internal, hide + * EditSession.screenToDocumentRow(screenRow, screenColumn) -> Number + * + * + **/ this.screenToDocumentRow = function(screenRow, screenColumn) { return this.screenToDocumentPosition(screenRow, screenColumn).row; }; - + /** internal, hide + * EditSession.screenToDocumentColumn(screenRow, screenColumn) -> Number + * + * + **/ this.screenToDocumentColumn = function(screenRow, screenColumn) { return this.screenToDocumentPosition(screenRow, screenColumn).column; }; - /** + /** related to: EditSession.documentToScreenPosition + * EditSession.screenToDocumentPosition(screenRow, screenColumn) -> Object + * - screenRow (Number): The screen row to check + * - screenColumn (Number): The screen column to check + * + (Object): The object returned has two properties: `row` and `column`. + * * Converts characters coordinates on the screen to characters coordinates within the document. [This takes into account code folding, word wrap, tab size, and any other visual modifications.]{: #conversionConsiderations} - * @param {Number} screenRow The screen row to check - * @param {Number} screenColumn The screen column to check - * @returns {Object} The object returned has two properties: `row` and `column`. * * - * @related EditSession.documentToScreenPosition - * **/ this.screenToDocumentPosition = function(screenRow, screenColumn) { if (screenRow < 0) @@ -2188,13 +2186,12 @@ var EditSession = function(text, mode) { var rowCache = this.$screenRowCache; var i = this.$getRowCacheIndex(rowCache, screenRow); - var l = rowCache.length; - if (l && i >= 0) { + if (0 < i && i < rowCache.length) { var row = rowCache[i]; var docRow = this.$docRowCache[i]; - var doCache = screenRow > rowCache[l - 1]; + var doCache = screenRow > row || (screenRow == row && i == rowCache.length - 1); } else { - var doCache = !l; + var doCache = true; } var maxRow = this.getLength() - 1; @@ -2203,7 +2200,7 @@ var EditSession = function(text, mode) { while (row <= screenRow) { rowLength = this.getRowLength(docRow); - if (row + rowLength > screenRow || docRow >= maxRow) { + if (row + rowLength - 1 >= screenRow || docRow >= maxRow) { break; } else { row += rowLength; @@ -2214,7 +2211,6 @@ var EditSession = function(text, mode) { foldStart = foldLine ? foldLine.start.row : Infinity; } } - if (doCache) { this.$docRowCache.push(docRow); this.$screenRowCache.push(row); @@ -2229,26 +2225,24 @@ var EditSession = function(text, mode) { return { row: maxRow, column: this.getLine(maxRow).length - }; + } } else { line = this.getLine(docRow); foldLine = null; } - var wrapIndent = 0; + if (this.$useWrapMode) { var splits = this.$wrapData[docRow]; if (splits) { - var splitIndex = Math.floor(screenRow - row); - column = splits[splitIndex]; - if(splitIndex > 0 && splits.length) { - wrapIndent = splits.indent; - docColumn = splits[splitIndex - 1] || splits[splits.length - 1]; + 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 - wrapIndent)[1]; + 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. @@ -2261,15 +2255,15 @@ var EditSession = function(text, mode) { return {row: docRow, column: docColumn}; }; - /** + /** related to: EditSession.screenToDocumentPosition + * EditSession.documentToScreenPosition(docRow, docColumn) -> Object + * - docRow (Number): The document row to check + * - docColumn (Number): The document column to check + * + (Object): The object returned by this method has two properties: `row` and `column`. + * * Converts document coordinates to screen coordinates. {:conversionConsiderations} - * @param {Number} docRow The document row to check - * @param {Number} docColumn The document column to check - * @returns {Object} The object returned by this method has two properties: `row` and `column`. * * - * @related EditSession.screenToDocumentPosition - * **/ this.documentToScreenPosition = function(docRow, docColumn) { // Normalize the passed in arguments. @@ -2297,13 +2291,12 @@ var EditSession = function(text, mode) { var rowCache = this.$docRowCache; var i = this.$getRowCacheIndex(rowCache, docRow); - var l = rowCache.length; - if (l && i >= 0) { + if (0 < i && i < rowCache.length) { var row = rowCache[i]; var screenRow = this.$screenRowCache[i]; - var doCache = docRow > rowCache[l - 1]; + var doCache = docRow > row || (docRow == row && i == rowCache.length - 1); } else { - var doCache = !l; + var doCache = true; } var foldLine = this.getNextFoldLine(row); @@ -2340,44 +2333,36 @@ var EditSession = function(text, mode) { textLine = this.getLine(docRow).substring(0, docColumn); foldStartRow = docRow; } - var wrapIndent = 0; // Clamp textLine if in wrapMode. if (this.$useWrapMode) { var wrapRow = this.$wrapData[foldStartRow]; - if (wrapRow) { - var screenRowOffset = 0; - while (textLine.length >= wrapRow[screenRowOffset]) { - screenRow ++; - screenRowOffset++; - } - textLine = textLine.substring( - wrapRow[screenRowOffset - 1] || 0, textLine.length - ); - wrapIndent = screenRowOffset > 0 ? wrapRow.indent : 0; + var screenRowOffset = 0; + while (textLine.length >= wrapRow[screenRowOffset]) { + screenRow ++; + screenRowOffset++; } + textLine = textLine.substring( + wrapRow[screenRowOffset - 1] || 0, textLine.length + ); } return { row: screenRow, - column: wrapIndent + this.$getStringScreenWidth(textLine)[0] + column: this.$getStringScreenWidth(textLine)[0] }; }; - /** - * For the given document row and column, returns the screen column. - * @param {Number} row - * @param {Number} docColumn - * @returns {Number} + /** internal, hide + * EditSession.documentToScreenColumn(row, docColumn) -> Number + * * **/ this.documentToScreenColumn = function(row, docColumn) { return this.documentToScreenPosition(row, docColumn).column; }; - /** - * For the given document row and column, returns the screen row. - * @param {Number} docRow - * @param {Number} docColumn + /** internal, hide + * EditSession.documentToScreenRow(docRow, docColumn) -> Number * * **/ @@ -2386,8 +2371,9 @@ var EditSession = function(text, mode) { }; /** + * EditSession.getScreenLength() -> Number + * * Returns the length of the screen. - * @returns {Number} **/ this.getScreenLength = function() { var screenRows = 0; @@ -2408,8 +2394,7 @@ var EditSession = function(text, mode) { var foldStart = fold ? fold.start.row :Infinity; while (row < lastRow) { - var splits = this.$wrapData[row]; - screenRows += splits ? splits.length + 1 : 1; + screenRows += this.$wrapData[row].length + 1; row ++; if (row > foldStart) { row = fold.end.row+1; @@ -2419,28 +2404,8 @@ var EditSession = function(text, mode) { } } - // todo - if (this.lineWidgets) - screenRows += this.$getWidgetScreenLength(); - return screenRows; - }; - - /** - * @private - * - */ - this.$setFontMetrics = function(fm) { - // todo - }; - - this.destroy = function() { - if (this.bgTokenizer) { - this.bgTokenizer.setDocument(null); - this.bgTokenizer = null; - } - this.$stopWorker(); - }; + } // 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 @@ -2486,101 +2451,5 @@ var EditSession = function(text, mode) { require("./edit_session/folding").Folding.call(EditSession.prototype); require("./edit_session/bracket_match").BracketMatch.call(EditSession.prototype); - -config.defineOptions(EditSession.prototype, "session", { - wrap: { - set: function(value) { - if (!value || value == "off") - value = false; - else if (value == "free") - value = true; - else if (value == "printMargin") - value = -1; - else if (typeof value == "string") - value = parseInt(value, 10) || false; - - if (this.$wrap == value) - return; - this.$wrap = value; - if (!value) { - this.setUseWrapMode(false); - } else { - var col = typeof value == "number" ? value : null; - this.setWrapLimitRange(col, col); - this.setUseWrapMode(true); - } - }, - get: function() { - if (this.getUseWrapMode()) { - if (this.$wrap == -1) - return "printMargin"; - if (!this.getWrapLimitRange().min) - return "free"; - return this.$wrap; - } - return "off"; - }, - handlesSet: true - }, - wrapMethod: { - // code|text|auto - set: function(val) { - val = val == "auto" - ? this.$mode.type != "text" - : val != "text"; - if (val != this.$wrapAsCode) { - this.$wrapAsCode = val; - if (this.$useWrapMode) { - this.$modified = true; - this.$resetRowCache(0); - this.$updateWrapData(0, this.getLength() - 1); - } - } - }, - initialValue: "auto" - }, - indentedSoftWrap: { initialValue: true }, - firstLineNumber: { - set: function() {this._signal("changeBreakpoint");}, - initialValue: 1 - }, - useWorker: { - set: function(useWorker) { - this.$useWorker = useWorker; - - this.$stopWorker(); - if (useWorker) - this.$startWorker(); - }, - initialValue: true - }, - useSoftTabs: {initialValue: true}, - tabSize: { - set: function(tabSize) { - if (isNaN(tabSize) || this.$tabSize === tabSize) return; - - this.$modified = true; - this.$rowLengthCache = []; - this.$tabSize = tabSize; - this._signal("changeTabSize"); - }, - initialValue: 4, - handlesSet: true - }, - overwrite: { - set: function(val) {this._signal("changeOverwrite");}, - initialValue: false - }, - newLineMode: { - set: function(val) {this.doc.setNewLineMode(val)}, - get: function() {return this.doc.getNewLineMode()}, - handlesSet: true - }, - mode: { - set: function(val) { this.setMode(val) }, - get: function() { return this.$modeId } - } -}); - exports.EditSession = EditSession; }); diff --git a/lib/ace/edit_session/bracket_match.js b/lib/ace/edit_session/bracket_match.js index 62a8499c..2a544945 100644 --- a/lib/ace/edit_session/bracket_match.js +++ b/lib/ace/edit_session/bracket_match.js @@ -1,30 +1,38 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: +/* vim:ts=4:sts=4:sw=4: + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -37,10 +45,10 @@ var Range = require("../range").Range; function BracketMatch() { - this.findMatchingBracket = function(position, chr) { + this.findMatchingBracket = function(position) { if (position.column == 0) return null; - var charBeforeCursor = chr || this.getLine(position.row).charAt(position.column-1); + var charBeforeCursor = this.getLine(position.row).charAt(position.column-1); if (charBeforeCursor == "") return null; var match = charBeforeCursor.match(/([\(\[\{])|([\)\]\}])/); @@ -117,7 +125,6 @@ function BracketMatch() { typeRe = new RegExp( "(\\.?" + token.type.replace(".", "\\.").replace("rparen", ".paren") - .replace(/\b(?:end)\b/, "(?:start|begin|end)") + ")+" ); } @@ -174,7 +181,6 @@ function BracketMatch() { typeRe = new RegExp( "(\\.?" + token.type.replace(".", "\\.").replace("lparen", ".paren") - .replace(/\b(?:start|begin)\b/, "(?:start|begin|end)") + ")+" ); } diff --git a/lib/ace/edit_session/fold.js b/lib/ace/edit_session/fold.js index 232101bd..d1165fb5 100644 --- a/lib/ace/edit_session/fold.js +++ b/lib/ace/edit_session/fold.js @@ -1,39 +1,44 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: +/* vim:ts=4:sts=4:sw=4: + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Julian Viereck + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ define(function(require, exports, module) { "use strict"; -var Range = require("../range").Range; -var RangeList = require("../range_list").RangeList; -var oop = require("../lib/oop") /* * Simple fold-data struct. **/ @@ -45,11 +50,9 @@ var Fold = exports.Fold = function(range, placeholder) { this.end = range.end; this.sameRow = range.start.row == range.end.row; - this.subFolds = this.ranges = []; + this.subFolds = []; }; -oop.inherits(Fold, RangeList); - (function() { this.toString = function() { @@ -69,21 +72,17 @@ oop.inherits(Fold, RangeList); this.subFolds.forEach(function(subFold) { fold.subFolds.push(subFold.clone()); }); - fold.collapseChildren = this.collapseChildren; return fold; }; this.addSubFold = function(fold) { if (this.range.isEqual(fold)) - return; + return this; if (!this.range.containsRange(fold)) - throw new Error("A fold can't intersect already existing fold" + fold.range + this.range); + throw "A fold can't intersect already existing fold" + fold.range + this.range; - // transform fold to local coordinates - consumeRange(fold, this.start); - - var row = fold.start.row, column = fold.start.column; + 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) @@ -104,37 +103,14 @@ oop.inherits(Fold, RangeList); var afterEnd = this.subFolds[j]; if (cmp == 0) - throw new Error("A fold can't intersect already existing fold" + fold.range + this.range); + 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; }; - - this.restoreRange = function(range) { - return restoreRange(range, this.start); - }; }).call(Fold.prototype); -function consumePoint(point, anchor) { - point.row -= anchor.row; - if (point.row == 0) - point.column -= anchor.column; -} -function consumeRange(range, anchor) { - consumePoint(range.start, anchor); - consumePoint(range.end, anchor); -} -function restorePoint(point, anchor) { - if (point.row == 0) - point.column += anchor.column; - point.row += anchor.row; -} -function restoreRange(range, anchor) { - restorePoint(range.start, anchor); - restorePoint(range.end, anchor); -} - }); diff --git a/lib/ace/edit_session/fold_line.js b/lib/ace/edit_session/fold_line.js index 9d73154d..5206dffc 100644 --- a/lib/ace/edit_session/fold_line.js +++ b/lib/ace/edit_session/fold_line.js @@ -1,30 +1,38 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: +/* vim:ts=4:sts=4:sw=4: + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Julian Viereck + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -44,7 +52,7 @@ function FoldLine(foldData, folds) { folds = this.folds = [ folds ]; } - var last = folds[folds.length - 1]; + 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; @@ -66,12 +74,12 @@ function FoldLine(foldData, folds) { 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 new Error("Can't add a fold to this FoldLine as it has no connection"); + throw "Can't add a fold to this FoldLine as it has no connection"; } this.folds.push(fold); this.folds.sort(function(a, b) { @@ -93,20 +101,20 @@ function FoldLine(foldData, folds) { this.start.row = fold.start.row; this.start.column = fold.start.column; } else { - throw new Error("Trying to add fold to FoldRow that doesn't have a matching row"); + 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, - cmp, stop, isNewRow = true; + comp, stop, isNewRow = true; if (endRow == null) { endRow = this.end.row; @@ -116,9 +124,9 @@ function FoldLine(foldData, folds) { for (var i = 0; i < folds.length; i++) { fold = folds[i]; - cmp = fold.range.compareStart(endRow, endColumn); + comp = fold.range.compareStart(endRow, endColumn); // This fold is after the endRow/Column. - if (cmp == -1) { + if (comp == -1) { callback(null, endRow, endColumn, lastEnd, isNewRow); return; } @@ -127,8 +135,8 @@ function FoldLine(foldData, folds) { 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 (cmp == 0), then end here. - if (stop || cmp === 0) { + // inside of this fold (comp == 0), then end here. + if (stop || comp == 0) { return; } @@ -138,7 +146,7 @@ function FoldLine(foldData, folds) { lastEnd = fold.end.column; } callback(null, endRow, endColumn, lastEnd, isNewRow); - }; + } this.getNextFoldTo = function(row, column) { var fold, cmp; @@ -150,15 +158,15 @@ function FoldLine(foldData, folds) { fold: fold, kind: "after" }; - } else if (cmp === 0) { + } else if (cmp == 0) { return { fold: fold, kind: "inside" - }; + } } } return null; - }; + } this.addRemoveChars = function(row, column, len) { var ret = this.getNextFoldTo(row, column), @@ -170,12 +178,12 @@ function FoldLine(foldData, folds) { && fold.start.row != row) { //throwing here breaks whole editor - //TODO: properly handle this + //@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) { + if (i == 0) { this.start.column += len; } for (i; i < folds.length; i++) { @@ -189,18 +197,16 @@ function FoldLine(foldData, folds) { this.end.column += len; } } - }; + } this.split = function(row, column) { - var pos = this.getNextFoldTo(row, column); - - if (!pos || pos.kind == "inside") - return null; - - var fold = pos.fold; - var folds = this.folds; + 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; @@ -213,7 +219,7 @@ function FoldLine(foldData, folds) { var newFoldLine = new FoldLine(foldData, folds); foldData.splice(foldData.indexOf(this) + 1, 0, newFoldLine); return newFoldLine; - }; + } this.merge = function(foldLineNext) { var folds = foldLineNext.folds; @@ -224,7 +230,7 @@ function FoldLine(foldData, folds) { // it's merged now with foldLineNext. var foldData = this.foldData; foldData.splice(foldData.indexOf(foldLineNext), 1); - }; + } this.toString = function() { var ret = [this.range.toString() + ": [" ]; @@ -232,12 +238,13 @@ function FoldLine(foldData, folds) { this.folds.forEach(function(fold) { ret.push(" " + fold.toString()); }); - ret.push("]"); + 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]; @@ -262,7 +269,7 @@ function FoldLine(foldData, folds) { row: this.end.row, column: this.end.column + idx }; - }; + } }).call(FoldLine.prototype); exports.FoldLine = FoldLine; diff --git a/lib/ace/edit_session/folding.js b/lib/ace/edit_session/folding.js index 77c0f22d..310a9856 100644 --- a/lib/ace/edit_session/folding.js +++ b/lib/ace/edit_session/folding.js @@ -1,30 +1,38 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: +/* vim:ts=4:sts=4:sw=4: + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Julian Viereck + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -66,6 +74,7 @@ function Folding() { * */ this.getFoldsInRange = function(range) { + range = range.clone(); var start = range.start; var end = range.end; var foldLines = this.$foldData; @@ -103,23 +112,8 @@ function Folding() { foundFolds.push(fold); } } - start.column -= 1; - end.column += 1; - return foundFolds; }; - - this.getFoldsInRangeList = function(ranges) { - if (Array.isArray(ranges)) { - var folds = []; - ranges.forEach(function(range) { - folds = folds.concat(this.getFoldsInRange(range)); - }, this); - } else { - var folds = this.getFoldsInRange(ranges); - } - return folds; - } /* * Returns all folds in the document @@ -128,9 +122,18 @@ function Folding() { 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++) - folds.push(foldLines[i].folds[j]); + addFold(foldLines[i].folds[j]); return folds; }; @@ -254,7 +257,7 @@ function Folding() { return foldLine; }; - /** + /* * Adds a new fold. * * @returns @@ -268,10 +271,9 @@ function Folding() { if (placeholder instanceof Fold) fold = placeholder; - else { + else fold = new Fold(range, placeholder); - fold.collapseChildren = range.collapseChildren; - } + this.$clipRangeToDocument(fold.range); var startRow = fold.start.row; @@ -280,30 +282,31 @@ function Folding() { var endColumn = fold.end.column; // --- Some checking --- - if (!(startRow < endRow || - startRow == endRow && startColumn <= endColumn - 2)) - throw new Error("The range has to be at least 2 characters width"); + 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)) - this.removeFold(startFold); - - if (endFold && !endFold.range.isEnd(endRow, endColumn)) - this.removeFold(endFold); - + 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. - folds.forEach(function(subFold) { - fold.addSubFold(subFold); - }); + fold.subFolds = folds; } for (var i = 0; i < foldData.length; i++) { @@ -312,7 +315,8 @@ function Folding() { foldLine.addFold(fold); added = true; break; - } else if (startRow == foldLine.end.row) { + } + else if (startRow == foldLine.end.row) { foldLine.addFold(fold); added = true; if (!fold.sameRow) { @@ -325,7 +329,8 @@ function Folding() { } } break; - } else if (endRow <= foldLine.start.row) { + } + else if (endRow <= foldLine.start.row) { break; } } @@ -340,7 +345,7 @@ function Folding() { // Notify that fold data has changed. this.$modified = true; - this._emit("changeFold", { data: fold, action: "add" }); + this._emit("changeFold", { data: fold }); return fold; }; @@ -392,16 +397,14 @@ function Folding() { newFoldLine.start.column = folds[0].start.column; } - if (!this.$updating) { - if (this.$useWrapMode) - this.$updateWrapData(startRow, endRow); - else - this.$updateRowLengthCache(startRow, endRow); - } - + 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, action: "remove" }); + this._emit("changeFold", { data: fold }); }; this.removeFolds = function(folds) { @@ -421,13 +424,9 @@ function Folding() { this.expandFold = function(fold) { this.removeFold(fold); - fold.subFolds.forEach(function(subFold) { - fold.restoreRange(subFold); - this.addFold(subFold); + fold.subFolds.forEach(function(fold) { + this.addFold(fold); }, this); - if (fold.collapseChildren > 0) { - this.foldAll(fold.start.row+1, fold.end.row, fold.collapseChildren-1); - } fold.subFolds = []; }; @@ -439,30 +438,26 @@ function Folding() { this.unfold = function(location, expandInner) { var range, folds; - if (location == null) { + if (location == null) range = new Range(0, 0, this.getLength(), 0); - expandInner = true; - } else if (typeof location == "number") + 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.getFoldsInRangeList(range); + + folds = this.getFoldsInRange(range); if (expandInner) { this.removeFolds(folds); } else { - var subFolds = folds; - // TODO: might be better to remove and add folds in one go instead of using + // TODO: might need to remove and add folds in one go instead of using // expandFolds several times. - while (subFolds.length) { - this.expandFolds(subFolds); - subFolds = this.getFoldsInRangeList(range); + while (folds.length) { + this.expandFolds(folds); + folds = this.getFoldsInRange(range); } } - if (folds.length) - return folds; }; /* @@ -478,41 +473,36 @@ function Folding() { return foldLine ? foldLine.end.row : docRow; }; - this.getRowFoldStart = function(docRow, startFoldRow) { - var foldLine = this.getFoldLine(docRow, startFoldRow); - return foldLine ? foldLine.start.row : docRow; - }; - this.getFoldDisplayLine = function(foldLine, endRow, endColumn, startRow, startColumn) { - if (startRow == null) + if (startRow == null) { startRow = foldLine.start.row; - if (startColumn == null) startColumn = 0; - if (endRow == null) + } + + if (endRow == null) { endRow = foldLine.end.row; - if (endColumn == null) 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) + if (row < startRow) { return; - if (row == startRow) { - if (column < startColumn) + } else if (row == startRow) { + if (column < startColumn) { return; + } lastColumn = Math.max(startColumn, lastColumn); } - - if (placeholder != null) { + if (placeholder) { textLine += placeholder; } else { textLine += doc.getLine(row).substring(lastColumn, column); } - }, endRow, endColumn); + }.bind(this), endRow, endColumn); return textLine; }; @@ -554,22 +544,26 @@ function Folding() { if (fold) { this.expandFold(fold); return; - } else if (bracketPos = this.findMatchingBracket(cursor)) { + } + else if (bracketPos = this.findMatchingBracket(cursor)) { if (range.comparePoint(bracketPos) == 1) { range.end = bracketPos; - } else { + } + else { range.start = bracketPos; range.start.column++; range.end.column--; } - } else if (bracketPos = this.findMatchingBracket({row: cursor.row, column: cursor.column + 1})) { + } + 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 { + } + else { range = this.getCommentFoldRange(cursor.row, cursor.column) || range; } } else { @@ -577,7 +571,8 @@ function Folding() { if (tryToUnfold && folds.length) { this.expandFolds(folds); return; - } else if (folds.length == 1 ) { + } + else if (folds.length == 1 ) { fold = folds[0]; } } @@ -601,47 +596,38 @@ function Folding() { this.addFold(placeholder, range); }; - this.getCommentFoldRange = function(row, column, dir) { + 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(/\..*/, "\\.")); - if (dir != 1) { - do { - token = iterator.stepBackward(); - } while(token && re.test(token.type)); - iterator.stepForward(); - } - + 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)); - if (dir != -1) { - do { - token = iterator.stepForward(); - } while(token && re.test(token.type)); - token = iterator.stepBackward(); - } else - token = iterator.getCurrentToken(); + token = iterator.stepBackward(); range.end.row = iterator.getCurrentTokenRow(); - range.end.column = iterator.getCurrentTokenColumn() + token.value.length - 2; + range.end.column = iterator.getCurrentTokenColumn() + token.value.length; return range; } }; - this.foldAll = function(startRow, endRow, depth) { - if (depth == undefined) - depth = 100000; // JSON.stringify doesn't hanle Infinity + this.foldAll = function(startRow, endRow) { var foldWidgets = this.foldWidgets; - if (!foldWidgets) - return; // mode doesn't support folding endRow = endRow || this.getLength(); - startRow = startRow || 0; - for (var row = startRow; row < endRow; row++) { + for (var row = startRow || 0; row < endRow; row++) { if (foldWidgets[row] == null) foldWidgets[row] = this.getFoldWidget(row); if (foldWidgets[row] != "start") @@ -649,23 +635,13 @@ function Folding() { var range = this.getFoldWidgetRange(row); // sometimes range can be incompatible with existing fold - // TODO change addFold to return null istead of throwing - if (range && range.isMultiLine() - && range.end.row <= endRow - && range.start.row >= startRow - ) { - row = range.end.row; - try { - // addFold can change the range - var fold = this.addFold("...", range); - if (fold) - fold.collapseChildren = depth; - } catch(e) {} - } + // 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) {} } }; - // structured folding this.$foldStyles = { "manual": 1, "markbegin": 1, @@ -690,14 +666,14 @@ function Folding() { this.$setFolding(mode); }; + // structured folding this.$setFolding = function(foldMode) { if (this.$foldMode == foldMode) return; this.$foldMode = foldMode; - this.off('change', this.$updateFoldWidgets); - this.off('tokenizerUpdate', this.$tokenizerUpdateFoldWidgets); + this.removeListener('change', this.$updateFoldWidgets); this._emit("changeAnnotation"); if (!foldMode || this.$foldStyle == "manual") { @@ -710,132 +686,62 @@ function Folding() { this.getFoldWidgetRange = foldMode.getFoldWidgetRange.bind(foldMode, this, this.$foldStyle); this.$updateFoldWidgets = this.updateFoldWidgets.bind(this); - this.$tokenizerUpdateFoldWidgets = this.tokenizerUpdateFoldWidgets.bind(this); this.on('change', this.$updateFoldWidgets); - this.on('tokenizerUpdate', this.$tokenizerUpdateFoldWidgets); + }; - this.getParentFoldRangeData = function (row, ignoreCurrent) { - var fw = this.foldWidgets; - if (!fw || (ignoreCurrent && fw[row])) - return {}; - - var i = row - 1, firstRange; - while (i >= 0) { - var c = fw[i]; - if (c == null) - c = fw[i] = this.getFoldWidget(i); - - if (c == "start") { - var range = this.getFoldWidgetRange(i); - if (!firstRange) - firstRange = range; - if (range && range.end.row >= row) - break; - } - i--; - } - - return { - range: i !== -1 && range, - firstRange: firstRange - }; - } - this.onFoldWidgetClick = function(row, e) { - e = e.domEvent; - var options = { - children: e.shiftKey, - all: e.ctrlKey || e.metaKey, - siblings: e.altKey - }; - - var range = this.$toggleFoldWidget(row, options); - if (!range) { - var el = (e.target || e.srcElement) - if (el && /ace_fold-widget/.test(el.className)) - el.className += " ace_invalid"; - } - }; - - this.$toggleFoldWidget = function(row, options) { - if (!this.getFoldWidget) - return; 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; - var dir = type === "end" ? -1 : 1; - var fold = this.getFoldAt(row, dir === -1 ? 0 : line.length, dir); + if (type == "end") + fold = this.getFoldAt(row, 0, -1); + else + fold = this.getFoldAt(row, line.length, 1); if (fold) { - if (options.children || options.all) + if (addSubfolds) this.removeFold(fold); else this.expandFold(fold); return; } - var range = this.getFoldWidgetRange(row, true); - // sometimes singleline folds can be missed by the code above - if (range && !range.isMultiLine()) { - fold = this.getFoldAt(range.start.row, range.start.column, 1); - if (fold && range.isEqual(fold.range)) { - this.removeFold(fold); - return; - } - } - - if (options.siblings) { - var data = this.getParentFoldRangeData(row); - if (data.range) { - var startRow = data.range.start.row + 1; - var endRow = data.range.end.row; - } - this.foldAll(startRow, endRow, options.all ? 10000 : 0); - } else if (options.children) { - endRow = range ? range.end.row : this.getLength(); - this.foldAll(row + 1, endRow, options.all ? 10000 : 0); - } else if (range) { - if (options.all) - range.collapseChildren = 10000; - this.addFold("...", range); - } - - return range; - }; - - - - this.toggleFoldWidget = function(toggleParent) { - var row = this.selection.getCursor().row; - row = this.getRowFoldStart(row); - var range = this.$toggleFoldWidget(row, {}); - - if (range) - return; - // handle toggleParent - var data = this.getParentFoldRangeData(row, true); - range = data.range || data.firstRange; - + var range = this.getFoldWidgetRange(row); if (range) { - row = range.start.row; - var fold = this.getFoldAt(row, this.getLine(row).length, 1); - - if (fold) { - this.removeFold(fold); - } else { - this.addFold("...", 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(delta) { - var firstRow = delta.start.row; - var len = delta.end.row - firstRow; + + 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 == 'remove') { + } else if (delta.action == "removeText" || delta.action == "removeLines") { this.foldWidgets.splice(firstRow, len + 1, null); } else { var args = Array(len + 1); @@ -843,13 +749,7 @@ function Folding() { this.foldWidgets.splice.apply(this.foldWidgets, args); } }; - this.tokenizerUpdateFoldWidgets = function(e) { - var rows = e.data; - if (rows.first != rows.last) { - if (this.foldWidgets.length > rows.first) - this.foldWidgets.splice(rows.first, this.foldWidgets.length); - } - } + } exports.Folding = Folding; diff --git a/lib/ace/edit_session_test.js b/lib/ace/edit_session_test.js index 0b904b63..0f7edd9e 100644 --- a/lib/ace/edit_session_test.js +++ b/lib/ace/edit_session_test.js @@ -1,30 +1,38 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * Julian Viereck + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -61,14 +69,6 @@ function createFoldTestSession() { return session; } -function assertArray(a, b) { - assert.equal(a+"", b+""); - assert.ok(a.length == b.length); - for (var i = 0; i < a.length; i++) { - assert.equal(a[i], b[i]); - } -} - module.exports = { "test: find matching opening bracket in Text mode" : function() { @@ -280,7 +280,7 @@ module.exports = { session.setUseWrapMode(true); session.setWrapLimitRange(12, 12); session.adjustWrapLimit(80); - session.setOption("wrapMethod", "text"); + assert.position(session.documentToScreenPosition(0, 11), 0, 11); assert.position(session.documentToScreenPosition(0, 12), 1, 0); }, @@ -380,20 +380,17 @@ module.exports = { line = lang.stringTrimRight(line); var tokens = EditSession.prototype.$getDisplayTokens(line); var splits = EditSession.prototype.$computeWrapSplits(tokens, wrapLimit, tabSize); - console.log("String:", line, "Result:", splits, "Expected:", assertEqual); - + // console.log("String:", line, "Result:", splits, "Expected:", assertEqual); assert.ok(splits.length == assertEqual.length); for (var i = 0; i < splits.length; i++) { assert.ok(splits[i] == assertEqual[i]); } } - - EditSession.prototype.$wrapAsCode = true; - EditSession.prototype.$indentedSoftWrap = false; + // Basic splitting. computeAndAssert("foo bar foo bar", [ 12 ]); computeAndAssert("foo bar f bar", [ 12 ]); - computeAndAssert("foo bar f r", [ 12 ]); // 14 if we enable + computeAndAssert("foo bar f r", [ 14 ]); computeAndAssert("foo bar foo bar foo bara foo", [12, 25]); // Don't split if there is only whitespaces/tabs at the end of the line. @@ -409,32 +406,18 @@ module.exports = { computeAndAssert("foo \t \tbar", [ 7 ]); // Ignore spaces/tabs at beginning of split. - computeAndAssert("foo \t \t \t \t bar", [ 7 ]); // 14 + computeAndAssert("foo \t \t \t \t bar", [ 14 ]); // Test wrapping for asian characters. computeAndAssert("ぁぁ", [1], 2); computeAndAssert(" ぁぁ", [1, 2], 2); computeAndAssert(" ぁ\tぁ", [1, 3], 2); - computeAndAssert(" ぁぁ\tぁ", [2, 4], 4); - computeAndAssert("ぁぁ ぁぁ\tぁ", [3, 6], 6); + computeAndAssert(" ぁぁ\tぁ", [1, 4], 4); // Test wrapping for punctuation. - computeAndAssert(" ab.c;ef++", [2, 4, 6, 8], 2); - computeAndAssert(" ab.c;ef++", [3, 5, 8], 3); + computeAndAssert(" ab.c;ef++", [1, 3, 5, 7, 8], 2); computeAndAssert(" a.b", [1, 2, 3], 1); computeAndAssert("#>>", [1, 2], 1); - - // Test wrapping for punctuation in - EditSession.prototype.$wrapAsCode = false; - computeAndAssert("ab cde, Juhu kinners", [3, 8, 13, 19], 6); - - // test indented wrapping - EditSession.prototype.$indentedSoftWrap = true; - computeAndAssert("foo bar foo bar foo bara foo", [12, 25]); - computeAndAssert("fooooooooooooooooooooooooooo", [12, 24]); - computeAndAssert("\t\tfoo bar fooooooooooobooooooo", [6, 10, 16, 22, 28]); - computeAndAssert("\t\t\tfoo bar fooooooooooobooooooo", [3, 7, 11, 17, 23, 29]); - computeAndAssert("\tfoo \t \t \t \t bar", [6, 12]); // 14 }, "test get longest line" : function() { @@ -442,12 +425,12 @@ module.exports = { session.setTabSize(4); assert.equal(session.getScreenWidth(), 2); - session.doc.insertMergedLines({row: 0, column: Infinity}, ['', '']); - session.doc.insertFullLines(1, ["123"]); + session.doc.insertNewLine({row: 0, column: Infinity}); + session.doc.insertLines(1, ["123"]); assert.equal(session.getScreenWidth(), 3); - session.doc.insertMergedLines({row: 0, column: Infinity}, ['', '']); - session.doc.insertFullLines(1, ["\t\t"]); + session.doc.insertNewLine({row: 0, column: Infinity}); + session.doc.insertLines(1, ["\t\t"]); assert.equal(session.getScreenWidth(), 8); @@ -471,9 +454,9 @@ module.exports = { session.setUseWrapMode(true); - document.insertFullLines(0, ["a", "b"]); - document.insertFullLines(2, ["c", "d"]); - document.removeFullLines(1, 2); + document.insertLines(0, ["a", "b"]); + document.insertLines(2, ["c", "d"]); + document.removeLines(1, 2); }, "test wrapMode init has to create wrapData array": function() { @@ -825,6 +808,13 @@ module.exports = { }, "test fold wrap data compution": function() { + function assertArray(a, b) { + assert.ok(a.length == b.length); + for (var i = 0; i < a.length; i++) { + assert.equal(a[i], b[i]); + } + } + function assertWrap(line0, line1, line2) { line0 && assertArray(wrapData[0], line0); line1 && assertArray(wrapData[1], line1); @@ -916,27 +906,7 @@ module.exports = { return session; }, - - "test delete fold with wrap enabled": function() { - var session = new EditSession(""); - session.setValue([ - "This is some placeholder text that will be folded inline.", - "This is some placeholder text that will be folded inline.", - "More text.", - "

                                                                                                                                                                                                                                                                                                                                                                                                                                                              The cursor in this paragraph text will be offset by 1 row.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              ", - "

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Everything after this will be offset as well due to the folds in the row before too.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              " - ].join("\n")); - session.addFold('...', new Range(0, 8, 0, 42)); - session.addFold('...', new Range(1, 8, 1, 42)); - session.addFold('...', new Range(3, 7, 3, 51)); - session.setOption("wrap", 40); - session.remove(new Range(0,0, 2, 5)); - // needed because adjustWrapLimit is called async from renderer - session.adjustWrapLimit(80); - - assert.equal(session.$wrapData + "", [[], [], [40, 76]] + ""); - }, - + "test add fold": function() { var session = createFoldTestSession(); var fold; @@ -949,7 +919,7 @@ module.exports = { fail = true; } if (fail != shouldFail) { - throw new Error("Expected to get an exception"); + throw "Expected to get an exception"; } } @@ -958,7 +928,7 @@ module.exports = { tryAddFold("foo", new Range(0, 13, 0, 18), false); assert.equal(session.$foldData[0].folds.length, 1); - tryAddFold("f", new Range(0, 13, 0, 18), false); + tryAddFold("f", new Range(0, 13, 0, 18), true); tryAddFold("foo", new Range(0, 18, 0, 21), false); assert.equal(session.$foldData[0].folds.length, 2); session.removeFold(fold); @@ -1001,87 +971,11 @@ module.exports = { session.addFold("fold0", new Range(0, 1, 0, 5)); session.addFold("fold0", new Range(0, 6, 0, 8)); assert.equal(fold.subFolds.length, 2); - }, - - "test row cache": function() { - var session = createFoldTestSession(); - - session.screenToDocumentPosition(2,3); - assertArray(session.$docRowCache, [1,3]); - assertArray(session.$screenRowCache, [1,2]); - - session.screenToDocumentPosition(5,3); - assertArray(session.$docRowCache, [1,3,4]); - assertArray(session.$screenRowCache, [1,2,3]); - - session.screenToDocumentPosition(0,3); - assertArray(session.$docRowCache, [1,3,4]); - assertArray(session.$screenRowCache, [1,2,3]); - - var pos = session.screenToDocumentPosition(0,0); - assert.equal(pos.row, 0); - assertArray(session.$docRowCache, [1,3,4]); - assertArray(session.$screenRowCache, [1,2,3]); - - session.screenToDocumentPosition(1,0); - assertArray(session.$docRowCache, [1,3,4]); - assertArray(session.$screenRowCache, [1,2,3]); - - session.$resetRowCache(); - assertArray(session.$docRowCache, []); - assertArray(session.$screenRowCache, []); - - session.screenToDocumentPosition(1,3); - assertArray(session.$docRowCache, [1]); - assertArray(session.$screenRowCache, [1]); - - session.screenToDocumentPosition(5,3); - assertArray(session.$docRowCache, [1,3,4]); - assertArray(session.$screenRowCache, [1,2,3]); - - session = new EditSession(new Array(30).join("\n")); - session.documentToScreenPosition(2,0); - session.documentToScreenPosition(2,0); - assertArray(session.$docRowCache, [1,2]); - assertArray(session.$screenRowCache, [1,2]); - }, - - "test annotations": function() { - var session = new EditSession([]), - annotation = {row: 0, type: 'info', text: "This is a test."}; - - session.clearAnnotations(); - assertArray(session.getAnnotations(), []); - session.setAnnotations([annotation]); - assertArray(session.getAnnotations(), [annotation]); - }, - - "test: mode loading" : function(next) { - if (!require.undef) { - console.log("Skipping test: This test only runs in the browser"); - next(); - return; - } - var session = new EditSession([]); - session.setMode("ace/mode/javascript"); - assert.equal(session.$modeid, "ace/mode/javascript"); - session.on("changeMode", function() { - assert.equal(session.$modeid, "ace/mode/javascript"); - }); - session.setMode("ace/mode/sh", function(mode) { - assert.ok(!mode); - }); - setTimeout(function() { - session.setMode("ace/mode/javascript", function(mode) { - session.setMode("ace/mode/javascript"); - assert.equal(session.$modeid, "ace/mode/javascript"); - next(); - }); - }, 0); } }; + }); if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec(); + require("asyncjs").test.testcase(module.exports).exec() } diff --git a/lib/ace/editor.js b/lib/ace/editor.js index 5da8a961..54becfcf 100644 --- a/lib/ace/editor.js +++ b/lib/ace/editor.js @@ -1,30 +1,40 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: +/* vim:ts=4:sts=4:sw=4: + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. * - * 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. + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * Irakli Gozalishvili (http://jeditoolkit.com) + * Julian Viereck + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -34,12 +44,12 @@ define(function(require, exports, module) { require("./lib/fixoldbrowsers"); var oop = require("./lib/oop"); -var dom = require("./lib/dom"); 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 TouchHandler = require("./mouse/touch_handler").TouchHandler; var KeyBinding = require("./keyboard/keybinding").KeyBinding; var EditSession = require("./edit_session").EditSession; var Search = require("./search").Search; @@ -47,26 +57,21 @@ 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; -var config = require("./config"); -var TokenIterator = require("./token_iterator").TokenIterator; /** - * The main entry point into the Ace functionality. + * class Editor * - * The `Editor` manages the [[EditSession]] (which manages [[Document]]s), as well as the [[VirtualRenderer]], which draws everything to the screen. + * The main entry point into the Ace functionality. The `Editor` manages the `EditSession` (which manages `Document`s), as well as the `VirtualRenderer`, which draws everything to the screen. Event sessions dealing with the mouse and keyboard are bubbled up from `Document` to the `Editor`, which decides what to do with them. * - * Event sessions dealing with the mouse and keyboard are bubbled up from `Document` to the `Editor`, which decides what to do with them. - * @class Editor **/ /** + * new Editor(renderer, session) + * - renderer (VirtualRenderer): Associated `VirtualRenderer` that draws everything + * - session (EditSession): The `EditSession` to refer to + * * Creates a new `Editor` object. * - * @param {VirtualRenderer} renderer Associated `VirtualRenderer` that draws everything - * @param {EditSession} session The `EditSession` to refer to - * - * - * @constructor **/ var Editor = function(renderer, session) { var container = renderer.getContainerElement(); @@ -79,212 +84,55 @@ var Editor = function(renderer, session) { this.keyBinding = new KeyBinding(this); // TODO detect touch event support - this.$mouseHandler = new MouseHandler(this); - new FoldHandler(this); + if ('ontouchstart' in this.container || 1) { + this.$mouseHandler = new TouchHandler(this); + } else { + this.$mouseHandler = new MouseHandler(this); + new FoldHandler(this); + } this.$blockScrolling = 0; this.$search = new Search().set({ wrap: true }); - this.$historyTracker = this.$historyTracker.bind(this); - this.commands.on("exec", this.$historyTracker); - - this.$initOperationListeners(); - - this._$emitInputEvent = lang.delayedCall(function() { - this._signal("input", {}); - if (this.session && this.session.bgTokenizer) - this.session.bgTokenizer.scheduleStart(); - }.bind(this)); - - this.on("change", function(_, _self) { - _self._$emitInputEvent.schedule(31); - }); - this.setSession(session || new EditSession("")); - config.resetOptions(this); - config._signal("editor", this); }; (function(){ oop.implement(this, EventEmitter); - this.$initOperationListeners = function() { - function last(a) {return a[a.length - 1]} - - this.selections = []; - this.commands.on("exec", this.startOperation.bind(this), true); - this.commands.on("afterExec", this.endOperation.bind(this), true); - - this.$opResetTimer = lang.delayedCall(this.endOperation.bind(this)); - - this.on("change", function() { - this.curOp || this.startOperation(); - this.curOp.docChanged = true; - }.bind(this), true); - - this.on("changeSelection", function() { - this.curOp || this.startOperation(); - this.curOp.selectionChanged = true; - }.bind(this), true); - }; - - this.curOp = null; - this.prevOp = {}; - this.startOperation = function(commadEvent) { - if (this.curOp) { - if (!commadEvent || this.curOp.command) - return; - this.prevOp = this.curOp; - } - if (!commadEvent) { - this.previousCommand = null; - commadEvent = {}; - } - - this.$opResetTimer.schedule(); - this.curOp = { - command: commadEvent.command || {}, - args: commadEvent.args, - scrollTop: this.renderer.scrollTop - }; - if (this.curOp.command.name && this.curOp.command.scrollIntoView !== undefined) - this.$blockScrolling++; - }; - - this.endOperation = function(e) { - if (this.curOp) { - if (e && e.returnValue === false) - return this.curOp = null; - this._signal("beforeEndOperation"); - var command = this.curOp.command; - if (command.name && this.$blockScrolling > 0) - this.$blockScrolling--; - var scrollIntoView = command && command.scrollIntoView; - if (scrollIntoView) { - switch (scrollIntoView) { - case "center-animate": - scrollIntoView = "animate"; - /* fall through */ - case "center": - this.renderer.scrollCursorIntoView(null, 0.5); - break; - case "animate": - case "cursor": - this.renderer.scrollCursorIntoView(); - break; - case "selectionPart": - var range = this.selection.getRange(); - var config = this.renderer.layerConfig; - if (range.start.row >= config.lastRow || range.end.row <= config.firstRow) { - this.renderer.scrollSelectionIntoView(this.selection.anchor, this.selection.lead); - } - break; - default: - break; - } - if (scrollIntoView == "animate") - this.renderer.animateScrolling(this.curOp.scrollTop); - } - - this.prevOp = this.curOp; - this.curOp = null; - } - }; - - // TODO use property on commands instead of this - this.$mergeableCommands = ["backspace", "del", "insertstring"]; - this.$historyTracker = function(e) { - if (!this.$mergeUndoDeltas) - return; - - var prev = this.prevOp; - var mergeableCommands = this.$mergeableCommands; - // previous command was the same - var shouldMerge = prev.command && (e.command.name == prev.command.name); - if (e.command.name == "insertstring") { - var text = e.args; - if (this.mergeNextCommand === undefined) - this.mergeNextCommand = true; - - shouldMerge = shouldMerge - && this.mergeNextCommand // previous command allows to coalesce with - && (!/\s/.test(text) || /\s/.test(prev.args)); // previous insertion was of same type - - this.mergeNextCommand = true; - } else { - shouldMerge = shouldMerge - && mergeableCommands.indexOf(e.command.name) !== -1; // the command is mergeable - } - - if ( - this.$mergeUndoDeltas != "always" - && Date.now() - this.sequenceStartTime > 2000 - ) { - shouldMerge = false; // the sequence is too long - } - - if (shouldMerge) - this.session.mergeUndoDeltas = true; - else if (mergeableCommands.indexOf(e.command.name) !== -1) - this.sequenceStartTime = Date.now(); - }; - /** - * Sets a new key handler, such as "vim" or "windows". - * @param {String} keyboardHandler The new key handler - * + * Editor.setKeyboardHandler(keyboardHandler) + * + * Sets a new keyboard handler. **/ - this.setKeyboardHandler = function(keyboardHandler, cb) { - if (keyboardHandler && typeof keyboardHandler === "string") { - this.$keybindingId = keyboardHandler; - var _self = this; - config.loadModule(["keybinding", keyboardHandler], function(module) { - if (_self.$keybindingId == keyboardHandler) - _self.keyBinding.setKeyboardHandler(module && module.handler); - cb && cb(); - }); - } else { - this.$keybindingId = null; - this.keyBinding.setKeyboardHandler(keyboardHandler); - cb && cb(); - } + this.setKeyboardHandler = function(keyboardHandler) { + this.keyBinding.setKeyboardHandler(keyboardHandler); }; - /** - * Returns the keyboard handler, such as "vim" or "windows". - * - * @returns {String} - * + /** related to: KeyBinding + * Editor.getKeyboardHandler() -> String + * + * Returns the keyboard handler. **/ this.getKeyboardHandler = function() { return this.keyBinding.getKeyboardHandler(); }; - /** - * Emitted whenever the [[EditSession]] changes. - * @event changeSession - * @param {Object} e An object with two properties, `oldSession` and `session`, that represent the old and new [[EditSession]]s. + * Editor.setSession(session) + * - session (EditSession): The new session to use * - **/ - /** * Sets a new editsession to use. This method also emits the `'changeSession'` event. - * @param {EditSession} session The new session to use - * **/ this.setSession = function(session) { if (this.session == session) return; - - // make sure operationEnd events are not emitted to wrong session - if (this.curOp) this.endOperation(); - this.curOp = {}; - var oldSession = this.session; - if (oldSession) { + 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); @@ -298,7 +146,7 @@ var Editor = function(renderer, session) { this.session.removeEventListener("changeAnnotation", this.$onChangeAnnotation); this.session.removeEventListener("changeOverwrite", this.$onCursorChange); this.session.removeEventListener("changeScrollTop", this.$onScrollTopChange); - this.session.removeEventListener("changeScrollLeft", this.$onScrollLeftChange); + this.session.removeEventListener("changeLeftTop", this.$onScrollLeftChange); var selection = this.session.getSelection(); selection.removeEventListener("changeCursor", this.$onCursorChange); @@ -306,102 +154,93 @@ var Editor = function(renderer, session) { } this.session = session; - if (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(); - } else { - this.selection = null; - this.renderer.setSession(session); - } - this._signal("changeSession", { + 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.curOp = null; - - oldSession && oldSession._signal("changeEditor", {oldEditor: this}); - session && session._signal("changeEditor", {editor: this}); }; /** + * Editor.getSession() -> EditSession + * * Returns the current session being used. - * @returns {EditSession} **/ this.getSession = function() { return this.session; }; - /** - * Sets the current document to `val`. - * @param {String} val The new value to set for the document - * @param {Number} cursorPos Where to set the new value. `undefined` or 0 is selectAll, -1 is at the document start, and 1 is at the end + /** related to: Document.setValue + * Editor.setValue(val [,cursorPos]) -> String + * - val (String): The new value to set for the document + * - cursorPos (Number): Where to set the new value. `undefined` or 0 is selectAll, -1 is at the document start, and 1 is at the end * - * @returns {String} The current document value - * @related Document.setValue + * Sets the current document to `val`. **/ this.setValue = function(val, cursorPos) { this.session.doc.setValue(val); @@ -416,92 +255,84 @@ var Editor = function(renderer, session) { return val; }; - /** - * Returns the current session's content. + /** related to: EditSession.getValue + * Editor.getValue() -> String * - * @returns {String} - * @related EditSession.getValue + * Returns the current session's content. **/ this.getValue = function() { return this.session.getValue(); }; /** - * + * Editor.getSelection() -> String + * * Returns the currently highlighted selection. - * @returns {String} The highlighted selection **/ this.getSelection = function() { return this.selection; }; - /** + /** related to: VirtualRenderer.onResize + * Editor.resize() + * * {:VirtualRenderer.onResize} - * @param {Boolean} force If `true`, recomputes the size, even if the height and width haven't changed - * - * - * @related VirtualRenderer.onResize **/ this.resize = function(force) { this.renderer.onResize(force); }; /** + * Editor.setTheme(theme) + * * {:VirtualRenderer.setTheme} - * @param {String} theme The path to a theme - * @param {Function} cb optional callback called when theme is loaded **/ - this.setTheme = function(theme, cb) { - this.renderer.setTheme(theme, cb); + this.setTheme = function(theme) { + this.renderer.setTheme(theme); }; - /** + /** related to: VirtualRenderer.getTheme + * Editor.getTheme() -> String + * * {:VirtualRenderer.getTheme} - * - * @returns {String} The set theme - * @related VirtualRenderer.getTheme **/ this.getTheme = function() { return this.renderer.getTheme(); }; - /** + /** related to: VirtualRenderer.setStyle + * Editor.setStyle(style) + * * {:VirtualRenderer.setStyle} - * @param {String} style A class name - * - * - * @related VirtualRenderer.setStyle **/ this.setStyle = function(style) { this.renderer.setStyle(style); }; - /** + /** related to: VirtualRenderer.unsetStyle + * Editor.unsetStyle(style) + * * {:VirtualRenderer.unsetStyle} - * @related VirtualRenderer.unsetStyle **/ this.unsetStyle = function(style) { this.renderer.unsetStyle(style); }; /** - * Gets the current font size of the editor text. - */ - this.getFontSize = function () { - return this.getOption("fontSize") || - dom.computedStyle(this.container, "fontSize"); - }; - - /** + * Editor.setFontSize(size) + * - size (Number): A font size + * * Set a new font size (in pixels) for the editor text. - * @param {String} size A font size ( _e.g._ "12px") - * - * **/ this.setFontSize = function(size) { - this.setOption("fontSize", size); + this.container.style.fontSize = size; + this.renderer.updateFontSize(); }; + /** internal, hide + * Editor.$highlightBrackets() + * + **/ this.$highlightBrackets = function() { if (this.session.$bracketHighlight) { this.session.removeMarker(this.session.$bracketHighlight); @@ -517,110 +348,18 @@ var Editor = function(renderer, session) { this.$highlightPending = true; setTimeout(function() { self.$highlightPending = false; - var session = self.session; - if (!session || !session.bgTokenizer) return; - var pos = session.findMatchingBracket(self.getCursorPosition()); + + var pos = self.session.findMatchingBracket(self.getCursorPosition()); if (pos) { - var range = new Range(pos.row, pos.column, pos.row, pos.column + 1); - } else if (session.$mode.getMatching) { - var range = session.$mode.getMatching(self.session); + var range = new Range(pos.row, pos.column, pos.row, pos.column+1); + self.session.$bracketHighlight = self.session.addMarker(range, "ace_bracket", "text"); } - if (range) - session.$bracketHighlight = session.addMarker(range, "ace_bracket", "text"); - }, 50); - }; - - // todo: move to mode.getMatching - this.$highlightTags = function() { - if (this.$highlightTagPending) - return; - - // perform highlight async to not block the browser during navigation - var self = this; - this.$highlightTagPending = true; - setTimeout(function() { - self.$highlightTagPending = false; - - var session = self.session; - if (!session || !session.bgTokenizer) return; - - var pos = self.getCursorPosition(); - var iterator = new TokenIterator(self.session, pos.row, pos.column); - var token = iterator.getCurrentToken(); - - if (!token || !/\b(?:tag-open|tag-name)/.test(token.type)) { - session.removeMarker(session.$tagHighlight); - session.$tagHighlight = null; - return; - } - - if (token.type.indexOf("tag-open") != -1) { - token = iterator.stepForward(); - if (!token) - return; - } - - var tag = token.value; - var depth = 0; - var prevToken = iterator.stepBackward(); - - if (prevToken.value == '<'){ - //find closing tag - do { - prevToken = token; - token = iterator.stepForward(); - - if (token && token.value === tag && token.type.indexOf('tag-name') !== -1) { - if (prevToken.value === '<'){ - depth++; - } else if (prevToken.value === '= 0); - } else { - //find opening tag - do { - token = prevToken; - prevToken = iterator.stepBackward(); - - if (token && token.value === tag && token.type.indexOf('tag-name') !== -1) { - if (prevToken.value === '<') { - depth++; - } else if (prevToken.value === ' Boolean + * + * Returns true if the current `textInput` is in focus. **/ this.isFocused = function() { return this.textInput.isFocused(); }; /** - * + * Editor.blur() + * * Blurs the current `textInput`. **/ this.blur = function() { @@ -651,33 +392,31 @@ var Editor = function(renderer, session) { }; /** + * Editor@focus() + * * Emitted once the editor comes into focus. - * @event focus - * - * **/ - this.onFocus = function(e) { + this.onFocus = function() { if (this.$isFocused) return; this.$isFocused = true; this.renderer.showCursor(); this.renderer.visualizeFocus(); - this._emit("focus", e); + this._emit("focus"); }; /** + * Editor@blur() + * * Emitted once the editor has been blurred. - * @event blur - * - * **/ - this.onBlur = function(e) { + this.onBlur = function() { if (!this.$isFocused) return; this.$isFocused = false; this.renderer.hideCursor(); this.renderer.visualizeBlur(); - this._emit("blur", e); + this._emit("blur"); }; this.$cursorChange = function() { @@ -685,24 +424,27 @@ var Editor = function(renderer, session) { }; /** - * Emitted whenever the document is changed. - * @event change - * @param {Object} e Contains a single property, `data`, which has the delta of changes - * - * + * Editor@change(e) + * - e (Object): Contains a single property, `data`, which has the delta of changes * + * Emitted whenever the document is changed. + * **/ - this.onDocumentChange = function(delta) { - // Rerender and emit "change" event. - var wrap = this.session.$useWrapMode; - var lastRow = (delta.start.row == delta.end.row ? delta.end.row : Infinity); - this.renderer.updateLines(delta.start.row, lastRow, wrap); + this.onDocumentChange = function(e) { + var delta = e.data; + var range = delta.range; + var lastRow; - this._signal("change", delta); - - // Update cursor because tab characters can influence the cursor position. + 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.$updateHighlightActiveLine(); }; this.onTokenizerUpdate = function(e) { @@ -714,58 +456,64 @@ var Editor = function(renderer, session) { this.onScrollTopChange = function() { this.renderer.scrollToY(this.session.getScrollTop()); }; - + this.onScrollLeftChange = function() { this.renderer.scrollToX(this.session.getScrollLeft()); }; /** - * Emitted when the selection changes. - * + * Editor@cursorChange() + * + * Emitted when the cursor changes. **/ this.onCursorChange = function() { this.$cursorChange(); if (!this.$blockScrolling) { - config.warn("Automatically scrolling cursor into view after selection change", - "this will be disabled in the next version", - "set editor.$blockScrolling = Infinity to disable this message" - ); this.renderer.scrollCursorIntoView(); } this.$highlightBrackets(); - this.$highlightTags(); this.$updateHighlightActiveLine(); - this._signal("changeSelection"); + this._emit("changeSelection"); }; + /** internal, hide + * Editor.$updateHighlightActiveLine() + * + * + **/ this.$updateHighlightActiveLine = function() { var session = this.getSession(); - var highlight; - if (this.$highlightActiveLine) { - if ((this.$selectionStyle != "line" || !this.selection.isMultiLine())) - highlight = this.getCursorPosition(); - if (this.renderer.$maxLines && this.session.getLength() === 1 && !(this.renderer.$minLines > 1)) - highlight = false; - } + if (session.$highlightLineMarker) + session.removeMarker(session.$highlightLineMarker); - if (session.$highlightLineMarker && !highlight) { - session.removeMarker(session.$highlightLineMarker.id); - session.$highlightLineMarker = null; - } else if (!session.$highlightLineMarker && highlight) { - var range = new Range(highlight.row, highlight.column, highlight.row, Infinity); - range.id = session.addMarker(range, "ace_active-line", "screenLine"); - session.$highlightLineMarker = range; - } else if (highlight) { - session.$highlightLineMarker.start.row = highlight.row; - session.$highlightLineMarker.end.row = highlight.row; - session.$highlightLineMarker.start.column = highlight.column; - session._signal("changeBackMarker"); + 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"); + } } }; + + /** + * Editor@selectionChange(e) + * - e (Object): Contains a single property, `data`, which has the delta of changes + * + * Emitted when a selection has changed. + **/ this.onSelectionChange = function(e) { var session = this.session; @@ -782,10 +530,10 @@ var Editor = function(renderer, session) { this.$updateHighlightActiveLine(); } - var re = this.$highlightSelectedWord && this.$getSelectionHighLightRegexp(); + var re = this.$highlightSelectedWord && this.$getSelectionHighLightRegexp() this.session.highlight(re); - - this._signal("changeSelection"); + + this._emit("changeSelection"); }; this.$getSelectionHighLightRegexp = function() { @@ -820,40 +568,74 @@ var Editor = function(renderer, session) { return re; }; - + /** + * Editor@changeFrontMarker() + * + * Emitted when a front marker changes. + **/ this.onChangeFrontMarker = function() { this.renderer.updateFrontMarkers(); }; + /** + * Editor@changeBackMarker() + * + * Emitted when a back marker changes. + **/ this.onChangeBackMarker = function() { this.renderer.updateBackMarkers(); }; - + /** + * Editor@changeBreakpoint() + * + * Emitted when a breakpoint changes. + **/ this.onChangeBreakpoint = function() { this.renderer.updateBreakpoints(); }; + /** + * Editor@changeAnnotation() + * + * Emitted when an annotation changes. + **/ this.onChangeAnnotation = function() { this.renderer.setAnnotations(this.session.getAnnotations()); }; - - this.onChangeMode = function(e) { + /** + * Editor@changeMode() + * + * Emitted when the mode changes. + **/ + this.onChangeMode = function() { this.renderer.updateText(); - this._emit("changeMode", e); }; - + /** + * Editor@changeWrapLimit() + * + * Emitted when the wrap limit changes. + **/ this.onChangeWrapLimit = function() { this.renderer.updateFull(); }; + /** + * Editor@changeWrapMode() + * + * Emitted when the wrap mode changes. + **/ this.onChangeWrapMode = function() { this.renderer.onResize(true); }; - + /** + * Editor@changeFold() + * + * Emitted when the code folds change. + **/ this.onChangeFold = function() { // Update the active line marker as due to folding changes the current // line range on the screen might have changed. @@ -862,33 +644,23 @@ var Editor = function(renderer, session) { this.renderer.updateFull(); }; - /** + * Editor.getCopyText() -> String + * * Returns the string of text currently highlighted. - * @returns {String} - **/ - this.getSelectedText = function() { - return this.session.getTextRange(this.getSelectionRange()); - }; - - /** - * Emitted when text is copied. - * @event copy - * @param {String} text The copied text - * - **/ - /** - * Returns the string of text currently highlighted. - * @returns {String} - * @deprecated Use getSelectedText instead. **/ this.getCopyText = function() { - var text = this.getSelectedText(); - this._signal("copy", text); + var text = ""; + if (!this.selection.isEmpty()) + text = this.session.getTextRange(this.getSelectionRange()); + + this._emit("copy", text); return text; }; /** + * Editor.onCopy() + * * Called whenever a text "copy" happens. **/ this.onCopy = function() { @@ -896,88 +668,51 @@ var Editor = function(renderer, session) { }; /** - * Called whenever a text "cut" happens. + * Editor.onCut() + * + * called whenever a text "cut" happens. **/ this.onCut = function() { this.commands.exec("cut", this); }; /** - * Emitted when text is pasted. - * @event paste - * @param {Object} an object which contains one property, `text`, that represents the text to be pasted. Editing this property will alter the text that is pasted. - * - * + * Editor.onPaste() + * + * called whenever a text "paste" happens. **/ - /** - * Called whenever a text "paste" happens. - * @param {String} text The pasted text - * - * - **/ - this.onPaste = function(text, event) { - var e = {text: text, event: event}; - this.commands.exec("paste", this, e); - }; - - this.$handlePaste = function(e) { - if (typeof e == "string") - e = {text: e}; - this._signal("paste", e); - var text = e.text; - if (!this.inMultiSelectMode || this.inVirtualSelectionMode) { - this.insert(text); - } else { - 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.execCommand = function(command, args) { - return this.commands.exec(command, this, args); + this.onPaste = function(text) { + // todo this should change when paste becomes a command + if (this.$readOnly) + return; + this._emit("paste", text); + this.insert(text); }; /** + * Editor.insert(text) + * - text (String): The new text to add + * * Inserts `text` into wherever the cursor is pointing. - * @param {String} text The new text to add - * **/ - this.insert = function(text, pasted) { + this.insert = function(text) { var session = this.session; var mode = session.getMode(); + var cursor = this.getCursorPosition(); - if (this.getBehavioursEnabled() && !pasted) { + 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) { - if (text !== transform.text) { - this.session.mergeUndoDeltas = false; - this.$mergeNextCommand = false; - } + if (transform) text = transform.text; - - } } - - if (text == "\t") - text = this.session.getTabString(); + + text = text.replace("\t", this.session.getTabString()); // remove selected text if (!this.selection.isEmpty()) { - var range = this.getSelectionRange(); - cursor = this.session.remove(range); + cursor = this.session.remove(this.getSelectionRange()); this.clearSelection(); } else if (this.session.getOverwrite()) { @@ -986,19 +721,13 @@ var Editor = function(renderer, session) { this.session.remove(range); } - if (text == "\n" || text == "\r\n") { - var line = session.getLine(cursor.row); - if (cursor.column > line.search(/\S|$/)) { - var d = line.substr(cursor.column).search(/\S|$/); - session.doc.removeInLine(cursor.row, cursor.column, cursor.column + d); - } - } 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 shouldOutdent = mode.checkOutdent(lineState, line, text); + var lineIndent = mode.getNextLineIndent(lineState, line.slice(0, cursor.column), session.getTabString()); var end = session.insert(cursor, text); if (transform && transform.selection) { @@ -1015,10 +744,44 @@ var Editor = function(renderer, session) { } } - if (session.getDocument().isNewLine(text)) { - var lineIndent = mode.getNextLineIndent(lineState, line.slice(0, cursor.column), session.getTabString()); + var lineState = session.getState(cursor.row); - session.insert({row: cursor.row+1, column: 0}, lineIndent); + // 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); @@ -1032,122 +795,158 @@ var Editor = function(renderer, session) { this.keyBinding.onCommandKey(e, hashId, keyCode); }; - /** + /** related to: EditSession.setOverwrite + * Editor.setOverwrite(overwrite) + * - overwrite (Boolean): Defines wheter or not to set overwrites + * * Pass in `true` to enable overwrites in your session, or `false` to disable. If overwrites is enabled, any text you enter will type over any text after it. If the value of `overwrite` changes, this function also emites the `changeOverwrite` event. - * @param {Boolean} overwrite Defines wheter or not to set overwrites * - * - * @related EditSession.setOverwrite **/ this.setOverwrite = function(overwrite) { this.session.setOverwrite(overwrite); }; - /** + /** related to: EditSession.getOverwrite + * Editor.getOverwrite() -> Boolean + * * Returns `true` if overwrites are enabled; `false` otherwise. - * @returns {Boolean} - * @related EditSession.getOverwrite **/ this.getOverwrite = function() { return this.session.getOverwrite(); }; - /** + /** related to: EditSession.toggleOverwrite + * Editor.toggleOverwrite() + * * Sets the value of overwrite to the opposite of whatever it currently is. - * @related EditSession.toggleOverwrite **/ this.toggleOverwrite = function() { this.session.toggleOverwrite(); }; /** + * Editor.setScrollSpeed(speed) + * - speed (Number): A value indicating the new speed + * * Sets how fast the mouse scrolling should do. - * @param {Number} speed A value indicating the new speed (in milliseconds) - **/ - this.setScrollSpeed = function(speed) { - this.setOption("scrollSpeed", speed); - }; - - /** - * Returns the value indicating how fast the mouse scroll speed is (in milliseconds). - * @returns {Number} - **/ - this.getScrollSpeed = function() { - return this.getOption("scrollSpeed"); - }; - - /** - * Sets the delay (in milliseconds) of the mouse drag. - * @param {Number} dragDelay A value indicating the new delay - **/ - this.setDragDelay = function(dragDelay) { - this.setOption("dragDelay", dragDelay); - }; - - /** - * Returns the current mouse drag delay. - * @returns {Number} - **/ - this.getDragDelay = function() { - return this.getOption("dragDelay"); - }; - - /** - * Emitted when the selection style changes, via [[Editor.setSelectionStyle]]. - * @event changeSelectionStyle - * @param {Object} data Contains one property, `data`, which indicates the new selection style - **/ - /** - * Draw selection markers spanning whole line, or only over selected text. Default value is "line" - * @param {String} style The new selection style "line"|"text" * **/ - this.setSelectionStyle = function(val) { - this.setOption("selectionStyle", val); + this.setScrollSpeed = function(speed) { + this.$mouseHandler.setScrollSpeed(speed); }; /** + * Editor.getScrollSpeed() -> Number + * + * Returns the value indicating how fast the mouse scroll speed is. + **/ + this.getScrollSpeed = function() { + return this.$mouseHandler.getScrollSpeed(); + }; + + /** + * Editor.setDragDelay(dragDelay) + * - dragDelay (Number): A value indicating the new delay + * + * Sets the delay (in milliseconds) of the mouse drag. + * + **/ + this.setDragDelay = function(dragDelay) { + this.$mouseHandler.setDragDelay(dragDelay); + }; + + /** + * Editor.getDragDelay() -> Number + * + * Returns the current mouse drag delay. + **/ + this.getDragDelay = function() { + return this.$mouseHandler.getDragDelay(); + }; + + this.$selectionStyle = "line"; + /** + * Editor.setSelectionStyle(style) + * - style (String): The new selection style + * + * Indicates how selections should occur. By default, selections are set to "line". This function also emits the `'changeSelectionStyle'` event. + * + **/ + this.setSelectionStyle = function(style) { + if (this.$selectionStyle == style) return; + + this.$selectionStyle = style; + this.onSelectionChange(); + this._emit("changeSelectionStyle", {data: style}); + }; + + /** + * Editor.getSelectionStyle() -> String + * * Returns the current selection style. - * @returns {String} **/ this.getSelectionStyle = function() { - return this.getOption("selectionStyle"); + return this.$selectionStyle; + }; + + this.$highlightActiveLine = true; + + /** + * Editor.setHighlightActiveLine(shouldHighlight) + * - shouldHighlight (Boolean): Set to `true` to highlight the current line + * + * Determines whether or not the current line should be highlighted. + * + **/ + this.setHighlightActiveLine = function(shouldHighlight) { + if (this.$highlightActiveLine == shouldHighlight) + return; + + this.$highlightActiveLine = shouldHighlight; + this.$updateHighlightActiveLine(); }; /** - * Determines whether or not the current line should be highlighted. - * @param {Boolean} shouldHighlight Set to `true` to highlight the current line - **/ - this.setHighlightActiveLine = function(shouldHighlight) { - this.setOption("highlightActiveLine", shouldHighlight); - }; - /** + * Editor.getHighlightActiveLine() -> Boolean + * * Returns `true` if current lines are always highlighted. - * @return {Boolean} **/ this.getHighlightActiveLine = function() { - return this.getOption("highlightActiveLine"); + return this.$highlightActiveLine; }; + + this.$highlightGutterLine = true; this.setHighlightGutterLine = function(shouldHighlight) { - this.setOption("highlightGutterLine", shouldHighlight); + if (this.$highlightGutterLine == shouldHighlight) + return; + + this.renderer.setHighlightGutterLine(shouldHighlight); + this.$highlightGutterLine = shouldHighlight; }; this.getHighlightGutterLine = function() { - return this.getOption("highlightGutterLine"); + return this.$highlightGutterLine; }; + this.$highlightSelectedWord = true; /** - * Determines if the currently selected word should be highlighted. - * @param {Boolean} shouldHighlight Set to `true` to highlight the currently selected word + * Editor.setHighlightSelectedWord(shouldHighlight) + * - shouldHighlight (Boolean): Set to `true` to highlight the currently selected word * + * Determines if the currently selected word should be highlighted. **/ this.setHighlightSelectedWord = function(shouldHighlight) { - this.setOption("highlightSelectedWord", shouldHighlight); + if (this.$highlightSelectedWord == shouldHighlight) + return; + + this.$highlightSelectedWord = shouldHighlight; + this.$onSelectionChange(); }; /** + * Editor.getHighlightSelectedWord() -> Boolean + * * Returns `true` if currently highlighted words are to be highlighted. - * @returns {Boolean} **/ this.getHighlightSelectedWord = function() { return this.$highlightSelectedWord; @@ -1162,17 +961,19 @@ var Editor = function(renderer, session) { }; /** - * If `showInvisibles` is set to `true`, invisible characters—like spaces or new lines—are show in the editor. - * @param {Boolean} showInvisibles Specifies whether or not to show invisible characters - * + * Editor.setShowInvisibles(showInvisibles) + * - showInvisibles (Boolean): Specifies whether or not to show invisible characters + * + * If `showInvisibiles` is set to `true`, invisible characters—like spaces or new lines—are show in the editor. **/ this.setShowInvisibles = function(showInvisibles) { this.renderer.setShowInvisibles(showInvisibles); }; /** + * Editor.getShowInvisibles() -> Boolean + * * Returns `true` if invisible characters are being shown. - * @returns {Boolean} **/ this.getShowInvisibles = function() { return this.renderer.getShowInvisibles(); @@ -1187,118 +988,123 @@ var Editor = function(renderer, session) { }; /** + * Editor.setShowPrintMargin(showPrintMargin) + * - showPrintMargin (Boolean): Specifies whether or not to show the print margin + * * If `showPrintMargin` is set to `true`, the print margin is shown in the editor. - * @param {Boolean} showPrintMargin Specifies whether or not to show the print margin - * **/ this.setShowPrintMargin = function(showPrintMargin) { this.renderer.setShowPrintMargin(showPrintMargin); }; /** + * Editor.getShowPrintMargin() -> Boolean + * * Returns `true` if the print margin is being shown. - * @returns {Boolean} **/ this.getShowPrintMargin = function() { return this.renderer.getShowPrintMargin(); }; /** - * Sets the column defining where the print margin should be. - * @param {Number} showPrintMargin Specifies the new print margin + * Editor.setPrintMarginColumn(showPrintMargin) + * - showPrintMargin (Number): Specifies the new print margin * + * Sets the column defining where the print margin should be. + * **/ this.setPrintMarginColumn = function(showPrintMargin) { this.renderer.setPrintMarginColumn(showPrintMargin); }; /** + * Editor.getPrintMarginColumn() -> Number + * * Returns the column number of where the print margin is. - * @returns {Number} **/ this.getPrintMarginColumn = function() { return this.renderer.getPrintMarginColumn(); }; + this.$readOnly = false; /** + * Editor.setReadOnly(readOnly) + * - readOnly (Boolean): Specifies whether the editor can be modified or not + * * If `readOnly` is true, then the editor is set to read-only mode, and none of the content can change. - * @param {Boolean} readOnly Specifies whether the editor can be modified or not - * **/ this.setReadOnly = function(readOnly) { - this.setOption("readOnly", readOnly); + this.$readOnly = readOnly; }; /** + * Editor.getReadOnly() -> Boolean + * * Returns `true` if the editor is set to read-only mode. - * @returns {Boolean} **/ this.getReadOnly = function() { - return this.getOption("readOnly"); + return this.$readOnly; }; + this.$modeBehaviours = true; + /** + * Editor.setBehavioursEnabled(enabled) + * - enabled (Boolean): Enables or disables behaviors + * * Specifies whether to use behaviors or not. ["Behaviors" in this case is the auto-pairing of special characters, like quotation marks, parenthesis, or brackets.]{: #BehaviorsDef} - * @param {Boolean} enabled Enables or disables behaviors - * **/ this.setBehavioursEnabled = function (enabled) { - this.setOption("behavioursEnabled", enabled); + this.$modeBehaviours = enabled; }; /** + * Editor.getBehavioursEnabled() -> Boolean + * * Returns `true` if the behaviors are currently enabled. {:BehaviorsDef} - * - * @returns {Boolean} **/ this.getBehavioursEnabled = function () { - return this.getOption("behavioursEnabled"); + return this.$modeBehaviours; }; /** - * Specifies whether to use wrapping behaviors or not, i.e. automatically wrapping the selection with characters such as brackets - * when such a character is typed in. - * @param {Boolean} enabled Enables or disables wrapping behaviors - * - **/ - this.setWrapBehavioursEnabled = function (enabled) { - this.setOption("wrapBehavioursEnabled", enabled); - }; - - /** - * Returns `true` if the wrapping behaviors are currently enabled. - **/ - this.getWrapBehavioursEnabled = function () { - return this.getOption("wrapBehavioursEnabled"); - }; - - /** - * Indicates whether the fold widgets should be shown or not. - * @param {Boolean} show Specifies whether the fold widgets are shown + * Editor.setShowFoldWidgets(show) + * - show (Boolean): Specifies whether the fold widgets are shown + * + * Indicates whether the fold widgets are shown or not. **/ this.setShowFoldWidgets = function(show) { - this.setOption("showFoldWidgets", show); + var gutter = this.renderer.$gutterLayer; + if (gutter.getShowFoldWidgets() == show) + return; + this.renderer.$gutterLayer.setShowFoldWidgets(show); + this.$showFoldWidgets = show; + this.renderer.updateFull(); }; + /** + * Editor.getShowFoldWidgets() -> Boolean + * * Returns `true` if the fold widgets are shown. - * @return {Boolean} **/ this.getShowFoldWidgets = function() { - return this.getOption("showFoldWidgets"); + return this.renderer.$gutterLayer.getShowFoldWidgets(); }; - this.setFadeFoldWidgets = function(fade) { - this.setOption("fadeFoldWidgets", fade); + this.setFadeFoldWidgets = function(show) { + this.renderer.setFadeFoldWidgets(show); }; this.getFadeFoldWidgets = function() { - return this.getOption("fadeFoldWidgets"); + return this.renderer.getFadeFoldWidgets(); }; /** - * Removes the current selection or one character. - * @param {String} dir The direction of the deletion to occur, either "left" or "right" + * Editor.remove(dir) + * - dir (String): The direction of the deletion to occur, either "left" or "right" + * + * Removes words of text from the editor. A "word" is defined as a string of characters bookended by whitespace. * **/ this.remove = function(dir) { @@ -1314,16 +1120,6 @@ var Editor = function(renderer, session) { var session = this.session; var state = session.getState(range.start.row); var new_range = session.getMode().transformAction(state, 'deletion', this, session, range); - - if (range.end.column === 0) { - var text = session.getTextRange(range); - if (text[text.length - 1] == "\n") { - var line = session.getLine(range.end.row); - if (/^\s+$/.test(line)) { - range.end.column = line.length; - } - } - } if (new_range) range = new_range; } @@ -1333,6 +1129,8 @@ var Editor = function(renderer, session) { }; /** + * Editor.removeWordRight() + * * Removes the word directly to the right of the current selection. **/ this.removeWordRight = function() { @@ -1344,6 +1142,8 @@ var Editor = function(renderer, session) { }; /** + * Editor.removeWordLeft() + * * Removes the word directly to the left of the current selection. **/ this.removeWordLeft = function() { @@ -1355,6 +1155,8 @@ var Editor = function(renderer, session) { }; /** + * Editor.removeToLineStart() + * * Removes all the words to the left of the current selection, until the start of the line. **/ this.removeToLineStart = function() { @@ -1366,6 +1168,8 @@ var Editor = function(renderer, session) { }; /** + * Editor.removeToLineEnd() + * * Removes all the words to the right of the current selection, until the end of the line. **/ this.removeToLineEnd = function() { @@ -1383,6 +1187,8 @@ var Editor = function(renderer, session) { }; /** + * Editor.splitLine() + * * Splits the line at the current selection (by inserting an `'\n'`). **/ this.splitLine = function() { @@ -1397,6 +1203,8 @@ var Editor = function(renderer, session) { }; /** + * Editor.transposeLetters() + * * Transposes current line. **/ this.transposeLetters = function() { @@ -1423,6 +1231,8 @@ var Editor = function(renderer, session) { }; /** + * Editor.toLowerCase() + * * Converts the current selection entirely into lowercase. **/ this.toLowerCase = function() { @@ -1438,6 +1248,8 @@ var Editor = function(renderer, session) { }; /** + * Editor.toUpperCase() + * * Converts the current selection entirely into uppercase. **/ this.toUpperCase = function() { @@ -1452,93 +1264,48 @@ var Editor = function(renderer, session) { this.selection.setSelectionRange(originalRange); }; - /** - * Inserts an indentation into the current cursor position or indents the selected lines. - * - * @related EditSession.indentRows + /** related to: EditSession.indentRows + * Editor.indent() + * + * Indents the current line. **/ this.indent = function() { var session = this.session; var range = this.getSelectionRange(); - if (range.start.row < range.end.row) { + if (range.start.row < range.end.row || range.start.column < range.end.column) { var rows = this.$getSelectedRows(); session.indentRows(rows.first, rows.last, "\t"); - return; - } else if (range.start.column < range.end.column) { - var text = session.getTextRange(range); - if (!/^\s+$/.test(text)) { - var rows = this.$getSelectedRows(); - session.indentRows(rows.first, rows.last, "\t"); - return; - } - } - - var line = session.getLine(range.start.row); - var position = range.start; - var size = session.getTabSize(); - var column = session.documentToScreenColumn(position.row, position.column); - - if (this.session.getUseSoftTabs()) { - var count = (size - column % size); - var indentString = lang.stringRepeat(" ", count); } else { - var count = column % size; - while (line[range.start.column] == " " && count) { - range.start.column--; - count--; - } - this.selection.setSelectionRange(range); - indentString = "\t"; + 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); } - return this.insert(indentString); }; - /** - * Indents the current line. - * @related EditSession.indentRows - **/ - this.blockIndent = function() { - var rows = this.$getSelectedRows(); - this.session.indentRows(rows.first, rows.last, "\t"); - }; - - /** + /** related to: EditSession.outdentRows + * Editor.blockOutdent() + * * Outdents the current line. - * @related EditSession.outdentRows **/ this.blockOutdent = function() { var selection = this.session.getSelection(); this.session.outdentRows(selection.getRange()); }; - // TODO: move out of core when we have good mechanism for managing extensions - this.sortLines = function() { - var rows = this.$getSelectedRows(); - var session = this.session; - - var lines = []; - for (i = rows.first; i <= rows.last; i++) - lines.push(session.getLine(i)); - - lines.sort(function(a, b) { - if (a.toLowerCase() < b.toLowerCase()) return -1; - if (a.toLowerCase() > b.toLowerCase()) return 1; - return 0; - }); - - var deleteRange = new Range(0, 0, 0, 0); - for (var i = rows.first; i <= rows.last; i++) { - var line = session.getLine(i); - deleteRange.start.row = i; - deleteRange.end.row = i; - deleteRange.end.column = line.length; - session.replace(deleteRange, lines[i-rows.first]); - } - }; - /** - * Given the currently selected range, this function either comments all the lines, or uncomments all of them. + * Editor.toggleCommentLines() + * + * Given the currently selected range, this function either comments all lines or uncomments all lines (depending on whether it's commented or not). **/ this.toggleCommentLines = function() { var state = this.session.getState(this.getCursorPosition().row); @@ -1546,234 +1313,166 @@ var Editor = function(renderer, session) { this.session.getMode().toggleCommentLines(state, this.session, rows.first, rows.last); }; - this.toggleBlockComment = function() { - var cursor = this.getCursorPosition(); - var state = this.session.getState(cursor.row); - var range = this.getSelectionRange(); - this.session.getMode().toggleBlockComment(state, this.session, range, cursor); - }; - - /** - * Works like [[EditSession.getTokenAt]], except it returns a number. - * @returns {Number} - **/ - this.getNumberAt = function(row, column) { - var _numberRx = /[\-]?[0-9]+(?:\.[0-9]+)?/g; - _numberRx.lastIndex = 0; - - var s = this.session.getLine(row); - while (_numberRx.lastIndex < column) { - var m = _numberRx.exec(s); - if(m.index <= column && m.index+m[0].length >= column){ - var number = { - value: m[0], - start: m.index, - end: m.index+m[0].length - }; - return number; - } - } - return null; - }; - - /** - * If the character before the cursor is a number, this functions changes its value by `amount`. - * @param {Number} amount The value to change the numeral by (can be negative to decrease value) - * - **/ - this.modifyNumber = function(amount) { - var row = this.selection.getCursor().row; - var column = this.selection.getCursor().column; - - // get the char before the cursor - var charRange = new Range(row, column-1, row, column); - - var c = this.session.getTextRange(charRange); - // if the char is a digit - if (!isNaN(parseFloat(c)) && isFinite(c)) { - // get the whole number the digit is part of - var nr = this.getNumberAt(row, column); - // if number found - if (nr) { - var fp = nr.value.indexOf(".") >= 0 ? nr.start + nr.value.indexOf(".") + 1 : nr.end; - var decimals = nr.start + nr.value.length - fp; - - var t = parseFloat(nr.value); - t *= Math.pow(10, decimals); - - - if(fp !== nr.end && column < fp){ - amount *= Math.pow(10, nr.end - column - 1); - } else { - amount *= Math.pow(10, nr.end - column); - } - - t += amount; - t /= Math.pow(10, decimals); - var nnr = t.toFixed(decimals); - - //update number - var replaceRange = new Range(row, nr.start, row, nr.end); - this.session.replace(replaceRange, nnr); - - //reposition the cursor - this.moveCursorTo(row, Math.max(nr.start +1, column + nnr.length - nr.value.length)); - - } - } - }; - - /** + /** related to: EditSession.remove + * Editor.removeLines() + * * Removes all the lines in the current selection - * @related EditSession.remove **/ this.removeLines = function() { var rows = this.$getSelectedRows(); - this.session.removeFullLines(rows.first, rows.last); + 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(); - var reverse = sel.isBackwards(); - if (range.isEmpty()) { - var row = range.start.row; - doc.duplicateLines(row, row); - } else { - var point = reverse ? range.start : range.end; - var endPoint = doc.insert(point, doc.getTextRange(range), false); - range.start = point; - range.end = endPoint; - - sel.setSelectionRange(range, reverse); - } + 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) + } }; - - /** + + /** related to: EditSession.moveLinesDown + * Editor.moveLinesDown() -> Number + * + (Number): On success, it returns -1. + * * Shifts all the selected lines down one row. * - * @returns {Number} On success, it returns -1. - * @related EditSession.moveLinesUp + * + * **/ this.moveLinesDown = function() { - this.$moveLines(1, false); + this.$moveLines(function(firstRow, lastRow) { + return this.session.moveLinesDown(firstRow, lastRow); + }); }; - /** + /** related to: EditSession.moveLinesUp + * Editor.moveLinesUp() -> Number + * + (Number): On success, it returns -1. + * * Shifts all the selected lines up one row. - * @returns {Number} On success, it returns -1. - * @related EditSession.moveLinesDown + * + * **/ this.moveLinesUp = function() { - this.$moveLines(-1, false); + this.$moveLines(function(firstRow, lastRow) { + return this.session.moveLinesUp(firstRow, lastRow); + }); }; - /** + /** related to: EditSession.moveText + * Editor.moveText(fromRange, toPosition) -> Range + * - fromRange (Range): The range of text you want moved within the document + * - toPosition (Object): The location (row and column) where you want to move the text to + * + (Range): The new range where the text was moved to. + * * Moves a range of text from the given range to the given position. `toPosition` is an object that looks like this: - * ```json - * { row: newRowLocation, column: newColumnLocation } - * ``` - * @param {Range} fromRange The range of text you want moved within the document - * @param {Object} toPosition The location (row and column) where you want to move the text to * - * @returns {Range} The new range where the text was moved to. - * @related EditSession.moveText + * { row: newRowLocation, column: newColumnLocation } + * + * **/ - this.moveText = function(range, toPosition, copy) { - return this.session.moveText(range, toPosition, copy); + this.moveText = function(range, toPosition) { + if (this.$readOnly) + return null; + + return this.session.moveText(range, toPosition); }; - /** - * Copies all the selected lines up one row. - * @returns {Number} On success, returns 0. + /** related to: EditSession.duplicateLines + * Editor.copyLinesUp() -> Number + * + (Number): On success, returns 0. * + * Copies all the selected lines up one row. + * + * **/ this.copyLinesUp = function() { - this.$moveLines(-1, true); + this.$moveLines(function(firstRow, lastRow) { + this.session.duplicateLines(firstRow, lastRow); + return 0; + }); }; - /** + /** related to: EditSession.duplicateLines + * Editor.copyLinesDown() -> Number + * + (Number): On success, returns the number of new rows added; in other words, `lastRow - firstRow + 1`. + * * Copies all the selected lines down one row. - * @returns {Number} On success, returns the number of new rows added; in other words, `lastRow - firstRow + 1`. - * @related EditSession.duplicateLines + * + * * **/ this.copyLinesDown = function() { - this.$moveLines(1, true); + this.$moveLines(function(firstRow, lastRow) { + return this.session.duplicateLines(firstRow, lastRow); + }); }; + /** - * for internal use - * @ignore + * Editor.$moveLines(mover) + * - mover (Function): A method to call on each selected row + * + * Executes a specific function, which can be anything that manipulates selected lines, such as copying them, duplicating them, or shifting them. * **/ - this.$moveLines = function(dir, copy) { - var rows, moved; + this.$moveLines = function(mover) { + var rows = this.$getSelectedRows(); var selection = this.selection; - if (!selection.inMultiSelectMode || this.inVirtualSelectionMode) { - var range = selection.toOrientedRange(); - rows = this.$getSelectedRows(range); - moved = this.session.$moveLines(rows.first, rows.last, copy ? 0 : dir); - if (copy && dir == -1) moved = 0; - range.moveBy(moved, 0); - selection.fromOrientedRange(range); - } else { - var ranges = selection.rangeList.ranges; - selection.rangeList.detach(this.session); - this.inVirtualSelectionMode = true; - - var diff = 0; - var totalDiff = 0; - var l = ranges.length; - for (var i = 0; i < l; i++) { - var rangeIndex = i; - ranges[i].moveBy(diff, 0); - rows = this.$getSelectedRows(ranges[i]); - var first = rows.first; - var last = rows.last; - while (++i < l) { - if (totalDiff) ranges[i].moveBy(totalDiff, 0); - var subRows = this.$getSelectedRows(ranges[i]); - if (copy && subRows.first != last) - break; - else if (!copy && subRows.first > last + 1) - break; - last = subRows.last; - } - i--; - diff = this.session.$moveLines(first, last, copy ? 0 : dir); - if (copy && dir == -1) rangeIndex = i + 1; - while (rangeIndex <= i) { - ranges[rangeIndex].moveBy(diff, 0); - rangeIndex++; - } - if (!copy) diff = 0; - totalDiff += diff; - } - - selection.fromOrientedRange(selection.ranges[0]); - selection.rangeList.attach(this.session); - this.inVirtualSelectionMode = false; + 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); + }); } }; /** + * Editor.$getSelectedRows() -> Object + * * Returns an object indicating the currently selected rows. The object looks like this: * - * ```json * { first: range.start.row, last: range.end.row } - * ``` * - * @returns {Object} **/ - this.$getSelectedRows = function(range) { - range = (range || this.getSelectionRange()).collapseRows(); + this.$getSelectedRows = function() { + var range = this.getSelectionRange().collapseRows(); return { - first: this.session.getRowFoldStart(range.start.row), - last: this.session.getRowFoldEnd(range.end.row) + first: range.start.row, + last: range.end.row }; }; @@ -1789,50 +1488,48 @@ var Editor = function(renderer, session) { this.renderer.hideComposition(); }; - /** + /** related to: VirtualRenderer.getFirstVisibleRow + * Editor.getFirstVisibleRow() -> Number + * * {:VirtualRenderer.getFirstVisibleRow} - * - * @returns {Number} - * @related VirtualRenderer.getFirstVisibleRow **/ this.getFirstVisibleRow = function() { return this.renderer.getFirstVisibleRow(); }; - /** + /** related to: VirtualRenderer.getLastVisibleRow + * Editor.getLastVisibleRow() -> Number + * * {:VirtualRenderer.getLastVisibleRow} - * - * @returns {Number} - * @related VirtualRenderer.getLastVisibleRow **/ this.getLastVisibleRow = function() { return this.renderer.getLastVisibleRow(); }; /** + * Editor.isRowVisible(row) -> Boolean + * - row (Number): The row to check + * * Indicates if the row is currently visible on the screen. - * @param {Number} row The row to check - * - * @returns {Boolean} **/ this.isRowVisible = function(row) { return (row >= this.getFirstVisibleRow() && row <= this.getLastVisibleRow()); }; /** + * Editor.isRowFullyVisible(row) -> Boolean + * - row (Number): The row to check + * * Indicates if the entire row is currently visible on the screen. - * @param {Number} row The row to check - * - * - * @returns {Boolean} **/ this.isRowFullyVisible = function(row) { return (row >= this.renderer.getFirstFullyVisibleRow() && row <= this.renderer.getLastFullyVisibleRow()); }; /** + * Editor.$getVisibleRowCount() -> Number + * * Returns the number of currently visibile rows. - * @returns {Number} **/ this.$getVisibleRowCount = function() { return this.renderer.getScrollBottomRow() - this.renderer.getScrollTopRow() + 1; @@ -1844,11 +1541,11 @@ var Editor = function(renderer, session) { var rows = dir * Math.floor(config.height / config.lineHeight); this.$blockScrolling++; - if (select === true) { + if (select == true) { this.selection.$moveSelection(function(){ this.moveCursorBy(rows, 0); }); - } else if (select === false) { + } else if (select == false) { this.selection.moveCursorBy(rows, 0); this.selection.clearSelection(); } @@ -1864,6 +1561,8 @@ var Editor = function(renderer, session) { }; /** + * Editor.selectPageDown() + * * Selects the text from the current position of the document until where a "page down" finishes. **/ this.selectPageDown = function() { @@ -1871,6 +1570,8 @@ var Editor = function(renderer, session) { }; /** + * Editor.selectPageUp() + * * Selects the text from the current position of the document until where a "page up" finishes. **/ this.selectPageUp = function() { @@ -1878,6 +1579,8 @@ var Editor = function(renderer, session) { }; /** + * Editor.gotoPageDown() + * * Shifts the document to wherever "page down" is, as well as moving the cursor position. **/ this.gotoPageDown = function() { @@ -1885,6 +1588,8 @@ var Editor = function(renderer, session) { }; /** + * Editor.gotoPageUp() + * * Shifts the document to wherever "page up" is, as well as moving the cursor position. **/ this.gotoPageUp = function() { @@ -1892,6 +1597,8 @@ var Editor = function(renderer, session) { }; /** + * Editor.scrollPageDown() + * * Scrolls the document to wherever "page down" is, without changing the cursor position. **/ this.scrollPageDown = function() { @@ -1899,35 +1606,41 @@ var Editor = function(renderer, session) { }; /** + * Editor.scrollPageUp() + * * Scrolls the document to wherever "page up" is, without changing the cursor position. **/ this.scrollPageUp = function() { this.$moveByPage(-1); }; - /** + /** related to: VirtualRenderer.scrollToRow + * Editor.scrollToRow(row) + * - row (Number): The row to move to + * * Moves the editor to the specified row. - * @related VirtualRenderer.scrollToRow + * **/ this.scrollToRow = function(row) { this.renderer.scrollToRow(row); }; - /** - * Scrolls to a line. If `center` is `true`, it puts the line in middle of screen (or attempts to). - * @param {Number} line The line to scroll to - * @param {Boolean} center If `true` - * @param {Boolean} animate If `true` animates scrolling - * @param {Function} callback Function to be called when the animation has finished + /** related to: VirtualRenderer.scrollToLine + * Editor.scrollToLine(line, center, animate, callback()) + * - line (Number): The line to scroll to + * - center (Boolean): If `true` + * - animate (Boolean): If `true` animates scrolling + * - callback (Function): Function to be called when the animation has finished * - * - * @related VirtualRenderer.scrollToLine + * TODO scrolls a to line, if center == true, puts line in middle of screen or attempts to) **/ this.scrollToLine = function(line, center, animate, callback) { this.renderer.scrollToLine(line, center, animate, callback); }; /** + * Editor.centerSelection() + * * Attempts to center the current selection on the screen. **/ this.centerSelection = function() { @@ -1935,46 +1648,47 @@ var Editor = function(renderer, session) { 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); }; - /** + /** related to: Selection.getCursor + * Editor.getCursorPosition() -> Object + * + (Object): This returns an object that looks something like this:
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + * ```{ row: currRow, column: currCol }``` + * * Gets the current position of the cursor. - * @returns {Object} An object that looks something like this: * - * ```json - * { row: currRow, column: currCol } - * ``` + * * - * @related Selection.getCursor **/ this.getCursorPosition = function() { return this.selection.getCursor(); }; - /** + /** related to: EditSession.documentToScreenPosition + * Editor.getCursorPositionScreen() -> Number + * * Returns the screen position of the cursor. - * @returns {Number} - * @related EditSession.documentToScreenPosition **/ this.getCursorPositionScreen = function() { return this.session.documentToScreenPosition(this.getCursorPosition()); }; - /** + /** related to: Selection.getRange + * Editor.getSelectionRange() -> Range + * * {:Selection.getRange} - * @returns {Range} - * @related Selection.getRange **/ this.getSelectionRange = function() { return this.selection.getRange(); }; - /** + /** related to: Selection.selectAll + * Editor.selectAll() + * * Selects all the text in editor. - * @related Selection.selectAll **/ this.selectAll = function() { this.$blockScrolling += 1; @@ -1982,218 +1696,89 @@ var Editor = function(renderer, session) { this.$blockScrolling -= 1; }; - /** + /** related to: Selection.clearSelection + * Editor.clearSelection() + * * {:Selection.clearSelection} - * @related Selection.clearSelection **/ this.clearSelection = function() { this.selection.clearSelection(); }; - /** + /** related to: Selection.moveCursorTo + * Editor.moveCursorTo(row, column) + * - row (Number): The new row number + * - column (Number): The new column number + * * Moves the cursor to the specified row and column. Note that this does not de-select the current selection. - * @param {Number} row The new row number - * @param {Number} column The new column number * - * - * @related Selection.moveCursorTo **/ this.moveCursorTo = function(row, column) { this.selection.moveCursorTo(row, column); }; - /** + /** related to: Selection.moveCursorToPosition + * Editor.moveCursorToPosition(pos) + * - pos (Object): An object with two properties, row and column + * * Moves the cursor to the position indicated by `pos.row` and `pos.column`. - * @param {Object} pos An object with two properties, row and column * - * - * @related Selection.moveCursorToPosition **/ this.moveCursorToPosition = function(pos) { this.selection.moveCursorToPosition(pos); }; - /** - * Moves the cursor's row and column to the next matching bracket or HTML tag. + /** + * Editor.jumpToMatching() + * + * Moves the cursor's row and column to the next matching bracket. * **/ - this.jumpToMatching = function(select, expand) { + this.jumpToMatching = function(select) { var cursor = this.getCursorPosition(); - var iterator = new TokenIterator(this.session, cursor.row, cursor.column); - var prevToken = iterator.getCurrentToken(); - var token = prevToken || iterator.stepForward(); - if (!token) return; - - //get next closing tag or bracket - var matchType; - var found = false; - var depth = {}; - var i = cursor.column - token.start; - var bracketType; - var brackets = { - ")": "(", - "(": "(", - "]": "[", - "[": "[", - "{": "{", - "}": "{" - }; - - do { - if (token.value.match(/[{}()\[\]]/g)) { - for (; i < token.value.length && !found; i++) { - if (!brackets[token.value[i]]) { - continue; - } - - bracketType = brackets[token.value[i]] + '.' + token.type.replace("rparen", "lparen"); - - if (isNaN(depth[bracketType])) { - depth[bracketType] = 0; - } - - switch (token.value[i]) { - case '(': - case '[': - case '{': - depth[bracketType]++; - break; - case ')': - case ']': - case '}': - depth[bracketType]--; - - if (depth[bracketType] === -1) { - matchType = 'bracket'; - found = true; - } - break; - } - } - } - else if (token && token.type.indexOf('tag-name') !== -1) { - if (isNaN(depth[token.value])) { - depth[token.value] = 0; - } - - if (prevToken.value === '<') { - depth[token.value]++; - } - else if (prevToken.value === '= 0; --i) { if(this.$tryReplace(ranges[i], replacement)) { @@ -2409,23 +2000,22 @@ var Editor = function(renderer, session) { } }; - /** + /** related to: Search.getOptions + * Editor.getLastSearchOptions() -> Object + * * {:Search.getOptions} For more information on `options`, see [[Search `Search`]]. - * @related Search.getOptions - * @returns {Object} **/ this.getLastSearchOptions = function() { return this.$search.getOptions(); }; - /** + /** related to: Search.find + * Editor.find(needle, options, animate) + * - needle (String): The text to search for (optional) + * - options (Object): An object defining various search properties + * - animate (Boolean): If `true` animate scrolling + * * Attempts to find `needle` within the document. For more information on `options`, see [[Search `Search`]]. - * @param {String} needle The text to search for (optional) - * @param {Object} options An object defining various search properties - * @param {Boolean} animate If `true` animate scrolling - * - * - * @related Search.find **/ this.find = function(needle, options, animate) { if (!options) @@ -2466,25 +2056,23 @@ var Editor = function(renderer, session) { this.selection.setRange(range); }; - /** + /** related to: Editor.find + * Editor.findNext(options, animate) + * - options (Object): search options + * - animate (Boolean): If `true` animate scrolling + * * Performs another search for `needle` in the document. For more information on `options`, see [[Search `Search`]]. - * @param {Object} options search options - * @param {Boolean} animate If `true` animate scrolling - * - * - * @related Editor.find **/ this.findNext = function(options, animate) { this.find({skipCurrent: true, backwards: false}, options, animate); }; - /** + /** related to: Editor.find + * Editor.findPrevious(options, animate) + * - options (Object): search options + * - animate (Boolean): If `true` animate scrolling + * * Performs a search for `needle` backwards. For more information on `options`, see [[Search `Search`]]. - * @param {Object} options search options - * @param {Boolean} animate If `true` animate scrolling - * - * - * @related Editor.find **/ this.findPrevious = function(options, animate) { this.find(options, {skipCurrent: true, backwards: true}, animate); @@ -2498,13 +2086,14 @@ var Editor = function(renderer, session) { var scrollTop = this.renderer.scrollTop; this.renderer.scrollSelectionIntoView(range.start, range.end, 0.5); - if (animate !== false) + if (animate != false) this.renderer.animateScrolling(scrollTop); }; - /** + /** related to: UndoManager.undo + * Editor.undo() + * * {:UndoManager.undo} - * @related UndoManager.undo **/ this.undo = function() { this.$blockScrolling++; @@ -2513,9 +2102,10 @@ var Editor = function(renderer, session) { this.renderer.scrollCursorIntoView(null, 0.5); }; - /** + /** related to: UndoManager.redo + * Editor.redo() + * * {:UndoManager.redo} - * @related UndoManager.redo **/ this.redo = function() { this.$blockScrolling++; @@ -2524,168 +2114,17 @@ var Editor = function(renderer, session) { this.renderer.scrollCursorIntoView(null, 0.5); }; - /** - * + /** + * Editor.destroy() + * * Cleans up the entire editor. **/ this.destroy = function() { this.renderer.destroy(); - this._signal("destroy", this); - if (this.session) { - this.session.destroy(); - } - }; - - /** - * Enables automatic scrolling of the cursor into view when editor itself is inside scrollable element - * @param {Boolean} enable default true - **/ - this.setAutoScrollEditorIntoView = function(enable) { - if (!enable) - return; - var rect; - var self = this; - var shouldScroll = false; - if (!this.$scrollAnchor) - this.$scrollAnchor = document.createElement("div"); - var scrollAnchor = this.$scrollAnchor; - scrollAnchor.style.cssText = "position:absolute"; - this.container.insertBefore(scrollAnchor, this.container.firstChild); - var onChangeSelection = this.on("changeSelection", function() { - shouldScroll = true; - }); - // needed to not trigger sync reflow - var onBeforeRender = this.renderer.on("beforeRender", function() { - if (shouldScroll) - rect = self.renderer.container.getBoundingClientRect(); - }); - var onAfterRender = this.renderer.on("afterRender", function() { - if (shouldScroll && rect && (self.isFocused() - || self.searchBox && self.searchBox.isFocused()) - ) { - var renderer = self.renderer; - var pos = renderer.$cursorLayer.$pixelPos; - var config = renderer.layerConfig; - var top = pos.top - config.offset; - if (pos.top >= 0 && top + rect.top < 0) { - shouldScroll = true; - } else if (pos.top < config.height && - pos.top + rect.top + config.lineHeight > window.innerHeight) { - shouldScroll = false; - } else { - shouldScroll = null; - } - if (shouldScroll != null) { - scrollAnchor.style.top = top + "px"; - scrollAnchor.style.left = pos.left + "px"; - scrollAnchor.style.height = config.lineHeight + "px"; - scrollAnchor.scrollIntoView(shouldScroll); - } - shouldScroll = rect = null; - } - }); - this.setAutoScrollEditorIntoView = function(enable) { - if (enable) - return; - delete this.setAutoScrollEditorIntoView; - this.removeEventListener("changeSelection", onChangeSelection); - this.renderer.removeEventListener("afterRender", onAfterRender); - this.renderer.removeEventListener("beforeRender", onBeforeRender); - }; - }; - - - this.$resetCursorStyle = function() { - var style = this.$cursorStyle || "ace"; - var cursorLayer = this.renderer.$cursorLayer; - if (!cursorLayer) - return; - cursorLayer.setSmoothBlinking(/smooth/.test(style)); - cursorLayer.isBlinking = !this.$readOnly && style != "wide"; - dom.setCssClass(cursorLayer.element, "ace_slim-cursors", /slim/.test(style)); }; }).call(Editor.prototype); - -config.defineOptions(Editor.prototype, "editor", { - selectionStyle: { - set: function(style) { - this.onSelectionChange(); - this._signal("changeSelectionStyle", {data: style}); - }, - initialValue: "line" - }, - highlightActiveLine: { - set: function() {this.$updateHighlightActiveLine();}, - initialValue: true - }, - highlightSelectedWord: { - set: function(shouldHighlight) {this.$onSelectionChange();}, - initialValue: true - }, - readOnly: { - set: function(readOnly) { - // disabled to not break vim mode! - // this.textInput.setReadOnly(readOnly); - this.$resetCursorStyle(); - }, - initialValue: false - }, - cursorStyle: { - set: function(val) { this.$resetCursorStyle(); }, - values: ["ace", "slim", "smooth", "wide"], - initialValue: "ace" - }, - mergeUndoDeltas: { - values: [false, true, "always"], - initialValue: true - }, - behavioursEnabled: {initialValue: true}, - wrapBehavioursEnabled: {initialValue: true}, - autoScrollEditorIntoView: { - set: function(val) {this.setAutoScrollEditorIntoView(val)} - }, - - hScrollBarAlwaysVisible: "renderer", - vScrollBarAlwaysVisible: "renderer", - highlightGutterLine: "renderer", - animatedScroll: "renderer", - showInvisibles: "renderer", - showPrintMargin: "renderer", - printMarginColumn: "renderer", - printMargin: "renderer", - fadeFoldWidgets: "renderer", - showFoldWidgets: "renderer", - showLineNumbers: "renderer", - showGutter: "renderer", - displayIndentGuides: "renderer", - fontSize: "renderer", - fontFamily: "renderer", - maxLines: "renderer", - minLines: "renderer", - scrollPastEnd: "renderer", - fixedWidthGutter: "renderer", - theme: "renderer", - - scrollSpeed: "$mouseHandler", - dragDelay: "$mouseHandler", - dragEnabled: "$mouseHandler", - focusTimout: "$mouseHandler", - tooltipFollowsMouse: "$mouseHandler", - - firstLineNumber: "session", - overwrite: "session", - newLineMode: "session", - useWorker: "session", - useSoftTabs: "session", - tabSize: "session", - wrap: "session", - indentedSoftWrap: "session", - foldStyle: "session", - mode: "session" -}); - exports.Editor = Editor; }); diff --git a/lib/ace/editor_change_document_test.js b/lib/ace/editor_change_document_test.js index a1fdaad9..9464202d 100644 --- a/lib/ace/editor_change_document_test.js +++ b/lib/ace/editor_change_document_test.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ diff --git a/lib/ace/editor_highlight_selected_word_test.js b/lib/ace/editor_highlight_selected_word_test.js index 13e19c23..c18a78bb 100644 --- a/lib/ace/editor_highlight_selected_word_test.js +++ b/lib/ace/editor_highlight_selected_word_test.js @@ -1,30 +1,38 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: +/* vim:ts=4:sts=4:sw=4: + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. * - * 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. + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Mihai Sucan. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Mihai Sucan + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ diff --git a/lib/ace/editor_navigation_test.js b/lib/ace/editor_navigation_test.js index ab348241..ebd55a89 100644 --- a/lib/ace/editor_navigation_test.js +++ b/lib/ace/editor_navigation_test.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ diff --git a/lib/ace/editor_text_edit_test.js b/lib/ace/editor_text_edit_test.js index 77ec34ed..171d40c7 100644 --- a/lib/ace/editor_text_edit_test.js +++ b/lib/ace/editor_text_edit_test.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -42,7 +49,6 @@ var JavaScriptMode = require("./mode/javascript").Mode; var UndoManager = require("./undomanager").UndoManager; var MockRenderer = require("./test/mockrenderer").MockRenderer; var assert = require("./test/assertions"); -var whitespace = require("./ext/whitespace"); module.exports = { "test: delete line from the middle" : function() { @@ -185,23 +191,21 @@ module.exports = { "test: comment lines should perserve selection" : function() { var session = new EditSession([" abc", "cde"].join("\n"), new JavaScriptMode()); var editor = new Editor(new MockRenderer(), session); - whitespace.detectIndentation(session); - + editor.moveCursorTo(0, 2); editor.getSelection().selectDown(); editor.toggleCommentLines(); - assert.equal(["// abc", "// cde"].join("\n"), session.toString()); + assert.equal(["// abc", "//cde"].join("\n"), session.toString()); var selection = editor.getSelectionRange(); - assert.position(selection.start, 0, 5); - assert.position(selection.end, 1, 5); + assert.position(selection.start, 0, 4); + assert.position(selection.end, 1, 4); }, "test: uncomment lines should perserve selection" : function() { - var session = new EditSession(["// abc", "//cde"].join("\n"), new JavaScriptMode()); + var session = new EditSession(["// abc", "//cde"].join("\n"), new JavaScriptMode()); var editor = new Editor(new MockRenderer(), session); - session.setTabSize(2); editor.moveCursorTo(0, 1); editor.getSelection().selectDown(); @@ -238,7 +242,7 @@ module.exports = { editor.getSelection().selectDown(); editor.toggleCommentLines(); - assert.range(editor.getSelectionRange(), 0, 3, 1, 0); + assert.range(editor.getSelectionRange(), 0, 2, 1, 0); // select up var session = new EditSession(["abc", "cde"].join("\n"), new JavaScriptMode()); @@ -248,10 +252,10 @@ module.exports = { editor.getSelection().selectUp(); editor.toggleCommentLines(); - assert.range(editor.getSelectionRange(), 0, 3, 1, 0); + assert.range(editor.getSelectionRange(), 0, 2, 1, 0); }, - "test: move lines down should keep selection on moved lines" : function() { + "test: move lines down should select moved lines" : function() { var session = new EditSession(["11", "22", "33", "44"].join("\n")); var editor = new Editor(new MockRenderer(), session); @@ -260,25 +264,25 @@ module.exports = { editor.moveLinesDown(); assert.equal(["33", "11", "22", "44"].join("\n"), session.toString()); - assert.position(editor.getCursorPosition(), 2, 1); - assert.position(editor.getSelection().getSelectionAnchor(), 1, 1); - assert.position(editor.getSelection().getSelectionLead(), 2, 1); + assert.position(editor.getCursorPosition(), 1, 0); + assert.position(editor.getSelection().getSelectionAnchor(), 3, 0); + assert.position(editor.getSelection().getSelectionLead(), 1, 0); editor.moveLinesDown(); assert.equal(["33", "44", "11", "22"].join("\n"), session.toString()); - assert.position(editor.getCursorPosition(), 3, 1); - assert.position(editor.getSelection().getSelectionAnchor(), 2, 1); - assert.position(editor.getSelection().getSelectionLead(), 3, 1); + assert.position(editor.getCursorPosition(), 2, 0); + assert.position(editor.getSelection().getSelectionAnchor(), 3, 2); + assert.position(editor.getSelection().getSelectionLead(), 2, 0); // moving again should have no effect editor.moveLinesDown(); assert.equal(["33", "44", "11", "22"].join("\n"), session.toString()); - assert.position(editor.getCursorPosition(), 3, 1); - assert.position(editor.getSelection().getSelectionAnchor(), 2, 1); - assert.position(editor.getSelection().getSelectionLead(), 3, 1); + assert.position(editor.getCursorPosition(), 2, 0); + assert.position(editor.getSelection().getSelectionAnchor(), 3, 2); + assert.position(editor.getSelection().getSelectionLead(), 2, 0); }, - "test: move lines up should keep selection on moved lines" : function() { + "test: move lines up should select moved lines" : function() { var session = new EditSession(["11", "22", "33", "44"].join("\n")); var editor = new Editor(new MockRenderer(), session); @@ -287,18 +291,19 @@ module.exports = { editor.moveLinesUp(); assert.equal(session.toString(), ["11", "33", "44", "22"].join("\n")); - assert.position(editor.getCursorPosition(), 2, 1); - assert.position(editor.getSelection().getSelectionAnchor(), 1, 1); - assert.position(editor.getSelection().getSelectionLead(), 2, 1); + assert.position(editor.getCursorPosition(), 1, 0); + assert.position(editor.getSelection().getSelectionAnchor(), 3, 0); + assert.position(editor.getSelection().getSelectionLead(), 1, 0); editor.moveLinesUp(); assert.equal(session.toString(), ["33", "44", "11", "22"].join("\n")); - assert.position(editor.getCursorPosition(), 1, 1); - assert.position(editor.getSelection().getSelectionAnchor(), 0, 1); - assert.position(editor.getSelection().getSelectionLead(), 1, 1); + assert.position(editor.getCursorPosition(), 0, 0); + assert.position(editor.getSelection().getSelectionAnchor(), 2, 0); + assert.position(editor.getSelection().getSelectionLead(), 0, 0); }, - "test: move line without active selection should not move cursor relative to the moved line" : function() { + "test: move line without active selection should not move cursor relative to the moved line" : function() + { var session = new EditSession(["11", "22", "33", "44"].join("\n")); var editor = new Editor(new MockRenderer(), session); @@ -316,7 +321,7 @@ module.exports = { assert.position(editor.getCursorPosition(), 1, 1); }, - "test: copy lines down should keep selection" : function() { + "test: copy lines down should select lines and place cursor at the selection start" : function() { var session = new EditSession(["11", "22", "33", "44"].join("\n")); var editor = new Editor(new MockRenderer(), session); @@ -326,12 +331,12 @@ module.exports = { editor.copyLinesDown(); assert.equal(["11", "22", "33", "22", "33", "44"].join("\n"), session.toString()); - assert.position(editor.getCursorPosition(), 4, 1); - assert.position(editor.getSelection().getSelectionAnchor(), 3, 1); - assert.position(editor.getSelection().getSelectionLead(), 4, 1); + assert.position(editor.getCursorPosition(), 3, 0); + assert.position(editor.getSelection().getSelectionAnchor(), 5, 0); + assert.position(editor.getSelection().getSelectionLead(), 3, 0); }, - "test: copy lines up should keep selection" : function() { + "test: copy lines up should select lines and place cursor at the selection start" : function() { var session = new EditSession(["11", "22", "33", "44"].join("\n")); var editor = new Editor(new MockRenderer(), session); @@ -341,9 +346,9 @@ module.exports = { editor.copyLinesUp(); assert.equal(["11", "22", "33", "22", "33", "44"].join("\n"), session.toString()); - assert.position(editor.getCursorPosition(), 2, 1); - assert.position(editor.getSelection().getSelectionAnchor(), 1, 1); - assert.position(editor.getSelection().getSelectionLead(), 2, 1); + assert.position(editor.getCursorPosition(), 1, 0); + assert.position(editor.getSelection().getSelectionAnchor(), 3, 0); + assert.position(editor.getSelection().getSelectionLead(), 1, 0); }, "test: input a tab with soft tab should convert it to spaces" : function() { diff --git a/lib/ace/ext/beautify.js b/lib/ace/ext/beautify.js deleted file mode 100644 index d0fa1799..00000000 --- a/lib/ace/ext/beautify.js +++ /dev/null @@ -1,57 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -// [WIP] - -define(function(require, exports, module) { -"use strict"; -var TokenIterator = require("ace/token_iterator").TokenIterator; - -var phpTransform = require("./beautify/php_rules").transform; - -exports.beautify = function(session) { - var iterator = new TokenIterator(session, 0, 0); - var token = iterator.getCurrentToken(); - - var context = session.$modeId.split("/").pop(); - - var code = phpTransform(iterator, context); - session.doc.setValue(code); -}; - -exports.commands = [{ - name: "beautify", - exec: function(editor) { - exports.beautify(editor.session); - }, - bindKey: "Ctrl-Shift-B" -}] - -}); \ No newline at end of file diff --git a/lib/ace/ext/beautify/php_rules.js b/lib/ace/ext/beautify/php_rules.js deleted file mode 100644 index 9a5bed36..00000000 --- a/lib/ace/ext/beautify/php_rules.js +++ /dev/null @@ -1,366 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; -var TokenIterator = require("ace/token_iterator").TokenIterator; -exports.newLines = [{ - type: 'support.php_tag', - value: '' -}, { - type: 'paren.lparen', - value: '{', - indent: true -}, { - type: 'paren.rparen', - breakBefore: true, - value: '}', - indent: false -}, { - type: 'paren.rparen', - breakBefore: true, - value: '})', - indent: false, - dontBreak: true -}, { - type: 'comment' -}, { - type: 'text', - value: ';' -}, { - type: 'text', - value: ':', - context: 'php' -}, { - type: 'keyword', - value: 'case', - indent: true, - dontBreak: true -}, { - type: 'keyword', - value: 'default', - indent: true, - dontBreak: true -}, { - type: 'keyword', - value: 'break', - indent: false, - dontBreak: true -}, { - type: 'punctuation.doctype.end', - value: '>' -}, { - type: 'meta.tag.punctuation.end', - value: '>' -}, { - type: 'meta.tag.punctuation.begin', - value: '<', - blockTag: true, - indent: true, - dontBreak: true -}, { - type: 'meta.tag.punctuation.begin', - value: '' ){ - context = 'php'; - } - else if( token.type == 'support.php_tag' && token.value == '?>' ){ - context = 'html'; - } - //css - else if( token.type == 'meta.tag.name.style' && context != 'css' ){ - context = 'css'; - } - else if( token.type == 'meta.tag.name.style' && context == 'css' ){ - context = 'html'; - } - //js - else if( token.type == 'meta.tag.name.script' && context != 'js' ){ - context = 'js'; - } - else if( token.type == 'meta.tag.name.script' && context == 'js' ){ - context = 'html'; - } - - nextToken = iterator.stepForward(); - - //tag name - if (nextToken && nextToken.type.indexOf('meta.tag.name') == 0) { - nextTag = nextToken.value; - } - - //don't linebreak - if ( lastToken.type == 'support.php_tag' && lastToken.value == '' ) { - dontBreak = false; - } - - //next token - lastTag = tag; - - lastToken = token; - - token = nextToken; - - if (token===null) { - break; - } - } - - return code; -}; - - - -}); \ No newline at end of file diff --git a/lib/ace/ext/chromevox.js b/lib/ace/ext/chromevox.js deleted file mode 100644 index 52a180d4..00000000 --- a/lib/ace/ext/chromevox.js +++ /dev/null @@ -1,979 +0,0 @@ -define(function(require, exports, module) { - -/* ChromeVox Ace namespace. */ -var cvoxAce = {}; - -/* Typedefs for Closure compiler. */ -/** - * @typedef {{ - rate: number, - pitch: number, - volume: number, - relativePitch: number, - punctuationEcho: string - }} - */ -/* TODO(peterxiao): Export this typedef through cvox.Api. */ -cvoxAce.SpeechProperty; - -/** - * @typedef {{ - * row: number, - * column: number - * }} - */ -cvoxAce.Cursor; - -/** - * @typedef {{ - type: string, - value: string - }} - } - */ -cvoxAce.Token; - -/** - * These are errors and information that Ace will display in the gutter. - * @typedef {{ - row: number, - column: number, - value: string - }} - } - */ -cvoxAce.Annotation; - -/* Speech Properties. */ -/** - * Speech property for speaking constant tokens. - * @type {cvoxAce.SpeechProperty} - */ -var CONSTANT_PROP = { - 'rate': 0.8, - 'pitch': 0.4, - 'volume': 0.9 -}; - -/** - * Default speech property for speaking tokens. - * @type {cvoxAce.SpeechProperty} - */ -var DEFAULT_PROP = { - 'rate': 1, - 'pitch': 0.5, - 'volume': 0.9 -}; - -/** - * Speech property for speaking entity tokens. - * @type {cvoxAce.SpeechProperty} - */ -var ENTITY_PROP = { - 'rate': 0.8, - 'pitch': 0.8, - 'volume': 0.9 -}; - -/** - * Speech property for speaking keywords. - * @type {cvoxAce.SpeechProperty} - */ -var KEYWORD_PROP = { - 'rate': 0.8, - 'pitch': 0.3, - 'volume': 0.9 -}; - -/** - * Speech property for speaking storage tokens. - * @type {cvoxAce.SpeechProperty} - */ -var STORAGE_PROP = { - 'rate': 0.8, - 'pitch': 0.7, - 'volume': 0.9 -}; - -/** - * Speech property for speaking variable tokens. - * @type {cvoxAce.SpeechProperty} - */ -var VARIABLE_PROP = { - 'rate': 0.8, - 'pitch': 0.8, - 'volume': 0.9 -}; - -/** - * Speech property for speaking deleted text. - * @type {cvoxAce.SpeechProperty} - */ -var DELETED_PROP = { - 'punctuationEcho': 'none', - 'relativePitch': -0.6 -}; - -/* Constants for Earcons. */ -var ERROR_EARCON = 'ALERT_NONMODAL'; -var MODE_SWITCH_EARCON = 'ALERT_MODAL'; -var NO_MATCH_EARCON = 'INVALID_KEYPRESS'; - -/* Constants for vim state. */ -var INSERT_MODE_STATE = 'insertMode'; -var COMMAND_MODE_STATE = 'start'; - -var REPLACE_LIST = [ - { - substr: ';', - newSubstr: ' semicolon ' - }, - { - substr: ':', - newSubstr: ' colon ' - } -]; - -/** - * Context menu commands. - */ -var Command = { - SPEAK_ANNOT: 'annots', - SPEAK_ALL_ANNOTS: 'all_annots', - TOGGLE_LOCATION: 'toggle_location', - SPEAK_MODE: 'mode', - SPEAK_ROW_COL: 'row_col', - TOGGLE_DISPLACEMENT: 'toggle_displacement', - FOCUS_TEXT: 'focus_text' -}; - -/** - * Key prefix for each shortcut. - */ -var KEY_PREFIX = 'CONTROL + SHIFT '; - -/* Globals. */ -cvoxAce.editor = null; -/** - * Last cursor position. - * @type {cvoxAce.Cursor} - */ -var lastCursor = null; - -/** - * Table of annotations. - * @typedef {!Object.>} - */ -var annotTable = {}; - -/** - * Whether to speak character, word, and then line. This allows blind users - * to know the location of the cursor when they change lines. - * @typedef {boolean} - */ -var shouldSpeakRowLocation = false; - -/** - * Whether to speak displacement. - * @typedef {boolean} - */ -var shouldSpeakDisplacement = false; - -/** - * Whether text was changed to cause a cursor change event. - * @typedef {boolean} - */ -var changed = false; - -/** - * Current state vim is in. - */ -var vimState = null; - -/** - * Mapping from key code to shortcut. - */ -var keyCodeToShortcutMap = {}; - -/** - * Mapping from command to shortcut. - */ -var cmdToShortcutMap = {}; - -/** - * Get shortcut string from keyCode. - * @param {number} keyCode Key code of shortcut. - * @return {string} String representation of shortcut. - */ -var getKeyShortcutString = function(keyCode) { - return KEY_PREFIX + String.fromCharCode(keyCode); -}; - -/** - * Return if in vim mode. - * @return {boolean} True if in Vim mode. - */ -var isVimMode = function() { - var keyboardHandler = cvoxAce.editor.keyBinding.getKeyboardHandler(); - return keyboardHandler.$id === 'ace/keyboard/vim'; -}; - -/** - * Gets the current token. - * @param {!cvoxAce.Cursor} cursor Current position of the cursor. - * @return {!cvoxAce.Token} Token at the current position. - */ -var getCurrentToken = function(cursor) { - return cvoxAce.editor.getSession().getTokenAt(cursor.row, cursor.column + 1); -}; - -/** - * Gets the current line the cursor is under. - * @param {!cvoxAce.Cursor} cursor Current cursor position. - */ -var getCurrentLine = function(cursor) { - return cvoxAce.editor.getSession().getLine(cursor.row); -}; - -/** - * Event handler for row changes. When the user changes rows we want to speak - * the line so the user can work on this line. If shouldSpeakRowLocation is on - * then we speak the character, then the row, then the line so the user knows - * where the cursor is. - * @param {!cvoxAce.Cursor} currCursor Current cursor position. - */ -var onRowChange = function(currCursor) { - /* Notify that this line has an annotation. */ - if (annotTable[currCursor.row]) { - cvox.Api.playEarcon(ERROR_EARCON); - } - if (shouldSpeakRowLocation) { - cvox.Api.stop(); - speakChar(currCursor); - speakTokenQueue(getCurrentToken(currCursor)); - speakLine(currCursor.row, 1); - } else { - speakLine(currCursor.row, 0); - } -}; - -/** - * Returns whether the cursor is at the beginning of a word. A word is - * a grouping of alphanumeric characters including underscores. - * @param {!cvoxAce.Cursor} cursor Current cursor position. - * @return {boolean} Whether there is word. - */ -var isWord = function(cursor) { - var line = getCurrentLine(cursor); - var lineSuffix = line.substr(cursor.column - 1); - if (cursor.column === 0) { - lineSuffix = ' ' + line; - } - /* Use regex to tell if the suffix is at the start of a new word. */ - var firstWordRegExp = /^\W(\w+)/; - var words = firstWordRegExp.exec(lineSuffix); - return words !== null; -}; - -/** - * A mapping of syntax type to speech properties / expanding rules. - */ -var rules = { - 'constant': { - prop: CONSTANT_PROP - }, - 'entity': { - prop: ENTITY_PROP - }, - 'keyword': { - prop: KEYWORD_PROP - }, - 'storage': { - prop: STORAGE_PROP - }, - 'variable': { - prop: VARIABLE_PROP - }, - 'meta': { - prop: DEFAULT_PROP, - replace: [ - { - substr: '', - newSubstr: ' close tag ' - }, - { - substr: '<', - newSubstr: ' tag start ' - }, - { - substr: '>', - newSubstr: ' tag end ' - } - ] - } -}; - -/** - * Default rule to be used. - */ -var DEFAULT_RULE = { - prop: DEFAULT_RULE -}; - -/** - * Expands substrings to how they are read based on the given rules. - * @param {string} value Text to be expanded. - * @param {Array.} replaceRules Rules to determine expansion. - * @return {string} New expanded value. - */ -var expand = function(value, replaceRules) { - var newValue = value; - for (var i = 0; i < replaceRules.length; i++) { - var replaceRule = replaceRules[i]; - var regexp = new RegExp(replaceRule.substr, 'g'); - newValue = newValue.replace(regexp, replaceRule.newSubstr); - } - return newValue; -}; - -/** - * Merges tokens from start inclusive to end exclusive. - * @param {Array.} Tokens to be merged. - * @param {number} start Start index inclusive. - * @param {number} end End index exclusive. - * @return {cvoxAce.Token} Merged token. - */ -var mergeTokens = function(tokens, start, end) { - /* Different type of token found! Merge all previous like tokens. */ - var newToken = {}; - newToken.value = ''; - newToken.type = tokens[start].type; - for (var j = start; j < end; j++) { - newToken.value += tokens[j].value; - } - return newToken; -}; - -/** - * Merges tokens that use the same speech properties. - * @param {Array.} tokens Tokens to be merged. - * @return {Array.} Merged tokens. - */ -var mergeLikeTokens = function(tokens) { - if (tokens.length <= 1) { - return tokens; - } - var newTokens = []; - var lastLikeIndex = 0; - for (var i = 1; i < tokens.length; i++) { - var lastLikeToken = tokens[lastLikeIndex]; - var currToken = tokens[i]; - if (getTokenRule(lastLikeToken) !== getTokenRule(currToken)) { - newTokens.push(mergeTokens(tokens, lastLikeIndex, i)); - lastLikeIndex = i; - } - } - newTokens.push(mergeTokens(tokens, lastLikeIndex, tokens.length)); - return newTokens; -}; - -/** - * Returns if given row is a whitespace row. - * @param {number} row Row. - * @return {boolean} True if row is whitespaces. - */ -var isRowWhiteSpace = function(row) { - var line = cvoxAce.editor.getSession().getLine(row); - var whiteSpaceRegexp = /^\s*$/; - return whiteSpaceRegexp.exec(line) !== null; -}; - -/** - * Speak the line with syntax properties. - * @param {number} row Row to speak. - * @param {number} queue Queue mode to speak. - */ -var speakLine = function(row, queue) { - var tokens = cvoxAce.editor.getSession().getTokens(row); - if (tokens.length === 0 || isRowWhiteSpace(row)) { - cvox.Api.playEarcon('EDITABLE_TEXT'); - return; - } - tokens = mergeLikeTokens(tokens); - var firstToken = tokens[0]; - /* Filter out first token. */ - tokens = tokens.filter(function(token) { - return token !== firstToken; - }); - /* Speak first token separately to flush if queue. */ - speakToken_(firstToken, queue); - /* Speak rest of tokens. */ - tokens.forEach(speakTokenQueue); -}; - -/** - * Speak the token based on the syntax of the token, flushing. - * @param {!cvoxAce.Token} token Token to speak. - * @param {number} queue Queue mode. - */ -var speakTokenFlush = function(token) { - speakToken_(token, 0); -}; - -/** - * Speak the token based on the syntax of the token, queueing. - * @param {!cvoxAce.Token} token Token to speak. - * @param {number} queue Queue mode. - */ -var speakTokenQueue = function(token) { - speakToken_(token, 1); -}; - -/** - * @param {!cvoxAce.Token} token Token to speak. - * Get the token speech property. - */ -var getTokenRule = function(token) { - /* Types are period delimited. In this case, we only syntax speak the outer - * most type of token. */ - if (!token || !token.type) { - return; - } - var split = token.type.split('.'); - if (split.length === 0) { - return; - } - var type = split[0]; - var rule = rules[type]; - if (!rule) { - return DEFAULT_RULE; - } - return rule; -}; - -/** - * Speak the token based on the syntax of the token. - * @private - * @param {!cvoxAce.Token} token Token to speak. - * @param {number} queue Queue mode. - */ -var speakToken_ = function(token, queue) { - var rule = getTokenRule(token); - var value = expand(token.value, REPLACE_LIST); - if (rule.replace) { - value = expand(value, rule.replace); - } - cvox.Api.speak(value, queue, rule.prop); -}; - -/** - * Speaks the character under the cursor. This is queued. - * @param {!cvoxAce.Cursor} cursor Current cursor position. - * @return {string} Character. - */ -var speakChar = function(cursor) { - var line = getCurrentLine(cursor); - cvox.Api.speak(line[cursor.column], 1); -}; - -/** - * Speaks the jump from lastCursor to currCursor. This function assumes the - * jump takes place on the current line. - * @param {!cvoxAce.Cursor} lastCursor Previous cursor position. - * @param {!cvoxAce.Cursor} currCursor Current cursor position. - */ -var speakDisplacement = function(lastCursor, currCursor) { - var line = getCurrentLine(currCursor); - - /* Get the text that we jumped past. */ - var displace = line.substring(lastCursor.column, currCursor.column); - - /* Speak out loud spaces. */ - displace = displace.replace(/ /g, ' space '); - cvox.Api.speak(displace); -}; - -/** - * Speaks the word if the cursor jumped to a new word or to the beginning - * of the line. Otherwise speak the charactor. - * @param {!cvoxAce.Cursor} lastCursor Previous cursor position. - * @param {!cvoxAce.Cursor} currCursor Current cursor position. - */ -var speakCharOrWordOrLine = function(lastCursor, currCursor) { - /* Say word only if jump. */ - if (Math.abs(lastCursor.column - currCursor.column) !== 1) { - var currLineLength = getCurrentLine(currCursor).length; - /* Speak line if jumping to beginning or end of line. */ - if (currCursor.column === 0 || currCursor.column === currLineLength) { - speakLine(currCursor.row, 0); - return; - } - if (isWord(currCursor)) { - cvox.Api.stop(); - speakTokenQueue(getCurrentToken(currCursor)); - return; - } - } - speakChar(currCursor); -}; - -/** - * Event handler for column changes. If shouldSpeakDisplacement is on, then - * we just speak displacements in row changes. Otherwise, we either speak - * the character for single character movements, the word when jumping to the - * next word, or the entire line if jumping to beginning or end of the line. - * @param {!cvoxAce.Cursor} lastCursor Previous cursor position. - * @param {!cvoxAce.Cursor} currCursor Current cursor position. - */ -var onColumnChange = function(lastCursor, currCursor) { - if (!cvoxAce.editor.selection.isEmpty()) { - speakDisplacement(lastCursor, currCursor); - cvox.Api.speak('selected', 1); - } - else if (shouldSpeakDisplacement) { - speakDisplacement(lastCursor, currCursor); - } else { - speakCharOrWordOrLine(lastCursor, currCursor); - } -}; - -/** - * Event handler for cursor changes. Classify cursor changes as either row or - * column changes, then delegate accordingly. - * @param {!Event} evt The event. - */ -var onCursorChange = function(evt) { - /* Do not speak if cursor change was a result of text insertion. We want to - * speak the text that was inserted and not where the cursor lands. */ - if (changed) { - changed = false; - return; - } - var currCursor = cvoxAce.editor.selection.getCursor(); - if (currCursor.row !== lastCursor.row) { - onRowChange(currCursor); - } else { - onColumnChange(lastCursor, currCursor); - } - lastCursor = currCursor; -}; - -/** - * Event handler for selection changes. - * @param {!Event} evt The event. - */ -var onSelectionChange = function(evt) { - /* Assumes that when selection changes to empty, the user has unselected. */ - if (cvoxAce.editor.selection.isEmpty()) { - cvox.Api.speak('unselected'); - } -}; - -/** - * Event handler for source changes. We want auditory feedback for inserting - * and deleting text. - * @param {!Event} evt The event. - */ -var onChange = function(delta) { - switch (data.action) { - case 'remove': - cvox.Api.speak(data.text, 0, DELETED_PROP); - /* Let the future cursor change event know it's from text change. */ - changed = true; - break; - case 'insert': - cvox.Api.speak(data.text, 0); - /* Let the future cursor change event know it's from text change. */ - changed = true; - break; - } -}; - -/** - * Returns whether or not the annotation is new. - * @param {!cvoxAce.Annotation} annot Annotation in question. - * @return {boolean} Whether annot is new. - */ -var isNewAnnotation = function(annot) { - var row = annot.row; - var col = annot.column; - return !annotTable[row] || !annotTable[row][col]; -}; - -/** - * Populates the annotation table. - * @param {!Array.} annotations Array of annotations. - */ -var populateAnnotations = function(annotations) { - annotTable = {}; - for (var i = 0; i < annotations.length; i++) { - var annotation = annotations[i]; - var row = annotation.row; - var col = annotation.column; - if (!annotTable[row]) { - annotTable[row] = {}; - } - annotTable[row][col] = annotation; - } -}; - -/** - * Event handler for annotation changes. We want to notify the user when an - * a new annotation appears. - * @param {!Event} evt Event. - */ -var onAnnotationChange = function(evt) { - var annotations = cvoxAce.editor.getSession().getAnnotations(); - var newAnnotations = annotations.filter(isNewAnnotation); - if (newAnnotations.length > 0) { - cvox.Api.playEarcon(ERROR_EARCON); - } - populateAnnotations(annotations); -}; - -/** - * Speak annotation. - * @param {!cvoxAce.Annotation} annot Annotation to speak. - */ -var speakAnnot = function(annot) { - var annotText = annot.type + ' ' + annot.text + ' on ' + - rowColToString(annot.row, annot.column); - annotText = annotText.replace(';', 'semicolon'); - cvox.Api.speak(annotText, 1); -}; - -/** - * Speak annotations in a row. - * @param {number} row Row of annotations to speak. - */ -var speakAnnotsByRow = function(row) { - var annots = annotTable[row]; - for (var col in annots) { - speakAnnot(annots[col]); - } -}; - -/** - * Get a string representation of a row and column. - * @param {boolean} row Zero indexed row. - * @param {boolean} col Zero indexed column. - * @return {string} Row and column to be spoken. - */ -var rowColToString = function(row, col) { - return 'row ' + (row + 1) + ' column ' + (col + 1); -}; - -/** - * Speaks the row and column. - */ -var speakCurrRowAndCol = function() { - cvox.Api.speak(rowColToString(lastCursor.row, lastCursor.column)); -}; - -/** - * Speaks all annotations. - */ -var speakAllAnnots = function() { - for (var row in annotTable) { - speakAnnotsByRow(row); - } -}; - -/** - * Speak the vim mode. If no vim mode, this function does nothing. - */ -var speakMode = function() { - if (!isVimMode()) { - return; - } - switch (cvoxAce.editor.keyBinding.$data.state) { - case INSERT_MODE_STATE: - cvox.Api.speak('Insert mode'); - break; - case COMMAND_MODE_STATE: - cvox.Api.speak('Command mode'); - break; - } -}; - -/** - * Toggle speak location. - */ -var toggleSpeakRowLocation = function() { - shouldSpeakRowLocation = !shouldSpeakRowLocation; - /* Auditory feedback of the change. */ - if (shouldSpeakRowLocation) { - cvox.Api.speak('Speak location on row change enabled.'); - } else { - cvox.Api.speak('Speak location on row change disabled.'); - } -}; - -/** - * Toggle speak displacement. - */ -var toggleSpeakDisplacement = function() { - shouldSpeakDisplacement = !shouldSpeakDisplacement; - /* Auditory feedback of the change. */ - if (shouldSpeakDisplacement) { - cvox.Api.speak('Speak displacement on column changes.'); - } else { - cvox.Api.speak('Speak current character or word on column changes.'); - } -}; - -/** - * Event handler for key down events. Gets the right shortcut from the map, - * and calls the associated function. - * @param {!Event} evt Keyboard event. - */ -var onKeyDown = function(evt) { - if (evt.ctrlKey && evt.shiftKey) { - var shortcut = keyCodeToShortcutMap[evt.keyCode]; - if (shortcut) { - shortcut.func(); - } - } -}; - -/** - * Event handler for status change events. Auditory feedback of changing - * between vim states. - * @param {!Event} evt Change status event. - * @param {!Object} editor Editor state. - */ -var onChangeStatus = function(evt, editor) { - if (!isVimMode()) { - return; - } - var state = editor.keyBinding.$data.state; - if (state === vimState) { - /* State hasn't changed, do nothing. */ - return; - } - switch (state) { - case INSERT_MODE_STATE: - cvox.Api.playEarcon(MODE_SWITCH_EARCON); - /* When in insert mode, we want to speak out keys as feedback. */ - cvox.Api.setKeyEcho(true); - break; - case COMMAND_MODE_STATE: - cvox.Api.playEarcon(MODE_SWITCH_EARCON); - /* When in command mode, we want don't speak out keys because those keys - * are not being inserted in the document. */ - cvox.Api.setKeyEcho(false); - break; - } - vimState = state; -}; - -/** - * Handles context menu events. This is a ChromeVox feature where hitting - * the shortcut ChromeVox + comma will open up a search bar where you can - * type in various commands. All keyboard shortcuts are also commands that - * can be invoked. This handles the event that ChromeVox sends to the page. - * @param {Event} evt Event received. - */ -var contextMenuHandler = function(evt) { - var cmd = evt.detail['customCommand']; - var shortcut = cmdToShortcutMap[cmd]; - if (shortcut) { - shortcut.func(); - /* ChromeVox will bring focus to an element near the cursor instead of the - * text input. */ - cvoxAce.editor.focus(); - } -}; - -/** - * Initialize the ChromeVox context menu. - */ -var initContextMenu = function() { - var ACTIONS = SHORTCUTS.map(function(shortcut) { - return { - desc: shortcut.desc + getKeyShortcutString(shortcut.keyCode), - cmd: shortcut.cmd - }; - }); - - /* Attach ContextMenuActions. */ - var body = document.querySelector('body'); - body.setAttribute('contextMenuActions', JSON.stringify(ACTIONS)); - - /* Listen for ContextMenu events. */ - body.addEventListener('ATCustomEvent', contextMenuHandler, true); -}; - -/** - * Event handler for find events. When there is a match, we want to speak the - * line we are now at. Otherwise, we want to notify the user there was no - * match - * @param {!Event} evt The event. - */ -var onFindSearchbox = function(evt) { - if (evt.match) { - /* There is still a match! Speak the line. */ - speakLine(lastCursor.row, 0); - } else { - /* No match, give auditory feedback! */ - cvox.Api.playEarcon(NO_MATCH_EARCON); - } -}; - -/** - * Focus to text input. - */ -var focus = function() { - cvoxAce.editor.focus(); -}; - -/** - * Shortcut definitions. - */ -var SHORTCUTS = [ - { - /* 1 key. */ - keyCode: 49, - func: function() { - speakAnnotsByRow(lastCursor.row); - }, - cmd: Command.SPEAK_ANNOT, - desc: 'Speak annotations on line' - }, - { - /* 2 key. */ - keyCode: 50, - func: speakAllAnnots, - cmd: Command.SPEAK_ALL_ANNOTS, - desc: 'Speak all annotations' - }, - { - /* 3 key. */ - keyCode: 51, - func: speakMode, - cmd: Command.SPEAK_MODE, - desc: 'Speak Vim mode' - }, - { - /* 4 key. */ - keyCode: 52, - func: toggleSpeakRowLocation, - cmd: Command.TOGGLE_LOCATION, - desc: 'Toggle speak row location' - }, - { - /* 5 key. */ - keyCode: 53, - func: speakCurrRowAndCol, - cmd: Command.SPEAK_ROW_COL, - desc: 'Speak row and column' - }, - { - /* 6 key. */ - keyCode: 54, - func: toggleSpeakDisplacement, - cmd: Command.TOGGLE_DISPLACEMENT, - desc: 'Toggle speak displacement' - }, - { - /* 7 key. */ - keyCode: 55, - func: focus, - cmd: Command.FOCUS_TEXT, - desc: 'Focus text' - } -]; - -/** - * Event handler for focus events. - */ -var onFocus = function() { - cvoxAce.editor = editor; - - /* Set up listeners. */ - editor.getSession().selection.on('changeCursor', onCursorChange); - editor.getSession().selection.on('changeSelection', onSelectionChange); - editor.getSession().on('change', onChange); - editor.getSession().on('changeAnnotation', onAnnotationChange); - editor.on('changeStatus', onChangeStatus); - editor.on('findSearchBox', onFindSearchbox); - editor.container.addEventListener('keydown', onKeyDown); - - lastCursor = editor.selection.getCursor(); -}; - -/** - * Initialize the theme. - * @param {Object} editor Editor to use. - */ -var init = function(editor) { - onFocus(); - - /* Construct maps. */ - SHORTCUTS.forEach(function(shortcut) { - keyCodeToShortcutMap[shortcut.keyCode] = shortcut; - cmdToShortcutMap[shortcut.cmd] = shortcut; - }); - - editor.on('focus', onFocus); - - /* Assume we start in command mode if vim. */ - if (isVimMode()) { - cvox.Api.setKeyEcho(false); - } - initContextMenu(); -}; - -/** - * Returns if cvox exists, and the api exists. - * @return {boolean} Whether not Cvox Api exists. - */ -function cvoxApiExists() { - return (typeof(cvox) !== 'undefined') && cvox && cvox.Api; -} - -/** - * Number of tries for Cvox loading. - * @type {number} - */ -var tries = 0; - -/** - * Max number of tries to watch for Cvox loading. - * @type {number} - */ -var MAX_TRIES = 15; - -/** - * Check for ChromeVox load. - * @param {Object} editor Editor to use. - */ -function watchForCvoxLoad(editor) { - if (cvoxApiExists()) { - init(editor); - } else { - tries++; - if (tries >= MAX_TRIES) { - return; - } - window.setTimeout(watchForCvoxLoad, 500, editor); - } -} - -var Editor = require('../editor').Editor; -require('../config').defineOptions(Editor.prototype, 'editor', { - enableChromevoxEnhancements: { - set: function(val) { - if (val) { - watchForCvoxLoad(this); - } - }, - value: true // turn it on by default or check for window.cvox - } -}); - -}); diff --git a/lib/ace/ext/elastic_tabstops_lite.js b/lib/ace/ext/elastic_tabstops_lite.js deleted file mode 100644 index 0f89423a..00000000 --- a/lib/ace/ext/elastic_tabstops_lite.js +++ /dev/null @@ -1,318 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var ElasticTabstopsLite = function(editor) { - this.$editor = editor; - var self = this; - var changedRows = []; - var recordChanges = false; - this.onAfterExec = function() { - recordChanges = false; - self.processRows(changedRows); - changedRows = []; - }; - this.onExec = function() { - recordChanges = true; - }; - this.onChange = function(delta) { - if (recordChanges) { - if (changedRows.indexOf(delta.start.row) == -1) - changedRows.push(delta.start.row); - if (delta.end.row != delta.start.row) - changedRows.push(delta.end.row); - } - }; -}; - -(function() { - this.processRows = function(rows) { - this.$inChange = true; - var checkedRows = []; - - for (var r = 0, rowCount = rows.length; r < rowCount; r++) { - var row = rows[r]; - - if (checkedRows.indexOf(row) > -1) - continue; - - var cellWidthObj = this.$findCellWidthsForBlock(row); - var cellWidths = this.$setBlockCellWidthsToMax(cellWidthObj.cellWidths); - var rowIndex = cellWidthObj.firstRow; - - for (var w = 0, l = cellWidths.length; w < l; w++) { - var widths = cellWidths[w]; - checkedRows.push(rowIndex); - this.$adjustRow(rowIndex, widths); - rowIndex++; - } - } - this.$inChange = false; - }; - - this.$findCellWidthsForBlock = function(row) { - var cellWidths = [], widths; - - // starting row and backward - var rowIter = row; - while (rowIter >= 0) { - widths = this.$cellWidthsForRow(rowIter); - if (widths.length == 0) - break; - - cellWidths.unshift(widths); - rowIter--; - } - var firstRow = rowIter + 1; - - // forward (not including starting row) - rowIter = row; - var numRows = this.$editor.session.getLength(); - - while (rowIter < numRows - 1) { - rowIter++; - - widths = this.$cellWidthsForRow(rowIter); - if (widths.length == 0) - break; - - cellWidths.push(widths); - } - - return { cellWidths: cellWidths, firstRow: firstRow }; - }; - - this.$cellWidthsForRow = function(row) { - var selectionColumns = this.$selectionColumnsForRow(row); - // todo: support multicursor - - var tabs = [-1].concat(this.$tabsForRow(row)); - var widths = tabs.map(function(el) { return 0; } ).slice(1); - var line = this.$editor.session.getLine(row); - - for (var i = 0, len = tabs.length - 1; i < len; i++) { - var leftEdge = tabs[i]+1; - var rightEdge = tabs[i+1]; - - var rightmostSelection = this.$rightmostSelectionInCell(selectionColumns, rightEdge); - var cell = line.substring(leftEdge, rightEdge); - widths[i] = Math.max(cell.replace(/\s+$/g,'').length, rightmostSelection - leftEdge); - } - - return widths; - }; - - this.$selectionColumnsForRow = function(row) { - var selections = [], cursor = this.$editor.getCursorPosition(); - if (this.$editor.session.getSelection().isEmpty()) { - // todo: support multicursor - if (row == cursor.row) - selections.push(cursor.column); - } - - return selections; - }; - - this.$setBlockCellWidthsToMax = function(cellWidths) { - var startingNewBlock = true, blockStartRow, blockEndRow, maxWidth; - var columnInfo = this.$izip_longest(cellWidths); - - for (var c = 0, l = columnInfo.length; c < l; c++) { - var column = columnInfo[c]; - if (!column.push) { - console.error(column); - continue; - } - // add an extra None to the end so that the end of the column automatically - // finishes a block - column.push(NaN); - - for (var r = 0, s = column.length; r < s; r++) { - var width = column[r]; - if (startingNewBlock) { - blockStartRow = r; - maxWidth = 0; - startingNewBlock = false; - } - if (isNaN(width)) { - // block ended - blockEndRow = r; - - for (var j = blockStartRow; j < blockEndRow; j++) { - cellWidths[j][c] = maxWidth; - } - startingNewBlock = true; - } - - maxWidth = Math.max(maxWidth, width); - } - } - - return cellWidths; - }; - - this.$rightmostSelectionInCell = function(selectionColumns, cellRightEdge) { - var rightmost = 0; - - if (selectionColumns.length) { - var lengths = []; - for (var s = 0, length = selectionColumns.length; s < length; s++) { - if (selectionColumns[s] <= cellRightEdge) - lengths.push(s); - else - lengths.push(0); - } - rightmost = Math.max.apply(Math, lengths); - } - - return rightmost; - }; - - this.$tabsForRow = function(row) { - var rowTabs = [], line = this.$editor.session.getLine(row), - re = /\t/g, match; - - while ((match = re.exec(line)) != null) { - rowTabs.push(match.index); - } - - return rowTabs; - }; - - this.$adjustRow = function(row, widths) { - var rowTabs = this.$tabsForRow(row); - - if (rowTabs.length == 0) - return; - - var bias = 0, location = -1; - - // this always only contains two elements, so we're safe in the loop below - var expandedSet = this.$izip(widths, rowTabs); - - for (var i = 0, l = expandedSet.length; i < l; i++) { - var w = expandedSet[i][0], it = expandedSet[i][1]; - location += 1 + w; - it += bias; - var difference = location - it; - - if (difference == 0) - continue; - - var partialLine = this.$editor.session.getLine(row).substr(0, it ); - var strippedPartialLine = partialLine.replace(/\s*$/g, ""); - var ispaces = partialLine.length - strippedPartialLine.length; - - if (difference > 0) { - // put the spaces after the tab and then delete the tab, so any insertion - // points behave as expected - this.$editor.session.getDocument().insertInLine({row: row, column: it + 1}, Array(difference + 1).join(" ") + "\t"); - this.$editor.session.getDocument().removeInLine(row, it, it + 1); - - bias += difference; - } - - if (difference < 0 && ispaces >= -difference) { - this.$editor.session.getDocument().removeInLine(row, it + difference, it); - bias += difference; - } - } - }; - - // the is a (naive) Python port--but works for these purposes - this.$izip_longest = function(iterables) { - if (!iterables[0]) - return []; - var longest = iterables[0].length; - var iterablesLength = iterables.length; - - for (var i = 1; i < iterablesLength; i++) { - var iLength = iterables[i].length; - if (iLength > longest) - longest = iLength; - } - - var expandedSet = []; - - for (var l = 0; l < longest; l++) { - var set = []; - for (var i = 0; i < iterablesLength; i++) { - if (iterables[i][l] === "") - set.push(NaN); - else - set.push(iterables[i][l]); - } - - expandedSet.push(set); - } - - - return expandedSet; - }; - - // an even more (naive) Python port - this.$izip = function(widths, tabs) { - // grab the shorter size - var size = widths.length >= tabs.length ? tabs.length : widths.length; - - var expandedSet = []; - for (var i = 0; i < size; i++) { - var set = [ widths[i], tabs[i] ]; - expandedSet.push(set); - } - return expandedSet; - }; - -}).call(ElasticTabstopsLite.prototype); - -exports.ElasticTabstopsLite = ElasticTabstopsLite; - -var Editor = require("../editor").Editor; -require("../config").defineOptions(Editor.prototype, "editor", { - useElasticTabstops: { - set: function(val) { - if (val) { - if (!this.elasticTabstops) - this.elasticTabstops = new ElasticTabstopsLite(this); - this.commands.on("afterExec", this.elasticTabstops.onAfterExec); - this.commands.on("exec", this.elasticTabstops.onExec); - this.on("change", this.elasticTabstops.onChange); - } else if (this.elasticTabstops) { - this.commands.removeListener("afterExec", this.elasticTabstops.onAfterExec); - this.commands.removeListener("exec", this.elasticTabstops.onExec); - this.removeListener("change", this.elasticTabstops.onChange); - } - } - } -}); - -}); \ No newline at end of file diff --git a/lib/ace/ext/emmet.js b/lib/ace/ext/emmet.js deleted file mode 100644 index 4faacef2..00000000 --- a/lib/ace/ext/emmet.js +++ /dev/null @@ -1,434 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; -var HashHandler = require("ace/keyboard/hash_handler").HashHandler; -var Editor = require("ace/editor").Editor; -var snippetManager = require("ace/snippets").snippetManager; -var Range = require("ace/range").Range; -var emmet, emmetPath; - -/** - * Implementation of {@link IEmmetEditor} interface for Ace - */ -function AceEmmetEditor() {} - -AceEmmetEditor.prototype = { - setupContext: function(editor) { - this.ace = editor; - this.indentation = editor.session.getTabString(); - if (!emmet) - emmet = window.emmet; - emmet.require("resources").setVariable("indentation", this.indentation); - this.$syntax = null; - this.$syntax = this.getSyntax(); - }, - /** - * Returns character indexes of selected text: object with start - * and end properties. If there's no selection, should return - * object with start and end properties referring - * to current caret position - * @return {Object} - * @example - * var selection = editor.getSelectionRange(); - * alert(selection.start + ', ' + selection.end); - */ - getSelectionRange: function() { - // TODO should start be caret position instead? - var range = this.ace.getSelectionRange(); - var doc = this.ace.session.doc; - return { - start: doc.positionToIndex(range.start), - end: doc.positionToIndex(range.end) - }; - }, - - /** - * Creates selection from start to end character - * indexes. If end is ommited, this method should place caret - * and start index - * @param {Number} start - * @param {Number} [end] - * @example - * editor.createSelection(10, 40); - * - * //move caret to 15th character - * editor.createSelection(15); - */ - createSelection: function(start, end) { - var doc = this.ace.session.doc; - this.ace.selection.setRange({ - start: doc.indexToPosition(start), - end: doc.indexToPosition(end) - }); - }, - - /** - * Returns current line's start and end indexes as object with start - * and end properties - * @return {Object} - * @example - * var range = editor.getCurrentLineRange(); - * alert(range.start + ', ' + range.end); - */ - getCurrentLineRange: function() { - var ace = this.ace; - var row = ace.getCursorPosition().row; - var lineLength = ace.session.getLine(row).length; - var index = ace.session.doc.positionToIndex({row: row, column: 0}); - return { - start: index, - end: index + lineLength - }; - }, - - /** - * Returns current caret position - * @return {Number|null} - */ - getCaretPos: function(){ - var pos = this.ace.getCursorPosition(); - return this.ace.session.doc.positionToIndex(pos); - }, - - /** - * Set new caret position - * @param {Number} index Caret position - */ - setCaretPos: function(index){ - var pos = this.ace.session.doc.indexToPosition(index); - this.ace.selection.moveToPosition(pos); - }, - - /** - * Returns content of current line - * @return {String} - */ - getCurrentLine: function() { - var row = this.ace.getCursorPosition().row; - return this.ace.session.getLine(row); - }, - - /** - * Replace editor's content or it's part (from start to - * end index). If value contains - * caret_placeholder, the editor will put caret into - * this position. If you skip start and end - * arguments, the whole target's content will be replaced with - * value. - * - * If you pass start argument only, - * the value will be placed at start string - * index of current content. - * - * If you pass start and end arguments, - * the corresponding substring of current target's content will be - * replaced with value. - * @param {String} value Content you want to paste - * @param {Number} [start] Start index of editor's content - * @param {Number} [end] End index of editor's content - * @param {Boolean} [noIndent] Do not auto indent value - */ - replaceContent: function(value, start, end, noIndent) { - if (end == null) - end = start == null ? this.getContent().length : start; - if (start == null) - start = 0; - - var editor = this.ace; - var doc = editor.session.doc; - var range = Range.fromPoints(doc.indexToPosition(start), doc.indexToPosition(end)); - editor.session.remove(range); - - range.end = range.start; - //editor.selection.setRange(range); - - value = this.$updateTabstops(value); - snippetManager.insertSnippet(editor, value); - }, - - /** - * Returns editor's content - * @return {String} - */ - getContent: function(){ - return this.ace.getValue(); - }, - - /** - * Returns current editor's syntax mode - * @return {String} - */ - getSyntax: function() { - if (this.$syntax) - return this.$syntax; - var syntax = this.ace.session.$modeId.split("/").pop(); - if (syntax == "html" || syntax == "php") { - var cursor = this.ace.getCursorPosition(); - var state = this.ace.session.getState(cursor.row); - if (typeof state != "string") - state = state[0]; - if (state) { - state = state.split("-"); - if (state.length > 1) - syntax = state[0]; - else if (syntax == "php") - syntax = "html"; - } - } - return syntax; - }, - - /** - * Returns current output profile name (@see emmet#setupProfile) - * @return {String} - */ - getProfileName: function() { - switch(this.getSyntax()) { - case "css": return "css"; - case "xml": - case "xsl": - return "xml"; - case "html": - var profile = emmet.require("resources").getVariable("profile"); - // no forced profile, guess from content html or xhtml? - if (!profile) - profile = this.ace.session.getLines(0,2).join("").search(/]+XHTML/i) != -1 ? "xhtml": "html"; - return profile; - } - return "xhtml"; - }, - - /** - * Ask user to enter something - * @param {String} title Dialog title - * @return {String} Entered data - * @since 0.65 - */ - prompt: function(title) { - return prompt(title); - }, - - /** - * Returns current selection - * @return {String} - * @since 0.65 - */ - getSelection: function() { - return this.ace.session.getTextRange(); - }, - - /** - * Returns current editor's file path - * @return {String} - * @since 0.65 - */ - getFilePath: function() { - return ""; - }, - - // update tabstops: make sure all caret placeholders are unique - // by default, abbreviation parser generates all unlinked (un-mirrored) - // tabstops as ${0}, so we have upgrade all caret tabstops with unique - // positions but make sure that all other tabstops are not linked accidentally - // based on https://github.com/sergeche/emmet-sublime/blob/master/editor.js#L119-L171 - $updateTabstops: function(value) { - var base = 1000; - var zeroBase = 0; - var lastZero = null; - var range = emmet.require('range'); - var ts = emmet.require('tabStops'); - var settings = emmet.require('resources').getVocabulary("user"); - var tabstopOptions = { - tabstop: function(data) { - var group = parseInt(data.group, 10); - var isZero = group === 0; - if (isZero) - group = ++zeroBase; - else - group += base; - - var placeholder = data.placeholder; - if (placeholder) { - // recursively update nested tabstops - placeholder = ts.processText(placeholder, tabstopOptions); - } - - var result = '${' + group + (placeholder ? ':' + placeholder : '') + '}'; - - if (isZero) { - lastZero = range.create(data.start, result); - } - - return result; - }, - escape: function(ch) { - if (ch == '$') return '\\$'; - if (ch == '\\') return '\\\\'; - return ch; - } - }; - - value = ts.processText(value, tabstopOptions); - - if (settings.variables['insert_final_tabstop'] && !/\$\{0\}$/.test(value)) { - value += '${0}'; - } else if (lastZero) { - value = emmet.require('utils').replaceSubstring(value, '${0}', lastZero); - } - - return value; - } -}; - - -var keymap = { - expand_abbreviation: {"mac": "ctrl+alt+e", "win": "alt+e"}, - match_pair_outward: {"mac": "ctrl+d", "win": "ctrl+,"}, - match_pair_inward: {"mac": "ctrl+j", "win": "ctrl+shift+0"}, - matching_pair: {"mac": "ctrl+alt+j", "win": "alt+j"}, - next_edit_point: "alt+right", - prev_edit_point: "alt+left", - toggle_comment: {"mac": "command+/", "win": "ctrl+/"}, - split_join_tag: {"mac": "shift+command+'", "win": "shift+ctrl+`"}, - remove_tag: {"mac": "command+'", "win": "shift+ctrl+;"}, - evaluate_math_expression: {"mac": "shift+command+y", "win": "shift+ctrl+y"}, - increment_number_by_1: "ctrl+up", - decrement_number_by_1: "ctrl+down", - increment_number_by_01: "alt+up", - decrement_number_by_01: "alt+down", - increment_number_by_10: {"mac": "alt+command+up", "win": "shift+alt+up"}, - decrement_number_by_10: {"mac": "alt+command+down", "win": "shift+alt+down"}, - select_next_item: {"mac": "shift+command+.", "win": "shift+ctrl+."}, - select_previous_item: {"mac": "shift+command+,", "win": "shift+ctrl+,"}, - reflect_css_value: {"mac": "shift+command+r", "win": "shift+ctrl+r"}, - - encode_decode_data_url: {"mac": "shift+ctrl+d", "win": "ctrl+'"}, - // update_image_size: {"mac": "shift+ctrl+i", "win": "ctrl+u"}, - // expand_as_you_type: "ctrl+alt+enter", - // wrap_as_you_type: {"mac": "shift+ctrl+g", "win": "shift+ctrl+g"}, - expand_abbreviation_with_tab: "Tab", - wrap_with_abbreviation: {"mac": "shift+ctrl+a", "win": "shift+ctrl+a"} -}; - -var editorProxy = new AceEmmetEditor(); -exports.commands = new HashHandler(); -exports.runEmmetCommand = function(editor) { - try { - editorProxy.setupContext(editor); - if (editorProxy.getSyntax() == "php") - return false; - var actions = emmet.require("actions"); - - if (this.action == "expand_abbreviation_with_tab") { - if (!editor.selection.isEmpty()) - return false; - } - - if (this.action == "wrap_with_abbreviation") { - // without setTimeout prompt doesn't work on firefox - return setTimeout(function() { - actions.run("wrap_with_abbreviation", editorProxy); - }, 0); - } - - var pos = editor.selection.lead; - var token = editor.session.getTokenAt(pos.row, pos.column); - if (token && /\btag\b/.test(token.type)) - return false; - - var result = actions.run(this.action, editorProxy); - } catch(e) { - editor._signal("changeStatus", typeof e == "string" ? e : e.message); - console.log(e); - result = false; - } - return result; -}; - -for (var command in keymap) { - exports.commands.addCommand({ - name: "emmet:" + command, - action: command, - bindKey: keymap[command], - exec: exports.runEmmetCommand, - multiSelectAction: "forEach" - }); -} - -exports.updateCommands = function(editor, enabled) { - if (enabled) { - editor.keyBinding.addKeyboardHandler(exports.commands); - } else { - editor.keyBinding.removeKeyboardHandler(exports.commands); - } -}; - -exports.isSupportedMode = function(modeId) { - return modeId && /css|less|scss|sass|stylus|html|php|twig|ejs|handlebars/.test(modeId); -}; - -var onChangeMode = function(e, target) { - var editor = target; - if (!editor) - return; - var enabled = exports.isSupportedMode(editor.session.$modeId); - if (e.enableEmmet === false) - enabled = false; - if (enabled) { - if (typeof emmetPath == "string") { - require("ace/config").loadModule(emmetPath, function() { - emmetPath = null; - }); - } - } - exports.updateCommands(editor, enabled); -}; - -exports.AceEmmetEditor = AceEmmetEditor; -require("ace/config").defineOptions(Editor.prototype, "editor", { - enableEmmet: { - set: function(val) { - this[val ? "on" : "removeListener"]("changeMode", onChangeMode); - onChangeMode({enableEmmet: !!val}, this); - }, - value: true - } -}); - -exports.setCore = function(e) { - if (typeof e == "string") - emmetPath = e; - else - emmet = e; -}; -}); - diff --git a/lib/ace/ext/error_marker.js b/lib/ace/ext/error_marker.js deleted file mode 100644 index 5dbe3d2e..00000000 --- a/lib/ace/ext/error_marker.js +++ /dev/null @@ -1,214 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; -var LineWidgets = require("../line_widgets").LineWidgets; -var dom = require("../lib/dom"); -var Range = require("../range").Range; - -function binarySearch(array, needle, comparator) { - var first = 0; - var last = array.length - 1; - - while (first <= last) { - var mid = (first + last) >> 1; - var c = comparator(needle, array[mid]); - if (c > 0) - first = mid + 1; - else if (c < 0) - last = mid - 1; - else - return mid; - } - - // Return the nearest lesser index, "-1" means "0, "-2" means "1", etc. - return -(first + 1); -} - -function findAnnotations(session, row, dir) { - var annotations = session.getAnnotations().sort(Range.comparePoints); - if (!annotations.length) - return; - - var i = binarySearch(annotations, {row: row, column: -1}, Range.comparePoints); - if (i < 0) - i = -i - 1; - - if (i >= annotations.length) - i = dir > 0 ? 0 : annotations.length - 1; - else if (i === 0 && dir < 0) - i = annotations.length - 1; - - var annotation = annotations[i]; - if (!annotation || !dir) - return; - - if (annotation.row === row) { - do { - annotation = annotations[i += dir]; - } while (annotation && annotation.row === row); - if (!annotation) - return annotations.slice(); - } - - - var matched = []; - row = annotation.row; - do { - matched[dir < 0 ? "unshift" : "push"](annotation); - annotation = annotations[i += dir]; - } while (annotation && annotation.row == row); - return matched.length && matched; -} - -exports.showErrorMarker = function(editor, dir) { - var session = editor.session; - if (!session.widgetManager) { - session.widgetManager = new LineWidgets(session); - session.widgetManager.attach(editor); - } - - var pos = editor.getCursorPosition(); - var row = pos.row; - var oldWidget = session.lineWidgets && session.lineWidgets[row]; - if (oldWidget) { - oldWidget.destroy(); - } else { - row -= dir; - } - var annotations = findAnnotations(session, row, dir); - var gutterAnno; - if (annotations) { - var annotation = annotations[0]; - pos.column = (annotation.pos && typeof annotation.column != "number" - ? annotation.pos.sc - : annotation.column) || 0; - pos.row = annotation.row; - gutterAnno = editor.renderer.$gutterLayer.$annotations[pos.row]; - } else if (oldWidget) { - return; - } else { - gutterAnno = { - text: ["Looks good!"], - className: "ace_ok" - }; - } - editor.session.unfold(pos.row); - editor.selection.moveToPosition(pos); - - var w = { - row: pos.row, - fixedWidth: true, - coverGutter: true, - el: dom.createElement("div") - }; - var el = w.el.appendChild(dom.createElement("div")); - var arrow = w.el.appendChild(dom.createElement("div")); - arrow.className = "error_widget_arrow " + gutterAnno.className; - - var left = editor.renderer.$cursorLayer - .getPixelPosition(pos).left; - arrow.style.left = left + editor.renderer.gutterWidth - 5 + "px"; - - w.el.className = "error_widget_wrapper"; - el.className = "error_widget " + gutterAnno.className; - el.innerHTML = gutterAnno.text.join("
                                                                                                                                                                                                                                                                                                                                                                                                                                                              "); - - el.appendChild(dom.createElement("div")); - - var kb = function(_, hashId, keyString) { - if (hashId === 0 && (keyString === "esc" || keyString === "return")) { - w.destroy(); - return {command: "null"}; - } - }; - - w.destroy = function() { - if (editor.$mouseHandler.isMousePressed) - return; - editor.keyBinding.removeKeyboardHandler(kb); - session.widgetManager.removeLineWidget(w); - editor.off("changeSelection", w.destroy); - editor.off("changeSession", w.destroy); - editor.off("mouseup", w.destroy); - editor.off("change", w.destroy); - }; - - editor.keyBinding.addKeyboardHandler(kb); - editor.on("changeSelection", w.destroy); - editor.on("changeSession", w.destroy); - editor.on("mouseup", w.destroy); - editor.on("change", w.destroy); - - editor.session.widgetManager.addLineWidget(w); - - w.el.onmousedown = editor.focus.bind(editor); - - editor.renderer.scrollCursorIntoView(null, 0.5, {bottom: w.el.offsetHeight}); -}; - - -dom.importCssString("\ - .error_widget_wrapper {\ - background: inherit;\ - color: inherit;\ - border:none\ - }\ - .error_widget {\ - border-top: solid 2px;\ - border-bottom: solid 2px;\ - margin: 5px 0;\ - padding: 10px 40px;\ - white-space: pre-wrap;\ - }\ - .error_widget.ace_error, .error_widget_arrow.ace_error{\ - border-color: #ff5a5a\ - }\ - .error_widget.ace_warning, .error_widget_arrow.ace_warning{\ - border-color: #F1D817\ - }\ - .error_widget.ace_info, .error_widget_arrow.ace_info{\ - border-color: #5a5a5a\ - }\ - .error_widget.ace_ok, .error_widget_arrow.ace_ok{\ - border-color: #5aaa5a\ - }\ - .error_widget_arrow {\ - position: absolute;\ - border: solid 5px;\ - border-top-color: transparent!important;\ - border-right-color: transparent!important;\ - border-left-color: transparent!important;\ - top: -5px;\ - }\ -", ""); - -}); \ No newline at end of file diff --git a/lib/ace/ext/keybinding_menu.js b/lib/ace/ext/keybinding_menu.js deleted file mode 100644 index bf8189a5..00000000 --- a/lib/ace/ext/keybinding_menu.js +++ /dev/null @@ -1,86 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2013 Matthew Christopher Kastor-Inare III, Atropa Inc. Intl - * All rights reserved. - * - * Contributed to Ajax.org under the BSD license. - * - * 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 ***** */ - -/*jslint indent: 4, maxerr: 50, white: true, browser: true, vars: true*/ -/*global define, require */ - -/** - * Show Keyboard Shortcuts - * @fileOverview Show Keyboard Shortcuts
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * Generates a menu which displays the keyboard shortcuts. - * @author - * Matthew Christopher Kastor-Inare III
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ☭ Hial Atropa!! ☭ - */ - -define(function(require, exports, module) { - "use strict"; - var Editor = require("ace/editor").Editor; - /** - * Generates a menu which displays the keyboard shortcuts. - * @author - * Matthew Christopher Kastor-Inare III
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ☭ Hial Atropa!! ☭ - * @param {ace.Editor} editor An instance of the ace editor. - */ - function showKeyboardShortcuts (editor) { - // make sure the menu isn't open already. - if(!document.getElementById('kbshortcutmenu')) { - var overlayPage = require('./menu_tools/overlay_page').overlayPage; - var getEditorKeybordShortcuts = require('./menu_tools/get_editor_keyboard_shortcuts').getEditorKeybordShortcuts; - var kb = getEditorKeybordShortcuts(editor); - var el = document.createElement('div'); - var commands = kb.reduce(function(previous, current) { - return previous + '
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ' - + current.command + ' : ' - + '' + current.key + '
                                                                                                                                                                                                                                                                                                                                                                                                                                                              '; - }, ''); - - el.id = 'kbshortcutmenu'; - el.innerHTML = '

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Keyboard Shortcuts

                                                                                                                                                                                                                                                                                                                                                                                                                                                              ' + commands + ''; - overlayPage(editor, el, '0', '0', '0', null); - } - }; - module.exports.init = function(editor) { - Editor.prototype.showKeyboardShortcuts = function() { - showKeyboardShortcuts(this); - }; - editor.commands.addCommands([{ - name: "showKeyboardShortcuts", - bindKey: {win: "Ctrl-Alt-h", mac: "Command-Alt-h"}, - exec: function(editor, line) { - editor.showKeyboardShortcuts(); - } - }]); - }; - -}); \ No newline at end of file diff --git a/lib/ace/ext/language_tools.js b/lib/ace/ext/language_tools.js deleted file mode 100644 index 563fe58a..00000000 --- a/lib/ace/ext/language_tools.js +++ /dev/null @@ -1,225 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var snippetManager = require("../snippets").snippetManager; -var Autocomplete = require("../autocomplete").Autocomplete; -var config = require("../config"); -var lang = require("../lib/lang"); -var util = require("../autocomplete/util"); - -var textCompleter = require("../autocomplete/text_completer"); -var keyWordCompleter = { - getCompletions: function(editor, session, pos, prefix, callback) { - if (session.$mode.completer) { - return session.$mode.completer.getCompletions(editor, session, pos, prefix, callback); - } - var state = editor.session.getState(pos.row); - var completions = session.$mode.getCompletions(state, session, pos, prefix); - callback(null, completions); - } -}; - -var snippetCompleter = { - getCompletions: function(editor, session, pos, prefix, callback) { - var snippetMap = snippetManager.snippetMap; - var completions = []; - snippetManager.getActiveScopes(editor).forEach(function(scope) { - var snippets = snippetMap[scope] || []; - for (var i = snippets.length; i--;) { - var s = snippets[i]; - var caption = s.name || s.tabTrigger; - if (!caption) - continue; - completions.push({ - caption: caption, - snippet: s.content, - meta: s.tabTrigger && !s.name ? s.tabTrigger + "\u21E5 " : "snippet", - type: "snippet" - }); - } - }, this); - callback(null, completions); - }, - getDocTooltip: function(item) { - if (item.type == "snippet" && !item.docHTML) { - item.docHTML = [ - "", lang.escapeHTML(item.caption), "", "
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ", - lang.escapeHTML(item.snippet) - ].join(""); - } - } -}; - -var completers = [snippetCompleter, textCompleter, keyWordCompleter]; -// Allows default completers to be removed or replaced with a explict set of completers -// A null argument here will result in an empty completer array, not a null attribute -exports.setCompleters = function(val) { - completers = val || []; -}; -exports.addCompleter = function(completer) { - completers.push(completer); -}; - -// Exports existing completer so that user can construct his own set of completers. -exports.textCompleter = textCompleter; -exports.keyWordCompleter = keyWordCompleter; -exports.snippetCompleter = snippetCompleter; - -var expandSnippet = { - name: "expandSnippet", - exec: function(editor) { - return snippetManager.expandWithTab(editor); - }, - bindKey: "Tab" -}; - -var onChangeMode = function(e, editor) { - loadSnippetsForMode(editor.session.$mode); -}; - -var loadSnippetsForMode = function(mode) { - var id = mode.$id; - if (!snippetManager.files) - snippetManager.files = {}; - loadSnippetFile(id); - if (mode.modes) - mode.modes.forEach(loadSnippetsForMode); -}; - -var loadSnippetFile = function(id) { - if (!id || snippetManager.files[id]) - return; - var snippetFilePath = id.replace("mode", "snippets"); - snippetManager.files[id] = {}; - config.loadModule(snippetFilePath, function(m) { - if (m) { - snippetManager.files[id] = m; - if (!m.snippets && m.snippetText) - m.snippets = snippetManager.parseSnippetFile(m.snippetText); - snippetManager.register(m.snippets || [], m.scope); - if (m.includeScopes) { - snippetManager.snippetMap[m.scope].includeScopes = m.includeScopes; - m.includeScopes.forEach(function(x) { - loadSnippetFile("ace/mode/" + x); - }); - } - } - }); -}; - -function getCompletionPrefix(editor) { - var pos = editor.getCursorPosition(); - var line = editor.session.getLine(pos.row); - var prefix; - // Try to find custom prefixes on the completers - editor.completers.forEach(function(completer) { - if (completer.identifierRegexps) { - completer.identifierRegexps.forEach(function(identifierRegex) { - if (!prefix && identifierRegex) - prefix = util.retrievePrecedingIdentifier(line, pos.column, identifierRegex); - }); - } - }); - return prefix || util.retrievePrecedingIdentifier(line, pos.column); -} - -var doLiveAutocomplete = function(e) { - var editor = e.editor; - var hasCompleter = editor.completer && editor.completer.activated; - - // We don't want to autocomplete with no prefix - if (e.command.name === "backspace") { - if (hasCompleter && !getCompletionPrefix(editor)) - editor.completer.detach(); - } - else if (e.command.name === "insertstring") { - var prefix = getCompletionPrefix(editor); - // Only autocomplete if there's a prefix that can be matched - if (prefix && !hasCompleter) { - if (!editor.completer) { - // Create new autocompleter - editor.completer = new Autocomplete(); - } - // Disable autoInsert - editor.completer.autoInsert = false; - editor.completer.showPopup(editor); - } - } -}; - -var Editor = require("../editor").Editor; -require("../config").defineOptions(Editor.prototype, "editor", { - enableBasicAutocompletion: { - set: function(val) { - if (val) { - if (!this.completers) - this.completers = Array.isArray(val)? val: completers; - this.commands.addCommand(Autocomplete.startCommand); - } else { - this.commands.removeCommand(Autocomplete.startCommand); - } - }, - value: false - }, - /** - * Enable live autocomplete. If the value is an array, it is assumed to be an array of completers - * and will use them instead of the default completers. - */ - enableLiveAutocompletion: { - set: function(val) { - if (val) { - if (!this.completers) - this.completers = Array.isArray(val)? val: completers; - // On each change automatically trigger the autocomplete - this.commands.on('afterExec', doLiveAutocomplete); - } else { - this.commands.removeListener('afterExec', doLiveAutocomplete); - } - }, - value: false - }, - enableSnippets: { - set: function(val) { - if (val) { - this.commands.addCommand(expandSnippet); - this.on("changeMode", onChangeMode); - onChangeMode(null, this); - } else { - this.commands.removeCommand(expandSnippet); - this.off("changeMode", onChangeMode); - } - }, - value: false - } -}); -}); diff --git a/lib/ace/ext/linking.js b/lib/ace/ext/linking.js deleted file mode 100644 index cfd333b2..00000000 --- a/lib/ace/ext/linking.js +++ /dev/null @@ -1,78 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -var Editor = require("ace/editor").Editor; - -require("../config").defineOptions(Editor.prototype, "editor", { - enableLinking: { - set: function(val) { - if (val) { - this.on("click", onClick); - this.on("mousemove", onMouseMove); - } else { - this.off("click", onClick); - this.off("mousemove", onMouseMove); - } - }, - value: false - } -}) - -function onMouseMove(e) { - var editor = e.editor; - var ctrl = e.getAccelKey(); - - if (ctrl) { - var editor = e.editor; - var docPos = e.getDocumentPosition(); - var session = editor.session; - var token = session.getTokenAt(docPos.row, docPos.column); - - editor._emit("linkHover", {position: docPos, token: token}); - } -} - -function onClick(e) { - var ctrl = e.getAccelKey(); - var button = e.getButton(); - - if (button == 0 && ctrl) { - var editor = e.editor; - var docPos = e.getDocumentPosition(); - var session = editor.session; - var token = session.getTokenAt(docPos.row, docPos.column); - - editor._emit("linkClick", {position: docPos, token: token}); - } -} - -}); diff --git a/lib/ace/ext/menu_tools/add_editor_menu_options.js b/lib/ace/ext/menu_tools/add_editor_menu_options.js deleted file mode 100644 index eb90e31d..00000000 --- a/lib/ace/ext/menu_tools/add_editor_menu_options.js +++ /dev/null @@ -1,109 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2013 Matthew Christopher Kastor-Inare III, Atropa Inc. Intl - * All rights reserved. - * - * Contributed to Ajax.org under the BSD license. - * - * 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 ***** */ - -/*jslint indent: 4, maxerr: 50, white: true, browser: true, vars: true*/ -/*global define, require */ - -/** - * Add Editor Menu Options - * @fileOverview Add Editor Menu Options
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * The menu options property needs to be added to the editor - * so that the settings menu can know about options for - * selection elements and track which option is selected. - * @author - * Matthew Christopher Kastor-Inare III
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ☭ Hial Atropa!! ☭ - */ - -define(function(require, exports, module) { -'use strict'; - -/** - * The menu options property needs to be added to the editor - * so that the settings menu can know about options for - * selection elements and track which option is selected. - * @author - * Matthew Christopher Kastor-Inare III
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ☭ Hial Atropa!! ☭ - * @param {ace.Editor} editor An instance of the ace editor. - */ -module.exports.addEditorMenuOptions = function addEditorMenuOptions (editor) { - var modelist = require('../modelist'); - var themelist = require('../themelist'); - editor.menuOptions = { - setNewLineMode: [{ - textContent: "unix", - value: "unix" - }, { - textContent: "windows", - value: "windows" - }, { - textContent: "auto", - value: "auto" - }], - setTheme: [], - setMode: [], - setKeyboardHandler: [{ - textContent: "ace", - value: "" - }, { - textContent: "vim", - value: "ace/keyboard/vim" - }, { - textContent: "emacs", - value: "ace/keyboard/emacs" - }, { - textContent: "textarea", - value: "ace/keyboard/textarea" - }, { - textContent: "sublime", - value: "ace/keyboard/sublime" - }] - }; - - editor.menuOptions.setTheme = themelist.themes.map(function(theme) { - return { - textContent: theme.caption, - value: theme.theme - }; - }); - - editor.menuOptions.setMode = modelist.modes.map(function(mode) { - return { - textContent: mode.name, - value: mode.mode - }; - }); -}; - - -}); diff --git a/lib/ace/ext/menu_tools/element_generator.js b/lib/ace/ext/menu_tools/element_generator.js deleted file mode 100644 index ec6ba93b..00000000 --- a/lib/ace/ext/menu_tools/element_generator.js +++ /dev/null @@ -1,148 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2013 Matthew Christopher Kastor-Inare III, Atropa Inc. Intl - * All rights reserved. - * - * Contributed to Ajax.org under the BSD license. - * - * 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 ***** */ - -/*jslint indent: 4, maxerr: 50, white: true, browser: true, vars: true*/ -/*global define, require */ - -/** - * Element Generator - * @fileOverview Element Generator
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * Contains methods for generating elements. - * @author - * Matthew Christopher Kastor-Inare III
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ☭ Hial Atropa!! ☭ - */ - -define(function(require, exports, module) { -'use strict'; -/** - * Creates a DOM option element - * @author - * Matthew Christopher Kastor-Inare III
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ☭ Hial Atropa!! ☭ - * @param {object} obj An object containing properties to add to the dom - * element. If one of those properties is named `selected` then it will be - * added as an attribute on the element instead. - */ -module.exports.createOption = function createOption (obj) { - var attribute; - var el = document.createElement('option'); - for(attribute in obj) { - if(obj.hasOwnProperty(attribute)) { - if(attribute === 'selected') { - el.setAttribute(attribute, obj[attribute]); - } else { - el[attribute] = obj[attribute]; - } - } - } - return el; -}; -/** - * Creates a DOM checkbox element. - * @author - * Matthew Christopher Kastor-Inare III
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ☭ Hial Atropa!! ☭ - * @param {string} id The id of the element. - * @param {boolean} checked Whether or not the element is checked. - * @param {string} clss The class of the element. - * @returns {DOMElement} Returns a checkbox element reference. - */ -module.exports.createCheckbox = function createCheckbox (id, checked, clss) { - var el = document.createElement('input'); - el.setAttribute('type', 'checkbox'); - el.setAttribute('id', id); - el.setAttribute('name', id); - el.setAttribute('value', checked); - el.setAttribute('class', clss); - if(checked) { - el.setAttribute('checked', 'checked'); - } - return el; -}; -/** - * Creates a DOM text input element. - * @author - * Matthew Christopher Kastor-Inare III
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ☭ Hial Atropa!! ☭ - * @param {string} id The id of the element. - * @param {string} value The default value of the input element. - * @param {string} clss The class of the element. - * @returns {DOMElement} Returns an input element reference. - */ -module.exports.createInput = function createInput (id, value, clss) { - var el = document.createElement('input'); - el.setAttribute('type', 'text'); - el.setAttribute('id', id); - el.setAttribute('name', id); - el.setAttribute('value', value); - el.setAttribute('class', clss); - return el; -}; -/** - * Creates a DOM label element. - * @author - * Matthew Christopher Kastor-Inare III
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ☭ Hial Atropa!! ☭ - * @param {string} text The label text. - * @param {string} labelFor The id of the element being labeled. - * @returns {DOMElement} Returns a label element reference. - */ -module.exports.createLabel = function createLabel (text, labelFor) { - var el = document.createElement('label'); - el.setAttribute('for', labelFor); - el.textContent = text; - return el; -}; -/** - * Creates a DOM selection element. - * @author - * Matthew Christopher Kastor-Inare III
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ☭ Hial Atropa!! ☭ - * @param {string} id The id of the element. - * @param {string} values An array of objects suitable for `createOption` - * @param {string} clss The class of the element. - * @returns {DOMElement} Returns a selection element reference. - * @see ace/ext/element_generator.createOption - */ -module.exports.createSelection = function createSelection (id, values, clss) { - var el = document.createElement('select'); - el.setAttribute('id', id); - el.setAttribute('name', id); - el.setAttribute('class', clss); - values.forEach(function(item) { - el.appendChild(module.exports.createOption(item)); - }); - return el; -}; - -}); \ No newline at end of file diff --git a/lib/ace/ext/menu_tools/generate_settings_menu.js b/lib/ace/ext/menu_tools/generate_settings_menu.js deleted file mode 100644 index 2ee1ae09..00000000 --- a/lib/ace/ext/menu_tools/generate_settings_menu.js +++ /dev/null @@ -1,264 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2013 Matthew Christopher Kastor-Inare III, Atropa Inc. Intl - * All rights reserved. - * - * Contributed to Ajax.org under the BSD license. - * - * 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 ***** */ - -/*jslint indent: 4, maxerr: 50, white: true, browser: true, vars: true*/ -/*global define*/ - -/** - * Generates the settings menu - * @fileOverview Generates the settings menu. - * @author - * Matthew Christopher Kastor-Inare III
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ☭ Hial Atropa!! ☭ - */ - -define(function(require, exports, module) { -'use strict'; -var egen = require('./element_generator'); -var addEditorMenuOptions = require('./add_editor_menu_options').addEditorMenuOptions; -var getSetFunctions = require('./get_set_functions').getSetFunctions; - -/** - * Generates an interactive menu with settings useful to end users. - * @author - * Matthew Christopher Kastor-Inare III
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ☭ Hial Atropa!! ☭ - * @param {ace.Editor} editor An instance of the ace editor. - */ -module.exports.generateSettingsMenu = function generateSettingsMenu (editor) { - /** - * container for dom elements that will go in the menu. - * @author - * Matthew Christopher Kastor-Inare III
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ☭ Hial Atropa!! ☭ - */ - var elements = []; - /** - * Sorts the menu entries (elements var) so they'll appear in alphabetical order - * the sort is performed based on the value of the contains property - * of each element. Since this is an `array.sort` the array is sorted - * in place. - * @author - * Matthew Christopher Kastor-Inare III
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ☭ Hial Atropa!! ☭ - */ - function cleanupElementsList() { - elements.sort(function(a, b) { - var x = a.getAttribute('contains'); - var y = b.getAttribute('contains'); - return x.localeCompare(y); - }); - } - /** - * Wraps all dom elements contained in the elements var with a single - * div. - * @author - * Matthew Christopher Kastor-Inare III
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ☭ Hial Atropa!! ☭ - */ - function wrapElements() { - var topmenu = document.createElement('div'); - topmenu.setAttribute('id', 'ace_settingsmenu'); - elements.forEach(function(element) { - topmenu.appendChild(element); - }); - - var el = topmenu.appendChild(document.createElement('div')); - var version = "1.1.9"; - el.style.padding = "1em"; - el.textContent = "Ace version " + version; - - return topmenu; - } - /** - * Creates a new menu entry. - * @author - * Matthew Christopher Kastor-Inare III
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ☭ Hial Atropa!! ☭ - * @param {object} obj This is a reference to the object containing the - * set function. It is used to set up event listeners for when the - * menu options change. - * @param {string} clss Maps to the class of the dom element. This is - * the name of the object containing the set function e.g. `editor`, - * `session`, `renderer`. - * @param {string} item This is the set function name. It maps to the - * id of the dom element (check, select, input) and to the "contains" - * attribute of the div holding both the element and its label. - * @param {mixed} val This is the value of the setting. It is mapped to - * the dom element's value, checked, or selected option accordingly. - */ - function createNewEntry(obj, clss, item, val) { - var el; - var div = document.createElement('div'); - div.setAttribute('contains', item); - div.setAttribute('class', 'ace_optionsMenuEntry'); - div.setAttribute('style', 'clear: both;'); - - div.appendChild(egen.createLabel( - item.replace(/^set/, '').replace(/([A-Z])/g, ' $1').trim(), - item - )); - - if (Array.isArray(val)) { - el = egen.createSelection(item, val, clss); - el.addEventListener('change', function(e) { - try{ - editor.menuOptions[e.target.id].forEach(function(x) { - if(x.textContent !== e.target.textContent) { - delete x.selected; - } - }); - obj[e.target.id](e.target.value); - } catch (err) { - throw new Error(err); - } - }); - } else if(typeof val === 'boolean') { - el = egen.createCheckbox(item, val, clss); - el.addEventListener('change', function(e) { - try{ - // renderer['setHighlightGutterLine'](true); - obj[e.target.id](!!e.target.checked); - } catch (err) { - throw new Error(err); - } - }); - } else { - // this aids in giving the ability to specify settings through - // post and get requests. - // /ace_editor.html?setMode=ace/mode/html&setOverwrite=true - el = egen.createInput(item, val, clss); - el.addEventListener('change', function(e) { - try{ - if(e.target.value === 'true') { - obj[e.target.id](true); - } else if(e.target.value === 'false') { - obj[e.target.id](false); - } else { - obj[e.target.id](e.target.value); - } - } catch (err) { - throw new Error(err); - } - }); - } - el.style.cssText = 'float:right;'; - div.appendChild(el); - return div; - } - /** - * Generates selection fields for the menu and populates their options - * using information from `editor.menuOptions` - * @author - * Matthew Christopher Kastor-Inare III
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ☭ Hial Atropa!! ☭ - * @param {string} item The set function name. - * @param {object} esr A reference to the object having the set function. - * @param {string} clss The name of the object containing the set function. - * @param {string} fn The matching get function's function name. - * @returns {DOMElement} Returns a dom element containing a selection - * element populated with options. The option whose value matches that - * returned from `esr[fn]()` will be selected. - */ - function makeDropdown(item, esr, clss, fn) { - var val = editor.menuOptions[item]; - var currentVal = esr[fn](); - if (typeof currentVal == 'object') - currentVal = currentVal.$id; - val.forEach(function(valuex) { - if (valuex.value === currentVal) - valuex.selected = 'selected'; - }); - return createNewEntry(esr, clss, item, val); - } - /** - * Processes the set functions returned from `getSetFunctions`. First it - * checks for menu options defined in `editor.menuOptions`. If no - * options are specified then it checks whether there is a get function - * (replace set with get) for the setting. When either of those - * conditions are met it will attempt to create a new entry for the - * settings menu and push it into the elements array defined above. - * It can only do so for get functions which return - * strings, numbers, and booleans. A special case is written in for - * `getMode` where it looks at the returned objects `$id` property and - * forwards that through instead. Other special cases could be written - * in but that would get a bit ridiculous. - * @author - * Matthew Christopher Kastor-Inare III
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ☭ Hial Atropa!! ☭ - * @param {object} setObj An item from the array returned by - * `getSetFunctions`. - */ - function handleSet(setObj) { - var item = setObj.functionName; - var esr = setObj.parentObj; - var clss = setObj.parentName; - var val; - var fn = item.replace(/^set/, 'get'); - if(editor.menuOptions[item] !== undefined) { - // has options for select element - elements.push(makeDropdown(item, esr, clss, fn)); - } else if(typeof esr[fn] === 'function') { - // has get function - try { - val = esr[fn](); - if(typeof val === 'object') { - // setMode takes a string, getMode returns an object - // the $id property of that object is the string - // which may be given to setMode... - val = val.$id; - } - // the rest of the get functions return strings, - // booleans, or numbers. - elements.push( - createNewEntry(esr, clss, item, val) - ); - } catch (e) { - // if there are errors it is because the element - // does not belong in the settings menu - } - } - } - addEditorMenuOptions(editor); - // gather the set functions - getSetFunctions(editor).forEach(function(setObj) { - // populate the elements array with good stuff. - handleSet(setObj); - }); - // sort the menu entries in the elements list so people can find - // the settings in alphabetical order. - cleanupElementsList(); - // dump the entries from the elements list and wrap them up in a div - return wrapElements(); -}; - -}); \ No newline at end of file diff --git a/lib/ace/ext/menu_tools/get_editor_keyboard_shortcuts.js b/lib/ace/ext/menu_tools/get_editor_keyboard_shortcuts.js deleted file mode 100644 index 99e006b0..00000000 --- a/lib/ace/ext/menu_tools/get_editor_keyboard_shortcuts.js +++ /dev/null @@ -1,91 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2013 Matthew Christopher Kastor-Inare III, Atropa Inc. Intl - * All rights reserved. - * - * Contributed to Ajax.org under the BSD license. - * - * 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 ***** */ - -/*jslint indent: 4, maxerr: 50, white: true, browser: true, vars: true*/ -/*global define, require */ - -/** - * Get Editor Keyboard Shortcuts - * @fileOverview Get Editor Keyboard Shortcuts
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * Gets a map of keyboard shortcuts to command names for the current platform. - * @author - * Matthew Christopher Kastor-Inare III
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ☭ Hial Atropa!! ☭ - */ - -define(function(require, exports, module) { -"use strict"; -var keys = require("../../lib/keys"); - -/** - * Gets a map of keyboard shortcuts to command names for the current platform. - * @author - * Matthew Christopher Kastor-Inare III
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ☭ Hial Atropa!! ☭ - * @param {ace.Editor} editor An editor instance. - * @returns {Array} Returns an array of objects representing the keyboard - * shortcuts for the given editor. - * @example - * var getKbShortcuts = require('./get_keyboard_shortcuts'); - * console.log(getKbShortcuts(editor)); - * // [ - * // {'command' : aCommand, 'key' : 'Control-d'}, - * // {'command' : aCommand, 'key' : 'Control-d'} - * // ] - */ -module.exports.getEditorKeybordShortcuts = function(editor) { - var KEY_MODS = keys.KEY_MODS; - var keybindings = []; - var commandMap = {}; - editor.keyBinding.$handlers.forEach(function(handler) { - var ckb = handler.commandKeyBinding; - for (var i in ckb) { - var key = i.replace(/(^|-)\w/g, function(x) { return x.toUpperCase(); }); - var commands = ckb[i]; - if (!Array.isArray(commands)) - commands = [commands]; - commands.forEach(function(command) { - if (typeof command != "string") - command = command.name - if (commandMap[command]) { - commandMap[command].key += "|" + key; - } else { - commandMap[command] = {key: key, command: command}; - keybindings.push(commandMap[command]); - } - }); - } - }); - return keybindings; -}; - -}); \ No newline at end of file diff --git a/lib/ace/ext/menu_tools/get_set_functions.js b/lib/ace/ext/menu_tools/get_set_functions.js deleted file mode 100644 index 4cd65508..00000000 --- a/lib/ace/ext/menu_tools/get_set_functions.js +++ /dev/null @@ -1,141 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2013 Matthew Christopher Kastor-Inare III, Atropa Inc. Intl - * All rights reserved. - * - * Contributed to Ajax.org under the BSD license. - * - * 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 ***** */ - -/*jslint indent: 4, maxerr: 50, white: true, browser: true, vars: true */ -/*global define*/ - -/** - * Get Set Functions - * @fileOverview Get Set Functions
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * Gets various functions for setting settings. - * @author - * Matthew Christopher Kastor-Inare III
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ☭ Hial Atropa!! ☭ - */ - -define(function(require, exports, module) { -'use strict'; -/** - * Generates a list of set functions for the settings menu. - * @author - * Matthew Christopher Kastor-Inare III
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ☭ Hial Atropa!! ☭ - * @param {object} editor The editor instance - * @return {array} Returns an array of objects. Each object contains the - * following properties: functionName, parentObj, and parentName. The - * function name will be the name of a method beginning with the string - * `set` which was found. The parent object will be a reference to the - * object having the method matching the function name. The parent name - * will be a string representing the identifier of the parent object e.g. - * `editor`, `session`, or `renderer`. - */ -module.exports.getSetFunctions = function getSetFunctions (editor) { - /** - * Output array. Will hold the objects described above. - * @author - * Matthew Christopher Kastor-Inare III
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ☭ Hial Atropa!! ☭ - */ - var out = []; - /** - * This object provides a map between the objects which will be - * traversed and the parent name which will appear in the output. - * @author - * Matthew Christopher Kastor-Inare III
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ☭ Hial Atropa!! ☭ - */ - var my = { - 'editor' : editor, - 'session' : editor.session, - 'renderer' : editor.renderer - }; - /** - * This array will hold the set function names which have already been - * found so that they are not added to the output multiple times. - * @author - * Matthew Christopher Kastor-Inare III
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ☭ Hial Atropa!! ☭ - */ - var opts = []; - /** - * This is a list of set functions which will not appear in the settings - * menu. I don't know what to do with setKeyboardHandler. When I tried - * to use it, it didn't appear to be working. Someone who knows better - * could remove it from this list and add it's options to - * add_editor_menu_options.js - * @author - * Matthew Christopher Kastor-Inare III
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ☭ Hial Atropa!! ☭ - */ - var skip = [ - 'setOption', - 'setUndoManager', - 'setDocument', - 'setValue', - 'setBreakpoints', - 'setScrollTop', - 'setScrollLeft', - 'setSelectionStyle', - 'setWrapLimitRange' - ]; - - - /** - * This will search the objects mapped to the `my` variable above. When - * it finds a set function in the object that is not listed in the - * `skip` list or the `opts` list it will push a new object to the - * output array. - * @author - * Matthew Christopher Kastor-Inare III
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ☭ Hial Atropa!! ☭ - */ - ['renderer', 'session', 'editor'].forEach(function(esra) { - var esr = my[esra]; - var clss = esra; - for(var fn in esr) { - if(skip.indexOf(fn) === -1) { - if(/^set/.test(fn) && opts.indexOf(fn) === -1) { - // found set function - opts.push(fn); - out.push({ - 'functionName' : fn, - 'parentObj' : esr, - 'parentName' : clss - }); - } - } - } - }); - return out; -}; - -}); \ No newline at end of file diff --git a/lib/ace/ext/menu_tools/overlay_page.js b/lib/ace/ext/menu_tools/overlay_page.js deleted file mode 100644 index bf985e29..00000000 --- a/lib/ace/ext/menu_tools/overlay_page.js +++ /dev/null @@ -1,116 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2013 Matthew Christopher Kastor-Inare III, Atropa Inc. Intl - * All rights reserved. - * - * Contributed to Ajax.org under the BSD license. - * - * 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 ***** */ - -/*jslint indent: 4, maxerr: 50, white: true, browser: true, vars: true*/ -/*global define, require */ - -/** - * Overlay Page - * @fileOverview Overlay Page
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * Generates an overlay for displaying menus. The overlay is an absolutely - * positioned div. - * @author - * Matthew Christopher Kastor-Inare III
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ☭ Hial Atropa!! ☭ - */ - -define(function(require, exports, module) { -'use strict'; -var dom = require("../../lib/dom"); -var cssText = require("../../requirejs/text!./settings_menu.css"); -dom.importCssString(cssText); - -/** - * Generates an overlay for displaying menus. The overlay is an absolutely - * positioned div. - * @author - * Matthew Christopher Kastor-Inare III
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ☭ Hial Atropa!! ☭ - * @param {DOMElement} contentElement Any element which may be presented inside - * a div. - * @param {string|number} top absolute position value. - * @param {string|number} right absolute position value. - * @param {string|number} bottom absolute position value. - * @param {string|number} left absolute position value. - */ -module.exports.overlayPage = function overlayPage(editor, contentElement, top, right, bottom, left) { - top = top ? 'top: ' + top + ';' : ''; - bottom = bottom ? 'bottom: ' + bottom + ';' : ''; - right = right ? 'right: ' + right + ';' : ''; - left = left ? 'left: ' + left + ';' : ''; - - var closer = document.createElement('div'); - var contentContainer = document.createElement('div'); - - function documentEscListener(e) { - if (e.keyCode === 27) { - closer.click(); - } - } - - closer.style.cssText = 'margin: 0; padding: 0; ' + - 'position: fixed; top:0; bottom:0; left:0; right:0;' + - 'z-index: 9990; ' + - 'background-color: rgba(0, 0, 0, 0.3);'; - closer.addEventListener('click', function() { - document.removeEventListener('keydown', documentEscListener); - closer.parentNode.removeChild(closer); - editor.focus(); - closer = null; - }); - // click closer if esc key is pressed - document.addEventListener('keydown', documentEscListener); - - contentContainer.style.cssText = top + right + bottom + left; - contentContainer.addEventListener('click', function(e) { - e.stopPropagation(); - }); - - var wrapper = dom.createElement("div"); - wrapper.style.position = "relative"; - - var closeButton = dom.createElement("div"); - closeButton.className = "ace_closeButton"; - closeButton.addEventListener('click', function() { - closer.click(); - }); - - wrapper.appendChild(closeButton); - contentContainer.appendChild(wrapper); - - contentContainer.appendChild(contentElement); - closer.appendChild(contentContainer); - document.body.appendChild(closer); - editor.blur(); -}; - -}); \ No newline at end of file diff --git a/lib/ace/ext/menu_tools/settings_menu.css b/lib/ace/ext/menu_tools/settings_menu.css deleted file mode 100644 index f8b761ce..00000000 --- a/lib/ace/ext/menu_tools/settings_menu.css +++ /dev/null @@ -1,48 +0,0 @@ -#ace_settingsmenu, #kbshortcutmenu { - background-color: #F7F7F7; - color: black; - box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55); - padding: 1em 0.5em 2em 1em; - overflow: auto; - position: absolute; - margin: 0; - bottom: 0; - right: 0; - top: 0; - z-index: 9991; - cursor: default; -} - -.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu { - box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25); - background-color: rgba(255, 255, 255, 0.6); - color: black; -} - -.ace_optionsMenuEntry:hover { - background-color: rgba(100, 100, 100, 0.1); - -webkit-transition: all 0.5s; - transition: all 0.3s -} - -.ace_closeButton { - background: rgba(245, 146, 146, 0.5); - border: 1px solid #F48A8A; - border-radius: 50%; - padding: 7px; - position: absolute; - right: -8px; - top: -8px; - z-index: 1000; -} -.ace_closeButton{ - background: rgba(245, 146, 146, 0.9); -} -.ace_optionsMenuKey { - color: darkslateblue; - font-weight: bold; -} -.ace_optionsMenuCommand { - color: darkcyan; - font-weight: normal; -} \ No newline at end of file diff --git a/lib/ace/ext/modelist.js b/lib/ace/ext/modelist.js deleted file mode 100644 index 675a4b85..00000000 --- a/lib/ace/ext/modelist.js +++ /dev/null @@ -1,197 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -var modes = []; -/** - * Suggests a mode based on the file extension present in the given path - * @param {string} path The path to the file - * @returns {object} Returns an object containing information about the - * suggested mode. - */ -function getModeForPath(path) { - var mode = modesByName.text; - var fileName = path.split(/[\/\\]/).pop(); - for (var i = 0; i < modes.length; i++) { - if (modes[i].supportsFile(fileName)) { - mode = modes[i]; - break; - } - } - return mode; -} - -var Mode = function(name, caption, extensions) { - this.name = name; - this.caption = caption; - this.mode = "ace/mode/" + name; - this.extensions = extensions; - if (/\^/.test(extensions)) { - var re = extensions.replace(/\|(\^)?/g, function(a, b){ - return "$|" + (b ? "^" : "^.*\\."); - }) + "$"; - } else { - var re = "^.*\\.(" + extensions + ")$"; - } - - this.extRe = new RegExp(re, "gi"); -}; - -Mode.prototype.supportsFile = function(filename) { - return filename.match(this.extRe); -}; - -// todo firstlinematch -var supportedModes = { - ABAP: ["abap"], - ABC: ["abc"], - ActionScript:["as"], - ADA: ["ada|adb"], - Apache_Conf: ["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"], - AsciiDoc: ["asciidoc|adoc"], - Assembly_x86:["asm"], - AutoHotKey: ["ahk"], - BatchFile: ["bat|cmd"], - C9Search: ["c9search_results"], - C_Cpp: ["cpp|c|cc|cxx|h|hh|hpp"], - Cirru: ["cirru|cr"], - Clojure: ["clj|cljs"], - Cobol: ["CBL|COB"], - coffee: ["coffee|cf|cson|^Cakefile"], - ColdFusion: ["cfm"], - CSharp: ["cs"], - CSS: ["css"], - Curly: ["curly"], - D: ["d|di"], - Dart: ["dart"], - Diff: ["diff|patch"], - Dockerfile: ["^Dockerfile"], - Dot: ["dot"], - Dummy: ["dummy"], - DummySyntax: ["dummy"], - Eiffel: ["e"], - EJS: ["ejs"], - Elixir: ["ex|exs"], - Elm: ["elm"], - Erlang: ["erl|hrl"], - Forth: ["frt|fs|ldr"], - FTL: ["ftl"], - Gcode: ["gcode"], - Gherkin: ["feature"], - Gitignore: ["^.gitignore"], - Glsl: ["glsl|frag|vert"], - golang: ["go"], - Groovy: ["groovy"], - HAML: ["haml"], - Handlebars: ["hbs|handlebars|tpl|mustache"], - Haskell: ["hs"], - haXe: ["hx"], - HTML: ["html|htm|xhtml"], - HTML_Ruby: ["erb|rhtml|html.erb"], - INI: ["ini|conf|cfg|prefs"], - Io: ["io"], - Jack: ["jack"], - Jade: ["jade"], - Java: ["java"], - JavaScript: ["js|jsm"], - JSON: ["json"], - JSONiq: ["jq"], - JSP: ["jsp"], - JSX: ["jsx"], - Julia: ["jl"], - LaTeX: ["tex|latex|ltx|bib"], - Lean: ["lean|hlean"], - LESS: ["less"], - Liquid: ["liquid"], - Lisp: ["lisp"], - LiveScript: ["ls"], - LogiQL: ["logic|lql"], - LSL: ["lsl"], - Lua: ["lua"], - LuaPage: ["lp"], - Lucene: ["lucene"], - Makefile: ["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"], - Markdown: ["md|markdown"], - Mask: ["mask"], - MATLAB: ["matlab"], - MEL: ["mel"], - MUSHCode: ["mc|mush"], - MySQL: ["mysql"], - Nix: ["nix"], - Nim: ["nim"], - ObjectiveC: ["m|mm"], - OCaml: ["ml|mli"], - Pascal: ["pas|p"], - Perl: ["pl|pm"], - pgSQL: ["pgsql"], - PHP: ["php|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp"], - Powershell: ["ps1"], - Praat: ["praat|praatscript|psc|proc"], - Prolog: ["plg|prolog"], - Properties: ["properties"], - Protobuf: ["proto"], - Python: ["py"], - R: ["r"], - RDoc: ["Rd"], - RHTML: ["Rhtml"], - Ruby: ["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"], - Rust: ["rs"], - SASS: ["sass"], - SCAD: ["scad"], - Scala: ["scala"], - Scheme: ["scm|rkt"], - SCSS: ["scss"], - SH: ["sh|bash|^.bashrc"], - SJS: ["sjs"], - Smarty: ["smarty|tpl"], - snippets: ["snippets"], - Soy_Template:["soy"], - Space: ["space"], - SQL: ["sql"], - SQLServer: ["sqlserver"], - Stylus: ["styl|stylus"], - SVG: ["svg"], - Tcl: ["tcl"], - Tex: ["tex"], - Text: ["txt"], - Textile: ["textile"], - Toml: ["toml"], - Twig: ["twig"], - Typescript: ["ts|typescript|str"], - Vala: ["vala"], - VBScript: ["vbs|vb"], - Velocity: ["vm"], - Verilog: ["v|vh|sv|svh"], - VHDL: ["vhd|vhdl"], - XML: ["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"], - XQuery: ["xq"], - YAML: ["yaml|yml"], - // Add the missing mode "Django" to ext-modelist - Django: ["html"] -}; - -var nameOverrides = { - ObjectiveC: "Objective-C", - CSharp: "C#", - golang: "Go", - C_Cpp: "C and C++", - coffee: "CoffeeScript", - HTML_Ruby: "HTML (Ruby)", - FTL: "FreeMarker" -}; -var modesByName = {}; -for (var name in supportedModes) { - var data = supportedModes[name]; - var displayName = (nameOverrides[name] || name).replace(/_/g, " "); - var filename = name.toLowerCase(); - var mode = new Mode(filename, displayName, data[0]); - modesByName[filename] = mode; - modes.push(mode); -} - -module.exports = { - getModeForPath: getModeForPath, - modes: modes, - modesByName: modesByName -}; - -}); diff --git a/lib/ace/ext/old_ie.js b/lib/ace/ext/old_ie.js deleted file mode 100644 index 8b8ce977..00000000 --- a/lib/ace/ext/old_ie.js +++ /dev/null @@ -1,114 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; -var MAX_TOKEN_COUNT = 1000; -var useragent = require("../lib/useragent"); -var TokenizerModule = require("../tokenizer"); - -function patch(obj, name, regexp, replacement) { - eval("obj['" + name + "']=" + obj[name].toString().replace( - regexp, replacement - )); -} - -if (useragent.isIE && useragent.isIE < 10 && window.top.document.compatMode === "BackCompat") - useragent.isOldIE = true; - -if (typeof document != "undefined" && !document.documentElement.querySelector) { - useragent.isOldIE = true; - var qs = function(el, selector) { - if (selector.charAt(0) == ".") { - var classNeme = selector.slice(1); - } else { - var m = selector.match(/(\w+)=(\w+)/); - var attr = m && m[1]; - var attrVal = m && m[2]; - } - for (var i = 0; i < el.all.length; i++) { - var ch = el.all[i]; - if (classNeme) { - if (ch.className.indexOf(classNeme) != -1) - return ch; - } else if (attr) { - if (ch.getAttribute(attr) == attrVal) - return ch; - } - } - }; - var sb = require("./searchbox").SearchBox.prototype; - patch( - sb, "$initElements", - /([^\s=]*).querySelector\((".*?")\)/g, - "qs($1, $2)" - ); -} - -var compliantExecNpcg = /()??/.exec("")[1] === undefined; -if (compliantExecNpcg) - return; -var proto = TokenizerModule.Tokenizer.prototype; -TokenizerModule.Tokenizer_orig = TokenizerModule.Tokenizer; -proto.getLineTokens_orig = proto.getLineTokens; - -patch( - TokenizerModule, "Tokenizer", - "ruleRegExps.push(adjustedregex);\n", - function(m) { - return m + '\ - if (state[i].next && RegExp(adjustedregex).test(""))\n\ - rule._qre = RegExp(adjustedregex, "g");\n\ - '; - } -); -TokenizerModule.Tokenizer.prototype = proto; -patch( - proto, "getLineTokens", - /if \(match\[i \+ 1\] === undefined\)\s*continue;/, - "if (!match[i + 1]) {\n\ - if (value)continue;\n\ - var qre = state[mapping[i]]._qre;\n\ - if (!qre) continue;\n\ - qre.lastIndex = lastIndex;\n\ - if (!qre.exec(line) || qre.lastIndex != lastIndex)\n\ - continue;\n\ - }" -); - -patch( - require("../mode/text").Mode.prototype, "getTokenizer", - /Tokenizer/, - "TokenizerModule.Tokenizer" -); - -useragent.isOldIE = true; - -}); diff --git a/lib/ace/ext/old_ie_test.js b/lib/ace/ext/old_ie_test.js deleted file mode 100644 index 98652e14..00000000 --- a/lib/ace/ext/old_ie_test.js +++ /dev/null @@ -1,77 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -if (typeof process !== "undefined") { - require("amd-loader"); -} - -define(function(require, exports, module) { -"use strict"; - -var assert = require("../test/assertions"); - -module.exports = { - "test: getTokenizer() (smoke test)" : function() { - var exec = RegExp.prototype.exec - var brokenExec = function(str) { - var result = exec.call(this, str); - if (result) { - for (var i = result.length; i--;) - if (!result[i]) - result[i] = ""; - } - return result; - } - - try { - // break this to emulate old ie - RegExp.prototype.exec = brokenExec; - require("./old_ie"); - var Tokenizer = require("../tokenizer").Tokenizer; - var JavaScriptHighlightRules = require("../mode/javascript_highlight_rules").JavaScriptHighlightRules; - var tokenizer = new Tokenizer((new JavaScriptHighlightRules).getRules()); - - var tokens = tokenizer.getLineTokens("'juhu'", "start").tokens; - assert.equal("string", tokens[0].type); - } finally { - // restore modified functions - RegExp.prototype.exec = exec; - var module = require("../tokenizer"); - module.Tokenizer = module.Tokenizer_orig; - module.Tokenizer.prototype.getLineTokens = module.Tokenizer.prototype.getLineTokens_orig; - } - } -}; - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec() -} diff --git a/lib/ace/ext/searchbox.css b/lib/ace/ext/searchbox.css deleted file mode 100644 index 5de8d847..00000000 --- a/lib/ace/ext/searchbox.css +++ /dev/null @@ -1,153 +0,0 @@ - - -/* ------------------------------------------------------------------------------------------ - * Editor Search Form - * --------------------------------------------------------------------------------------- */ - .ace_search { - background-color: #ddd; - border: 1px solid #cbcbcb; - border-top: 0 none; - max-width: 325px; - overflow: hidden; - margin: 0; - padding: 4px; - padding-right: 6px; - padding-bottom: 0; - position: absolute; - top: 0px; - z-index: 99; - white-space: normal; -} -.ace_search.left { - border-left: 0 none; - border-radius: 0px 0px 5px 0px; - left: 0; -} -.ace_search.right { - border-radius: 0px 0px 0px 5px; - border-right: 0 none; - right: 0; -} - -.ace_search_form, .ace_replace_form { - border-radius: 3px; - border: 1px solid #cbcbcb; - float: left; - margin-bottom: 4px; - overflow: hidden; -} -.ace_search_form.ace_nomatch { - outline: 1px solid red; -} - -.ace_search_field { - background-color: white; - border-right: 1px solid #cbcbcb; - border: 0 none; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - float: left; - height: 22px; - outline: 0; - padding: 0 7px; - width: 214px; - margin: 0; -} -.ace_searchbtn, -.ace_replacebtn { - background: #fff; - border: 0 none; - border-left: 1px solid #dcdcdc; - cursor: pointer; - float: left; - height: 22px; - margin: 0; - padding: 0; - position: relative; -} -.ace_searchbtn:last-child, -.ace_replacebtn:last-child { - border-top-right-radius: 3px; - border-bottom-right-radius: 3px; -} -.ace_searchbtn:disabled { - background: none; - cursor: default; -} -.ace_searchbtn { - background-position: 50% 50%; - background-repeat: no-repeat; - width: 27px; -} -.ace_searchbtn.prev { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADFJREFUeNpiSU1NZUAC/6E0I0yACYskCpsJiySKIiY0SUZk40FyTEgCjGgKwTRAgAEAQJUIPCE+qfkAAAAASUVORK5CYII=); -} -.ace_searchbtn.next { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAYAAAB4ka1VAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADRJREFUeNpiTE1NZQCC/0DMyIAKwGJMUAYDEo3M/s+EpvM/mkKwCQxYjIeLMaELoLMBAgwAU7UJObTKsvAAAAAASUVORK5CYII=); -} -.ace_searchbtn_close { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0; - border-radius: 50%; - border: 0 none; - color: #656565; - cursor: pointer; - float: right; - font: 16px/16px Arial; - height: 14px; - margin: 5px 1px 9px 5px; - padding: 0; - text-align: center; - width: 14px; -} -.ace_searchbtn_close:hover { - background-color: #656565; - background-position: 50% 100%; - color: white; -} -.ace_replacebtn.prev { - width: 54px -} -.ace_replacebtn.next { - width: 27px -} - -.ace_button { - margin-left: 2px; - cursor: pointer; - -webkit-user-select: none; - -moz-user-select: none; - -o-user-select: none; - -ms-user-select: none; - user-select: none; - overflow: hidden; - opacity: 0.7; - border: 1px solid rgba(100,100,100,0.23); - padding: 1px; - -moz-box-sizing: border-box; - box-sizing: border-box; - color: black; -} - -.ace_button:hover { - background-color: #eee; - opacity:1; -} -.ace_button:active { - background-color: #ddd; -} - -.ace_button.checked { - border-color: #3399ff; - opacity:1; -} - -.ace_search_options{ - margin-bottom: 3px; - text-align: right; - -webkit-user-select: none; - -moz-user-select: none; - -o-user-select: none; - -ms-user-select: none; - user-select: none; -} \ No newline at end of file diff --git a/lib/ace/ext/searchbox.js b/lib/ace/ext/searchbox.js deleted file mode 100644 index b316aa75..00000000 --- a/lib/ace/ext/searchbox.js +++ /dev/null @@ -1,308 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var dom = require("../lib/dom"); -var lang = require("../lib/lang"); -var event = require("../lib/event"); -var searchboxCss = require("../requirejs/text!./searchbox.css"); -var HashHandler = require("../keyboard/hash_handler").HashHandler; -var keyUtil = require("../lib/keys"); - -dom.importCssString(searchboxCss, "ace_searchbox"); - -var html = ''.replace(/>\s+/g, ">"); - -var SearchBox = function(editor, range, showReplaceForm) { - var div = dom.createElement("div"); - div.innerHTML = html; - this.element = div.firstChild; - - this.$init(); - this.setEditor(editor); -}; - -(function() { - this.setEditor = function(editor) { - editor.searchBox = this; - editor.container.appendChild(this.element); - this.editor = editor; - }; - - this.$initElements = function(sb) { - this.searchBox = sb.querySelector(".ace_search_form"); - this.replaceBox = sb.querySelector(".ace_replace_form"); - this.searchOptions = sb.querySelector(".ace_search_options"); - this.regExpOption = sb.querySelector("[action=toggleRegexpMode]"); - this.caseSensitiveOption = sb.querySelector("[action=toggleCaseSensitive]"); - this.wholeWordOption = sb.querySelector("[action=toggleWholeWords]"); - this.searchInput = this.searchBox.querySelector(".ace_search_field"); - this.replaceInput = this.replaceBox.querySelector(".ace_search_field"); - }; - - this.$init = function() { - var sb = this.element; - - this.$initElements(sb); - - var _this = this; - event.addListener(sb, "mousedown", function(e) { - setTimeout(function(){ - _this.activeInput.focus(); - }, 0); - event.stopPropagation(e); - }); - event.addListener(sb, "click", function(e) { - var t = e.target || e.srcElement; - var action = t.getAttribute("action"); - if (action && _this[action]) - _this[action](); - else if (_this.$searchBarKb.commands[action]) - _this.$searchBarKb.commands[action].exec(_this); - event.stopPropagation(e); - }); - - event.addCommandKeyListener(sb, function(e, hashId, keyCode) { - var keyString = keyUtil.keyCodeToString(keyCode); - var command = _this.$searchBarKb.findKeyCommand(hashId, keyString); - if (command && command.exec) { - command.exec(_this); - event.stopEvent(e); - } - }); - - this.$onChange = lang.delayedCall(function() { - _this.find(false, false); - }); - - event.addListener(this.searchInput, "input", function() { - _this.$onChange.schedule(20); - }); - event.addListener(this.searchInput, "focus", function() { - _this.activeInput = _this.searchInput; - _this.searchInput.value && _this.highlight(); - }); - event.addListener(this.replaceInput, "focus", function() { - _this.activeInput = _this.replaceInput; - _this.searchInput.value && _this.highlight(); - }); - }; - - //keybinging outsite of the searchbox - this.$closeSearchBarKb = new HashHandler([{ - bindKey: "Esc", - name: "closeSearchBar", - exec: function(editor) { - editor.searchBox.hide(); - } - }]); - - //keybinging outsite of the searchbox - this.$searchBarKb = new HashHandler(); - this.$searchBarKb.bindKeys({ - "Ctrl-f|Command-f|Ctrl-H|Command-Option-F": function(sb) { - var isReplace = sb.isReplace = !sb.isReplace; - sb.replaceBox.style.display = isReplace ? "" : "none"; - sb[isReplace ? "replaceInput" : "searchInput"].focus(); - }, - "Ctrl-G|Command-G": function(sb) { - sb.findNext(); - }, - "Ctrl-Shift-G|Command-Shift-G": function(sb) { - sb.findPrev(); - }, - "esc": function(sb) { - setTimeout(function() { sb.hide();}); - }, - "Return": function(sb) { - if (sb.activeInput == sb.replaceInput) - sb.replace(); - sb.findNext(); - }, - "Shift-Return": function(sb) { - if (sb.activeInput == sb.replaceInput) - sb.replace(); - sb.findPrev(); - }, - "Alt-Return": function(sb) { - if (sb.activeInput == sb.replaceInput) - sb.replaceAll(); - sb.findAll(); - }, - "Tab": function(sb) { - (sb.activeInput == sb.replaceInput ? sb.searchInput : sb.replaceInput).focus(); - } - }); - - this.$searchBarKb.addCommands([{ - name: "toggleRegexpMode", - bindKey: {win: "Alt-R|Alt-/", mac: "Ctrl-Alt-R|Ctrl-Alt-/"}, - exec: function(sb) { - sb.regExpOption.checked = !sb.regExpOption.checked; - sb.$syncOptions(); - } - }, { - name: "toggleCaseSensitive", - bindKey: {win: "Alt-C|Alt-I", mac: "Ctrl-Alt-R|Ctrl-Alt-I"}, - exec: function(sb) { - sb.caseSensitiveOption.checked = !sb.caseSensitiveOption.checked; - sb.$syncOptions(); - } - }, { - name: "toggleWholeWords", - bindKey: {win: "Alt-B|Alt-W", mac: "Ctrl-Alt-B|Ctrl-Alt-W"}, - exec: function(sb) { - sb.wholeWordOption.checked = !sb.wholeWordOption.checked; - sb.$syncOptions(); - } - }]); - - this.$syncOptions = function() { - dom.setCssClass(this.regExpOption, "checked", this.regExpOption.checked); - dom.setCssClass(this.wholeWordOption, "checked", this.wholeWordOption.checked); - dom.setCssClass(this.caseSensitiveOption, "checked", this.caseSensitiveOption.checked); - this.find(false, false); - }; - - this.highlight = function(re) { - this.editor.session.highlight(re || this.editor.$search.$options.re); - this.editor.renderer.updateBackMarkers() - }; - this.find = function(skipCurrent, backwards) { - var range = this.editor.find(this.searchInput.value, { - skipCurrent: skipCurrent, - backwards: backwards, - wrap: true, - regExp: this.regExpOption.checked, - caseSensitive: this.caseSensitiveOption.checked, - wholeWord: this.wholeWordOption.checked - }); - var noMatch = !range && this.searchInput.value; - dom.setCssClass(this.searchBox, "ace_nomatch", noMatch); - this.editor._emit("findSearchBox", { match: !noMatch }); - this.highlight(); - }; - this.findNext = function() { - this.find(true, false); - }; - this.findPrev = function() { - this.find(true, true); - }; - this.findAll = function(){ - var range = this.editor.findAll(this.searchInput.value, { - regExp: this.regExpOption.checked, - caseSensitive: this.caseSensitiveOption.checked, - wholeWord: this.wholeWordOption.checked - }); - var noMatch = !range && this.searchInput.value; - dom.setCssClass(this.searchBox, "ace_nomatch", noMatch); - this.editor._emit("findSearchBox", { match: !noMatch }); - this.highlight(); - this.hide(); - }; - this.replace = function() { - if (!this.editor.getReadOnly()) - this.editor.replace(this.replaceInput.value); - }; - this.replaceAndFindNext = function() { - if (!this.editor.getReadOnly()) { - this.editor.replace(this.replaceInput.value); - this.findNext() - } - }; - this.replaceAll = function() { - if (!this.editor.getReadOnly()) - this.editor.replaceAll(this.replaceInput.value); - }; - - this.hide = function() { - this.element.style.display = "none"; - this.editor.keyBinding.removeKeyboardHandler(this.$closeSearchBarKb); - this.editor.focus(); - }; - this.show = function(value, isReplace) { - this.element.style.display = ""; - this.replaceBox.style.display = isReplace ? "" : "none"; - - this.isReplace = isReplace; - - if (value) - this.searchInput.value = value; - this.searchInput.focus(); - this.searchInput.select(); - - this.editor.keyBinding.addKeyboardHandler(this.$closeSearchBarKb); - }; - - this.isFocused = function() { - var el = document.activeElement; - return el == this.searchInput || el == this.replaceInput; - } -}).call(SearchBox.prototype); - -exports.SearchBox = SearchBox; - -exports.Search = function(editor, isReplace) { - var sb = editor.searchBox || new SearchBox(editor); - sb.show(editor.session.getTextRange(), isReplace); -}; - -}); - - -/* ------------------------------------------------------------------------------------------ - * TODO - * --------------------------------------------------------------------------------------- */ -/* -- move search form to the left if it masks current word -- includ all options that search has. ex: regex -- searchbox.searchbox is not that pretty. we should have just searchbox -- disable prev button if it makes sence -*/ diff --git a/lib/ace/ext/settings_menu.js b/lib/ace/ext/settings_menu.js deleted file mode 100644 index 44f6d6ad..00000000 --- a/lib/ace/ext/settings_menu.js +++ /dev/null @@ -1,76 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2013 Matthew Christopher Kastor-Inare III, Atropa Inc. Intl - * All rights reserved. - * - * Contributed to Ajax.org under the BSD license. - * - * 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 ***** */ - -/*jslint indent: 4, maxerr: 50, white: true, browser: true, vars: true*/ -/*global define, require */ - -/** - * Show Settings Menu - * @fileOverview Show Settings Menu
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * Displays an interactive settings menu mostly generated on the fly based on - * the current state of the editor. - * @author - * Matthew Christopher Kastor-Inare III
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ☭ Hial Atropa!! ☭ - */ - -define(function(require, exports, module) { -"use strict"; -var generateSettingsMenu = require('./menu_tools/generate_settings_menu').generateSettingsMenu; -var overlayPage = require('./menu_tools/overlay_page').overlayPage; -/** - * This displays the settings menu if it is not already being shown. - * @author - * Matthew Christopher Kastor-Inare III
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ☭ Hial Atropa!! ☭ - * @param {ace.Editor} editor An instance of the ace editor. - */ -function showSettingsMenu(editor) { - // make sure the menu isn't open already. - var sm = document.getElementById('ace_settingsmenu'); - if (!sm) - overlayPage(editor, generateSettingsMenu(editor), '0', '0', '0'); -} - -/** - * Initializes the settings menu extension. It adds the showSettingsMenu - * method to the given editor object and adds the showSettingsMenu command - * to the editor with appropriate keyboard shortcuts. - * @param {ace.Editor} editor An instance of the Editor. - */ -module.exports.init = function(editor) { - var Editor = require("ace/editor").Editor; - Editor.prototype.showSettingsMenu = function() { - showSettingsMenu(this); - }; -}; -}); \ No newline at end of file diff --git a/lib/ace/ext/spellcheck.js b/lib/ace/ext/spellcheck.js deleted file mode 100644 index 08bf2189..00000000 --- a/lib/ace/ext/spellcheck.js +++ /dev/null @@ -1,69 +0,0 @@ -define(function(require, exports, module) { -"use strict"; -var event = require("../lib/event"); - -exports.contextMenuHandler = function(e){ - var host = e.target; - var text = host.textInput.getElement(); - if (!host.selection.isEmpty()) - return; - var c = host.getCursorPosition(); - var r = host.session.getWordRange(c.row, c.column); - var w = host.session.getTextRange(r); - - host.session.tokenRe.lastIndex = 0; - if (!host.session.tokenRe.test(w)) - return; - var PLACEHOLDER = "\x01\x01"; - var value = w + " " + PLACEHOLDER; - text.value = value; - text.setSelectionRange(w.length, w.length + 1); - text.setSelectionRange(0, 0); - text.setSelectionRange(0, w.length); - - var afterKeydown = false; - event.addListener(text, "keydown", function onKeydown() { - event.removeListener(text, "keydown", onKeydown); - afterKeydown = true; - }); - - host.textInput.setInputHandler(function(newVal) { - console.log(newVal , value, text.selectionStart, text.selectionEnd) - if (newVal == value) - return ''; - if (newVal.lastIndexOf(value, 0) === 0) - return newVal.slice(value.length); - if (newVal.substr(text.selectionEnd) == value) - return newVal.slice(0, -value.length); - if (newVal.slice(-2) == PLACEHOLDER) { - var val = newVal.slice(0, -2); - if (val.slice(-1) == " ") { - if (afterKeydown) - return val.substring(0, text.selectionEnd); - val = val.slice(0, -1); - host.session.replace(r, val); - return ""; - } - } - - return newVal; - }); -}; -// todo support highlighting with typo.js -var Editor = require("../editor").Editor; -require("../config").defineOptions(Editor.prototype, "editor", { - spellcheck: { - set: function(val) { - var text = this.textInput.getElement(); - text.spellcheck = !!val; - if (!val) - this.removeListener("nativecontextmenu", exports.contextMenuHandler); - else - this.on("nativecontextmenu", exports.contextMenuHandler); - }, - value: true - } -}); - -}); - diff --git a/lib/ace/ext/split.js b/lib/ace/ext/split.js deleted file mode 100644 index 8316562f..00000000 --- a/lib/ace/ext/split.js +++ /dev/null @@ -1,40 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -/** - * this is experimental, and subject to change, use at your own risk! - */ -module.exports = require("../split"); - -}); - diff --git a/lib/ace/ext/static.css b/lib/ace/ext/static.css index 51986c3f..7d785b49 100644 --- a/lib/ace/ext/static.css +++ b/lib/ace/ext/static.css @@ -1,38 +1,22 @@ -.ace_static_highlight { - font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', 'Droid Sans Mono', monospace; - font-size: 12px; - white-space: pre-wrap +.ace_editor { + font-family: 'Monaco', 'Menlo', 'Droid Sans Mono', 'Courier New', monospace; + font-size: 12px; } -.ace_static_highlight .ace_gutter { - width: 2em; - text-align: right; - padding: 0 3px 0 0; +.ace_editor .ace_gutter { + width: 25px !important; + display: block; + float: left; + text-align: right; + padding: 0 3px 0 0; margin-right: 3px; } -.ace_static_highlight.ace_show_gutter .ace_line { - padding-left: 2.6em; -} +.ace_line { clear: both; } -.ace_static_highlight .ace_line { position: relative; } - -.ace_static_highlight .ace_gutter-cell { - -moz-user-select: -moz-none; - -khtml-user-select: none; - -webkit-user-select: none; - user-select: none; - top: 0; - bottom: 0; - left: 0; - position: absolute; -} - - -.ace_static_highlight .ace_gutter-cell:before { - content: counter(ace_line, decimal); - counter-increment: ace_line; -} -.ace_static_highlight { - counter-reset: ace_line; -} +*.ace_gutter-cell { + -moz-user-select: -moz-none; + -khtml-user-select: none; + -webkit-user-select: none; + user-select: none; +} \ No newline at end of file diff --git a/lib/ace/ext/static_highlight.js b/lib/ace/ext/static_highlight.js index 2acb3ac5..24c97195 100644 --- a/lib/ace/ext/static_highlight.js +++ b/lib/ace/ext/static_highlight.js @@ -1,30 +1,39 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: +/* vim:ts=4:sts=4:sw=4: + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. * - * 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. + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Jan Jongboom + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -34,158 +43,55 @@ define(function(require, exports, module) { var EditSession = require("../edit_session").EditSession; var TextLayer = require("../layer/text").Text; var baseStyles = require("../requirejs/text!./static.css"); -var config = require("../config"); -var dom = require("../lib/dom"); -var SimpleTextLayer = function() { - this.config = {}; -}; -SimpleTextLayer.prototype = TextLayer.prototype; +/* Transforms a given input code snippet into HTML using the given mode +* +* @param {string} input Code snippet +* @param {mode} mode Mode loaded from /ace/mode (use 'ServerSideHiglighter.getMode') +* @param {string} r Code snippet +* @returns {object} An object containing: html, css +*/ -var highlight = function(el, opts, callback) { - var m = el.className.match(/lang-(\w+)/); - var mode = opts.mode || m && ("ace/mode/" + m[1]); - if (!mode) - return false; - var theme = opts.theme || "ace/theme/textmate"; - - var data = ""; - var nodes = []; - - if (el.firstElementChild) { - var textLen = 0; - for (var i = 0; i < el.childNodes.length; i++) { - var ch = el.childNodes[i]; - if (ch.nodeType == 3) { - textLen += ch.data.length; - data += ch.data; - } else { - nodes.push(textLen, ch); - } - } - } else { - data = dom.getInnerText(el); - if (opts.trim) - data = data.trim(); - } - - highlight.render(data, mode, theme, opts.firstLineNumber, !opts.showGutter, function (highlighted) { - dom.importCssString(highlighted.css, "ace_highlight"); - el.innerHTML = highlighted.html; - var container = el.firstChild.firstChild; - for (var i = 0; i < nodes.length; i += 2) { - var pos = highlighted.session.doc.indexToPosition(nodes[i]); - var node = nodes[i + 1]; - var lineEl = container.children[pos.row]; - lineEl && lineEl.appendChild(node); - } - callback && callback(); - }); -}; - -/** - * Transforms a given input code snippet into HTML using the given mode - * - * @param {string} input Code snippet - * @param {string|mode} mode String specifying the mode to load such as - * `ace/mode/javascript` or, a mode loaded from `/ace/mode` - * (use 'ServerSideHiglighter.getMode'). - * @param {string|theme} theme String specifying the theme to load such as - * `ace/theme/twilight` or, a theme loaded from `/ace/theme`. - * @param {number} lineStart A number indicating the first line number. Defaults - * to 1. - * @param {boolean} disableGutter Specifies whether or not to disable the gutter. - * `true` disables the gutter, `false` enables the gutter. Defaults to `false`. - * @param {function} callback When specifying the mode or theme as a string, - * this method has no return value and you must specify a callback function. The - * callback will receive the rendered object containing the properties `html` - * and `css`. - * @returns {object} An object containing the properties `html` and `css`. - */ -highlight.render = function(input, mode, theme, lineStart, disableGutter, callback) { - var waiting = 1; - var modeCache = EditSession.prototype.$modes; - - // if either the theme or the mode were specified as objects - // then we need to lazily load them. - if (typeof theme == "string") { - waiting++; - config.loadModule(['theme', theme], function(m) { - theme = m; - --waiting || done(); - }); - } - // allow setting mode options e.h {path: "ace/mode/php", inline:true} - var modeOptions; - if (mode && typeof mode === "object" && !mode.getTokenizer) { - modeOptions = mode; - mode = modeOptions.path; - } - if (typeof mode == "string") { - waiting++; - config.loadModule(['mode', mode], function(m) { - if (!modeCache[mode] || modeOptions) - modeCache[mode] = new m.Mode(modeOptions); - mode = modeCache[mode]; - --waiting || done(); - }); - } - - // loads or passes the specified mode module then calls renderer - function done() { - var result = highlight.renderSync(input, mode, theme, lineStart, disableGutter); - return callback ? callback(result) : result; - } - return --waiting || done(); -}; - -/** - * Transforms a given input code snippet into HTML using the given mode - * @param {string} input Code snippet - * @param {mode} mode Mode loaded from /ace/mode (use 'ServerSideHiglighter.getMode') - * @param {string} r Code snippet - * @returns {object} An object containing: html, css - */ -highlight.renderSync = function(input, mode, theme, lineStart, disableGutter) { +exports.render = function(input, mode, theme, lineStart, disableGutter) { lineStart = parseInt(lineStart || 1, 10); - + var session = new EditSession(""); - session.setUseWorker(false); session.setMode(mode); - - var textLayer = new SimpleTextLayer(); + session.setUseWorker(false); + + var textLayer = new TextLayer(document.createElement("div")); textLayer.setSession(session); - + textLayer.config = { + characterWidth: 10, + lineHeight: 20 + }; + session.setValue(input); - + var stringBuilder = []; var length = session.getLength(); for(var ix = 0; ix < length; ix++) { stringBuilder.push("
                                                                                                                                                                                                                                                                                                                                                                                                                                                              "); if (!disableGutter) - stringBuilder.push("" + /*(ix + lineStart) + */ ""); + stringBuilder.push("" + (ix + lineStart) + ""); textLayer.$renderLine(stringBuilder, ix, true, false); - stringBuilder.push("\n
                                                                                                                                                                                                                                                                                                                                                                                                                                                              "); + stringBuilder.push(""); } - + // let's prepare the whole html - var html = "
                                                                                                                                                                                                                                                                                                                                                                                                                                                              " + - "
                                                                                                                                                                                                                                                                                                                                                                                                                                                              " + - stringBuilder.join("") + - "
                                                                                                                                                                                                                                                                                                                                                                                                                                                              " + - "
                                                                                                                                                                                                                                                                                                                                                                                                                                                              "; - + var html = "
                                                                                                                                                                                                                                                                                                                                                                                                                                                              \ +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              \ + :code\ +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              \ +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ".replace(/:cssClass/, theme.cssClass).replace(/:code/, stringBuilder.join("")); + textLayer.destroy(); - + return { css: baseStyles + theme.cssText, - html: html, - session: session + html: html }; }; -module.exports = highlight; -module.exports.highlight =highlight; }); diff --git a/lib/ace/ext/static_highlight_test.js b/lib/ace/ext/static_highlight_test.js index 6271666d..707d00ea 100644 --- a/lib/ace/ext/static_highlight_test.js +++ b/lib/ace/ext/static_highlight_test.js @@ -9,82 +9,62 @@ define(function(require, exports, module) { var assert = require("assert"); var highlighter = require("./static_highlight"); var JavaScriptMode = require("../mode/javascript").Mode; -var TextMode = require("../mode/text").Mode; // Execution ORDER: test.setUpSuite, setUp, testFn, tearDown, test.tearDownSuite module.exports = { timeout: 10000, - + "test simple snippet": function(next) { var theme = require("../theme/tomorrow"); - var snippet = [ - "/** this is a function", - "*", - "*/", - "function hello (a, b, c) {", - " console.log(a * b + c + 'sup$');", - "}" - ].join("\n"); + var snippet = "\ +/** this is a function\n\ +*\n\ +*/\n\ +function hello (a, b, c) {\n\ + console.log(a * b + c + 'sup?');\n\ +}"; var mode = new JavaScriptMode(); - + var result = highlighter.render(snippet, mode, theme); - assert.equal(result.html, "
                                                                                                                                                                                                                                                                                                                                                                                                                                                              " - + "
                                                                                                                                                                                                                                                                                                                                                                                                                                                              /** this is a function\n
                                                                                                                                                                                                                                                                                                                                                                                                                                                              " - + "
                                                                                                                                                                                                                                                                                                                                                                                                                                                              *\n
                                                                                                                                                                                                                                                                                                                                                                                                                                                              " - + "
                                                                                                                                                                                                                                                                                                                                                                                                                                                              */\n
                                                                                                                                                                                                                                                                                                                                                                                                                                                              " - + "
                                                                                                                                                                                                                                                                                                                                                                                                                                                              function hello (a, b, c) {\n
                                                                                                                                                                                                                                                                                                                                                                                                                                                              " - + "
                                                                                                                                                                                                                                                                                                                                                                                                                                                              console.log(a * b + c + 'sup$');\n
                                                                                                                                                                                                                                                                                                                                                                                                                                                              " - + "
                                                                                                                                                                                                                                                                                                                                                                                                                                                              }\n
                                                                                                                                                                                                                                                                                                                                                                                                                                                              " - + "
                                                                                                                                                                                                                                                                                                                                                                                                                                                              "); + assert.equal(result.html, "
                                                                                                                                                                                                                                                                                                                                                                                                                                                              1/** this is a function
                                                                                                                                                                                                                                                                                                                                                                                                                                                              2*
                                                                                                                                                                                                                                                                                                                                                                                                                                                              3*/
                                                                                                                                                                                                                                                                                                                                                                                                                                                              4function hello (abc) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              5    console.log(a * b + c + 'sup?');
                                                                                                                                                                                                                                                                                                                                                                                                                                                              6}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              "); assert.ok(!!result.css); next(); }, - + "test css from theme is used": function(next) { var theme = require("../theme/tomorrow"); - var snippet = [ - "/** this is a function", - "*", - "*/", - "function hello (a, b, c) {", - " console.log(a * b + c + 'sup?');", - "}" - ].join("\n"); + var snippet = "\ +/** this is a function\n\ +*\n\ +*/\n\ +function hello (a, b, c) {\n\ + console.log(a * b + c + 'sup?');\n\ +}"; var mode = new JavaScriptMode(); - - var result = highlighter.render(snippet, mode, theme); - + + var isError = false, result; + result = highlighter.render(snippet, mode, theme); + assert.ok(result.css.indexOf(theme.cssText) !== -1); - - next(); - }, - - "test theme classname should be in output html": function(next) { - var theme = require("../theme/tomorrow"); - var snippet = [ - "/** this is a function", - "*", - "*/", - "function hello (a, b, c) {", - " console.log(a * b + c + 'sup?');", - "}" - ].join("\n"); - var mode = new JavaScriptMode(); - - var result = highlighter.render(snippet, mode, theme); - assert.equal(!!result.html.match(/
                                                                                                                                                                                                                                                                                                                                                                                                                                                              /), true); - + next(); }, - "test js string replace specials": function(next) { + "test theme classname should be in output html": function (next) { var theme = require("../theme/tomorrow"); - var snippet = "$'$1$2$$$&"; - var mode = new TextMode(); - - var result = highlighter.render(snippet, mode, theme); - assert.ok(result.html.indexOf(snippet) != -1); - + var snippet = "\ +/** this is a function\n\ +*\n\ +*/\n\ +function hello (a, b, c) {\n\ + console.log(a * b + c + 'sup?');\n\ +}"; + var mode = new JavaScriptMode(); + + var isError = false, result; + result = highlighter.render(snippet, mode, theme); + assert.equal(!!result.html.match(/
                                                                                                                                                                                                                                                                                                                                                                                                                                                              /), true); + next(); } }; diff --git a/lib/ace/ext/statusbar.js b/lib/ace/ext/statusbar.js deleted file mode 100644 index 5e5b0572..00000000 --- a/lib/ace/ext/statusbar.js +++ /dev/null @@ -1,48 +0,0 @@ -define(function(require, exports, module) { -"use strict"; -/** simple statusbar **/ -var dom = require("ace/lib/dom"); -var lang = require("ace/lib/lang"); - -var StatusBar = function(editor, parentNode) { - this.element = dom.createElement("div"); - this.element.className = "ace_status-indicator"; - this.element.style.cssText = "display: inline-block;"; - parentNode.appendChild(this.element); - - var statusUpdate = lang.delayedCall(function(){ - this.updateStatus(editor) - }.bind(this)); - editor.on("changeStatus", function() { - statusUpdate.schedule(100); - }); - editor.on("changeSelection", function() { - statusUpdate.schedule(100); - }); -}; - -(function(){ - this.updateStatus = function(editor) { - var status = []; - function add(str, separator) { - str && status.push(str, separator || "|"); - } - - add(editor.keyBinding.getStatusText(editor)); - if (editor.commands.recording) - add("REC"); - - var c = editor.selection.lead; - add(c.row + ":" + c.column, " "); - if (!editor.selection.isEmpty()) { - var r = editor.getSelectionRange(); - add("(" + (r.end.row - r.start.row) + ":" +(r.end.column - r.start.column) + ")"); - } - status.pop(); - this.element.textContent = status.join(""); - }; -}).call(StatusBar.prototype); - -exports.StatusBar = StatusBar; - -}); \ No newline at end of file diff --git a/lib/ace/ext/textarea.js b/lib/ace/ext/textarea.js index c9972488..918e8ebd 100644 --- a/lib/ace/ext/textarea.js +++ b/lib/ace/ext/textarea.js @@ -1,30 +1,39 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. * - * 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. + * The Original Code is Mozilla Skywriter. + * + * The Initial Developer of the Original Code is + * Mozilla. + * Portions created by the Initial Developer are Copyright (C) 2009 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Kevin Dangoor (kdangoor@mozilla.com) + * Julian Viereck + * Harutyun Amirjanyan [harutyun@c9.io] + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -36,7 +45,7 @@ var UA = require("../lib/useragent"); var net = require("../lib/net"); var ace = require("../ace"); -require("../theme/textmate"); +require("ace/theme/textmate"); module.exports = exports = ace; @@ -73,8 +82,8 @@ function applyStyles(elm, styles) { } function setupContainer(element, getValue) { - if (element.type != 'textarea') { - throw new Error("Textarea required!"); + if (element.type != 'textarea') { + throw "Textarea required!"; } var parentNode = element.parentNode; @@ -132,7 +141,11 @@ function setupContainer(element, getValue) { resizeEvent(); // Insert the div container after the element. - parentNode.insertBefore(container, element.nextSibling); + if (element.nextSibling) { + parentNode.insertBefore(container, element.nextSibling); + } else { + parentNode.appendChild(container); + } // Override the forms onsubmit function. Set the innerHTML and value // of the textarea before submitting. @@ -141,6 +154,7 @@ function setupContainer(element, getValue) { var oldSumit = parentNode.onsubmit; // Override the onsubmit function of the form. parentNode.onsubmit = function(evt) { + element.innerHTML = getValue(); element.value = getValue(); // If there is a onsubmit function already, then call // it with the current context and pass the event. @@ -155,7 +169,7 @@ function setupContainer(element, getValue) { return container; } -exports.transformTextarea = function(element, options) { +exports.transformTextarea = function(element, loader) { var session; var container = setupContainer(element, function() { return session.getValue(); @@ -172,8 +186,7 @@ exports.transformTextarea = function(element, options) { left: "0px", right: "0px", bottom: "0px", - border: "1px solid gray", - position: "absolute" + border: "1px solid gray" }); container.appendChild(editorDiv); @@ -194,7 +207,7 @@ exports.transformTextarea = function(element, options) { var settingDiv = document.createElement("div"); var settingDivStyles = { top: "0px", - left: "20%", + left: "0px", right: "0px", bottom: "0px", position: "absolute", @@ -203,8 +216,7 @@ exports.transformTextarea = function(element, options) { color: "white", display: "none", overflow: "auto", - fontSize: "14px", - boxShadow: "-5px 2px 3px gray" + fontSize: "14px" }; if (!UA.isOldIE) { settingDivStyles.backgroundColor = "rgba(0, 0, 0, 0.6)"; @@ -215,8 +227,9 @@ exports.transformTextarea = function(element, options) { applyStyles(settingDiv, settingDivStyles); container.appendChild(settingDiv); - options = options || exports.defaultOptions; // Power up ace on the textarea: + var options = {}; + var editor = ace.edit(editorDiv); session = editor.getSession(); @@ -224,14 +237,14 @@ exports.transformTextarea = function(element, options) { editor.focus(); // Add the settingPanel opener to the editor's div. - container.appendChild(settingOpener); + editorDiv.appendChild(settingOpener); // Create the API. - setupApi(editor, editorDiv, settingDiv, ace, options, load); + setupApi(editor, editorDiv, settingDiv, ace, options, loader); // Create the setting's panel. - setupSettingPanel(settingDiv, settingOpener, editor); - + setupSettingPanel(settingDiv, settingOpener, editor, options); + var state = ""; event.addListener(settingOpener, "mousemove", function(e) { var rect = this.getBoundingClientRect(); @@ -244,7 +257,7 @@ exports.transformTextarea = function(element, options) { this.style.cursor = "nw-resize"; } }); - + event.addListener(settingOpener, "mousedown", function(e) { if (state == "toggle") { editor.setDisplaySettings(); @@ -276,98 +289,117 @@ function setupApi(editor, editorDiv, settingDiv, ace, options, loader) { loader = loader || load; function toBool(value) { - return value === "true" || value == true; + return value == "true"; } editor.setDisplaySettings = function(display) { if (display == null) display = settingDiv.style.display == "none"; - if (display) { - settingDiv.style.display = "block"; - settingDiv.hideButton.focus(); - editor.on("focus", function onFocus() { - editor.removeListener("focus", onFocus); - settingDiv.style.display = "none"; - }); - } else { - editor.focus(); - } + settingDiv.style.display = display ? "block" : "none"; }; - - editor.$setOption = editor.setOption; - editor.$getOption = editor.getOption; + editor.setOption = function(key, value) { + if (options[key] == value) return; + switch (key) { + case "gutter": + renderer.setShowGutter(toBool(value)); + break; + case "mode": - editor.$setOption("mode", "ace/mode/" + value) - break; - case "theme": - editor.$setOption("theme", "ace/theme/" + value) - break; - case "keybindings": - switch (value) { - case "vim": - editor.setKeyboardHandler("ace/keyboard/vim"); - break; - case "emacs": - editor.setKeyboardHandler("ace/keyboard/emacs"); - break; - default: - editor.setKeyboardHandler(null); + if (value != "text") { + // Load the required mode file. Files get loaded only once. + loader("mode-" + value + ".js", "ace/mode/" + value, function() { + var aceMode = require("../mode/" + value).Mode; + session.setMode(new aceMode()); + }); + } else { + session.setMode(new (require("../mode/text").Mode)); } break; + case "theme": + if (value != "textmate") { + // Load the required theme file. Files get loaded only once. + loader("theme-" + value + ".js", "ace/theme/" + value, function() { + editor.setTheme("ace/theme/" + value); + }); + } else { + editor.setTheme("ace/theme/textmate"); + } + break; + + case "fontSize": + editorDiv.style.fontSize = value; + break; + case "softWrap": - case "fontSize": - editor.$setOption(key, value); - break; - - default: - editor.$setOption(key, toBool(value)); - } - }; - - editor.getOption = function(key) { - switch (key) { - case "mode": - return editor.$getOption("mode").substr("ace/mode/".length) - break; - - case "theme": - return editor.$getOption("theme").substr("ace/theme/".length) - break; - - case "keybindings": - var value = editor.getKeyboardHandler() - switch (value && value.$id) { - case "ace/keyboard/vim": - return "vim"; - case "ace/keyboard/emacs": - return "emacs"; - default: - return "ace"; + switch (value) { + case "off": + session.setUseWrapMode(false); + renderer.setPrintMarginColumn(80); + break; + case "40": + session.setUseWrapMode(true); + session.setWrapLimitRange(40, 40); + renderer.setPrintMarginColumn(40); + break; + case "80": + session.setUseWrapMode(true); + session.setWrapLimitRange(80, 80); + renderer.setPrintMarginColumn(80); + break; + case "free": + session.setUseWrapMode(true); + session.setWrapLimitRange(null, null); + renderer.setPrintMarginColumn(80); + break; } break; - default: - return editor.$getOption(key); + case "useSoftTabs": + session.setUseSoftTabs(toBool(value)); + break; + + case "showPrintMargin": + renderer.setShowPrintMargin(toBool(value)); + break; + + case "showInvisibles": + editor.setShowInvisibles(toBool(value)); + break; } + + options[key] = value; }; - editor.setOptions(options); + editor.getOption = function(key) { + return options[key]; + }; + + editor.getOptions = function() { + return options; + }; + + for (var option in exports.options) { + editor.setOption(option, exports.options[option]); + } + return editor; } -function setupSettingPanel(settingDiv, settingOpener, editor) { - var BOOL = null; +function setupSettingPanel(settingDiv, settingOpener, editor, options) { + var BOOL = { + "true": true, + "false": false + }; var desc = { mode: "Mode:", - wrap: "Soft Wrap:", + gutter: "Display Gutter:", theme: "Theme:", fontSize: "Font Size:", - showGutter: "Display Gutter:", - keybindings: "Keyboard", + softWrap: "Soft Wrap:", showPrintMargin: "Show Print Margin:", useSoftTabs: "Use Soft Tabs:", showInvisibles: "Show Invisibles" @@ -419,7 +451,7 @@ function setupSettingPanel(settingDiv, settingOpener, editor) { twilight: "Twilight", vibrant_ink: "Vibrant Ink" }, - showGutter: BOOL, + gutter: BOOL, fontSize: { "10px": "10px", "11px": "11px", @@ -427,17 +459,12 @@ function setupSettingPanel(settingDiv, settingOpener, editor) { "14px": "14px", "16px": "16px" }, - wrap: { + softWrap: { off: "Off", 40: "40", 80: "80", free: "Free" }, - keybindings: { - ace: "ace", - vim: "vim", - emacs: "emacs" - }, showPrintMargin: BOOL, useSoftTabs: BOOL, showInvisibles: BOOL @@ -447,14 +474,6 @@ function setupSettingPanel(settingDiv, settingOpener, editor) { table.push(""); function renderOption(builder, option, obj, cValue) { - if (!obj) { - builder.push( - "" - ); - return; - } builder.push(""); table.push(""); } table.push("
                                                                                                                                                                                                                                                                                                                                                                                                                                                              SettingValue
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ", desc[option], ""); - renderOption(table, option, optionValues[option], editor.getOption(option)); + renderOption(table, option, optionValues[option], options[option]); table.push("
                                                                                                                                                                                                                                                                                                                                                                                                                                                              "); settingDiv.innerHTML = table.join(""); - var onChange = function(e) { - var select = e.currentTarget; - editor.setOption(select.title, select.value); - }; - var onClick = function(e) { - var cb = e.currentTarget; - editor.setOption(cb.title, cb.checked); - }; var selects = settingDiv.getElementsByTagName("select"); - for (var i = 0; i < selects.length; i++) + for (var i = 0; i < selects.length; i++) { + var onChange = (function() { + var select = selects[i]; + return function() { + var option = select.title; + var value = select.value; + editor.setOption(option, value); + }; + })(); selects[i].onchange = onChange; - var cbs = settingDiv.getElementsByTagName("input"); - for (var i = 0; i < cbs.length; i++) - cbs[i].onclick = onClick; - + } var button = document.createElement("input"); button.type = "button"; @@ -502,20 +518,18 @@ function setupSettingPanel(settingDiv, settingOpener, editor) { editor.setDisplaySettings(false); }); settingDiv.appendChild(button); - settingDiv.hideButton = button; } // Default startup options. -exports.defaultOptions = { - mode: "javascript", +exports.options = { + mode: "text", theme: "textmate", - wrap: "off", + gutter: "false", fontSize: "12px", - showGutter: "false", - keybindings: "ace", + softWrap: "off", showPrintMargin: "false", useSoftTabs: "true", - showInvisibles: "false" + showInvisibles: "true" }; }); diff --git a/lib/ace/ext/themelist.js b/lib/ace/ext/themelist.js deleted file mode 100644 index 0df76b02..00000000 --- a/lib/ace/ext/themelist.js +++ /dev/null @@ -1,103 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2013 Matthew Christopher Kastor-Inare III, Atropa Inc. Intl - * All rights reserved. - * - * Contributed to Ajax.org under the BSD license. - * - * 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 ***** */ - - -/** - * Generates a list of themes available when ace was built. - * @fileOverview Generates a list of themes available when ace was built. - * @author - * Matthew Christopher Kastor-Inare III
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - * ☭ Hial Atropa!! ☭ - */ - -define(function(require, exports, module) { -"use strict"; -require("ace/lib/fixoldbrowsers"); - -var themeData = [ - ["Chrome" ], - ["Clouds" ], - ["Crimson Editor" ], - ["Dawn" ], - ["Dreamweaver" ], - ["Eclipse" ], - ["GitHub" ], - ["IPlastic" ], - ["Solarized Light"], - ["TextMate" ], - ["Tomorrow" ], - ["XCode" ], - ["Kuroir"], - ["KatzenMilch"], - ["SQL Server" ,"sqlserver" , "light"], - ["Ambiance" ,"ambiance" , "dark"], - ["Chaos" ,"chaos" , "dark"], - ["Clouds Midnight" ,"clouds_midnight" , "dark"], - ["Cobalt" ,"cobalt" , "dark"], - ["idle Fingers" ,"idle_fingers" , "dark"], - ["krTheme" ,"kr_theme" , "dark"], - ["Merbivore" ,"merbivore" , "dark"], - ["Merbivore Soft" ,"merbivore_soft" , "dark"], - ["Mono Industrial" ,"mono_industrial" , "dark"], - ["Monokai" ,"monokai" , "dark"], - ["Pastel on dark" ,"pastel_on_dark" , "dark"], - ["Solarized Dark" ,"solarized_dark" , "dark"], - ["Terminal" ,"terminal" , "dark"], - ["Tomorrow Night" ,"tomorrow_night" , "dark"], - ["The Night After Tomorrow" ,"the_night_after_tomorrow" , "dark"], - ["Tomorrow Night Blue" ,"tomorrow_night_blue" , "dark"], - ["Tomorrow Night Bright","tomorrow_night_bright" , "dark"], - ["Tomorrow Night 80s" ,"tomorrow_night_eighties" , "dark"], - ["Twilight" ,"twilight" , "dark"], - ["Vibrant Ink" ,"vibrant_ink" , "dark"] -]; - - -exports.themesByName = {}; - -/** - * An array containing information about available themes. - */ -exports.themes = themeData.map(function(data) { - var name = data[1] || data[0].replace(/ /g, "_").toLowerCase(); - var theme = { - caption: data[0], - theme: "ace/theme/" + name, - isDark: data[2] == "dark", - name: name - }; - exports.themesByName[name] = theme; - return theme; -}); - -}); - diff --git a/lib/ace/ext/whitespace.js b/lib/ace/ext/whitespace.js deleted file mode 100644 index 27ee223e..00000000 --- a/lib/ace/ext/whitespace.js +++ /dev/null @@ -1,213 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var lang = require("../lib/lang"); - -// based on http://www.freehackers.org/Indent_Finder -exports.$detectIndentation = function(lines, fallback) { - var stats = []; - var changes = []; - var tabIndents = 0; - var prevSpaces = 0; - var max = Math.min(lines.length, 1000); - for (var i = 0; i < max; i++) { - var line = lines[i]; - // ignore empty and comment lines - if (!/^\s*[^*+\-\s]/.test(line)) - continue; - - if (line[0] == "\t") - tabIndents++; - - var spaces = line.match(/^ */)[0].length; - if (spaces && line[spaces] != "\t") { - var diff = spaces - prevSpaces; - if (diff > 0 && !(prevSpaces%diff) && !(spaces%diff)) - changes[diff] = (changes[diff] || 0) + 1; - - stats[spaces] = (stats[spaces] || 0) + 1; - } - prevSpaces = spaces; - - // ignore lines ending with backslash - while (i < max && line[line.length - 1] == "\\") - line = lines[i++]; - } - - function getScore(indent) { - var score = 0; - for (var i = indent; i < stats.length; i += indent) - score += stats[i] || 0; - return score; - } - - var changesTotal = changes.reduce(function(a,b){return a+b}, 0); - - var first = {score: 0, length: 0}; - var spaceIndents = 0; - for (var i = 1; i < 12; i++) { - var score = getScore(i); - if (i == 1) { - spaceIndents = score; - score = stats[1] ? 0.9 : 0.8; - if (!stats.length) - score = 0 - } else - score /= spaceIndents; - - if (changes[i]) - score += changes[i] / changesTotal; - - if (score > first.score) - first = {score: score, length: i}; - } - - if (first.score && first.score > 1.4) - var tabLength = first.length; - - if (tabIndents > spaceIndents + 1) - return {ch: "\t", length: tabLength}; - - if (spaceIndents > tabIndents + 1) - return {ch: " ", length: tabLength}; -}; - -exports.detectIndentation = function(session) { - var lines = session.getLines(0, 1000); - var indent = exports.$detectIndentation(lines) || {}; - - if (indent.ch) - session.setUseSoftTabs(indent.ch == " "); - - if (indent.length) - session.setTabSize(indent.length); - return indent; -}; - -exports.trimTrailingSpace = function(session, trimEmpty) { - var doc = session.getDocument(); - var lines = doc.getAllLines(); - - var min = trimEmpty ? -1 : 0; - - for (var i = 0, l=lines.length; i < l; i++) { - var line = lines[i]; - var index = line.search(/\s+$/); - - if (index > min) - doc.removeInLine(i, index, line.length); - } -}; - -exports.convertIndentation = function(session, ch, len) { - var oldCh = session.getTabString()[0]; - var oldLen = session.getTabSize(); - if (!len) len = oldLen; - if (!ch) ch = oldCh; - - var tab = ch == "\t" ? ch: lang.stringRepeat(ch, len); - - var doc = session.doc; - var lines = doc.getAllLines(); - - var cache = {}; - var spaceCache = {}; - for (var i = 0, l=lines.length; i < l; i++) { - var line = lines[i]; - var match = line.match(/^\s*/)[0]; - if (match) { - var w = session.$getStringScreenWidth(match)[0]; - var tabCount = Math.floor(w/oldLen); - var reminder = w%oldLen; - var toInsert = cache[tabCount] || (cache[tabCount] = lang.stringRepeat(tab, tabCount)); - toInsert += spaceCache[reminder] || (spaceCache[reminder] = lang.stringRepeat(" ", reminder)); - - if (toInsert != match) { - doc.removeInLine(i, 0, match.length); - doc.insertInLine({row: i, column: 0}, toInsert); - } - } - } - session.setTabSize(len); - session.setUseSoftTabs(ch == " "); -}; - -exports.$parseStringArg = function(text) { - var indent = {}; - if (/t/.test(text)) - indent.ch = "\t"; - else if (/s/.test(text)) - indent.ch = " "; - var m = text.match(/\d+/); - if (m) - indent.length = parseInt(m[0], 10); - return indent; -}; - -exports.$parseArg = function(arg) { - if (!arg) - return {}; - if (typeof arg == "string") - return exports.$parseStringArg(arg); - if (typeof arg.text == "string") - return exports.$parseStringArg(arg.text); - return arg; -}; - -exports.commands = [{ - name: "detectIndentation", - exec: function(editor) { - exports.detectIndentation(editor.session); - // todo show message? - } -}, { - name: "trimTrailingSpace", - exec: function(editor) { - exports.trimTrailingSpace(editor.session); - } -}, { - name: "convertIndentation", - exec: function(editor, arg) { - var indent = exports.$parseArg(arg); - exports.convertIndentation(editor.session, indent.ch, indent.length); - } -}, { - name: "setIndentation", - exec: function(editor, arg) { - var indent = exports.$parseArg(arg); - indent.length && editor.session.setTabSize(indent.length); - indent.ch && editor.session.setUseSoftTabs(indent.ch == " "); - } -}]; - -}); diff --git a/lib/ace/ext/whitespace_test.js b/lib/ace/ext/whitespace_test.js deleted file mode 100644 index be4f360f..00000000 --- a/lib/ace/ext/whitespace_test.js +++ /dev/null @@ -1,116 +0,0 @@ -if (typeof process !== "undefined") { - require("amd-loader"); - require("../test/mockdom"); -} - -define(function(require, exports, module) { -"use strict"; - -var assert = require("assert"); -var EditSession = require("../edit_session").EditSession; -var whitespace = require("./whitespace"); - -// Execution ORDER: test.setUpSuite, setUp, testFn, tearDown, test.tearDownSuite -module.exports = { - timeout: 10000, - - "test tab detection": function(next) { - var s = new EditSession([ - "define({", - "\tfoo:1,", - "\tbar:2,", - "\tbaz:{,", - "\t\tx:3", - "\t}", - "})" - ]); - - var indent = whitespace.$detectIndentation(s.doc.$lines); - assert.equal(indent.ch, "\t"); - assert.equal(indent.length, undefined); - - s.insert({row: 0, column: 0}, " "); - indent = whitespace.$detectIndentation(s.doc.$lines); - assert.equal(indent.ch, "\t"); - assert.equal(indent.length, 4); - - s.setValue(""); - indent = whitespace.$detectIndentation(s.doc.$lines); - assert.ok(!indent); - - next(); - }, - - "test empty session": function(next) { - var s = new EditSession([ - "define({", - "foo:1,", - "})" - ]); - var indent = whitespace.$detectIndentation(s.doc.$lines); - assert.ok(!indent); - s.insert({row: 1, column: 0}, " x\n "); - - indent = whitespace.$detectIndentation(s.doc.$lines); - assert.equal(indent.ch, " "); - assert.equal(indent.length, 4); - - next(); - }, - - "!test one line": function(next) { - var s = new EditSession([ - "define({", - " foo:1,", - "})" - ]); - var indent = whitespace.$detectIndentation(s.doc.$lines); - assert.equal(indent.ch, " "); - assert.equal(indent.length, 4); - - next(); - }, - - "test 1 width indents": function(next) { - var s = new EditSession([ - "define({", - " foo:1,", - "})", - "define({", - " bar:1,", - "})", - " t", - " t", - " t", - " t", - " t", - " t", - " t", - " t" - ]); - var indent = whitespace.$detectIndentation(s.doc.$lines); - // assert.equal(indent.ch, " "); - // assert.equal(indent.length, 4); - - s = new EditSession([ - "{", - " foo:1,", - " bar: {", - " baz:2", - " }", - "}" - ]); - indent = whitespace.$detectIndentation(s.doc.$lines); - assert.equal(indent.ch, " "); - assert.equal(indent.length, 1); - - next(); - }, - -}; - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec(); -} diff --git a/lib/ace/incremental_search.js b/lib/ace/incremental_search.js deleted file mode 100644 index e4c1bdf8..00000000 --- a/lib/ace/incremental_search.js +++ /dev/null @@ -1,317 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("./lib/oop"); -var Range = require("./range").Range; -var Search = require("./search").Search; -var SearchHighlight = require("./search_highlight").SearchHighlight; -var iSearchCommandModule = require("./commands/incremental_search_commands"); -var ISearchKbd = iSearchCommandModule.IncrementalSearchKeyboardHandler; - -/** - * @class IncrementalSearch - * - * Implements immediate searching while the user is typing. When incremental - * search is activated, keystrokes into the editor will be used for composing - * a search term. Immediately after every keystroke the search is updated: - * - so-far-matching characters are highlighted - * - the cursor is moved to the next match - * - **/ - - -/** - * - * - * Creates a new `IncrementalSearch` object. - * - * @constructor - **/ -function IncrementalSearch() { - this.$options = {wrap: false, skipCurrent: false}; - this.$keyboardHandler = new ISearchKbd(this); -} - -oop.inherits(IncrementalSearch, Search); - -// regexp handling - -function isRegExp(obj) { - return obj instanceof RegExp; -} - -function regExpToObject(re) { - var string = String(re), - start = string.indexOf('/'), - flagStart = string.lastIndexOf('/'); - return { - expression: string.slice(start+1, flagStart), - flags: string.slice(flagStart+1) - } -} - -function stringToRegExp(string, flags) { - try { - return new RegExp(string, flags); - } catch (e) { return string; } -} - -function objectToRegExp(obj) { - return stringToRegExp(obj.expression, obj.flags); -} - -// iSearch class - -;(function() { - - this.activate = function(ed, backwards) { - this.$editor = ed; - this.$startPos = this.$currentPos = ed.getCursorPosition(); - this.$options.needle = ''; - this.$options.backwards = backwards; - ed.keyBinding.addKeyboardHandler(this.$keyboardHandler); - // we need to completely intercept paste, just registering an event handler does not work - this.$originalEditorOnPaste = ed.onPaste; ed.onPaste = this.onPaste.bind(this); - this.$mousedownHandler = ed.addEventListener('mousedown', this.onMouseDown.bind(this)); - this.selectionFix(ed); - this.statusMessage(true); - }; - - this.deactivate = function(reset) { - this.cancelSearch(reset); - var ed = this.$editor; - ed.keyBinding.removeKeyboardHandler(this.$keyboardHandler); - if (this.$mousedownHandler) { - ed.removeEventListener('mousedown', this.$mousedownHandler); - delete this.$mousedownHandler; - } - ed.onPaste = this.$originalEditorOnPaste; - this.message(''); - }; - - this.selectionFix = function(editor) { - // Fix selection bug: When clicked inside the editor - // editor.selection.$isEmpty is false even if the mouse click did not - // open a selection. This is interpreted by the move commands to - // extend the selection. To only extend the selection when there is - // one, we clear it here - if (editor.selection.isEmpty() && !editor.session.$emacsMark) { - editor.clearSelection(); - } - }; - - this.highlight = function(regexp) { - var sess = this.$editor.session, - hl = sess.$isearchHighlight = sess.$isearchHighlight || sess.addDynamicMarker( - new SearchHighlight(null, "ace_isearch-result", "text")); - hl.setRegexp(regexp); - sess._emit("changeBackMarker"); // force highlight layer redraw - }; - - this.cancelSearch = function(reset) { - var e = this.$editor; - this.$prevNeedle = this.$options.needle; - this.$options.needle = ''; - if (reset) { - e.moveCursorToPosition(this.$startPos); - this.$currentPos = this.$startPos; - } else { - e.pushEmacsMark && e.pushEmacsMark(this.$startPos, false); - } - this.highlight(null); - return Range.fromPoints(this.$currentPos, this.$currentPos); - }; - - this.highlightAndFindWithNeedle = function(moveToNext, needleUpdateFunc) { - if (!this.$editor) return null; - var options = this.$options; - - // get search term - if (needleUpdateFunc) { - options.needle = needleUpdateFunc.call(this, options.needle || '') || ''; - } - if (options.needle.length === 0) { - this.statusMessage(true); - return this.cancelSearch(true); - } - - // try to find the next occurence and enable highlighting marker - options.start = this.$currentPos; - var session = this.$editor.session, - found = this.find(session), - shouldSelect = this.$editor.emacsMark ? - !!this.$editor.emacsMark() : !this.$editor.selection.isEmpty(); - if (found) { - if (options.backwards) found = Range.fromPoints(found.end, found.start); - this.$editor.selection.setRange(Range.fromPoints(shouldSelect ? this.$startPos : found.end, found.end)); - if (moveToNext) this.$currentPos = found.end; - // highlight after cursor move, so selection works properly - this.highlight(options.re); - } - - this.statusMessage(found); - - return found; - }; - - this.addString = function(s) { - return this.highlightAndFindWithNeedle(false, function(needle) { - if (!isRegExp(needle)) - return needle + s; - var reObj = regExpToObject(needle); - reObj.expression += s; - return objectToRegExp(reObj); - }); - }; - - this.removeChar = function(c) { - return this.highlightAndFindWithNeedle(false, function(needle) { - if (!isRegExp(needle)) - return needle.substring(0, needle.length-1); - var reObj = regExpToObject(needle); - reObj.expression = reObj.expression.substring(0, reObj.expression.length-1); - return objectToRegExp(reObj); - }); - }; - - this.next = function(options) { - // try to find the next occurence of whatever we have searched for - // earlier. - // options = {[backwards: BOOL], [useCurrentOrPrevSearch: BOOL]} - options = options || {}; - this.$options.backwards = !!options.backwards; - this.$currentPos = this.$editor.getCursorPosition(); - return this.highlightAndFindWithNeedle(true, function(needle) { - return options.useCurrentOrPrevSearch && needle.length === 0 ? - this.$prevNeedle || '' : needle; - }); - }; - - this.onMouseDown = function(evt) { - // when mouse interaction happens then we quit incremental search - this.deactivate(); - return true; - }; - - this.onPaste = function(text) { - this.addString(text); - }; - - this.convertNeedleToRegExp = function() { - return this.highlightAndFindWithNeedle(false, function(needle) { - return isRegExp(needle) ? needle : stringToRegExp(needle, 'ig'); - }); - }; - - this.convertNeedleToString = function() { - return this.highlightAndFindWithNeedle(false, function(needle) { - return isRegExp(needle) ? regExpToObject(needle).expression : needle; - }); - }; - - this.statusMessage = function(found) { - var options = this.$options, msg = ''; - msg += options.backwards ? 'reverse-' : ''; - msg += 'isearch: ' + options.needle; - msg += found ? '' : ' (not found)'; - this.message(msg); - }; - - this.message = function(msg) { - if (this.$editor.showCommandLine) { - this.$editor.showCommandLine(msg); - this.$editor.focus(); - } else { - console.log(msg); - } - }; - -}).call(IncrementalSearch.prototype); - - -exports.IncrementalSearch = IncrementalSearch; - - -/** - * - * Config settings for enabling/disabling [[IncrementalSearch `IncrementalSearch`]]. - * - **/ - -var dom = require('./lib/dom'); -dom.importCssString && dom.importCssString("\ -.ace_marker-layer .ace_isearch-result {\ - position: absolute;\ - z-index: 6;\ - -moz-box-sizing: border-box;\ - -webkit-box-sizing: border-box;\ - box-sizing: border-box;\ -}\ -div.ace_isearch-result {\ - border-radius: 4px;\ - background-color: rgba(255, 200, 0, 0.5);\ - box-shadow: 0 0 4px rgb(255, 200, 0);\ -}\ -.ace_dark div.ace_isearch-result {\ - background-color: rgb(100, 110, 160);\ - box-shadow: 0 0 4px rgb(80, 90, 140);\ -}", "incremental-search-highlighting"); - -// support for default keyboard handler -var commands = require("./commands/command_manager"); -(function() { - this.setupIncrementalSearch = function(editor, val) { - if (this.usesIncrementalSearch == val) return; - this.usesIncrementalSearch = val; - var iSearchCommands = iSearchCommandModule.iSearchStartCommands; - var method = val ? 'addCommands' : 'removeCommands'; - this[method](iSearchCommands); - }; -}).call(commands.CommandManager.prototype); - -// incremental search config option -var Editor = require("./editor").Editor; -require("./config").defineOptions(Editor.prototype, "editor", { - useIncrementalSearch: { - set: function(val) { - this.keyBinding.$handlers.forEach(function(handler) { - if (handler.setupIncrementalSearch) { - handler.setupIncrementalSearch(this, val); - } - }); - this._emit('incrementalSearchSettingChanged', {isEnabled: val}); - } - } -}); - -}); diff --git a/lib/ace/incremental_search_test.js b/lib/ace/incremental_search_test.js deleted file mode 100644 index d1303b42..00000000 --- a/lib/ace/incremental_search_test.js +++ /dev/null @@ -1,213 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -if (typeof process !== "undefined") { - require("amd-loader"); -} - -define(function(require, exports, module) { -"use strict"; - -var emacs = require('./keyboard/emacs'); -var EditSession = require("./edit_session").EditSession; -var Editor = require("./editor").Editor; -var MockRenderer = require("./test/mockrenderer").MockRenderer; -var Range = require("./range").Range; -var MultiSelect = require("./multi_select").MultiSelect; -var assert = require("./test/assertions"); -var IncrementalSearch = require("./incremental_search").IncrementalSearch; - -require("./multi_select"); - -var editor, iSearch; -function testRanges(str, ranges) { - ranges = ranges || editor.selection.getAllRanges(); - assert.equal(ranges + "", str + ""); -} - -// force "rerender" -function callHighlighterUpdate() { - var session = editor.session, - ranges = [], - mockMarkerLayer = { - drawSingleLineMarker: function(_, markerRanges) { - ranges = ranges.concat(markerRanges); - } - } - session.$isearchHighlight.update([], mockMarkerLayer, session, { - firstRow: 0, lastRow: session.getRowLength()}); - return ranges; -} - -module.exports = { - - name: "ACE incremental_search.js", - - setUp: function() { - var session = new EditSession(["abc123", "xyz124"]); - editor = new Editor(new MockRenderer(), session); - new MultiSelect(editor); - iSearch = new IncrementalSearch(); - }, - - "test: keyboard handler setup" : function() { - iSearch.activate(editor); - assert.equal(editor.getKeyboardHandler(), iSearch.$keyboardHandler); - iSearch.deactivate(); - assert.notEqual(editor.getKeyboardHandler(), iSearch.$keyboardHandler); - }, - - "test: isearch highlight setup" : function() { - var sess = editor.session; - iSearch.activate(editor); - iSearch.highlight('foo'); - var highl = sess.$isearchHighlight.id; - assert.ok(sess.$isearchHighlight, 'session has no isearch highlighter'); - assert.equal(sess.getMarkers()[highl.id], highl.id, 'isearch highlight not in markers'); - iSearch.deactivate(); - iSearch.activate(editor); - iSearch.highlight('bar'); - var highl2 = sess.$isearchHighlight.id; - assert.equal(highl2, highl, 'multiple isearch highlights'); - }, - - "test: find simple text incrementally" : function() { - iSearch.activate(editor); - var range = iSearch.addString('1'), // "1" - highlightRanges = callHighlighterUpdate(editor.session); - testRanges("Range: [0/3] -> [0/4]", [range], "range"); - testRanges("Range: [0/3] -> [0/4],Range: [1/3] -> [1/4]", highlightRanges, "highlight"); - - range = iSearch.addString('2'); // "12" - highlightRanges = callHighlighterUpdate(editor.session); - testRanges("Range: [0/3] -> [0/5]", [range], "range"); - testRanges("Range: [0/3] -> [0/5],Range: [1/3] -> [1/5]", highlightRanges, "highlight"); - - range = iSearch.addString('3'); // "123" - highlightRanges = callHighlighterUpdate(editor.session); - testRanges("Range: [0/3] -> [0/6]", [range], "range"); - testRanges("Range: [0/3] -> [0/6]", highlightRanges, "highlight"); - - range = iSearch.removeChar(); // "12" - highlightRanges = callHighlighterUpdate(editor.session); - testRanges("Range: [0/3] -> [0/5]", [range], "range"); - testRanges("Range: [0/3] -> [0/5],Range: [1/3] -> [1/5]", highlightRanges, "highlight"); - }, - - "test: forward / backward" : function() { - iSearch.activate(editor); - iSearch.addString('1'); iSearch.addString('2'); - var range = iSearch.next(); - testRanges("Range: [1/3] -> [1/5]", [range], "range"); - - range = iSearch.next(); // nothing to find - testRanges("", [range], "range"); - - range = iSearch.next({backwards: true}); // backwards - testRanges("Range: [1/5] -> [1/3]", [range], "range"); - }, - - "test: cancelSearch" : function() { - iSearch.activate(editor); - iSearch.addString('1'); iSearch.addString('2'); - var range = iSearch.cancelSearch(true); - testRanges("Range: [0/0] -> [0/0]", [range], "range"); - - iSearch.addString('1'); range = iSearch.addString('2'); - testRanges("Range: [0/3] -> [0/5]", [range], "range"); - }, - - "test: failing search keeps pos" : function() { - iSearch.activate(editor); - iSearch.addString('1'); iSearch.addString('2'); - var range = iSearch.addString('x'); - testRanges("", [range], "range"); - assert.position(editor.getCursorPosition(), 0, 5); - }, - - "test: backwards search" : function() { - editor.moveCursorTo(1,0); - iSearch.activate(editor, true); - iSearch.addString('1'); var range = iSearch.addString('2');; - testRanges("Range: [0/5] -> [0/3]", [range], "range"); - assert.position(editor.getCursorPosition(), 0, 3); - }, - - "test: forwards then backwards, same result, reoriented range" : function() { - iSearch.activate(editor); - iSearch.addString('1'); var range = iSearch.addString('2');; - testRanges("Range: [0/3] -> [0/5]", [range], "range"); - assert.position(editor.getCursorPosition(), 0, 5); - - range = iSearch.next({backwards: true}); - testRanges("Range: [0/5] -> [0/3]", [range], "range"); - assert.position(editor.getCursorPosition(), 0, 3); - }, - - "test: reuse prev search via option" : function() { - iSearch.activate(editor); - iSearch.addString('1'); iSearch.addString('2');; - assert.position(editor.getCursorPosition(), 0, 5); - iSearch.deactivate(); - - iSearch.activate(editor); - iSearch.next({backwards: false, useCurrentOrPrevSearch: true}); - assert.position(editor.getCursorPosition(), 1, 5); - }, - - "test: don't extend selection range if selection is empty" : function() { - iSearch.activate(editor); - iSearch.addString('1'); iSearch.addString('2');; - testRanges("Range: [0/5] -> [0/5]", [editor.getSelectionRange()], "sel range"); - }, - - "test: extend selection range if selection exists" : function() { - iSearch.activate(editor); - editor.selection.selectTo(0, 1); - iSearch.addString('1'); iSearch.addString('2');; - testRanges("Range: [0/0] -> [0/5]", [editor.getSelectionRange()], "sel range"); - }, - - "test: extend selection in emacs mark mode" : function() { - var emacs = require('./keyboard/emacs'); - editor.keyBinding.addKeyboardHandler(emacs.handler); - emacs.handler.commands.setMark.exec(editor); - iSearch.activate(editor); - iSearch.addString('1'); iSearch.addString('2'); - testRanges("Range: [0/0] -> [0/5]", [editor.getSelectionRange()], "sel range"); - } - -}; - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec() -} diff --git a/lib/ace/keyboard/emacs.js b/lib/ace/keyboard/emacs.js index 8cecad1b..e2c65e9d 100644 --- a/lib/ace/keyboard/emacs.js +++ b/lib/ace/keyboard/emacs.js @@ -1,30 +1,38 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. * - * 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. + * The Original Code is Mozilla Skywriter. + * + * The Initial Developer of the Original Code is + * Mozilla. + * Portions created by the Initial Developer are Copyright (C) 2009 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Julian Viereck (julian.viereck@gmail.com) + * Harutyun Amirjanyan (harutyun@c9.io) + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,18 +40,15 @@ define(function(require, exports, module) { "use strict"; var dom = require("../lib/dom"); -require("../incremental_search"); -var iSearchCommandModule = require("../commands/incremental_search_commands"); - -var screenToTextBlockCoordinates = function(x, y) { +var screenToTextBlockCoordinates = function(pageX, pageY) { var canvasPos = this.scroller.getBoundingClientRect(); var col = Math.floor( - (x + this.scrollLeft - canvasPos.left - this.$padding) / this.characterWidth + (pageX + this.scrollLeft - canvasPos.left - this.$padding - dom.getPageScrollLeft()) / this.characterWidth ); var row = Math.floor( - (y + this.scrollTop - canvasPos.top) / this.lineHeight + (pageY + this.scrollTop - canvasPos.top - dom.getPageScrollTop()) / this.lineHeight ); return this.session.screenToDocumentPosition(row, col); @@ -52,30 +57,23 @@ var screenToTextBlockCoordinates = function(x, y) { var HashHandler = require("./hash_handler").HashHandler; exports.handler = new HashHandler(); -exports.handler.isEmacs = true; -exports.handler.$id = "ace/keyboard/emacs"; - var initialized = false; -var $formerLongWords; -var $formerLineStart; - exports.handler.attach = function(editor) { if (!initialized) { initialized = true; dom.importCssString('\ .emacs-mode .ace_cursor{\ - border: 1px rgba(50,250,50,0.8) solid!important;\ + border: 2px rgba(50,250,50,0.8) solid!important;\ -moz-box-sizing: border-box!important;\ - -webkit-box-sizing: border-box!important;\ box-sizing: border-box!important;\ background-color: rgba(0,250,0,0.9);\ opacity: 0.5;\ }\ - .emacs-mode .ace_hidden-cursors .ace_cursor{\ + .emacs-mode .ace_cursor.ace_hidden{\ opacity: 1;\ background-color: transparent;\ }\ - .emacs-mode .ace_overwrite-cursors .ace_cursor {\ + .emacs-mode .ace_cursor.ace_overwrite {\ opacity: 1;\ background-color: transparent;\ border-width: 0 0 2px 2px !important;\ @@ -88,268 +86,110 @@ exports.handler.attach = function(editor) { }', 'emacsMode' ); } - // in emacs, gotowordleft/right should not count a space as a word.. - $formerLongWords = editor.session.$selectLongWords; - editor.session.$selectLongWords = true; - // CTRL-A should go to actual beginning of line - $formerLineStart = editor.session.$useEmacsStyleLineStart; - editor.session.$useEmacsStyleLineStart = true; - editor.session.$emacsMark = null; // the active mark - editor.session.$emacsMarkRing = editor.session.$emacsMarkRing || []; - - editor.emacsMark = function() { - return this.session.$emacsMark; - }; - - editor.setEmacsMark = function(p) { - // to deactivate pass in a falsy value - this.session.$emacsMark = p; - }; - - editor.pushEmacsMark = function(p, activate) { - var prevMark = this.session.$emacsMark; - if (prevMark) - this.session.$emacsMarkRing.push(prevMark); - if (!p || activate) this.setEmacsMark(p); - else this.session.$emacsMarkRing.push(p); - }; - - editor.popEmacsMark = function() { - var mark = this.emacsMark(); - if (mark) { this.setEmacsMark(null); return mark; } - return this.session.$emacsMarkRing.pop(); - }; - - editor.getLastEmacsMark = function(p) { - return this.session.$emacsMark || this.session.$emacsMarkRing.slice(-1)[0]; - }; - - editor.emacsMarkForSelection = function(replacement) { - // find the mark in $emacsMarkRing corresponding to the current - // selection - var sel = this.selection, - multiRangeLength = this.multiSelect ? - this.multiSelect.getAllRanges().length : 1, - selIndex = sel.index || 0, - markRing = this.session.$emacsMarkRing, - markIndex = markRing.length - (multiRangeLength - selIndex), - lastMark = markRing[markIndex] || sel.anchor; - if (replacement) { - markRing.splice(markIndex, 1, - "row" in replacement && "column" in replacement ? - replacement : undefined); - } - return lastMark; - } - - editor.on("click", $resetMarkMode); - editor.on("changeSession", $kbSessionChange); editor.renderer.screenToTextCoordinates = screenToTextBlockCoordinates; editor.setStyle("emacs-mode"); - editor.commands.addCommands(commands); - exports.handler.platform = editor.commands.platform; - editor.$emacsModeHandler = this; - editor.addEventListener('copy', this.onCopy); - editor.addEventListener('paste', this.onPaste); }; exports.handler.detach = function(editor) { delete editor.renderer.screenToTextCoordinates; - editor.session.$selectLongWords = $formerLongWords; - editor.session.$useEmacsStyleLineStart = $formerLineStart; - editor.removeEventListener("click", $resetMarkMode); - editor.removeEventListener("changeSession", $kbSessionChange); editor.unsetStyle("emacs-mode"); - editor.commands.removeCommands(commands); - editor.removeEventListener('copy', this.onCopy); - editor.removeEventListener('paste', this.onPaste); - editor.$emacsModeHandler = null; }; -var $kbSessionChange = function(e) { - if (e.oldSession) { - e.oldSession.$selectLongWords = $formerLongWords; - e.oldSession.$useEmacsStyleLineStart = $formerLineStart; - } - - $formerLongWords = e.session.$selectLongWords; - e.session.$selectLongWords = true; - $formerLineStart = e.session.$useEmacsStyleLineStart; - e.session.$useEmacsStyleLineStart = true; - - if (!e.session.hasOwnProperty('$emacsMark')) - e.session.$emacsMark = null; - if (!e.session.hasOwnProperty('$emacsMarkRing')) - e.session.$emacsMarkRing = []; -}; - -var $resetMarkMode = function(e) { - e.editor.session.$emacsMark = null; -}; var keys = require("../lib/keys").KEY_MODS; -var eMods = {C: "ctrl", S: "shift", M: "alt", CMD: "command"}; -var combinations = ["C-S-M-CMD", - "S-M-CMD", "C-M-CMD", "C-S-CMD", "C-S-M", - "M-CMD", "S-CMD", "S-M", "C-CMD", "C-M", "C-S", - "CMD", "M", "S", "C"]; -combinations.forEach(function(c) { +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) { + c.split("-").forEach(function(c){ hashId = hashId | keys[eMods[c]]; }); eMods[hashId] = c.toLowerCase() + "-"; }); -exports.handler.onCopy = function(e, editor) { - if (editor.$handlesEmacsOnCopy) return; - editor.$handlesEmacsOnCopy = true; - exports.handler.commands.killRingSave.exec(editor); - editor.$handlesEmacsOnCopy = false; -}; - -exports.handler.onPaste = function(e, editor) { - editor.pushEmacsMark(editor.getCursorPosition()); -}; - exports.handler.bindKey = function(key, command) { - if (typeof key == "object") - key = key[this.platform]; if (!key) return; - var ckb = this.commandKeyBinding; + var ckb = this.commmandKeyBinding; key.split("|").forEach(function(keyPart) { keyPart = keyPart.toLowerCase(); ckb[keyPart] = command; - // register all partial key combos as null commands - // to be able to activate key combos with arbitrary length - // Example: if keyPart is "C-c C-l t" then "C-c C-l t" will - // get command assigned and "C-c" and "C-c C-l" will get - // a null command assigned in this.commandKeyBinding. For - // the lookup logic see handleKeyboard() - var keyParts = keyPart.split(" ").slice(0,-1); - keyParts.reduce(function(keyMapKeys, keyPart, i) { - var prefix = keyMapKeys[i-1] ? keyMapKeys[i-1] + ' ' : ''; - return keyMapKeys.concat([prefix + keyPart]); - }, []).forEach(function(keyPart) { - if (!ckb[keyPart]) ckb[keyPart] = "null"; - }); + keyPart = keyPart.split(" ")[0]; + if (!ckb[keyPart]) + ckb[keyPart] = "null"; }, this); }; -exports.handler.getStatusText = function(editor, data) { - var str = ""; - if (data.count) - str += data.count; - if (data.keyChain) - str += " " + data.keyChain - return str; -}; exports.handler.handleKeyboard = function(data, hashId, key, keyCode) { - // if keyCode == -1 a non-printable key was pressed, such as just - // control. Handling those is currently not supported in this handler - if (keyCode === -1) return undefined; - - var editor = data.editor; - editor._signal("changeStatus"); - // insertstring data.count times if (hashId == -1) { - editor.pushEmacsMark(); if (data.count) { - var str = new Array(data.count + 1).join(key); + var str = Array(data.count + 1).join(key); data.count = null; return {command: "insertstring", args: str}; } } - var modifier = eMods[hashId]; + if (key == "\x00") + return; - // CTRL + number / universalArgument for setting data.count - if (modifier == "c-" || data.count) { + var modifier = eMods[hashId]; + if (modifier == "c-" || data.universalArgument) { var count = parseInt(key[key.length - 1]); - if (typeof count === 'number' && !isNaN(count)) { - data.count = Math.max(data.count, 0) || 0; - data.count = 10 * data.count + count; + if (count) { + data.count = count; return {command: "null"}; } } + data.universalArgument = false; - // this.commandKeyBinding maps key specs like "c-p" (for CTRL + P) to - // command objects, for lookup key needs to include the modifier - if (modifier) key = modifier + key; + if (modifier) + key = modifier + key; - // Key combos like CTRL+X H build up the data.keyChain - if (data.keyChain) key = data.keyChain += " " + key; + if (data.keyChain) + key = data.keyChain += " " + key; - // Key combo prefixes get stored as "null" (String!) in this - // this.commandKeyBinding. When encountered no command is invoked but we - // buld up data.keyChain - var command = this.commandKeyBinding[key]; + var command = this.commmandKeyBinding[key]; data.keyChain = command == "null" ? key : ""; - // there really is no command - if (!command) return undefined; + if (!command) + return; - // we pass b/c of key combo or universalArgument - if (command === "null") return {command: "null"}; + if (command == "null") + return {command: "null"}; - if (command === "universalArgument") { - // if no number pressed emacs repeats action 4 times. - // minus sign is needed to allow next keypress to replace it - data.count = -4; + if (command == "universalArgument") { + data.universalArgument = true; return {command: "null"}; } - // lookup command - // TODO extract special handling of markmode - // TODO special case command.command is really unnecessary, remove - var args; - if (typeof command !== "string") { - args = command.args; - if (command.command) command = command.command; - if (command === "goorselect") { - command = editor.emacsMark() ? args[1] : args[0]; - args = null; - } + if (typeof command != "string") { + var args = command.args; + command = command.command; } - if (typeof command === "string") { - if (command === "insertstring" || - command === "splitline" || - command === "togglecomment") { - editor.pushEmacsMark(); - } - command = this.commands[command] || editor.commands.commands[command]; - if (!command) return undefined; + if (typeof command == "string") { + command = this.commands[command] || data.editor.commands.commands[command]; } - if (!command.readOnly && !command.isYank) + if (!command.readonly && !command.isYank) data.lastCommand = null; - if (!command.readOnly && editor.emacsMark()) - editor.setEmacsMark(null) - if (data.count) { var count = data.count; data.count = 0; - if (!command || !command.handlesCount) { - return { - args: args, - command: { - exec: function(editor, args) { - for (var i = 0; i < count; i++) - command.exec(editor, args); - }, - multiSelectAction: command.multiSelectAction + return { + args: args, + command: { + exec: function(editor, args) { + for (var i = 0; i < count; i++) + command.exec(editor, args); } - }; - } else { - if (!args) args = {}; - if (typeof args === 'object') args.count = count; - } + } + }; } return {command: command, args: args}; @@ -357,16 +197,16 @@ exports.handler.handleKeyboard = function(data, hashId, key, keyCode) { exports.emacsKeys = { // movement - "Up|C-p" : {command: "goorselect", args: ["golineup","selectup"]}, - "Down|C-n" : {command: "goorselect", args: ["golinedown","selectdown"]}, - "Left|C-b" : {command: "goorselect", args: ["gotoleft","selectleft"]}, - "Right|C-f" : {command: "goorselect", args: ["gotoright","selectright"]}, - "C-Left|M-b" : {command: "goorselect", args: ["gotowordleft","selectwordleft"]}, - "C-Right|M-f" : {command: "goorselect", args: ["gotowordright","selectwordright"]}, - "Home|C-a" : {command: "goorselect", args: ["gotolinestart","selecttolinestart"]}, - "End|C-e" : {command: "goorselect", args: ["gotolineend","selecttolineend"]}, - "C-Home|S-M-,": {command: "goorselect", args: ["gotostart","selecttostart"]}, - "C-End|S-M-." : {command: "goorselect", args: ["gotoend","selecttoend"]}, + "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", @@ -380,22 +220,19 @@ exports.emacsKeys = { "S-C-Home" : "selecttostart", "S-C-End" : "selecttoend", - "C-l" : "recenterTopBottom", - "M-s" : "centerselection", + "C-l|M-s" : "centerselection", "M-g": "gotoline", "C-x C-p": "selectall", // todo fix these - "C-Down": {command: "goorselect", args: ["gotopagedown","selectpagedown"]}, - "C-Up": {command: "goorselect", args: ["gotopageup","selectpageup"]}, - "PageDown|C-v": {command: "goorselect", args: ["gotopagedown","selectpagedown"]}, - "PageUp|M-v": {command: "goorselect", args: ["gotopageup","selectpageup"]}, + "C-Down": "gotopagedown", + "C-Up": "gotopageup", + "PageDown|C-v": "gotopagedown", + "PageUp|M-v": "gotopageup", "S-C-Down": "selectpagedown", "S-C-Up": "selectpageup", - - "C-s": "iSearch", - "C-r": "iSearchBackwards", - + "C-s": "findnext", + "C-r": "findprevious", "M-C-s": "findnext", "M-C-r": "findprevious", "S-M-5": "replace", @@ -414,117 +251,45 @@ exports.emacsKeys = { "M-y": "yankRotate", "C-g": "keyboardQuit", - "C-w|C-S-W": "killRegion", + "C-w": "killRegion", "M-w": "killRingSave", + "C-Space": "setMark", "C-x C-x": "exchangePointAndMark", "C-t": "transposeletters", - "M-u": "touppercase", // Doesn't work - "M-l": "tolowercase", - "M-/": "autocomplete", // Doesn't work - "C-u": "universalArgument", + "M-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? + "S-C-/|S-C-x u|C--|S-C-z": "redo", //infinite undo? // vertical editing - "C-x r": "selectRectangularRegion", - "M-x": {command: "focusCommandLine", args: "M-x "} + "C-x r": "selectRectangularRegion" + // todo - // "C-x C-t" "M-t" "M-c" "F11" "C-M- "M-q" + // "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: { - exec: function(editor, args) { - // Sets mark-mode and clears current selection. - // When mark is set, keyboard cursor movement commands become - // selection modification commands. That is, - // "goto" commands become "select" commands. - // Any insertion or mouse click resets mark-mode. - // setMark twice in a row at the same place resets markmode. - // in multi select mode, ea selection is handled individually - - if (args && args.count) { - if (editor.inMultiSelectMode) editor.forEachSelection(moveToMark); - else moveToMark(); - moveToMark(); - return; - } - - var mark = editor.emacsMark(), - ranges = editor.selection.getAllRanges(), - rangePositions = ranges.map(function(r) { return {row: r.start.row, column: r.start.column}; }), - transientMarkModeActive = true, - hasNoSelection = ranges.every(function(range) { return range.isEmpty(); }); - // if transientMarkModeActive then mark behavior is a little - // different. Deactivate the mark when setMark is run with active - // mark - if (transientMarkModeActive && (mark || !hasNoSelection)) { - if (editor.inMultiSelectMode) editor.forEachSelection({exec: editor.clearSelection.bind(editor)}); - else editor.clearSelection(); - if (mark) editor.pushEmacsMark(null); - return; - } - - if (!mark) { - rangePositions.forEach(function(pos) { editor.pushEmacsMark(pos); }); - editor.setEmacsMark(rangePositions[rangePositions.length-1]); - return; - } - - // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - - function moveToMark() { - var mark = editor.popEmacsMark(); - mark && editor.moveCursorToPosition(mark); - } - - }, - readOnly: true, - handlesCount: true + setMark: function() { }, exchangePointAndMark: { - exec: function exchangePointAndMark$exec(editor, args) { - var sel = editor.selection; - if (!args.count && !sel.isEmpty()) { // just invert selection - sel.setSelectionRange(sel.getRange(), !sel.isBackwards()); - return; - } - - if (args.count) { // replace mark and point - var pos = {row: sel.lead.row, column: sel.lead.column}; - sel.clearSelection(); - sel.moveCursorToPosition(editor.emacsMarkForSelection(pos)); - } else { // create selection to last mark - sel.selectToPosition(editor.emacsMarkForSelection()); - } + exec: function(editor) { + var range = editor.selection.getRange(); + editor.selection.setSelectionRange(range, !editor.selection.isBackwards()); }, - readOnly: true, - handlesCount: true, - multiSelectAction: "forEach" + readonly: true, + multiselectAction: "forEach" }, killWord: { exec: function(editor, dir) { @@ -541,23 +306,10 @@ exports.handler.addCommands({ editor.session.remove(range); editor.clearSelection(); }, - multiSelectAction: "forEach" + multiselectAction: "forEach" }, killLine: function(editor) { - editor.pushEmacsMark(null); - var pos = editor.getCursorPosition(); - if (pos.column === 0 && - editor.session.doc.getLine(pos.row).length === 0) { - // If an already empty line is killed, remove - // the line entirely - editor.selection.selectLine(); - } else { - // otherwise just remove from the current cursor position - // to the end (but don't delete the selection if it's before - // the cursor) - editor.clearSelection(); - editor.selection.selectLineEnd(); - } + editor.selection.selectLine(); var range = editor.getSelectionRange(); var text = editor.session.getTextRange(range); exports.killRing.add(text); @@ -566,63 +318,26 @@ exports.handler.addCommands({ editor.clearSelection(); }, yank: function(editor) { - editor.onPaste(exports.killRing.get() || ''); + editor.onPaste(exports.killRing.get()); editor.keyBinding.$data.lastCommand = "yank"; }, yankRotate: function(editor) { if (editor.keyBinding.$data.lastCommand != "yank") return; + editor.undo(); - editor.session.$emacsMarkRing.pop(); // also undo recording mark editor.onPaste(exports.killRing.rotate()); editor.keyBinding.$data.lastCommand = "yank"; }, - killRegion: { - exec: function(editor) { - exports.killRing.add(editor.getCopyText()); - editor.commands.byName.cut.exec(editor); - }, - readOnly: true, - multiSelectAction: "forEach" + killRegion: function(editor) { + exports.killRing.add(editor.getCopyText()); + editor.cut(); }, - killRingSave: { - exec: function(editor) { - // copy text and deselect. will save marks for starts of the - // selection(s) - - editor.$handlesEmacsOnCopy = true; - var marks = editor.session.$emacsMarkRing.slice(), - deselectedMarks = []; - exports.killRing.add(editor.getCopyText()); - - setTimeout(function() { - function deselect() { - var sel = editor.selection, range = sel.getRange(), - pos = sel.isBackwards() ? range.end : range.start; - deselectedMarks.push({row: pos.row, column: pos.column}); - sel.clearSelection(); - } - editor.$handlesEmacsOnCopy = false; - if (editor.inMultiSelectMode) editor.forEachSelection({exec: deselect}); - else deselect(); - editor.session.$emacsMarkRing = marks.concat(deselectedMarks.reverse()); - }, 0); - }, - readOnly: true - }, - keyboardQuit: function(editor) { - editor.selection.clearSelection(); - editor.setEmacsMark(null); - editor.keyBinding.$data.count = null; - }, - focusCommandLine: function(editor, arg) { - if (editor.showCommandLine) - editor.showCommandLine(arg); + killRingSave: function(editor) { + exports.killRing.add(editor.getCopyText()); } }); -exports.handler.addCommands(iSearchCommandModule.iSearchStartCommands); - var commands = exports.handler.commands; commands.yank.isYank = true; commands.yankRotate.isYank = true; @@ -634,9 +349,8 @@ exports.killRing = { if (this.$data.length > 30) this.$data.shift(); }, - get: function(n) { - n = n || 1; - return this.$data.slice(this.$data.length-n, this.$data.length).reverse().join('\n'); + get: function() { + return this.$data[this.$data.length - 1] || ""; }, pop: function() { if (this.$data.length > 1) @@ -649,4 +363,5 @@ exports.killRing = { } }; + }); diff --git a/lib/ace/keyboard/emacs_test.js b/lib/ace/keyboard/emacs_test.js deleted file mode 100644 index 3ba5efaa..00000000 --- a/lib/ace/keyboard/emacs_test.js +++ /dev/null @@ -1,151 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -if (typeof process !== "undefined") { - require("amd-loader"); -} - -define(function(require, exports, module) { -"use strict"; - -require("../multi_select"); - -var EditSession = require("./../edit_session").EditSession, - Editor = require("./../editor").Editor, - Range = require("./../range").Range, - MockRenderer = require("./../test/mockrenderer").MockRenderer, - emacs = require('./emacs'), - assert = require("./../test/assertions"), - editor, sel; - -function initEditor(docString) { - var doc = new EditSession(docString.split("\n")); - editor = new Editor(new MockRenderer(), doc); - editor.setKeyboardHandler(emacs.handler); - sel = editor.selection; -} - -function print(obj) { - return JSON.stringify(obj, null, 2); -} - -function pluck(arr, what) { - return arr.map(function(ea) { return ea[what]; }); -} - -module.exports = { - - "test: detach removes emacs commands from command manager": function() { - initEditor(''); - assert.ok(!!editor.commands.byName["keyboardQuit"], 'setup error: emacs commands not installed'); - editor.keyBinding.removeKeyboardHandler(editor.getKeyboardHandler()); - assert.ok(!editor.commands.byName["keyboardQuit"], 'emacs commands not removed'); - }, - - "test: keyboardQuit clears selection": function() { - initEditor('foo'); - editor.selectAll(); - editor.execCommand('keyboardQuit'); - assert.ok(editor.selection.isEmpty(), 'selection non-empty'); - }, - - "test: exchangePointAndMark without mark set": function() { - initEditor('foo'); - sel.setRange(Range.fromPoints({row: 0, column: 1}, {row: 0, column: 3})); - editor.execCommand('exchangePointAndMark'); - assert.deepEqual({row: 0, column: 1}, editor.getCursorPosition(), print(editor.getCursorPosition())); - }, - - "test: exchangePointAndMark with mark set": function() { - initEditor('foo'); - editor.pushEmacsMark({row: 0, column: 1}); - editor.pushEmacsMark({row: 0, column: 2}); - editor.execCommand('exchangePointAndMark', {count: 4}); - assert.deepEqual({row: 0, column: 2}, editor.getCursorPosition(), print(editor.getCursorPosition())); - assert.deepEqual([{row: 0, column: 1}, {row: 0, column: 0}], editor.session.$emacsMarkRing, print(editor.session.$emacsMarkRing)); - }, - - "test: exchangePointAndMark with selection": function() { - initEditor('foo'); - editor.pushEmacsMark({row: 0, column: 1}); - editor.pushEmacsMark({row: 0, column: 2}); - sel.setRange(Range.fromPoints({row: 0, column: 0}, {row: 0, column: 1}), true); - editor.execCommand('exchangePointAndMark'); - assert.deepEqual({row: 0, column: 1}, editor.getCursorPosition(), print(editor.getCursorPosition())); - assert.deepEqual([{row: 0, column: 1}, {row: 0, column: 2}], editor.session.$emacsMarkRing, print(editor.session.$emacsMarkRing)); - }, - - "test: exchangePointAndMark with multi selection": function() { - initEditor('foo\nhello world\n123'); - var ranges = [[{row: 0, column: 0}, {row: 0, column: 3}], - [{row: 1, column: 0}, {row: 1, column: 5}], - [{row: 1, column: 6}, {row: 1, column: 11}]] - ranges.forEach(function(r) { - sel.addRange(Range.fromPoints(r[0], r[1])); - }); - assert.equal("foo\nhello\nworld", editor.getSelectedText()); - editor.execCommand('exchangePointAndMark'); - assert.equal("foo\nhello\nworld", editor.getSelectedText()); - assert.deepEqual(pluck(ranges, 0), pluck(sel.getAllRanges(), 'cursor'), "selections dir not inverted"); - }, - - "test: exchangePointAndMark with multi cursors": function() { - initEditor('foo\nhello world\n123'); - var ranges = [[{row: 0, column: 0}, {row: 0, column: 3}], - [{row: 1, column: 0}, {row: 1, column: 5}], - [{row: 1, column: 6}, {row: 1, column: 11}]]; - // move cursors to the start of each range and set a mark to its end - // without selecting anything - ranges.forEach(function(r) { - editor.pushEmacsMark(r[1]); - sel.addRange(Range.fromPoints(r[0], r[0])); - }); - assert.deepEqual(pluck(ranges, 0), pluck(sel.getAllRanges(), 'cursor'), print(sel.getAllRanges())); - editor.execCommand('exchangePointAndMark'); - assert.deepEqual(pluck(ranges, 1), pluck(sel.getAllRanges(), 'cursor'), "not inverted: " + print(sel.getAllRanges())); - }, - - "test: setMark with multi cursors": function() { - initEditor('foo\nhello world\n123'); - var positions = [{row: 0, column: 0}, - {row: 1, column: 0}, - {row: 1, column: 6}]; - positions.forEach(function(p) { sel.addRange(Range.fromPoints(p,p)); }); - editor.execCommand('setMark'); - assert.deepEqual(positions, editor.session.$emacsMarkRing, print(editor.session.$emacsMarkRing)); - } - -}; - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec() -} diff --git a/lib/ace/keyboard/hash_handler.js b/lib/ace/keyboard/hash_handler.js index a7dc1a93..3fad3339 100644 --- a/lib/ace/keyboard/hash_handler.js +++ b/lib/ace/keyboard/hash_handler.js @@ -1,57 +1,55 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Mozilla Skywriter. + * + * The Initial Developer of the Original Code is + * Mozilla. + * Portions created by the Initial Developer are Copyright (C) 2009 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * Julian Viereck (julian.viereck@gmail.com) + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ define(function(require, exports, module) { "use strict"; -var keyUtil = require("../lib/keys"); -var useragent = require("../lib/useragent"); -var KEY_MODS = keyUtil.KEY_MODS; +var keyUtil = require("../lib/keys"); function HashHandler(config, platform) { - this.platform = platform || (useragent.isMac ? "mac" : "win"); + this.platform = platform; this.commands = {}; - this.commandKeyBinding = {}; + this.commmandKeyBinding = {}; + this.addCommands(config); - this.$singleCommand = true; -} - -function MultiHashHandler(config, platform) { - HashHandler.call(this, config, platform); - this.$singleCommand = false; -} - -MultiHashHandler.prototype = HashHandler.prototype; +}; (function() { - this.addCommand = function(command) { if (this.commands[command.name]) @@ -63,109 +61,47 @@ MultiHashHandler.prototype = HashHandler.prototype; this._buildKeyHash(command); }; - this.removeCommand = function(command, keepCommand) { - var name = command && (typeof command === 'string' ? command : command.name); + this.removeCommand = function(command) { + var name = (typeof command === 'string' ? command : command.name); command = this.commands[name]; - if (!keepCommand) - delete 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.commandKeyBinding; - for (var keyId in ckb) { - var cmdGroup = ckb[keyId]; - if (cmdGroup == command) { - delete ckb[keyId]; - } else if (Array.isArray(cmdGroup)) { - var i = cmdGroup.indexOf(command); - if (i != -1) { - cmdGroup.splice(i, 1); - if (cmdGroup.length == 1) - ckb[keyId] = cmdGroup[0]; - } + 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, position) { - if (typeof key == "object") { - if (position == undefined) - position = key.position; - key = key[this.platform]; - } - if (!key) + this.bindKey = function(key, command) { + if(!key) + return; + if (typeof command == "function") { + this.addCommand({exec: command, bindKey: key, name: key}); return; - if (typeof command == "function") - return this.addCommand({exec: command, bindKey: key, name: command.name || key}); - - key.split("|").forEach(function(keyPart) { - var chain = ""; - if (keyPart.indexOf(" ") != -1) { - var parts = keyPart.split(/\s+/); - keyPart = parts.pop(); - parts.forEach(function(keyPart) { - var binding = this.parseKeys(keyPart); - var id = KEY_MODS[binding.hashId] + binding.key; - chain += (chain ? " " : "") + id; - this._addCommandToBinding(chain, "chainKeys"); - }, this); - chain += " "; - } - var binding = this.parseKeys(keyPart); - var id = KEY_MODS[binding.hashId] + binding.key; - this._addCommandToBinding(chain + id, command, position); - }, this); - }; - - function getPosition(command) { - return typeof command == "object" && command.bindKey - && command.bindKey.position || 0; - } - this._addCommandToBinding = function(keyId, command, position) { - var ckb = this.commandKeyBinding, i; - if (!command) { - delete ckb[keyId]; - } else if (!ckb[keyId] || this.$singleCommand) { - ckb[keyId] = command; - } else { - if (!Array.isArray(ckb[keyId])) { - ckb[keyId] = [ckb[keyId]]; - } else if ((i = ckb[keyId].indexOf(command)) != -1) { - ckb[keyId].splice(i, 1); - } - - if (typeof position != "number") { - if (position || command.isDefault) - position = -100; - else - position = getPosition(command); - } - var commands = ckb[keyId]; - for (i = 0; i < commands.length; i++) { - var other = commands[i]; - var otherPos = getPosition(other); - if (otherPos > position) - break; - } - commands.splice(i, 0, command); } + + 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 (!command) - return; - if (typeof command === "string") return this.bindKey(command, name); if (typeof command === "function") command = { exec: command }; - if (typeof command !== "object") - return; - if (!command.name) command.name = name; @@ -186,71 +122,49 @@ MultiHashHandler.prototype = HashHandler.prototype; }; this._buildKeyHash = function(command) { - this.bindKey(command.bindKey, 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 key; var hashId = 0; - for (var i = parts.length; i--;) { - var modifier = keyUtil.KEY_MODS[parts[i]]; - if (modifier == null) { - if (typeof console != "undefined") - console.error("invalid modifier " + parts[i] + " in " + keys); - return false; - } - hashId |= modifier; + var parts = keys.toLowerCase().trim().split(/\s*\-\s*/); + + for (var i = 0, l = parts.length; i < l; i++) { + if (keyUtil.KEY_MODS[parts[i]]) + hashId = hashId | keyUtil.KEY_MODS[parts[i]]; + else + key = parts[i] || "-"; //when empty, the splitSafe removed a '-' } - return {key: key, hashId: hashId}; + + if (parts[0] == "text" && parts.length == 2) { + hashId = -1; + key = parts[1]; + } + + return { + key: key, + hashId: hashId + }; }; this.findKeyCommand = function findKeyCommand(hashId, keyString) { - var key = KEY_MODS[hashId] + keyString; - return this.commandKeyBinding[key]; + var ckbr = this.commmandKeyBinding; + return ckbr[hashId] && ckbr[hashId][keyString.toLowerCase()]; }; this.handleKeyboard = function(data, hashId, keyString, keyCode) { - var key = KEY_MODS[hashId] + keyString; - var command = this.commandKeyBinding[key]; - if (data.$keyChain) { - data.$keyChain += " " + key; - command = this.commandKeyBinding[data.$keyChain] || command; - } - - if (command) { - if (command == "chainKeys" || command[command.length - 1] == "chainKeys") { - data.$keyChain = data.$keyChain || key; - return {command: "null"}; - } - } - - if (data.$keyChain) { - if ((!hashId || hashId == 4) && keyString.length == 1) - data.$keyChain = data.$keyChain.slice(0, -key.length - 1); // wait for input - else if (hashId == -1 || keyCode > 0) - data.$keyChain = ""; // reset keyChain - } - return {command: command}; - }; - - this.getStatusText = function(editor, data) { - return data.$keyChain || ""; + return { + command: this.findKeyCommand(hashId, keyString) + }; }; -}).call(HashHandler.prototype); +}).call(HashHandler.prototype) exports.HashHandler = HashHandler; -exports.MultiHashHandler = MultiHashHandler; }); diff --git a/lib/ace/keyboard/keybinding.js b/lib/ace/keyboard/keybinding.js index cddf0666..80bf0de1 100644 --- a/lib/ace/keyboard/keybinding.js +++ b/lib/ace/keyboard/keybinding.js @@ -1,30 +1,39 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * Julian Viereck + * Harutyun Amirjanyan + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -36,7 +45,7 @@ var event = require("../lib/event"); var KeyBinding = function(editor) { this.$editor = editor; - this.$data = {editor: editor}; + this.$data = { }; this.$handlers = []; this.setDefaultHandler(editor.commands); }; @@ -46,15 +55,15 @@ var KeyBinding = function(editor) { this.removeKeyboardHandler(this.$defaultHandler); this.$defaultHandler = kb; this.addKeyboardHandler(kb, 0); + this.$data = {editor: this.$editor}; }; this.setKeyboardHandler = function(kb) { - var h = this.$handlers; - if (h[h.length - 1] == kb) + if (this.$handlers[this.$handlers.length - 1] == kb) return; - while (h[h.length - 1] && h[h.length - 1] != this.$defaultHandler) - this.removeKeyboardHandler(h[h.length - 1]); + while (this.$handlers[1]) + this.removeKeyboardHandler(this.$handlers[1]); this.addKeyboardHandler(kb, 1); }; @@ -62,8 +71,6 @@ var KeyBinding = function(editor) { this.addKeyboardHandler = function(kb, pos) { if (!kb) return; - if (typeof kb == "function" && !kb.handleKeyboard) - kb.handleKeyboard = kb; var i = this.$handlers.indexOf(kb); if (i != -1) this.$handlers.splice(i, 1); @@ -89,42 +96,33 @@ var KeyBinding = function(editor) { this.getKeyboardHandler = function() { return this.$handlers[this.$handlers.length - 1]; }; - - this.getStatusText = function() { - var data = this.$data; - var editor = data.editor; - return this.$handlers.map(function(h) { - return h.getStatusText && h.getStatusText(editor, data) || ""; - }).filter(Boolean).join(" "); - }; - this.$callKeyboardHandlers = function(hashId, keyString, keyCode, e) { + this.$callKeyboardHandlers = function (hashId, keyString, keyCode, e) { var toExecute; - var success = false; - var commands = this.$editor.commands; - for (var i = this.$handlers.length; i--;) { toExecute = this.$handlers[i].handleKeyboard( this.$data, hashId, keyString, keyCode, e ); - if (!toExecute || !toExecute.command) - continue; - - // allow keyboardHandler to consume keys - if (toExecute.command == "null") { - success = true; - } else { - success = commands.exec(toExecute.command, this.$editor, toExecute.args, e); - } - // do not stop input events to not break repeating - if (success && e && hashId != -1 && - toExecute.passEvent != true && toExecute.command.passEvent != true - ) { - event.stopEvent(e); - } - if (success) + 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; }; diff --git a/lib/ace/keyboard/keybinding_test.js b/lib/ace/keyboard/keybinding_test.js deleted file mode 100644 index 617d99c4..00000000 --- a/lib/ace/keyboard/keybinding_test.js +++ /dev/null @@ -1,69 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -if (typeof process !== "undefined") { - require("amd-loader"); -} - -define(function(require, exports, module) { -"use strict"; - -var EditSession = require("./../edit_session").EditSession, - Editor = require("./../editor").Editor, - MockRenderer = require("./../test/mockrenderer").MockRenderer, - assert = require("./../test/assertions"), - HashHandler = require('./hash_handler').HashHandler, - keys = require('../lib/keys'), - editor; - -function initEditor(docString) { - var doc = new EditSession(docString.split("\n")); - editor = new Editor(new MockRenderer(), doc); -} - -module.exports = { - - "test: adding a new keyboard handler does not remove the default handler": function() { - initEditor('abc'); - var handler = new HashHandler({'del': 'f1'}); - editor.keyBinding.setKeyboardHandler(handler); - editor.onCommandKey({}, 0, keys['f1']); - assert.equal('bc', editor.getValue(), "binding of new handler"); - editor.onCommandKey({}, 0, keys['delete']); - assert.equal('c', editor.getValue(), "bindings of the old handler should still work"); - } - -}; - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec() -} diff --git a/lib/ace/keyboard/state_handler.js b/lib/ace/keyboard/state_handler.js index 8265bbe1..bfd18906 100644 --- a/lib/ace/keyboard/state_handler.js +++ b/lib/ace/keyboard/state_handler.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Mozilla Skywriter. + * + * The Initial Developer of the Original Code is + * Mozilla. + * Portions created by the Initial Developer are Copyright (C) 2009 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Julian Viereck (julian.viereck@gmail.com) + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -223,7 +230,8 @@ StateHandler.prototype = { * 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 + * @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 diff --git a/lib/ace/keyboard/textarea.js b/lib/ace/keyboard/textarea.js deleted file mode 100644 index 470b2940..00000000 --- a/lib/ace/keyboard/textarea.js +++ /dev/null @@ -1,82 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var HashHandler = require("./hash_handler").HashHandler; -exports.handler = new HashHandler(); - -[{ - bindKey: "Shift-Tab|Tab", - command: "passKeysToBrowser" -}, { - bindKey: {win: "Ctrl-L", mac: "Cmd-L"}, - command: "passKeysToBrowser" -}, { - bindKey: {win: "Ctrl-G", mac: "Cmd-G"}, - command: "gotoline" -}, { - bindKey: {win: "Ctrl-T|Ctrl-Shift-T", mac: "Cmd-T|Cmd-Shift-T"}, - command: "passKeysToBrowser" -}, { - bindKey: {win: "Ctrl-G", mac: "Cmd-G"}, - command: "passKeysToBrowser" -}, { - bindKey: {win: "Ctrl-G", mac: "Cmd-G"}, - command: "passKeysToBrowser" -}, { - name: "golineup", - bindKey: {win: null, mac: "Ctrl-P"}, -}, { - name: "golinedown", - bindKey: {win: null, mac: "Ctrl-N"}, -}, { - name: "gotoleft", - bindKey: {win: null, mac: "Ctrl-B"}, -}, { - name: "gotoright", - bindKey: {win: null, mac: "Ctrl-F"}, -}, { - name: "gotolineend", - bindKey: {win: null, mac: "Ctrl-E"}, -}, { - name: "gotolinestart", - bindKey: {win: null, mac: "Ctrl-A"}, -} -].forEach(function(k) { - var bindKey = k.bindKey; - if (typeof bindKey == "object") - bindKey = bindKey[exports.handler.platform]; - exports.handler.bindKey(bindKey, k.command); -}); -exports.handler.$id = "ace/keyboard/textarea"; - -}); diff --git a/lib/ace/keyboard/textinput.js b/lib/ace/keyboard/textinput.js index 4a2bb72c..c70d570a 100644 --- a/lib/ace/keyboard/textinput.js +++ b/lib/ace/keyboard/textinput.js @@ -1,30 +1,39 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: +/* vim:ts=4:sts=4:sw=4: + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. * - * 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. + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * Mihai Sucan + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -34,442 +43,258 @@ define(function(require, exports, module) { var event = require("../lib/event"); var useragent = require("../lib/useragent"); var dom = require("../lib/dom"); -var lang = require("../lib/lang"); -var BROKEN_SETDATA = useragent.isChrome < 18; -var USE_IE_MIME_TYPE = useragent.isIE; var TextInput = function(parentNode, host) { var text = dom.createElement("textarea"); - text.className = "ace_text-input"; - + /*/ debug + text.style.opacity = 1 + text.style.background = "rgba(0, 250, 0, 0.3)" + text.style.outline = "rgba(0, 250, 0, 0.8) solid 1px" + text.style.outlineOffset = "3px" + /**/ if (useragent.isTouchPad) text.setAttribute("x-palm-disable-auto-cap", true); text.setAttribute("wrap", "off"); - text.setAttribute("autocorrect", "off"); - text.setAttribute("autocapitalize", "off"); - text.setAttribute("spellcheck", false); - text.style.opacity = "0"; - if (useragent.isOldIE) text.style.top = "-1000px"; + text.style.top = "-2em"; parentNode.insertBefore(text, parentNode.firstChild); - var PLACEHOLDER = "\x01\x01"; + var PLACEHOLDER = useragent.isIE ? "\x01" : "\x01"; + sendText(); + var inCompostion = false; var copied = false; var pasted = false; - var inComposition = false; var tempStyle = ''; - var isSelectionEmpty = true; - // FOCUS - // ie9 throws error if document.activeElement is accessed too soon - try { var isFocused = document.activeElement === text; } catch(e) {} - - event.addListener(text, "blur", function(e) { - host.onBlur(e); - isFocused = false; - }); - event.addListener(text, "focus", function(e) { - isFocused = true; - host.onFocus(e); - resetSelection(); - }); - this.focus = function() { - if (tempStyle) return text.focus(); - text.style.position = "fixed"; - text.style.top = "-1000px"; - text.focus(); - setTimeout(function() { - text.style.position = ""; + 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); }; - this.blur = function() { text.blur(); }; - this.isFocused = function() { - return isFocused; + + var onPropertyChange = function(e) { + setTimeout(function() { + if (!inCompostion) + if(text.value != "") { + sendText(); + } + }, 0); }; - // modifying selection of blured textarea can focus it (chrome mac/linux) - var syncSelection = lang.delayedCall(function() { - isFocused && resetSelection(isSelectionEmpty); - }); - var syncValue = lang.delayedCall(function() { - if (!inComposition) { - text.value = PLACEHOLDER; - isFocused && resetSelection(); - } - }); - - function resetSelection(isEmpty) { - if (inComposition) - return; - - // this prevents infinite recursion on safari 8 - // see https://github.com/ajaxorg/ace/issues/2114 - inComposition = true; - - if (inputHandler) { - selectionStart = 0; - selectionEnd = isEmpty ? 0 : text.value.length - 1; - } else { - var selectionStart = isEmpty ? 2 : 1; - var selectionEnd = 2; - } - // on firefox this throws if textarea is hidden - try { - text.setSelectionRange(selectionStart, selectionEnd); - } catch(e){} - - inComposition = false; - } - - function resetValue() { - if (inComposition) - return; - text.value = PLACEHOLDER; - //http://code.google.com/p/chromium/issues/detail?id=76516 - if (useragent.isWebKit) - syncValue.schedule(); - } - - useragent.isWebKit || host.addEventListener('changeSelection', function() { - if (host.selection.isEmpty() != isSelectionEmpty) { - isSelectionEmpty = !isSelectionEmpty; - syncSelection.schedule(); - } - }); - - resetValue(); - if (isFocused) - host.onFocus(); - - - var isAllSelected = function(text) { - return text.selectionStart === 0 && text.selectionEnd === text.value.length; - }; - // IE8 does not support setSelectionRange - if (!text.setSelectionRange && text.createTextRange) { - text.setSelectionRange = function(selectionStart, selectionEnd) { - var range = this.createTextRange(); - range.collapse(true); - range.moveStart('character', selectionStart); - range.moveEnd('character', selectionEnd); - range.select(); - }; - isAllSelected = function(text) { - try { - var range = text.ownerDocument.selection.createRange(); - }catch(e) {} - if (!range || range.parentElement() != text) return false; - return range.text == text.value; - } - } - if (useragent.isOldIE) { - var inPropertyChange = false; - var onPropertyChange = function(e){ - if (inPropertyChange) - return; - var data = text.value; - if (inComposition || !data || data == PLACEHOLDER) - return; - // can happen either after delete or during insert operation - if (e && data == PLACEHOLDER[0]) - return syncProperty.schedule(); - - sendText(data); - // ie8 calls propertychange handlers synchronously! - inPropertyChange = true; - resetValue(); - inPropertyChange = false; - }; - var syncProperty = lang.delayedCall(onPropertyChange); - event.addListener(text, "propertychange", onPropertyChange); - - var keytable = { 13:1, 27:1 }; - event.addListener(text, "keyup", function (e) { - if (inComposition && (!text.value || keytable[e.keyCode])) - setTimeout(onCompositionEnd, 0); - if ((text.value.charCodeAt(0)||0) < 129) { - return syncProperty.call(); - } - inComposition ? onCompositionUpdate() : onCompositionStart(); - }); - // when user presses backspace after focusing the editor - // propertychange isn't called for the next character - event.addListener(text, "keydown", function (e) { - syncProperty.schedule(50); - }); - } - - var onSelect = function(e) { - if (copied) { - copied = false; - } else if (isAllSelected(text)) { - host.selectAll(); - resetSelection(); - } else if (inputHandler) { - resetSelection(host.selection.isEmpty()); - } + var onCompositionStart = function(e) { + inCompostion = true; + host.onCompositionStart(); + setTimeout(onCompositionUpdate, 0); }; - var inputHandler = null; - this.setInputHandler = function(cb) {inputHandler = cb}; - this.getInputHandler = function() {return inputHandler}; - var afterContextMenu = false; - - var sendText = function(data) { - if (inputHandler) { - data = inputHandler(data); - inputHandler = null; - } - if (pasted) { - resetSelection(); - if (data) - host.onPaste(data); - pasted = false; - } else if (data == PLACEHOLDER.charAt(0)) { - if (afterContextMenu) - host.execCommand("del", {source: "ace"}); - else // some versions of android do not fire keydown when pressing backspace - host.execCommand("backspace", {source: "ace"}); - } else { - if (data.substring(0, 2) == PLACEHOLDER) - data = data.substr(2); - else if (data.charAt(0) == PLACEHOLDER.charAt(0)) - data = data.substr(1); - else if (data.charAt(data.length - 1) == PLACEHOLDER.charAt(0)) - data = data.slice(0, -1); - // can happen if undo in textarea isn't stopped - if (data.charAt(data.length - 1) == PLACEHOLDER.charAt(0)) - data = data.slice(0, -1); - - if (data) - host.onTextInput(data); - } - if (afterContextMenu) - afterContextMenu = false; - }; - var onInput = function(e) { - // console.log("onInput", inComposition) - if (inComposition) - return; - var data = text.value; - sendText(data); - resetValue(); - }; - - var handleClipboardData = function(e, data) { - var clipboardData = e.clipboardData || window.clipboardData; - if (!clipboardData || BROKEN_SETDATA) - return; - // using "Text" doesn't work on old webkit but ie needs it - // TODO are there other browsers that require "Text"? - var mime = USE_IE_MIME_TYPE ? "Text" : "text/plain"; - if (data) { - // Safari 5 has clipboardData object, but does not handle setData() - return clipboardData.setData(mime, data) !== false; - } else { - return clipboardData.getData(mime); - } + var onCompositionUpdate = function() { + if (!inCompostion) return; + host.onCompositionUpdate(text.value); }; - var doCopy = function(e, isCut) { - var data = host.getCopyText(); - if (!data) - return event.preventDefault(e); + var onCompositionEnd = function(e) { + inCompostion = false; + host.onCompositionEnd(); + }; - if (handleClipboardData(e, data)) { - isCut ? host.onCut() : host.onCopy(); - event.preventDefault(e); - } else { - copied = true; - text.value = data; - text.select(); - setTimeout(function(){ - copied = false; - resetValue(); - resetSelection(); - isCut ? host.onCut() : host.onCopy(); - }); - } - }; - - var onCut = function(e) { - doCopy(e, true); - }; - var onCopy = function(e) { - doCopy(e, false); + copied = true; + var copyText = host.getCopyText(); + if(copyText) + text.value = copyText; + else + e.preventDefault(); + reset(); + setTimeout(function () { + sendText(); + }, 0); }; - - var onPaste = function(e) { - var data = handleClipboardData(e); - if (typeof data == "string") { - if (data) - host.onPaste(data, e); - if (useragent.isIE) - setTimeout(resetSelection); - event.preventDefault(e); - } - else { - text.value = ""; - pasted = true; - } + + 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, "select", onSelect); + 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(); + } + }); - event.addListener(text, "input", onInput); - - event.addListener(text, "cut", onCut); - event.addListener(text, "copy", onCopy); - event.addListener(text, "paste", onPaste); - - - // Opera has no clipboard events - if (!('oncut' in text) || !('oncopy' in text) || !('onpaste' in text)){ + 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; - switch (e.keyCode) { - case 67: - onCopy(e); - break; - case 86: - onPaste(e); - break; - case 88: - onCut(e); - break; + if ((e.keyCode == 88 || e.keyCode == 67)) { + var copyText = host.getCopyText(); + if (copyText) { + text.value = copyText; + text.select(); + if (e.keyCode == 88) + host.onCut(); + } } }); } - - - // COMPOSITION - var onCompositionStart = function(e) { - if (inComposition || !host.onCompositionStart || host.$readOnly) - return; - // console.log("onCompositionStart", inComposition) - inComposition = {}; - host.onCompositionStart(); - setTimeout(onCompositionUpdate, 0); - host.on("mousedown", onCompositionEnd); - if (!host.selection.isEmpty()) { - host.insert(""); - host.session.markUndoGroup(); - host.selection.clearSelection(); - } - host.session.markUndoGroup(); - }; - - var onCompositionUpdate = function() { - // console.log("onCompositionUpdate", inComposition && JSON.stringify(text.value)) - if (!inComposition || !host.onCompositionUpdate || host.$readOnly) - return; - var val = text.value.replace(/\x01/g, ""); - if (inComposition.lastValue === val) return; - - host.onCompositionUpdate(val); - if (inComposition.lastValue) - host.undo(); - inComposition.lastValue = val; - if (inComposition.lastValue) { - var r = host.selection.getRange(); - host.insert(inComposition.lastValue); - host.session.markUndoGroup(); - inComposition.range = host.selection.getRange(); - host.selection.setRange(r); - host.selection.clearSelection(); - } - }; - - var onCompositionEnd = function(e) { - if (!host.onCompositionEnd || host.$readOnly) return; - // console.log("onCompositionEnd", inComposition &&inComposition.lastValue) - var c = inComposition; - inComposition = false; - var timer = setTimeout(function() { - timer = null; - var str = text.value.replace(/\x01/g, ""); - // console.log(str, c.lastValue) - if (inComposition) - return; - else if (str == c.lastValue) - resetValue(); - else if (!c.lastValue && str) { - resetValue(); - sendText(str); - } - }); - inputHandler = function compositionInputHandler(str) { - // console.log("onCompositionEnd", str, c.lastValue) - if (timer) - clearTimeout(timer); - str = str.replace(/\x01/g, ""); - if (str == c.lastValue) - return ""; - if (c.lastValue && timer) - host.undo(); - return str; - }; - host.onCompositionEnd(); - host.removeListener("mousedown", onCompositionEnd); - if (e.type == "compositionend" && c.range) { - host.selection.setRange(c.range); - } - }; - - - - var syncComposition = lang.delayedCall(onCompositionUpdate, 50); + else { + event.addListener(text, "copy", onCopy); + event.addListener(text, "cut", onCut); + } event.addListener(text, "compositionstart", onCompositionStart); if (useragent.isGecko) { - event.addListener(text, "text", function(){syncComposition.schedule()}); - } else { - event.addListener(text, "keyup", function(){syncComposition.schedule()}); - event.addListener(text, "keydown", function(){syncComposition.schedule()}); + 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.setReadOnly = function(readOnly) { - text.readOnly = readOnly; - }; - this.onContextMenu = function(e) { - afterContextMenu = true; - resetSelection(host.selection.isEmpty()); - host._emit("nativecontextmenu", {target: host, domEvent: e}); - this.moveToMouse(e, true); - }; - - this.moveToMouse = function(e, bringToFront) { - if (!bringToFront && useragent.isOldIE) - return; if (!tempStyle) tempStyle = text.style.cssText; - text.style.cssText = (bringToFront ? "z-index:100000;" : "") - + "height:" + text.style.height + ";" - + (useragent.isIE ? "opacity:0.1;" : ""); - var rect = host.container.getBoundingClientRect(); - var style = dom.computedStyle(host.container); - var top = rect.top + (parseInt(style.borderTopWidth) || 0); - var left = rect.left + (parseInt(rect.borderLeftWidth) || 0); - var maxTop = rect.bottom - top - text.clientHeight -2; - var move = function(e) { - text.style.left = e.clientX - left - 2 + "px"; - text.style.top = Math.min(e.clientY - top - 2, maxTop) + "px"; - }; - move(e); + 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; @@ -478,32 +303,34 @@ var TextInput = function(parentNode, host) { host.renderer.$keepTextAreaAtCursor = null; // on windows context menu is opened after mouseup - if (useragent.isWin && !useragent.isOldIE) - event.capture(host.container, move, onContextMenuClose); + 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); }; - this.onContextMenuClose = onContextMenuClose; - var closeTimeout; function onContextMenuClose() { - clearTimeout(closeTimeout) - closeTimeout = setTimeout(function () { + setTimeout(function () { if (tempStyle) { text.style.cssText = tempStyle; tempStyle = ''; } + sendText(); if (host.renderer.$keepTextAreaAtCursor == null) { host.renderer.$keepTextAreaAtCursor = true; host.renderer.$moveTextAreaToCursor(); } - }, useragent.isOldIE ? 200 : 0); - } - - var onContextMenu = function(e) { - host.textInput.onContextMenu(e); - onContextMenuClose(); + }, 0); }; - event.addListener(host.renderer.scroller, "contextmenu", onContextMenu); - event.addListener(text, "contextmenu", onContextMenu); + 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; diff --git a/lib/ace/keyboard/vim.js b/lib/ace/keyboard/vim.js index 17c26c16..98b80683 100644 --- a/lib/ace/keyboard/vim.js +++ b/lib/ace/keyboard/vim.js @@ -1,6177 +1,158 @@ -// CodeMirror, copyright (c) by Marijn Haverbeke and others -// Distributed under an MIT license: http://codemirror.net/LICENSE - -/** - * Supported keybindings: +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Motion: - * h, j, k, l - * gj, gk - * e, E, w, W, b, B, ge, gE - * f, F, t, T - * $, ^, 0, -, +, _ - * gg, G - * % - * ', ` + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * Operator: - * d, y, c - * dd, yy, cc - * g~, g~g~ - * >, <, >>, << + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. * - * Operator-Motion: - * x, X, D, Y, C, ~ + * The Original Code is Ajax.org Code Editor (ACE). * - * Action: - * a, i, s, A, I, S, o, O - * zz, z., z, zt, zb, z- - * J - * u, Ctrl-r - * m - * r + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. * - * Modes: - * ESC - leave insert mode, visual mode, and clear input state. - * Ctrl-[, Ctrl-c - same as ESC. + * Contributor(s): + * Sergi Mansilla + * Harutyun Amirjanyan * - * Registers: unnamed, -, a-z, A-Z, 0-9 - * (Does not respect the special case for number registers when delete - * operator is made with these commands: %, (, ), , /, ?, n, N, {, } ) - * TODO: Implement the remaining registers. - * Marks: a-z, A-Z, and 0-9 - * TODO: Implement the remaining special marks. They have more complex - * behavior. + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * - * Events: - * 'vim-mode-change' - raised on the editor anytime the current mode changes, - * Event object: {mode: "visual", subMode: "linewise"} - * - * Code structure: - * 1. Default keymap - * 2. Variable declarations and short basic helpers - * 3. Instance (External API) implementation - * 4. Internal state tracking objects (input state, counter) implementation - * and instanstiation - * 5. Key handler (the main command dispatcher) implementation - * 6. Motion, operator, and action implementations - * 7. Helper functions for the key handler, motions, operators, and actions - * 8. Set up Vim to work as a keymap for CodeMirror. - */ + * ***** END LICENSE BLOCK ***** */ define(function(require, exports, module) { - 'use strict'; +"use strict"; - function log() { - var d = ""; - function format(p) { - if (typeof p != "object") - return p + ""; - if ("line" in p) { - return p.line + ":" + p.ch; - } - if ("anchor" in p) { - return format(p.anchor) + "->" + format(p.head); - } - if (Array.isArray(p)) - return "[" + p.map(function(x) { - return format(x); - }) + "]"; - return JSON.stringify(p); - } - for (var i = 0; i < arguments.length; i++) { - var p = arguments[i]; - var f = format(p); - d += f + " "; - } - console.log(d); - } - var Range = require("../range").Range; - var EventEmitter = require("../lib/event_emitter").EventEmitter; - var dom = require("../lib/dom"); - var oop = require("../lib/oop"); - var KEYS = require("../lib/keys"); - var event = require("../lib/event"); - var Search = require("../search").Search; - var useragent = require("../lib/useragent"); - var SearchHighlight = require("../search_highlight").SearchHighlight; - var multiSelectCommands = require("../commands/multi_select_commands"); - var TextModeTokenRe = require("../mode/text").Mode.prototype.tokenRe; - require("../multi_select"); +var cmds = require("./vim/commands"); +var coreCommands = cmds.coreCommands; +var util = require("./vim/maps/util"); +var useragent = require("../lib/useragent"); - var CodeMirror = function(ace) { - this.ace = ace; - this.state = {}; - this.marks = {}; - this.$uid = 0; - this.onChange = this.onChange.bind(this); - this.onSelectionChange = this.onSelectionChange.bind(this); - this.onBeforeEndOperation = this.onBeforeEndOperation.bind(this); - this.ace.on('change', this.onChange); - this.ace.on('changeSelection', this.onSelectionChange); - this.ace.on('beforeEndOperation', this.onBeforeEndOperation); - }; - CodeMirror.Pos = function(line, ch) { - if (!(this instanceof Pos)) return new Pos(line, ch); - this.line = line; this.ch = ch; - }; - CodeMirror.defineOption = function(name, val, setter) {}; - CodeMirror.commands = { - redo: function(cm) { cm.ace.redo(); }, - undo: function(cm) { cm.ace.undo(); }, - newlineAndIndent: function(cm) { cm.ace.insert("\n"); }, - }; - CodeMirror.keyMap = {}; - CodeMirror.addClass = CodeMirror.rmClass = - CodeMirror.e_stop = function() {}; - CodeMirror.keyName = function(e) { - if (e.key) return e.key; - var key = (KEYS[e.keyCode] || ""); - if (key.length == 1) key = key.toUpperCase(); - key = event.getModifierString(e).replace(/(^|-)\w/g, function(m) { - return m.toUpperCase(); - }) + key; - return key; - }; - CodeMirror.keyMap['default'] = function(key) { - return function(cm) { - var cmd = cm.ace.commands.commandKeyBinding[key.toLowerCase()]; - return cmd && cm.ace.execCommand(cmd) !== false; - }; - }; - CodeMirror.lookupKey = function lookupKey(key, map, handle) { - if (typeof map == "string") - map = CodeMirror.keyMap[map]; - var found = typeof map == "function" ? map(key) : map[key]; - if (found === false) return "nothing"; - if (found === "...") return "multi"; - if (found != null && handle(found)) return "handled"; - - if (map.fallthrough) { - if (!Array.isArray(map.fallthrough)) - return lookupKey(key, map.fallthrough, handle); - for (var i = 0; i < map.fallthrough.length; i++) { - var result = lookupKey(key, map.fallthrough[i], handle); - if (result) return result; - } - } - }; - - CodeMirror.signal = function(o, name, e) { return o._signal(name, e) }; - CodeMirror.on = event.addListener; - CodeMirror.off = event.removeListener; - CodeMirror.isWordChar = function(ch) { - TextModeTokenRe.lastIndex = 0; - return TextModeTokenRe.test(ch); - }; - -(function() { - oop.implement(CodeMirror.prototype, EventEmitter); - - this.destroy = function() { - this.ace.off('change', this.onChange); - this.ace.off('changeSelection', this.onSelectionChange); - this.ace.off('beforeEndOperation', this.onBeforeEndOperation); - this.removeOverlay(); - }; - this.virtualSelectionMode = function() { - return this.ace.inVirtualSelectionMode && this.ace.selection.index; - }; - this.onChange = function(delta) { - if (delta.action[0] == 'i') { - var change = { text: delta.lines }; - var curOp = this.curOp = this.curOp || {}; - if (!curOp.changeHandlers) - curOp.changeHandlers = this._eventRegistry["change"] && this._eventRegistry["change"].slice(); - if (this.virtualSelectionMode()) return; - if (!curOp.lastChange) { - curOp.lastChange = curOp.change = change; - } else { - curOp.lastChange.next = curOp.lastChange = change; - } - } - this.$updateMarkers(delta); - }; - this.onSelectionChange = function() { - var curOp = this.curOp = this.curOp || {}; - if (!curOp.cursorActivityHandlers) - curOp.cursorActivityHandlers = this._eventRegistry["cursorActivity"] && this._eventRegistry["cursorActivity"].slice(); - this.curOp.cursorActivity = true; - if (this.ace.inMultiSelectMode) { - this.ace.keyBinding.removeKeyboardHandler(multiSelectCommands.keyboardHandler); - } - }; - this.operation = function(fn, force) { - if (!force && this.curOp || force && this.curOp && this.curOp.force) { - return fn(); - } - if (force || !this.ace.curOp) { - if (this.curOp) - this.onBeforeEndOperation(); - } - if (!this.ace.curOp) { - var prevOp = this.ace.prevOp; - this.ace.startOperation({ - command: { name: "vim", scrollIntoView: "cursor" } - }); - } - var curOp = this.curOp = this.curOp || {}; - this.curOp.force = force; - var result = fn(); - if (this.ace.curOp && this.ace.curOp.command.name == "vim") { - this.ace.endOperation(); - if (!curOp.cursorActivity && !curOp.lastChange && prevOp) - this.ace.prevOp = prevOp; - } - if (force || !this.ace.curOp) { - if (this.curOp) - this.onBeforeEndOperation(); - } - return result; - }; - this.onBeforeEndOperation = function() { - var op = this.curOp; - if (op) { - if (op.change) { this.signal("change", op.change, op); } - if (op && op.cursorActivity) { this.signal("cursorActivity", null, op); } - this.curOp = null; - } - }; - - this.signal = function(eventName, e, handlers) { - var listeners = handlers ? handlers[eventName + "Handlers"] - : (this._eventRegistry || {})[eventName]; - if (!listeners) - return; - listeners = listeners.slice(); - for (var i=0; i 0) { - point.row += rowShift; - point.column += point.row == end.row ? colShift : 0; - continue; - } - if (!isInsert && cmp2 <= 0) { - point.row = start.row; - point.column = start.column; - if (cmp2 === 0) - point.bias = 1; - } - } - }; - var Marker = function(cm, id, row, column) { - this.cm = cm; - this.id = id; - this.row = row; - this.column = column; - cm.marks[this.id] = this; - }; - Marker.prototype.clear = function() { delete this.cm.marks[this.id] }; - Marker.prototype.find = function() { return toCmPos(this) }; - this.setBookmark = function(cursor, options) { - var bm = new Marker(this, this.$uid++, cursor.line, cursor.ch); - if (!options || !options.insertLeft) - bm.$insertRight = true; - this.marks[bm.id] = bm; - return bm; - }; - this.moveH = function(increment, unit) { - if (unit == 'char') { - var sel = this.ace.selection; - sel.clearSelection(); - sel.moveCursorBy(0, increment); - } - }; - this.findPosV = function(start, amount, unit, goalColumn) { - if (unit == 'page') { - var renderer = this.ace.renderer; - var config = renderer.layerConfig; - amount = amount * Math.floor(config.height / config.lineHeight); - unit = 'line'; - } - if (unit == 'line') { - var screenPos = this.ace.session.documentToScreenPosition(start.line, start.ch); - if (goalColumn != null) - screenPos.column = goalColumn; - screenPos.row += amount; - // not what codemirror does but vim mode needs only this - screenPos.row = Math.min(Math.max(0, screenPos.row), this.ace.session.getScreenLength() - 1); - var pos = this.ace.session.screenToDocumentPosition(screenPos.row, screenPos.column); - return toCmPos(pos); - } else { - debugger; - } - }; - this.charCoords = function(pos, mode) { - if (mode == 'div' || !mode) { - var sc = this.ace.session.documentToScreenPosition(pos.line, pos.ch); - return {left: sc.column, top: sc.row}; - }if (mode == 'local') { - var renderer = this.ace.renderer; - var sc = this.ace.session.documentToScreenPosition(pos.line, pos.ch); - var lh = renderer.layerConfig.lineHeight; - var cw = renderer.layerConfig.characterWidth; - var top = lh * sc.row; - return {left: sc.column * cw, top: top, bottom: top + lh}; - } - }; - this.coordsChar = function(pos, mode) { - var renderer = this.ace.renderer; - if (mode == 'local') { - var row = Math.max(0, Math.floor(pos.top / renderer.lineHeight)); - var col = Math.max(0, Math.floor(pos.left / renderer.characterWidth)); - var ch = renderer.session.screenToDocumentPosition(row, col); - return toCmPos(ch); - } else if (mode == 'div') { - throw "not implemented"; - } - }; - this.getSearchCursor = function(query, pos, caseFold) { - var caseSensitive = false; - var isRegexp = false; - if (query instanceof RegExp && !query.global) { - caseSensitive = !query.ignoreCase; - query = query.source; - isRegexp = true; - } - var search = new Search(); - if (pos.ch == undefined) pos.ch = Number.MAX_VALUE; - var acePos = {row: pos.line, column: pos.ch}; - var cm = this; - var last = null; - return { - findNext: function() { return this.find(false) }, - findPrevious: function() {return this.find(true) }, - find: function(back) { - search.setOptions({ - needle: query, - caseSensitive: caseSensitive, - wrap: false, - backwards: back, - regExp: isRegexp, - start: last || acePos - }); - var range = search.find(cm.ace.session); - if (range && range.isEmpty()) { - if (cm.getLine(range.start.row).length == range.start.column) { - search.$options.start = range; - range = search.find(cm.ace.session); - } - } - last = range; - return last; - }, - from: function() { return last && toCmPos(last.start) }, - to: function() { return last && toCmPos(last.end) }, - replace: function(text) { - if (last) { - last.end = cm.ace.session.doc.replace(last, text); - } - } - }; - }; - this.scrollTo = function(x, y) { - var renderer = this.ace.renderer; - var config = renderer.layerConfig; - var maxHeight = config.maxHeight; - maxHeight -= (renderer.$size.scrollerHeight - renderer.lineHeight) * renderer.$scrollPastEnd; - if (y != null) this.ace.session.setScrollTop(Math.max(0, Math.min(y, maxHeight))); - if (x != null) this.ace.session.setScrollLeft(Math.max(0, Math.min(x, config.width))); - }; - this.scrollInfo = function() { return 0; }; - this.scrollIntoView = function(pos, margin) { - if (pos) { - var renderer = this.ace.renderer; - var viewMargin = { "top": 0, "bottom": margin }; - renderer.scrollCursorIntoView(toAcePos(pos), - (renderer.lineHeight * 2) / renderer.$size.scrollerHeight, viewMargin); - } - }; - this.getLine = function(row) { return this.ace.session.getLine(row) }; - this.getRange = function(s, e) { - return this.ace.session.getTextRange(new Range(s.line, s.ch, e.line, e.ch)); - }; - this.replaceRange = function(text, s, e) { - if (!e) e = s; - return this.ace.session.replace(new Range(s.line, s.ch, e.line, e.ch), text); - }; - this.replaceSelections = function(p) { - var sel = this.ace.selection; - if (this.ace.inVirtualSelectionMode) { - this.ace.session.replace(sel.getRange(), p[0] || ""); - return; - } - sel.inVirtualSelectionMode = true; - var ranges = sel.rangeList.ranges; - if (!ranges.length) ranges = [this.ace.multiSelect.getRange()]; - for (var i = ranges.length; i--;) - this.ace.session.replace(ranges[i], p[i] || ""); - sel.inVirtualSelectionMode = false; - }; - this.getSelection = function() { - return this.ace.getSelectedText(); - }; - this.getSelections = function() { - return this.listSelections().map(function(x) { - return this.getRange(x.anchor, x.head); - }, this); - }; - this.getInputField = function() { - return this.ace.textInput.getElement(); - }; - this.getWrapperElement = function() { - return this.ace.containter; - }; - var optMap = { - indentWithTabs: "useSoftTabs", - indentUnit: "tabSize", - firstLineNumber: "firstLineNumber" - }; - this.setOption = function(name, val) { - this.state[name] = val; - switch (name) { - case 'indentWithTabs': - name = optMap[name]; - val = !val; - break; - default: - name = optMap[name]; - } - if (name) - this.ace.setOption(name, val); - }; - this.getOption = function(name, val) { - var aceOpt = optMap[name]; - if (aceOpt) - val = this.ace.getOption(aceOpt); - switch (name) { - case 'indentWithTabs': - name = optMap[name]; - return !val; - } - return aceOpt ? val : this.state[name]; - }; - this.toggleOverwrite = function(on) { - this.state.overwrite = on; - return this.ace.setOverwrite(on); - }; - this.addOverlay = function(o) { - if (!this.$searchHighlight || !this.$searchHighlight.session) { - var highlight = new SearchHighlight(null, "ace_highlight-marker", "text"); - var marker = this.ace.session.addDynamicMarker(highlight); - highlight.id = marker.id; - highlight.session = this.ace.session; - highlight.destroy = function(o) { - highlight.session.off("change", highlight.updateOnChange); - highlight.session.off("changeEditor", highlight.destroy); - highlight.session.removeMarker(highlight.id); - highlight.session = null; - }; - highlight.updateOnChange = function(delta) { - var row = delta.start.row; - if (row == delta.end.row) highlight.cache[row] = undefined; - else highlight.cache.splice(row, highlight.cache.length); - }; - highlight.session.on("changeEditor", highlight.destroy); - highlight.session.on("change", highlight.updateOnChange); - } - var re = new RegExp(o.query.source, "gmi"); - this.$searchHighlight = o.highlight = highlight; - this.$searchHighlight.setRegexp(re); - this.ace.renderer.updateBackMarkers(); - }; - this.removeOverlay = function(o) { - if (this.$searchHighlight && this.$searchHighlight.session) { - this.$searchHighlight.destroy(); - } - }; - this.getScrollInfo = function() { - var renderer = this.ace.renderer; - var config = renderer.layerConfig; - return { - left: renderer.scrollLeft, - top: renderer.scrollTop, - height: config.maxHeight, - width: config.width, - clientHeight: config.height, - clientWidth: config.width - }; - }; - this.getValue = function() { - return this.ace.getValue(); - }; - this.setValue = function(v) { - return this.ace.setValue(v); - }; - this.getTokenTypeAt = function(pos) { - var token = this.ace.session.getTokenAt(pos.line, pos.ch); - return token && /comment|string/.test(token.type) ? "string" : ""; - }; - this.findMatchingBracket = function(pos) { - var m = this.ace.session.findMatchingBracket(toAcePos(pos)); - return {to: m && toCmPos(m)}; - }; - this.indentLine = function(line, method) { - if (method === true) - this.ace.session.indentRows(line, line, "\t"); - else if (method === false) - this.ace.session.outdentRows(new Range(line, 0, line, 0)); - }; - this.indexFromPos = function(pos) { - return this.ace.session.doc.positionToIndex(toAcePos(pos)); - }; - this.posFromIndex = function(index) { - return toCmPos(this.ace.session.doc.indexToPosition(index)); - }; - this.focus = function(index) { - return this.ace.focus(); - }; - this.blur = function(index) { - return this.ace.blur(); - }; - this.defaultTextHeight = function(index) { - return this.ace.renderer.layerConfig.lineHeight; - }; - this.scanForBracket = function(pos, dir, _, options) { - var re = options.bracketRegex.source; - if (dir == 1) { - var m = this.ace.session.$findClosingBracket(re.slice(1, 2), toAcePos(pos), /paren|text/); - } else { - var m = this.ace.session.$findOpeningBracket(re.slice(-2, -1), {row: pos.line, column: pos.ch + 1}, /paren|text/); - } - return m && {pos: toCmPos(m)}; - }; - this.refresh = function() { - return this.ace.resize(true); - }; - this.getMode = function() { - return { name : this.getOption("mode") }; - } -}).call(CodeMirror.prototype); - function toAcePos(cmPos) { - return {row: cmPos.line, column: cmPos.ch}; - } - function toCmPos(acePos) { - return new Pos(acePos.row, acePos.column); - } - - var StringStream = CodeMirror.StringStream = function(string, tabSize) { - this.pos = this.start = 0; - this.string = string; - this.tabSize = tabSize || 8; - this.lastColumnPos = this.lastColumnValue = 0; - this.lineStart = 0; - }; - - StringStream.prototype = { - eol: function() {return this.pos >= this.string.length;}, - sol: function() {return this.pos == this.lineStart;}, - peek: function() {return this.string.charAt(this.pos) || undefined;}, - next: function() { - if (this.pos < this.string.length) - return this.string.charAt(this.pos++); +var startCommands = { + "i": { + command: coreCommands.start }, - eat: function(match) { - var ch = this.string.charAt(this.pos); - if (typeof match == "string") var ok = ch == match; - else var ok = ch && (match.test ? match.test(ch) : match(ch)); - if (ok) {++this.pos; return ch;} + "I": { + command: coreCommands.startBeginning }, - eatWhile: function(match) { - var start = this.pos; - while (this.eat(match)){} - return this.pos > start; + "a": { + command: coreCommands.append }, - eatSpace: function() { - var start = this.pos; - while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos; - return this.pos > start; + "A": { + command: coreCommands.appendEnd }, - skipToEnd: function() {this.pos = this.string.length;}, - skipTo: function(ch) { - var found = this.string.indexOf(ch, this.pos); - if (found > -1) {this.pos = found; return true;} + "ctrl-f": { + command: "gotopagedown" }, - backUp: function(n) {this.pos -= n;}, - column: function() { - throw "not implemented"; - }, - indentation: function() { - throw "not implemented"; - }, - match: function(pattern, consume, caseInsensitive) { - if (typeof pattern == "string") { - var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;}; - var substr = this.string.substr(this.pos, pattern.length); - if (cased(substr) == cased(pattern)) { - if (consume !== false) this.pos += pattern.length; - return true; - } - } else { - var match = this.string.slice(this.pos).match(pattern); - if (match && match.index > 0) return null; - if (match && consume !== false) this.pos += match[0].length; - return match; - } - }, - current: function(){return this.string.slice(this.start, this.pos);}, - hideFirstChars: function(n, inner) { - this.lineStart += n; - try { return inner(); } - finally { this.lineStart -= n; } + "ctrl-b": { + command: "gotopageup" } - }; - -// todo replace with showCommandLine -CodeMirror.defineExtension = function(name, fn) { - CodeMirror.prototype[name] = fn; }; -dom.importCssString(".normal-mode .ace_cursor{\ - border: 1px solid red;\ - background-color: red;\ - opacity: 0.5;\ -}\ -.normal-mode .ace_hidden-cursors .ace_cursor{\ - background-color: transparent;\ -}\ -.ace_dialog {\ - position: absolute;\ - left: 0; right: 0;\ - background: white;\ - z-index: 15;\ - padding: .1em .8em;\ - overflow: hidden;\ - color: #333;\ -}\ -.ace_dialog-top {\ - border-bottom: 1px solid #eee;\ - top: 0;\ -}\ -.ace_dialog-bottom {\ - border-top: 1px solid #eee;\ - bottom: 0;\ -}\ -.ace_dialog input {\ - border: none;\ - outline: none;\ - background: transparent;\ - width: 20em;\ - color: inherit;\ - font-family: monospace;\ -}", "vimMode"); -(function() { - function closeNotification(cm, newVal) { - if (cm.state.currentNotificationClose) - cm.state.currentNotificationClose(); - cm.state.currentNotificationClose = newVal; - } - CodeMirror.defineExtension("openDialog", function(template, callback, options) { - if (this.virtualSelectionMode()) return; - if (!options) options = {}; - - closeNotification(this, null); - - var dialog = dialogDiv(this, template, options.bottom); - var closed = false, me = this; - function close(newVal) { - if (typeof newVal == 'string') { - inp.value = newVal; - } else { - if (closed) return; - closed = true; - dialog.parentNode.removeChild(dialog); - me.focus(); - - if (options.onClose) options.onClose(dialog); - } - } - - var inp = dialog.getElementsByTagName("input")[0], button; - if (inp) { - if (options.value) { - inp.value = options.value; - if (options.select !== false) inp.select(); - } - - if (options.onInput) - CodeMirror.on(inp, "input", function(e) { options.onInput(e, inp.value, close);}); - if (options.onKeyUp) - CodeMirror.on(inp, "keyup", function(e) {options.onKeyUp(e, inp.value, close);}); - - CodeMirror.on(inp, "keydown", function(e) { - if (options && options.onKeyDown && options.onKeyDown(e, inp.value, close)) { return; } - if (e.keyCode == 27 || (options.closeOnEnter !== false && e.keyCode == 13)) { - inp.blur(); - CodeMirror.e_stop(e); - close(); - } - if (e.keyCode == 13) callback(inp.value); - }); - - if (options.closeOnBlur !== false) CodeMirror.on(inp, "blur", close); - - inp.focus(); - } else if (button = dialog.getElementsByTagName("button")[0]) { - CodeMirror.on(button, "click", function() { - close(); - me.focus(); - }); - - if (options.closeOnBlur !== false) CodeMirror.on(button, "blur", close); - - button.focus(); - } - return close; - }); - - CodeMirror.defineExtension("openNotification", function(template, options) { - if (this.virtualSelectionMode()) return; - closeNotification(this, close); - var dialog = dialogDiv(this, template, options && options.bottom); - var closed = false, doneTimer; - var duration = options && typeof options.duration !== "undefined" ? options.duration : 5000; - - function close() { - if (closed) return; - closed = true; - clearTimeout(doneTimer); - dialog.parentNode.removeChild(dialog); - } - - CodeMirror.on(dialog, 'click', function(e) { - CodeMirror.e_preventDefault(e); - close(); - }); - - if (duration) - doneTimer = setTimeout(close, duration); - - return close; - }); -})(); - - - var defaultKeymap = [ - // Key to key mapping. This goes first to make it possible to override - // existing mappings. - { keys: '', type: 'keyToKey', toKeys: 'h' }, - { keys: '', type: 'keyToKey', toKeys: 'l' }, - { keys: '', type: 'keyToKey', toKeys: 'k' }, - { keys: '', type: 'keyToKey', toKeys: 'j' }, - { keys: '', type: 'keyToKey', toKeys: 'l' }, - { keys: '', type: 'keyToKey', toKeys: 'h', context: 'normal'}, - { keys: '', type: 'keyToKey', toKeys: 'W' }, - { keys: '', type: 'keyToKey', toKeys: 'B', context: 'normal' }, - { keys: '', type: 'keyToKey', toKeys: 'w' }, - { keys: '', type: 'keyToKey', toKeys: 'b', context: 'normal' }, - { keys: '', type: 'keyToKey', toKeys: 'j' }, - { keys: '', type: 'keyToKey', toKeys: 'k' }, - { keys: '', type: 'keyToKey', toKeys: '' }, - { keys: '', type: 'keyToKey', toKeys: '' }, - { keys: '', type: 'keyToKey', toKeys: '', context: 'insert' }, - { keys: '', type: 'keyToKey', toKeys: '', context: 'insert' }, - { keys: 's', type: 'keyToKey', toKeys: 'cl', context: 'normal' }, - { keys: 's', type: 'keyToKey', toKeys: 'xi', context: 'visual'}, - { keys: 'S', type: 'keyToKey', toKeys: 'cc', context: 'normal' }, - { keys: 'S', type: 'keyToKey', toKeys: 'dcc', context: 'visual' }, - { keys: '', type: 'keyToKey', toKeys: '0' }, - { keys: '', type: 'keyToKey', toKeys: '$' }, - { keys: '', type: 'keyToKey', toKeys: '' }, - { keys: '', type: 'keyToKey', toKeys: '' }, - { keys: '', type: 'keyToKey', toKeys: 'j^', context: 'normal' }, - // Motions - { keys: 'H', type: 'motion', motion: 'moveToTopLine', motionArgs: { linewise: true, toJumplist: true }}, - { keys: 'M', type: 'motion', motion: 'moveToMiddleLine', motionArgs: { linewise: true, toJumplist: true }}, - { keys: 'L', type: 'motion', motion: 'moveToBottomLine', motionArgs: { linewise: true, toJumplist: true }}, - { keys: 'h', type: 'motion', motion: 'moveByCharacters', motionArgs: { forward: false }}, - { keys: 'l', type: 'motion', motion: 'moveByCharacters', motionArgs: { forward: true }}, - { keys: 'j', type: 'motion', motion: 'moveByLines', motionArgs: { forward: true, linewise: true }}, - { keys: 'k', type: 'motion', motion: 'moveByLines', motionArgs: { forward: false, linewise: true }}, - { keys: 'gj', type: 'motion', motion: 'moveByDisplayLines', motionArgs: { forward: true }}, - { keys: 'gk', type: 'motion', motion: 'moveByDisplayLines', motionArgs: { forward: false }}, - { keys: 'w', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: false }}, - { keys: 'W', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: false, bigWord: true }}, - { keys: 'e', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: true, inclusive: true }}, - { keys: 'E', type: 'motion', motion: 'moveByWords', motionArgs: { forward: true, wordEnd: true, bigWord: true, inclusive: true }}, - { keys: 'b', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: false }}, - { keys: 'B', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: false, bigWord: true }}, - { keys: 'ge', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: true, inclusive: true }}, - { keys: 'gE', type: 'motion', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: true, bigWord: true, inclusive: true }}, - { keys: '{', type: 'motion', motion: 'moveByParagraph', motionArgs: { forward: false, toJumplist: true }}, - { keys: '}', type: 'motion', motion: 'moveByParagraph', motionArgs: { forward: true, toJumplist: true }}, - { keys: '', type: 'motion', motion: 'moveByPage', motionArgs: { forward: true }}, - { keys: '', type: 'motion', motion: 'moveByPage', motionArgs: { forward: false }}, - { keys: '', type: 'motion', motion: 'moveByScroll', motionArgs: { forward: true, explicitRepeat: true }}, - { keys: '', type: 'motion', motion: 'moveByScroll', motionArgs: { forward: false, explicitRepeat: true }}, - { keys: 'gg', type: 'motion', motion: 'moveToLineOrEdgeOfDocument', motionArgs: { forward: false, explicitRepeat: true, linewise: true, toJumplist: true }}, - { keys: 'G', type: 'motion', motion: 'moveToLineOrEdgeOfDocument', motionArgs: { forward: true, explicitRepeat: true, linewise: true, toJumplist: true }}, - { keys: '0', type: 'motion', motion: 'moveToStartOfLine' }, - { keys: '^', type: 'motion', motion: 'moveToFirstNonWhiteSpaceCharacter' }, - { keys: '+', type: 'motion', motion: 'moveByLines', motionArgs: { forward: true, toFirstChar:true }}, - { keys: '-', type: 'motion', motion: 'moveByLines', motionArgs: { forward: false, toFirstChar:true }}, - { keys: '_', type: 'motion', motion: 'moveByLines', motionArgs: { forward: true, toFirstChar:true, repeatOffset:-1 }}, - { keys: '$', type: 'motion', motion: 'moveToEol', motionArgs: { inclusive: true }}, - { keys: '%', type: 'motion', motion: 'moveToMatchedSymbol', motionArgs: { inclusive: true, toJumplist: true }}, - { keys: 'f', type: 'motion', motion: 'moveToCharacter', motionArgs: { forward: true , inclusive: true }}, - { keys: 'F', type: 'motion', motion: 'moveToCharacter', motionArgs: { forward: false }}, - { keys: 't', type: 'motion', motion: 'moveTillCharacter', motionArgs: { forward: true, inclusive: true }}, - { keys: 'T', type: 'motion', motion: 'moveTillCharacter', motionArgs: { forward: false }}, - { keys: ';', type: 'motion', motion: 'repeatLastCharacterSearch', motionArgs: { forward: true }}, - { keys: ',', type: 'motion', motion: 'repeatLastCharacterSearch', motionArgs: { forward: false }}, - { keys: '\'', type: 'motion', motion: 'goToMark', motionArgs: {toJumplist: true, linewise: true}}, - { keys: '`', type: 'motion', motion: 'goToMark', motionArgs: {toJumplist: true}}, - { keys: ']`', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: true } }, - { keys: '[`', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: false } }, - { keys: ']\'', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: true, linewise: true } }, - { keys: '[\'', type: 'motion', motion: 'jumpToMark', motionArgs: { forward: false, linewise: true } }, - // the next two aren't motions but must come before more general motion declarations - { keys: ']p', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: true, isEdit: true, matchIndent: true}}, - { keys: '[p', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: false, isEdit: true, matchIndent: true}}, - { keys: ']', type: 'motion', motion: 'moveToSymbol', motionArgs: { forward: true, toJumplist: true}}, - { keys: '[', type: 'motion', motion: 'moveToSymbol', motionArgs: { forward: false, toJumplist: true}}, - { keys: '|', type: 'motion', motion: 'moveToColumn'}, - { keys: 'o', type: 'motion', motion: 'moveToOtherHighlightedEnd', context:'visual'}, - { keys: 'O', type: 'motion', motion: 'moveToOtherHighlightedEnd', motionArgs: {sameLine: true}, context:'visual'}, - // Operators - { keys: 'd', type: 'operator', operator: 'delete' }, - { keys: 'y', type: 'operator', operator: 'yank' }, - { keys: 'c', type: 'operator', operator: 'change' }, - { keys: '>', type: 'operator', operator: 'indent', operatorArgs: { indentRight: true }}, - { keys: '<', type: 'operator', operator: 'indent', operatorArgs: { indentRight: false }}, - { keys: 'g~', type: 'operator', operator: 'changeCase' }, - { keys: 'gu', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: true}, isEdit: true }, - { keys: 'gU', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: false}, isEdit: true }, - { keys: 'n', type: 'motion', motion: 'findNext', motionArgs: { forward: true, toJumplist: true }}, - { keys: 'N', type: 'motion', motion: 'findNext', motionArgs: { forward: false, toJumplist: true }}, - // Operator-Motion dual commands - { keys: 'x', type: 'operatorMotion', operator: 'delete', motion: 'moveByCharacters', motionArgs: { forward: true }, operatorMotionArgs: { visualLine: false }}, - { keys: 'X', type: 'operatorMotion', operator: 'delete', motion: 'moveByCharacters', motionArgs: { forward: false }, operatorMotionArgs: { visualLine: true }}, - { keys: 'D', type: 'operatorMotion', operator: 'delete', motion: 'moveToEol', motionArgs: { inclusive: true }, context: 'normal'}, - { keys: 'D', type: 'operator', operator: 'delete', operatorArgs: { linewise: true }, context: 'visual'}, - { keys: 'Y', type: 'operatorMotion', operator: 'yank', motion: 'moveToEol', motionArgs: { inclusive: true }, context: 'normal'}, - { keys: 'Y', type: 'operator', operator: 'yank', operatorArgs: { linewise: true }, context: 'visual'}, - { keys: 'C', type: 'operatorMotion', operator: 'change', motion: 'moveToEol', motionArgs: { inclusive: true }, context: 'normal'}, - { keys: 'C', type: 'operator', operator: 'change', operatorArgs: { linewise: true }, context: 'visual'}, - { keys: '~', type: 'operatorMotion', operator: 'changeCase', motion: 'moveByCharacters', motionArgs: { forward: true }, operatorArgs: { shouldMoveCursor: true }, context: 'normal'}, - { keys: '~', type: 'operator', operator: 'changeCase', context: 'visual'}, - { keys: '', type: 'operatorMotion', operator: 'delete', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: false }, context: 'insert' }, - // Actions - { keys: '', type: 'action', action: 'jumpListWalk', actionArgs: { forward: true }}, - { keys: '', type: 'action', action: 'jumpListWalk', actionArgs: { forward: false }}, - { keys: '', type: 'action', action: 'scroll', actionArgs: { forward: true, linewise: true }}, - { keys: '', type: 'action', action: 'scroll', actionArgs: { forward: false, linewise: true }}, - { keys: 'a', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'charAfter' }, context: 'normal' }, - { keys: 'A', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'eol' }, context: 'normal' }, - { keys: 'A', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'endOfSelectedArea' }, context: 'visual' }, - { keys: 'i', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'inplace' }, context: 'normal' }, - { keys: 'I', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'firstNonBlank'}, context: 'normal' }, - { keys: 'I', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { insertAt: 'startOfSelectedArea' }, context: 'visual' }, - { keys: 'o', type: 'action', action: 'newLineAndEnterInsertMode', isEdit: true, interlaceInsertRepeat: true, actionArgs: { after: true }, context: 'normal' }, - { keys: 'O', type: 'action', action: 'newLineAndEnterInsertMode', isEdit: true, interlaceInsertRepeat: true, actionArgs: { after: false }, context: 'normal' }, - { keys: 'v', type: 'action', action: 'toggleVisualMode' }, - { keys: 'V', type: 'action', action: 'toggleVisualMode', actionArgs: { linewise: true }}, - { keys: '', type: 'action', action: 'toggleVisualMode', actionArgs: { blockwise: true }}, - { keys: 'gv', type: 'action', action: 'reselectLastSelection' }, - { keys: 'J', type: 'action', action: 'joinLines', isEdit: true }, - { keys: 'p', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: true, isEdit: true }}, - { keys: 'P', type: 'action', action: 'paste', isEdit: true, actionArgs: { after: false, isEdit: true }}, - { keys: 'r', type: 'action', action: 'replace', isEdit: true }, - { keys: '@', type: 'action', action: 'replayMacro' }, - { keys: 'q', type: 'action', action: 'enterMacroRecordMode' }, - // Handle Replace-mode as a special case of insert mode. - { keys: 'R', type: 'action', action: 'enterInsertMode', isEdit: true, actionArgs: { replace: true }}, - { keys: 'u', type: 'action', action: 'undo', context: 'normal' }, - { keys: 'u', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: true}, context: 'visual', isEdit: true }, - { keys: 'U', type: 'operator', operator: 'changeCase', operatorArgs: {toLower: false}, context: 'visual', isEdit: true }, - { keys: '', type: 'action', action: 'redo' }, - { keys: 'm', type: 'action', action: 'setMark' }, - { keys: '"', type: 'action', action: 'setRegister' }, - { keys: 'zz', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'center' }}, - { keys: 'z.', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'center' }, motion: 'moveToFirstNonWhiteSpaceCharacter' }, - { keys: 'zt', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'top' }}, - { keys: 'z', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'top' }, motion: 'moveToFirstNonWhiteSpaceCharacter' }, - { keys: 'z-', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'bottom' }}, - { keys: 'zb', type: 'action', action: 'scrollToCursor', actionArgs: { position: 'bottom' }, motion: 'moveToFirstNonWhiteSpaceCharacter' }, - { keys: '.', type: 'action', action: 'repeatLastEdit' }, - { keys: '', type: 'action', action: 'incrementNumberToken', isEdit: true, actionArgs: {increase: true, backtrack: false}}, - { keys: '', type: 'action', action: 'incrementNumberToken', isEdit: true, actionArgs: {increase: false, backtrack: false}}, - // Text object motions - { keys: 'a', type: 'motion', motion: 'textObjectManipulation' }, - { keys: 'i', type: 'motion', motion: 'textObjectManipulation', motionArgs: { textObjectInner: true }}, - // Search - { keys: '/', type: 'search', searchArgs: { forward: true, querySrc: 'prompt', toJumplist: true }}, - { keys: '?', type: 'search', searchArgs: { forward: false, querySrc: 'prompt', toJumplist: true }}, - { keys: '*', type: 'search', searchArgs: { forward: true, querySrc: 'wordUnderCursor', wholeWordOnly: true, toJumplist: true }}, - { keys: '#', type: 'search', searchArgs: { forward: false, querySrc: 'wordUnderCursor', wholeWordOnly: true, toJumplist: true }}, - { keys: 'g*', type: 'search', searchArgs: { forward: true, querySrc: 'wordUnderCursor', toJumplist: true }}, - { keys: 'g#', type: 'search', searchArgs: { forward: false, querySrc: 'wordUnderCursor', toJumplist: true }}, - // Ex command - { keys: ':', type: 'ex' } - ]; - - var Pos = CodeMirror.Pos; - - var Vim = function() { return vimApi; } //{ - function enterVimMode(cm) { - cm.setOption('disableInput', true); - cm.setOption('showCursorWhenSelecting', false); - CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"}); - cm.on('cursorActivity', onCursorActivity); - maybeInitVimState(cm); - CodeMirror.on(cm.getInputField(), 'paste', getOnPasteFn(cm)); - } - - function leaveVimMode(cm) { - cm.setOption('disableInput', false); - cm.off('cursorActivity', onCursorActivity); - CodeMirror.off(cm.getInputField(), 'paste', getOnPasteFn(cm)); - cm.state.vim = null; - } - - function detachVimMap(cm, next) { - if (this == CodeMirror.keyMap.vim) - CodeMirror.rmClass(cm.getWrapperElement(), "cm-fat-cursor"); - - if (!next || next.attach != attachVimMap) - leaveVimMode(cm, false); - } - function attachVimMap(cm, prev) { - if (this == CodeMirror.keyMap.vim) - CodeMirror.addClass(cm.getWrapperElement(), "cm-fat-cursor"); - - if (!prev || prev.attach != attachVimMap) - enterVimMode(cm); - } - - // Deprecated, simply setting the keymap works again. - CodeMirror.defineOption('vimMode', false, function(cm, val, prev) { - if (val && cm.getOption("keyMap") != "vim") - cm.setOption("keyMap", "vim"); - else if (!val && prev != CodeMirror.Init && /^vim/.test(cm.getOption("keyMap"))) - cm.setOption("keyMap", "default"); - }); - - function cmKey(key, cm) { - if (!cm) { return undefined; } - var vimKey = cmKeyToVimKey(key); - if (!vimKey) { - return false; - } - var cmd = CodeMirror.Vim.findKey(cm, vimKey); - if (typeof cmd == 'function') { - CodeMirror.signal(cm, 'vim-keypress', vimKey); - } - return cmd; - } - - var modifiers = {'Shift': 'S', 'Ctrl': 'C', 'Alt': 'A', 'Cmd': 'D', 'Mod': 'A'}; - var specialKeys = {Enter:'CR',Backspace:'BS',Delete:'Del'}; - function cmKeyToVimKey(key) { - if (key.charAt(0) == '\'') { - // Keypress character binding of format "'a'" - return key.charAt(1); - } - var pieces = key.split('-'); - if (/-$/.test(key)) { - // If the - key was typed, split will result in 2 extra empty strings - // in the array. Replace them with 1 '-'. - pieces.splice(-2, 2, '-'); - } - var lastPiece = pieces[pieces.length - 1]; - if (pieces.length == 1 && pieces[0].length == 1) { - // No-modifier bindings use literal character bindings above. Skip. - return false; - } else if (pieces.length == 2 && pieces[0] == 'Shift' && lastPiece.length == 1) { - // Ignore Shift+char bindings as they should be handled by literal character. - return false; - } - var hasCharacter = false; - for (var i = 0; i < pieces.length; i++) { - var piece = pieces[i]; - if (piece in modifiers) { pieces[i] = modifiers[piece]; } - else { hasCharacter = true; } - if (piece in specialKeys) { pieces[i] = specialKeys[piece]; } - } - if (!hasCharacter) { - // Vim does not support modifier only keys. - return false; - } - // TODO: Current bindings expect the character to be lower case, but - // it looks like vim key notation uses upper case. - if (isUpperCase(lastPiece)) { - pieces[pieces.length - 1] = lastPiece.toLowerCase(); - } - return '<' + pieces.join('-') + '>'; - } - - function getOnPasteFn(cm) { - var vim = cm.state.vim; - if (!vim.onPasteFn) { - vim.onPasteFn = function() { - if (!vim.insertMode) { - cm.setCursor(offsetCursor(cm.getCursor(), 0, 1)); - actions.enterInsertMode(cm, {}, vim); - } - }; - } - return vim.onPasteFn; - } - - var numberRegex = /[\d]/; - var wordCharTest = [CodeMirror.isWordChar, function(ch) { - return ch && !CodeMirror.isWordChar(ch) && !/\s/.test(ch); - }], bigWordCharTest = [function(ch) { - return /\S/.test(ch); - }]; - function makeKeyRange(start, size) { - var keys = []; - for (var i = start; i < start + size; i++) { - keys.push(String.fromCharCode(i)); - } - return keys; - } - var upperCaseAlphabet = makeKeyRange(65, 26); - var lowerCaseAlphabet = makeKeyRange(97, 26); - var numbers = makeKeyRange(48, 10); - var validMarks = [].concat(upperCaseAlphabet, lowerCaseAlphabet, numbers, ['<', '>']); - var validRegisters = [].concat(upperCaseAlphabet, lowerCaseAlphabet, numbers, ['-', '"', '.', ':', '/']); - - function isLine(cm, line) { - return line >= cm.firstLine() && line <= cm.lastLine(); - } - function isLowerCase(k) { - return (/^[a-z]$/).test(k); - } - function isMatchableSymbol(k) { - return '()[]{}'.indexOf(k) != -1; - } - function isNumber(k) { - return numberRegex.test(k); - } - function isUpperCase(k) { - return (/^[A-Z]$/).test(k); - } - function isWhiteSpaceString(k) { - return (/^\s*$/).test(k); - } - function inArray(val, arr) { - for (var i = 0; i < arr.length; i++) { - if (arr[i] == val) { - return true; - } - } - return false; - } - - var options = {}; - function defineOption(name, defaultValue, type, aliases, callback) { - if (defaultValue === undefined && !callback) { - throw Error('defaultValue is required unless callback is provided'); - } - if (!type) { type = 'string'; } - options[name] = { - type: type, - defaultValue: defaultValue, - callback: callback - }; - if (aliases) { - for (var i = 0; i < aliases.length; i++) { - options[aliases[i]] = options[name]; - } - } - if (defaultValue) { - setOption(name, defaultValue); - } - } - - function setOption(name, value, cm, cfg) { - var option = options[name]; - cfg = cfg || {}; - var scope = cfg.scope; - if (!option) { - throw Error('Unknown option: ' + name); - } - if (option.type == 'boolean') { - if (value && value !== true) { - throw Error('Invalid argument: ' + name + '=' + value); - } else if (value !== false) { - // Boolean options are set to true if value is not defined. - value = true; - } - } - if (option.callback) { - if (scope !== 'local') { - option.callback(value, undefined); - } - if (scope !== 'global' && cm) { - option.callback(value, cm); - } - } else { - if (scope !== 'local') { - option.value = option.type == 'boolean' ? !!value : value; - } - if (scope !== 'global' && cm) { - cm.state.vim.options[name] = {value: value}; - } - } - } - - function getOption(name, cm, cfg) { - var option = options[name]; - cfg = cfg || {}; - var scope = cfg.scope; - if (!option) { - throw Error('Unknown option: ' + name); - } - if (option.callback) { - var local = cm && option.callback(undefined, cm); - if (scope !== 'global' && local !== undefined) { - return local; - } - if (scope !== 'local') { - return option.callback(); - } - return; - } else { - var local = (scope !== 'global') && (cm && cm.state.vim.options[name]); - return (local || (scope !== 'local') && option || {}).value; - } - } - - defineOption('filetype', undefined, 'string', ['ft'], function(name, cm) { - // Option is local. Do nothing for global. - if (cm === undefined) { - return; - } - // The 'filetype' option proxies to the CodeMirror 'mode' option. - if (name === undefined) { - var mode = cm.getMode().name; - return mode == 'null' ? '' : mode; - } else { - var mode = name == '' ? 'null' : name; - cm.setOption('mode', mode); - } - }); - - var createCircularJumpList = function() { - var size = 100; - var pointer = -1; - var head = 0; - var tail = 0; - var buffer = new Array(size); - function add(cm, oldCur, newCur) { - var current = pointer % size; - var curMark = buffer[current]; - function useNextSlot(cursor) { - var next = ++pointer % size; - var trashMark = buffer[next]; - if (trashMark) { - trashMark.clear(); - } - buffer[next] = cm.setBookmark(cursor); - } - if (curMark) { - var markPos = curMark.find(); - // avoid recording redundant cursor position - if (markPos && !cursorEqual(markPos, oldCur)) { - useNextSlot(oldCur); - } - } else { - useNextSlot(oldCur); - } - useNextSlot(newCur); - head = pointer; - tail = pointer - size + 1; - if (tail < 0) { - tail = 0; - } - } - function move(cm, offset) { - pointer += offset; - if (pointer > head) { - pointer = head; - } else if (pointer < tail) { - pointer = tail; - } - var mark = buffer[(size + pointer) % size]; - // skip marks that are temporarily removed from text buffer - if (mark && !mark.find()) { - var inc = offset > 0 ? 1 : -1; - var newCur; - var oldCur = cm.getCursor(); - do { - pointer += inc; - mark = buffer[(size + pointer) % size]; - // skip marks that are the same as current position - if (mark && - (newCur = mark.find()) && - !cursorEqual(oldCur, newCur)) { - break; - } - } while (pointer < head && pointer > tail); - } - return mark; - } - return { - cachedCursor: undefined, //used for # and * jumps - add: add, - move: move - }; - }; - - // Returns an object to track the changes associated insert mode. It - // clones the object that is passed in, or creates an empty object one if - // none is provided. - var createInsertModeChanges = function(c) { - if (c) { - // Copy construction - return { - changes: c.changes, - expectCursorActivityForChange: c.expectCursorActivityForChange - }; - } - return { - // Change list - changes: [], - // Set to true on change, false on cursorActivity. - expectCursorActivityForChange: false - }; - }; - - function MacroModeState() { - this.latestRegister = undefined; - this.isPlaying = false; - this.isRecording = false; - this.replaySearchQueries = []; - this.onRecordingDone = undefined; - this.lastInsertModeChanges = createInsertModeChanges(); - } - MacroModeState.prototype = { - exitMacroRecordMode: function() { - var macroModeState = vimGlobalState.macroModeState; - if (macroModeState.onRecordingDone) { - macroModeState.onRecordingDone(); // close dialog - } - macroModeState.onRecordingDone = undefined; - macroModeState.isRecording = false; - }, - enterMacroRecordMode: function(cm, registerName) { - var register = - vimGlobalState.registerController.getRegister(registerName); - if (register) { - register.clear(); - this.latestRegister = registerName; - if (cm.openDialog) { - this.onRecordingDone = cm.openDialog( - '(recording)['+registerName+']', null, {bottom:true}); - } - this.isRecording = true; - } - } - }; - - function maybeInitVimState(cm) { - if (!cm.state.vim) { - // Store instance state in the CodeMirror object. - cm.state.vim = { - inputState: new InputState(), - // Vim's input state that triggered the last edit, used to repeat - // motions and operators with '.'. - lastEditInputState: undefined, - // Vim's action command before the last edit, used to repeat actions - // with '.' and insert mode repeat. - lastEditActionCommand: undefined, - // When using jk for navigation, if you move from a longer line to a - // shorter line, the cursor may clip to the end of the shorter line. - // If j is pressed again and cursor goes to the next line, the - // cursor should go back to its horizontal position on the longer - // line if it can. This is to keep track of the horizontal position. - lastHPos: -1, - // Doing the same with screen-position for gj/gk - lastHSPos: -1, - // The last motion command run. Cleared if a non-motion command gets - // executed in between. - lastMotion: null, - marks: {}, - // Mark for rendering fake cursor for visual mode. - fakeCursor: null, - insertMode: false, - // Repeat count for changes made in insert mode, triggered by key - // sequences like 3,i. Only exists when insertMode is true. - insertModeRepeat: undefined, - visualMode: false, - // If we are in visual line mode. No effect if visualMode is false. - visualLine: false, - visualBlock: false, - lastSelection: null, - lastPastedText: null, - sel: {}, - // Buffer-local/window-local values of vim options. - options: {} - }; - } - return cm.state.vim; - } - var vimGlobalState; - function resetVimGlobalState() { - vimGlobalState = { - // The current search query. - searchQuery: null, - // Whether we are searching backwards. - searchIsReversed: false, - // Replace part of the last substituted pattern - lastSubstituteReplacePart: undefined, - jumpList: createCircularJumpList(), - macroModeState: new MacroModeState, - // Recording latest f, t, F or T motion command. - lastChararacterSearch: {increment:0, forward:true, selectedCharacter:''}, - registerController: new RegisterController({}), - // search history buffer - searchHistoryController: new HistoryController({}), - // ex Command history buffer - exCommandHistoryController : new HistoryController({}) - }; - for (var optionName in options) { - var option = options[optionName]; - option.value = option.defaultValue; - } - } - - var lastInsertModeKeyTimer; - var vimApi= { - buildKeyMap: function() { - // TODO: Convert keymap into dictionary format for fast lookup. - }, - // Testing hook, though it might be useful to expose the register - // controller anyways. - getRegisterController: function() { - return vimGlobalState.registerController; - }, - // Testing hook. - resetVimGlobalState_: resetVimGlobalState, - - // Testing hook. - getVimGlobalState_: function() { - return vimGlobalState; - }, - - // Testing hook. - maybeInitVimState_: maybeInitVimState, - - suppressErrorLogging: false, - - InsertModeKey: InsertModeKey, - map: function(lhs, rhs, ctx) { - // Add user defined key bindings. - exCommandDispatcher.map(lhs, rhs, ctx); - }, - unmap: function(lhs, ctx) { - // remove user defined key bindings. - exCommandDispatcher.unmap(lhs, ctx); - }, - // TODO: Expose setOption and getOption as instance methods. Need to decide how to namespace - // them, or somehow make them work with the existing CodeMirror setOption/getOption API. - setOption: setOption, - getOption: getOption, - defineOption: defineOption, - defineEx: function(name, prefix, func){ - if (name.indexOf(prefix) !== 0) { - throw new Error('(Vim.defineEx) "'+prefix+'" is not a prefix of "'+name+'", command not registered'); - } - exCommands[name]=func; - exCommandDispatcher.commandMap_[prefix]={name:name, shortName:prefix, type:'api'}; - }, - handleKey: function (cm, key, origin) { - var command = this.findKey(cm, key, origin); - if (typeof command === 'function') { - return command(); - } - }, - /** - * This is the outermost function called by CodeMirror, after keys have - * been mapped to their Vim equivalents. - * - * Finds a command based on the key (and cached keys if there is a - * multi-key sequence). Returns `undefined` if no key is matched, a noop - * function if a partial match is found (multi-key), and a function to - * execute the bound command if a a key is matched. The function always - * returns true. - */ - findKey: function(cm, key, origin) { - var vim = maybeInitVimState(cm); - function handleMacroRecording() { - var macroModeState = vimGlobalState.macroModeState; - if (macroModeState.isRecording) { - if (key == 'q') { - macroModeState.exitMacroRecordMode(); - clearInputState(cm); - return true; - } - if (origin != 'mapping') { - logKey(macroModeState, key); - } - } - } - function handleEsc() { - if (key == '') { - // Clear input state and get back to normal mode. - clearInputState(cm); - if (vim.visualMode) { - exitVisualMode(cm); - } else if (vim.insertMode) { - exitInsertMode(cm); - } - return true; - } - } - function doKeyToKey(keys) { - // TODO: prevent infinite recursion. - var match; - while (keys) { - // Pull off one command key, which is either a single character - // or a special sequence wrapped in '<' and '>', e.g. ''. - match = (/<\w+-.+?>|<\w+>|./).exec(keys); - key = match[0]; - keys = keys.substring(match.index + key.length); - CodeMirror.Vim.handleKey(cm, key, 'mapping'); - } - } - - function handleKeyInsertMode() { - if (handleEsc()) { return true; } - var keys = vim.inputState.keyBuffer = vim.inputState.keyBuffer + key; - var keysAreChars = key.length == 1; - var match = commandDispatcher.matchCommand(keys, defaultKeymap, vim.inputState, 'insert'); - // Need to check all key substrings in insert mode. - while (keys.length > 1 && match.type != 'full') { - var keys = vim.inputState.keyBuffer = keys.slice(1); - var thisMatch = commandDispatcher.matchCommand(keys, defaultKeymap, vim.inputState, 'insert'); - if (thisMatch.type != 'none') { match = thisMatch; } - } - if (match.type == 'none') { clearInputState(cm); return false; } - else if (match.type == 'partial') { - if (lastInsertModeKeyTimer) { window.clearTimeout(lastInsertModeKeyTimer); } - lastInsertModeKeyTimer = window.setTimeout( - function() { if (vim.insertMode && vim.inputState.keyBuffer) { clearInputState(cm); } }, - getOption('insertModeEscKeysTimeout')); - return !keysAreChars; - } - - if (lastInsertModeKeyTimer) { window.clearTimeout(lastInsertModeKeyTimer); } - if (keysAreChars) { - var here = cm.getCursor(); - cm.replaceRange('', offsetCursor(here, 0, -(keys.length - 1)), here, '+input'); - } - clearInputState(cm); - return match.command; - } - - function handleKeyNonInsertMode() { - if (handleMacroRecording() || handleEsc()) { return true; }; - - var keys = vim.inputState.keyBuffer = vim.inputState.keyBuffer + key; - if (/^[1-9]\d*$/.test(keys)) { return true; } - - var keysMatcher = /^(\d*)(.*)$/.exec(keys); - if (!keysMatcher) { clearInputState(cm); return false; } - var context = vim.visualMode ? 'visual' : - 'normal'; - var match = commandDispatcher.matchCommand(keysMatcher[2] || keysMatcher[1], defaultKeymap, vim.inputState, context); - if (match.type == 'none') { clearInputState(cm); return false; } - else if (match.type == 'partial') { return true; } - - vim.inputState.keyBuffer = ''; - var keysMatcher = /^(\d*)(.*)$/.exec(keys); - if (keysMatcher[1] && keysMatcher[1] != '0') { - vim.inputState.pushRepeatDigit(keysMatcher[1]); - } - return match.command; - } - - var command; - if (vim.insertMode) { command = handleKeyInsertMode(); } - else { command = handleKeyNonInsertMode(); } - if (command === false) { - return undefined; - } else if (command === true) { - // TODO: Look into using CodeMirror's multi-key handling. - // Return no-op since we are caching the key. Counts as handled, but - // don't want act on it just yet. - return function() {}; - } else { - return function() { - return cm.operation(function() { - cm.curOp.isVimOp = true; - try { - if (command.type == 'keyToKey') { - doKeyToKey(command.toKeys); - } else { - commandDispatcher.processCommand(cm, vim, command); - } - } catch (e) { - // clear VIM state in case it's in a bad state. - cm.state.vim = undefined; - maybeInitVimState(cm); - if (!CodeMirror.Vim.suppressErrorLogging) { - console['log'](e); - } - throw e; - } - return true; - }); - }; - } - }, - handleEx: function(cm, input) { - exCommandDispatcher.processCommand(cm, input); - }, - - defineMotion: defineMotion, - defineAction: defineAction, - defineOperator: defineOperator, - mapCommand: mapCommand, - _mapCommand: _mapCommand, - - exitVisualMode: exitVisualMode, - exitInsertMode: exitInsertMode - }; - - // Represents the current input state. - function InputState() { - this.prefixRepeat = []; - this.motionRepeat = []; - - this.operator = null; - this.operatorArgs = null; - this.motion = null; - this.motionArgs = null; - this.keyBuffer = []; // For matching multi-key commands. - this.registerName = null; // Defaults to the unnamed register. - } - InputState.prototype.pushRepeatDigit = function(n) { - if (!this.operator) { - this.prefixRepeat = this.prefixRepeat.concat(n); - } else { - this.motionRepeat = this.motionRepeat.concat(n); - } - }; - InputState.prototype.getRepeat = function() { - var repeat = 0; - if (this.prefixRepeat.length > 0 || this.motionRepeat.length > 0) { - repeat = 1; - if (this.prefixRepeat.length > 0) { - repeat *= parseInt(this.prefixRepeat.join(''), 10); - } - if (this.motionRepeat.length > 0) { - repeat *= parseInt(this.motionRepeat.join(''), 10); - } - } - return repeat; - }; - - function clearInputState(cm, reason) { - cm.state.vim.inputState = new InputState(); - CodeMirror.signal(cm, 'vim-command-done', reason); - } - - /* - * Register stores information about copy and paste registers. Besides - * text, a register must store whether it is linewise (i.e., when it is - * pasted, should it insert itself into a new line, or should the text be - * inserted at the cursor position.) - */ - function Register(text, linewise, blockwise) { - this.clear(); - this.keyBuffer = [text || '']; - this.insertModeChanges = []; - this.searchQueries = []; - this.linewise = !!linewise; - this.blockwise = !!blockwise; - } - Register.prototype = { - setText: function(text, linewise, blockwise) { - this.keyBuffer = [text || '']; - this.linewise = !!linewise; - this.blockwise = !!blockwise; - }, - pushText: function(text, linewise) { - // if this register has ever been set to linewise, use linewise. - if (linewise) { - if (!this.linewise) { - this.keyBuffer.push('\n'); - } - this.linewise = true; - } - this.keyBuffer.push(text); - }, - pushInsertModeChanges: function(changes) { - this.insertModeChanges.push(createInsertModeChanges(changes)); - }, - pushSearchQuery: function(query) { - this.searchQueries.push(query); - }, - clear: function() { - this.keyBuffer = []; - this.insertModeChanges = []; - this.searchQueries = []; - this.linewise = false; - }, - toString: function() { - return this.keyBuffer.join(''); - } - }; - - /* - * vim registers allow you to keep many independent copy and paste buffers. - * See http://usevim.com/2012/04/13/registers/ for an introduction. - * - * RegisterController keeps the state of all the registers. An initial - * state may be passed in. The unnamed register '"' will always be - * overridden. - */ - function RegisterController(registers) { - this.registers = registers; - this.unnamedRegister = registers['"'] = new Register(); - registers['.'] = new Register(); - registers[':'] = new Register(); - registers['/'] = new Register(); - } - RegisterController.prototype = { - pushText: function(registerName, operator, text, linewise, blockwise) { - if (linewise && text.charAt(0) == '\n') { - text = text.slice(1) + '\n'; - } - if (linewise && text.charAt(text.length - 1) !== '\n'){ - text += '\n'; - } - // Lowercase and uppercase registers refer to the same register. - // Uppercase just means append. - var register = this.isValidRegister(registerName) ? - this.getRegister(registerName) : null; - // if no register/an invalid register was specified, things go to the - // default registers - if (!register) { - switch (operator) { - case 'yank': - // The 0 register contains the text from the most recent yank. - this.registers['0'] = new Register(text, linewise, blockwise); - break; - case 'delete': - case 'change': - if (text.indexOf('\n') == -1) { - // Delete less than 1 line. Update the small delete register. - this.registers['-'] = new Register(text, linewise); - } else { - // Shift down the contents of the numbered registers and put the - // deleted text into register 1. - this.shiftNumericRegisters_(); - this.registers['1'] = new Register(text, linewise); - } - break; - } - // Make sure the unnamed register is set to what just happened - this.unnamedRegister.setText(text, linewise, blockwise); - return; - } - - // If we've gotten to this point, we've actually specified a register - var append = isUpperCase(registerName); - if (append) { - register.pushText(text, linewise); - } else { - register.setText(text, linewise, blockwise); - } - // The unnamed register always has the same value as the last used - // register. - this.unnamedRegister.setText(register.toString(), linewise); - }, - // Gets the register named @name. If one of @name doesn't already exist, - // create it. If @name is invalid, return the unnamedRegister. - getRegister: function(name) { - if (!this.isValidRegister(name)) { - return this.unnamedRegister; - } - name = name.toLowerCase(); - if (!this.registers[name]) { - this.registers[name] = new Register(); - } - return this.registers[name]; - }, - isValidRegister: function(name) { - return name && inArray(name, validRegisters); - }, - shiftNumericRegisters_: function() { - for (var i = 9; i >= 2; i--) { - this.registers[i] = this.getRegister('' + (i - 1)); - } - } - }; - function HistoryController() { - this.historyBuffer = []; - this.iterator; - this.initialPrefix = null; - } - HistoryController.prototype = { - // the input argument here acts a user entered prefix for a small time - // until we start autocompletion in which case it is the autocompleted. - nextMatch: function (input, up) { - var historyBuffer = this.historyBuffer; - var dir = up ? -1 : 1; - if (this.initialPrefix === null) this.initialPrefix = input; - for (var i = this.iterator + dir; up ? i >= 0 : i < historyBuffer.length; i+= dir) { - var element = historyBuffer[i]; - for (var j = 0; j <= element.length; j++) { - if (this.initialPrefix == element.substring(0, j)) { - this.iterator = i; - return element; - } - } - } - // should return the user input in case we reach the end of buffer. - if (i >= historyBuffer.length) { - this.iterator = historyBuffer.length; - return this.initialPrefix; - } - // return the last autocompleted query or exCommand as it is. - if (i < 0 ) return input; - }, - pushInput: function(input) { - var index = this.historyBuffer.indexOf(input); - if (index > -1) this.historyBuffer.splice(index, 1); - if (input.length) this.historyBuffer.push(input); - }, - reset: function() { - this.initialPrefix = null; - this.iterator = this.historyBuffer.length; - } - }; - var commandDispatcher = { - matchCommand: function(keys, keyMap, inputState, context) { - var matches = commandMatches(keys, keyMap, context, inputState); - if (!matches.full && !matches.partial) { - return {type: 'none'}; - } else if (!matches.full && matches.partial) { - return {type: 'partial'}; - } - - var bestMatch; - for (var i = 0; i < matches.full.length; i++) { - var match = matches.full[i]; - if (!bestMatch) { - bestMatch = match; - } - } - if (bestMatch.keys.slice(-11) == '') { - inputState.selectedCharacter = lastChar(keys); - } - return {type: 'full', command: bestMatch}; - }, - processCommand: function(cm, vim, command) { - vim.inputState.repeatOverride = command.repeatOverride; - switch (command.type) { - case 'motion': - this.processMotion(cm, vim, command); - break; - case 'operator': - this.processOperator(cm, vim, command); - break; - case 'operatorMotion': - this.processOperatorMotion(cm, vim, command); - break; - case 'action': - this.processAction(cm, vim, command); - break; - case 'search': - this.processSearch(cm, vim, command); - break; - case 'ex': - case 'keyToEx': - this.processEx(cm, vim, command); - break; - default: - break; - } - }, - processMotion: function(cm, vim, command) { - vim.inputState.motion = command.motion; - vim.inputState.motionArgs = copyArgs(command.motionArgs); - this.evalInput(cm, vim); - }, - processOperator: function(cm, vim, command) { - var inputState = vim.inputState; - if (inputState.operator) { - if (inputState.operator == command.operator) { - // Typing an operator twice like 'dd' makes the operator operate - // linewise - inputState.motion = 'expandToLine'; - inputState.motionArgs = { linewise: true }; - this.evalInput(cm, vim); - return; - } else { - // 2 different operators in a row doesn't make sense. - clearInputState(cm); - } - } - inputState.operator = command.operator; - inputState.operatorArgs = copyArgs(command.operatorArgs); - if (vim.visualMode) { - // Operating on a selection in visual mode. We don't need a motion. - this.evalInput(cm, vim); - } - }, - processOperatorMotion: function(cm, vim, command) { - var visualMode = vim.visualMode; - var operatorMotionArgs = copyArgs(command.operatorMotionArgs); - if (operatorMotionArgs) { - // Operator motions may have special behavior in visual mode. - if (visualMode && operatorMotionArgs.visualLine) { - vim.visualLine = true; - } - } - this.processOperator(cm, vim, command); - if (!visualMode) { - this.processMotion(cm, vim, command); - } - }, - processAction: function(cm, vim, command) { - var inputState = vim.inputState; - var repeat = inputState.getRepeat(); - var repeatIsExplicit = !!repeat; - var actionArgs = copyArgs(command.actionArgs) || {}; - if (inputState.selectedCharacter) { - actionArgs.selectedCharacter = inputState.selectedCharacter; - } - // Actions may or may not have motions and operators. Do these first. - if (command.operator) { - this.processOperator(cm, vim, command); - } - if (command.motion) { - this.processMotion(cm, vim, command); - } - if (command.motion || command.operator) { - this.evalInput(cm, vim); - } - actionArgs.repeat = repeat || 1; - actionArgs.repeatIsExplicit = repeatIsExplicit; - actionArgs.registerName = inputState.registerName; - clearInputState(cm); - vim.lastMotion = null; - if (command.isEdit) { - this.recordLastEdit(vim, inputState, command); - } - actions[command.action](cm, actionArgs, vim); - }, - processSearch: function(cm, vim, command) { - if (!cm.getSearchCursor) { - // Search depends on SearchCursor. - return; - } - var forward = command.searchArgs.forward; - var wholeWordOnly = command.searchArgs.wholeWordOnly; - getSearchState(cm).setReversed(!forward); - var promptPrefix = (forward) ? '/' : '?'; - var originalQuery = getSearchState(cm).getQuery(); - var originalScrollPos = cm.getScrollInfo(); - function handleQuery(query, ignoreCase, smartCase) { - vimGlobalState.searchHistoryController.pushInput(query); - vimGlobalState.searchHistoryController.reset(); - try { - updateSearchQuery(cm, query, ignoreCase, smartCase); - } catch (e) { - showConfirm(cm, 'Invalid regex: ' + query); - clearInputState(cm); - return; - } - commandDispatcher.processMotion(cm, vim, { - type: 'motion', - motion: 'findNext', - motionArgs: { forward: true, toJumplist: command.searchArgs.toJumplist } - }); - } - function onPromptClose(query) { - cm.scrollTo(originalScrollPos.left, originalScrollPos.top); - handleQuery(query, true /** ignoreCase */, true /** smartCase */); - var macroModeState = vimGlobalState.macroModeState; - if (macroModeState.isRecording) { - logSearchQuery(macroModeState, query); - } - } - function onPromptKeyUp(e, query, close) { - var keyName = CodeMirror.keyName(e), up; - if (keyName == 'Up' || keyName == 'Down') { - up = keyName == 'Up' ? true : false; - query = vimGlobalState.searchHistoryController.nextMatch(query, up) || ''; - close(query); - } else { - if ( keyName != 'Left' && keyName != 'Right' && keyName != 'Ctrl' && keyName != 'Alt' && keyName != 'Shift') - vimGlobalState.searchHistoryController.reset(); - } - var parsedQuery; - try { - parsedQuery = updateSearchQuery(cm, query, - true /** ignoreCase */, true /** smartCase */); - } catch (e) { - // Swallow bad regexes for incremental search. - } - if (parsedQuery) { - cm.scrollIntoView(findNext(cm, !forward, parsedQuery), 30); - } else { - clearSearchHighlight(cm); - cm.scrollTo(originalScrollPos.left, originalScrollPos.top); - } - } - function onPromptKeyDown(e, query, close) { - var keyName = CodeMirror.keyName(e); - if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[' || - (keyName == 'Backspace' && query == '')) { - vimGlobalState.searchHistoryController.pushInput(query); - vimGlobalState.searchHistoryController.reset(); - updateSearchQuery(cm, originalQuery); - clearSearchHighlight(cm); - cm.scrollTo(originalScrollPos.left, originalScrollPos.top); - CodeMirror.e_stop(e); - clearInputState(cm); - close(); - cm.focus(); - } else if (keyName == 'Ctrl-U') { - // Ctrl-U clears input. - CodeMirror.e_stop(e); - close(''); - } - } - switch (command.searchArgs.querySrc) { - case 'prompt': - var macroModeState = vimGlobalState.macroModeState; - if (macroModeState.isPlaying) { - var query = macroModeState.replaySearchQueries.shift(); - handleQuery(query, true /** ignoreCase */, false /** smartCase */); - } else { - showPrompt(cm, { - onClose: onPromptClose, - prefix: promptPrefix, - desc: searchPromptDesc, - onKeyUp: onPromptKeyUp, - onKeyDown: onPromptKeyDown - }); - } - break; - case 'wordUnderCursor': - var word = expandWordUnderCursor(cm, false /** inclusive */, - true /** forward */, false /** bigWord */, - true /** noSymbol */); - var isKeyword = true; - if (!word) { - word = expandWordUnderCursor(cm, false /** inclusive */, - true /** forward */, false /** bigWord */, - false /** noSymbol */); - isKeyword = false; - } - if (!word) { - return; - } - var query = cm.getLine(word.start.line).substring(word.start.ch, - word.end.ch); - if (isKeyword && wholeWordOnly) { - query = '\\b' + query + '\\b'; - } else { - query = escapeRegex(query); - } - - // cachedCursor is used to save the old position of the cursor - // when * or # causes vim to seek for the nearest word and shift - // the cursor before entering the motion. - vimGlobalState.jumpList.cachedCursor = cm.getCursor(); - cm.setCursor(word.start); - - handleQuery(query, true /** ignoreCase */, false /** smartCase */); - break; - } - }, - processEx: function(cm, vim, command) { - function onPromptClose(input) { - // Give the prompt some time to close so that if processCommand shows - // an error, the elements don't overlap. - vimGlobalState.exCommandHistoryController.pushInput(input); - vimGlobalState.exCommandHistoryController.reset(); - exCommandDispatcher.processCommand(cm, input); - } - function onPromptKeyDown(e, input, close) { - var keyName = CodeMirror.keyName(e), up; - if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[' || - (keyName == 'Backspace' && input == '')) { - vimGlobalState.exCommandHistoryController.pushInput(input); - vimGlobalState.exCommandHistoryController.reset(); - CodeMirror.e_stop(e); - clearInputState(cm); - close(); - cm.focus(); - } - if (keyName == 'Up' || keyName == 'Down') { - up = keyName == 'Up' ? true : false; - input = vimGlobalState.exCommandHistoryController.nextMatch(input, up) || ''; - close(input); - } else if (keyName == 'Ctrl-U') { - // Ctrl-U clears input. - CodeMirror.e_stop(e); - close(''); - } else { - if ( keyName != 'Left' && keyName != 'Right' && keyName != 'Ctrl' && keyName != 'Alt' && keyName != 'Shift') - vimGlobalState.exCommandHistoryController.reset(); - } - } - if (command.type == 'keyToEx') { - // Handle user defined Ex to Ex mappings - exCommandDispatcher.processCommand(cm, command.exArgs.input); - } else { - if (vim.visualMode) { - showPrompt(cm, { onClose: onPromptClose, prefix: ':', value: '\'<,\'>', - onKeyDown: onPromptKeyDown, select: false}); - } else { - showPrompt(cm, { onClose: onPromptClose, prefix: ':', - onKeyDown: onPromptKeyDown}); - } - } - }, - evalInput: function(cm, vim) { - // If the motion comand is set, execute both the operator and motion. - // Otherwise return. - var inputState = vim.inputState; - var motion = inputState.motion; - var motionArgs = inputState.motionArgs || {}; - var operator = inputState.operator; - var operatorArgs = inputState.operatorArgs || {}; - var registerName = inputState.registerName; - var sel = vim.sel; - // TODO: Make sure cm and vim selections are identical outside visual mode. - var origHead = copyCursor(vim.visualMode ? clipCursorToContent(cm, sel.head): cm.getCursor('head')); - var origAnchor = copyCursor(vim.visualMode ? clipCursorToContent(cm, sel.anchor) : cm.getCursor('anchor')); - var oldHead = copyCursor(origHead); - var oldAnchor = copyCursor(origAnchor); - var newHead, newAnchor; - var repeat; - if (operator) { - this.recordLastEdit(vim, inputState); - } - if (inputState.repeatOverride !== undefined) { - // If repeatOverride is specified, that takes precedence over the - // input state's repeat. Used by Ex mode and can be user defined. - repeat = inputState.repeatOverride; - } else { - repeat = inputState.getRepeat(); - } - if (repeat > 0 && motionArgs.explicitRepeat) { - motionArgs.repeatIsExplicit = true; - } else if (motionArgs.noRepeat || - (!motionArgs.explicitRepeat && repeat === 0)) { - repeat = 1; - motionArgs.repeatIsExplicit = false; - } - if (inputState.selectedCharacter) { - // If there is a character input, stick it in all of the arg arrays. - motionArgs.selectedCharacter = operatorArgs.selectedCharacter = - inputState.selectedCharacter; - } - motionArgs.repeat = repeat; - clearInputState(cm); - if (motion) { - var motionResult = motions[motion](cm, origHead, motionArgs, vim); - vim.lastMotion = motions[motion]; - if (!motionResult) { - return; - } - if (motionArgs.toJumplist) { - if (!operator) - cm.ace.curOp.command.scrollIntoView = "center-animate"; // ace patch - var jumpList = vimGlobalState.jumpList; - // if the current motion is # or *, use cachedCursor - var cachedCursor = jumpList.cachedCursor; - if (cachedCursor) { - recordJumpPosition(cm, cachedCursor, motionResult); - delete jumpList.cachedCursor; - } else { - recordJumpPosition(cm, origHead, motionResult); - } - } - if (motionResult instanceof Array) { - newAnchor = motionResult[0]; - newHead = motionResult[1]; - } else { - newHead = motionResult; - } - // TODO: Handle null returns from motion commands better. - if (!newHead) { - newHead = copyCursor(origHead); - } - if (vim.visualMode) { - if (!(vim.visualBlock && newHead.ch === Infinity)) { - newHead = clipCursorToContent(cm, newHead, vim.visualBlock); - } - if (newAnchor) { - newAnchor = clipCursorToContent(cm, newAnchor, true); - } - newAnchor = newAnchor || oldAnchor; - sel.anchor = newAnchor; - sel.head = newHead; - updateCmSelection(cm); - updateMark(cm, vim, '<', - cursorIsBefore(newAnchor, newHead) ? newAnchor - : newHead); - updateMark(cm, vim, '>', - cursorIsBefore(newAnchor, newHead) ? newHead - : newAnchor); - } else if (!operator) { - newHead = clipCursorToContent(cm, newHead); - cm.setCursor(newHead.line, newHead.ch); - } - } - if (operator) { - if (operatorArgs.lastSel) { - // Replaying a visual mode operation - newAnchor = oldAnchor; - var lastSel = operatorArgs.lastSel; - var lineOffset = Math.abs(lastSel.head.line - lastSel.anchor.line); - var chOffset = Math.abs(lastSel.head.ch - lastSel.anchor.ch); - if (lastSel.visualLine) { - // Linewise Visual mode: The same number of lines. - newHead = Pos(oldAnchor.line + lineOffset, oldAnchor.ch); - } else if (lastSel.visualBlock) { - // Blockwise Visual mode: The same number of lines and columns. - newHead = Pos(oldAnchor.line + lineOffset, oldAnchor.ch + chOffset); - } else if (lastSel.head.line == lastSel.anchor.line) { - // Normal Visual mode within one line: The same number of characters. - newHead = Pos(oldAnchor.line, oldAnchor.ch + chOffset); - } else { - // Normal Visual mode with several lines: The same number of lines, in the - // last line the same number of characters as in the last line the last time. - newHead = Pos(oldAnchor.line + lineOffset, oldAnchor.ch); - } - vim.visualMode = true; - vim.visualLine = lastSel.visualLine; - vim.visualBlock = lastSel.visualBlock; - sel = vim.sel = { - anchor: newAnchor, - head: newHead - }; - updateCmSelection(cm); - } else if (vim.visualMode) { - operatorArgs.lastSel = { - anchor: copyCursor(sel.anchor), - head: copyCursor(sel.head), - visualBlock: vim.visualBlock, - visualLine: vim.visualLine - }; - } - var curStart, curEnd, linewise, mode; - var cmSel; - if (vim.visualMode) { - // Init visual op - curStart = cursorMin(sel.head, sel.anchor); - curEnd = cursorMax(sel.head, sel.anchor); - linewise = vim.visualLine || operatorArgs.linewise; - mode = vim.visualBlock ? 'block' : - linewise ? 'line' : - 'char'; - cmSel = makeCmSelection(cm, { - anchor: curStart, - head: curEnd - }, mode); - if (linewise) { - var ranges = cmSel.ranges; - if (mode == 'block') { - // Linewise operators in visual block mode extend to end of line - for (var i = 0; i < ranges.length; i++) { - ranges[i].head.ch = lineLength(cm, ranges[i].head.line); - } - } else if (mode == 'line') { - ranges[0].head = Pos(ranges[0].head.line + 1, 0); - } - } - } else { - // Init motion op - curStart = copyCursor(newAnchor || oldAnchor); - curEnd = copyCursor(newHead || oldHead); - if (cursorIsBefore(curEnd, curStart)) { - var tmp = curStart; - curStart = curEnd; - curEnd = tmp; - } - linewise = motionArgs.linewise || operatorArgs.linewise; - if (linewise) { - // Expand selection to entire line. - expandSelectionToLine(cm, curStart, curEnd); - } else if (motionArgs.forward) { - // Clip to trailing newlines only if the motion goes forward. - clipToLine(cm, curStart, curEnd); - } - mode = 'char'; - var exclusive = !motionArgs.inclusive || linewise; - cmSel = makeCmSelection(cm, { - anchor: curStart, - head: curEnd - }, mode, exclusive); - } - cm.setSelections(cmSel.ranges, cmSel.primary); - vim.lastMotion = null; - operatorArgs.repeat = repeat; // For indent in visual mode. - operatorArgs.registerName = registerName; - // Keep track of linewise as it affects how paste and change behave. - operatorArgs.linewise = linewise; - var operatorMoveTo = operators[operator]( - cm, operatorArgs, cmSel.ranges, oldAnchor, newHead); - if (vim.visualMode) { - exitVisualMode(cm, operatorMoveTo != null); - } - if (operatorMoveTo) { - cm.setCursor(operatorMoveTo); - } - } - }, - recordLastEdit: function(vim, inputState, actionCommand) { - var macroModeState = vimGlobalState.macroModeState; - if (macroModeState.isPlaying) { return; } - vim.lastEditInputState = inputState; - vim.lastEditActionCommand = actionCommand; - macroModeState.lastInsertModeChanges.changes = []; - macroModeState.lastInsertModeChanges.expectCursorActivityForChange = false; - } - }; - - /** - * typedef {Object{line:number,ch:number}} Cursor An object containing the - * position of the cursor. - */ - // All of the functions below return Cursor objects. - var motions = { - moveToTopLine: function(cm, _head, motionArgs) { - var line = getUserVisibleLines(cm).top + motionArgs.repeat -1; - return Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line))); - }, - moveToMiddleLine: function(cm) { - var range = getUserVisibleLines(cm); - var line = Math.floor((range.top + range.bottom) * 0.5); - return Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line))); - }, - moveToBottomLine: function(cm, _head, motionArgs) { - var line = getUserVisibleLines(cm).bottom - motionArgs.repeat +1; - return Pos(line, findFirstNonWhiteSpaceCharacter(cm.getLine(line))); - }, - expandToLine: function(_cm, head, motionArgs) { - // Expands forward to end of line, and then to next line if repeat is - // >1. Does not handle backward motion! - var cur = head; - return Pos(cur.line + motionArgs.repeat - 1, Infinity); - }, - findNext: function(cm, _head, motionArgs) { - var state = getSearchState(cm); - var query = state.getQuery(); - if (!query) { - return; - } - var prev = !motionArgs.forward; - // If search is initiated with ? instead of /, negate direction. - prev = (state.isReversed()) ? !prev : prev; - highlightSearchMatches(cm, query); - return findNext(cm, prev/** prev */, query, motionArgs.repeat); - }, - goToMark: function(cm, _head, motionArgs, vim) { - var mark = vim.marks[motionArgs.selectedCharacter]; - if (mark) { - var pos = mark.find(); - return motionArgs.linewise ? { line: pos.line, ch: findFirstNonWhiteSpaceCharacter(cm.getLine(pos.line)) } : pos; - } - return null; - }, - moveToOtherHighlightedEnd: function(cm, _head, motionArgs, vim) { - if (vim.visualBlock && motionArgs.sameLine) { - var sel = vim.sel; - return [ - clipCursorToContent(cm, Pos(sel.anchor.line, sel.head.ch)), - clipCursorToContent(cm, Pos(sel.head.line, sel.anchor.ch)) - ]; - } else { - return ([vim.sel.head, vim.sel.anchor]); - } - }, - jumpToMark: function(cm, head, motionArgs, vim) { - var best = head; - for (var i = 0; i < motionArgs.repeat; i++) { - var cursor = best; - for (var key in vim.marks) { - if (!isLowerCase(key)) { - continue; - } - var mark = vim.marks[key].find(); - var isWrongDirection = (motionArgs.forward) ? - cursorIsBefore(mark, cursor) : cursorIsBefore(cursor, mark); - - if (isWrongDirection) { - continue; - } - if (motionArgs.linewise && (mark.line == cursor.line)) { - continue; - } - - var equal = cursorEqual(cursor, best); - var between = (motionArgs.forward) ? - cursorIsBetween(cursor, mark, best) : - cursorIsBetween(best, mark, cursor); - - if (equal || between) { - best = mark; - } - } - } - - if (motionArgs.linewise) { - // Vim places the cursor on the first non-whitespace character of - // the line if there is one, else it places the cursor at the end - // of the line, regardless of whether a mark was found. - best = Pos(best.line, findFirstNonWhiteSpaceCharacter(cm.getLine(best.line))); - } - return best; - }, - moveByCharacters: function(_cm, head, motionArgs) { - var cur = head; - var repeat = motionArgs.repeat; - var ch = motionArgs.forward ? cur.ch + repeat : cur.ch - repeat; - return Pos(cur.line, ch); - }, - moveByLines: function(cm, head, motionArgs, vim) { - var cur = head; - var endCh = cur.ch; - // Depending what our last motion was, we may want to do different - // things. If our last motion was moving vertically, we want to - // preserve the HPos from our last horizontal move. If our last motion - // was going to the end of a line, moving vertically we should go to - // the end of the line, etc. - switch (vim.lastMotion) { - case this.moveByLines: - case this.moveByDisplayLines: - case this.moveByScroll: - case this.moveToColumn: - case this.moveToEol: - endCh = vim.lastHPos; - break; - default: - vim.lastHPos = endCh; - } - var repeat = motionArgs.repeat+(motionArgs.repeatOffset||0); - var line = motionArgs.forward ? cur.line + repeat : cur.line - repeat; - var first = cm.firstLine(); - var last = cm.lastLine(); - // Vim cancels linewise motions that start on an edge and move beyond - // that edge. It does not cancel motions that do not start on an edge. - if ((line < first && cur.line == first) || - (line > last && cur.line == last)) { - return; - } - // /ace patch - var fold = cm.ace.session.getFoldAt(line, endCh); - if (fold) { - if (motionArgs.forward) - line = fold.end.row + 1; - else - line = fold.start.row - 1; - } - // /ace patche - if (motionArgs.toFirstChar){ - endCh=findFirstNonWhiteSpaceCharacter(cm.getLine(line)); - vim.lastHPos = endCh; - } - vim.lastHSPos = cm.charCoords(Pos(line, endCh),'div').left; - return Pos(line, endCh); - }, - moveByDisplayLines: function(cm, head, motionArgs, vim) { - var cur = head; - switch (vim.lastMotion) { - case this.moveByDisplayLines: - case this.moveByScroll: - case this.moveByLines: - case this.moveToColumn: - case this.moveToEol: - break; - default: - vim.lastHSPos = cm.charCoords(cur,'div').left; - } - var repeat = motionArgs.repeat; - var res=cm.findPosV(cur,(motionArgs.forward ? repeat : -repeat),'line',vim.lastHSPos); - if (res.hitSide) { - if (motionArgs.forward) { - var lastCharCoords = cm.charCoords(res, 'div'); - var goalCoords = { top: lastCharCoords.top + 8, left: vim.lastHSPos }; - var res = cm.coordsChar(goalCoords, 'div'); - } else { - var resCoords = cm.charCoords(Pos(cm.firstLine(), 0), 'div'); - resCoords.left = vim.lastHSPos; - res = cm.coordsChar(resCoords, 'div'); - } - } - vim.lastHPos = res.ch; - return res; - }, - moveByPage: function(cm, head, motionArgs) { - // CodeMirror only exposes functions that move the cursor page down, so - // doing this bad hack to move the cursor and move it back. evalInput - // will move the cursor to where it should be in the end. - var curStart = head; - var repeat = motionArgs.repeat; - return cm.findPosV(curStart, (motionArgs.forward ? repeat : -repeat), 'page'); - }, - moveByParagraph: function(cm, head, motionArgs) { - var dir = motionArgs.forward ? 1 : -1; - return findParagraph(cm, head, motionArgs.repeat, dir); - }, - moveByScroll: function(cm, head, motionArgs, vim) { - var scrollbox = cm.getScrollInfo(); - var curEnd = null; - var repeat = motionArgs.repeat; - if (!repeat) { - repeat = scrollbox.clientHeight / (2 * cm.defaultTextHeight()); - } - var orig = cm.charCoords(head, 'local'); - motionArgs.repeat = repeat; - var curEnd = motions.moveByDisplayLines(cm, head, motionArgs, vim); - if (!curEnd) { - return null; - } - var dest = cm.charCoords(curEnd, 'local'); - cm.scrollTo(null, scrollbox.top + dest.top - orig.top); - return curEnd; - }, - moveByWords: function(cm, head, motionArgs) { - return moveToWord(cm, head, motionArgs.repeat, !!motionArgs.forward, - !!motionArgs.wordEnd, !!motionArgs.bigWord); - }, - moveTillCharacter: function(cm, _head, motionArgs) { - var repeat = motionArgs.repeat; - var curEnd = moveToCharacter(cm, repeat, motionArgs.forward, - motionArgs.selectedCharacter); - var increment = motionArgs.forward ? -1 : 1; - recordLastCharacterSearch(increment, motionArgs); - if (!curEnd) return null; - curEnd.ch += increment; - return curEnd; - }, - moveToCharacter: function(cm, head, motionArgs) { - var repeat = motionArgs.repeat; - recordLastCharacterSearch(0, motionArgs); - return moveToCharacter(cm, repeat, motionArgs.forward, - motionArgs.selectedCharacter) || head; - }, - moveToSymbol: function(cm, head, motionArgs) { - var repeat = motionArgs.repeat; - return findSymbol(cm, repeat, motionArgs.forward, - motionArgs.selectedCharacter) || head; - }, - moveToColumn: function(cm, head, motionArgs, vim) { - var repeat = motionArgs.repeat; - // repeat is equivalent to which column we want to move to! - vim.lastHPos = repeat - 1; - vim.lastHSPos = cm.charCoords(head,'div').left; - return moveToColumn(cm, repeat); - }, - moveToEol: function(cm, head, motionArgs, vim) { - var cur = head; - vim.lastHPos = Infinity; - var retval= Pos(cur.line + motionArgs.repeat - 1, Infinity); - var end=cm.clipPos(retval); - end.ch--; - vim.lastHSPos = cm.charCoords(end,'div').left; - return retval; - }, - moveToFirstNonWhiteSpaceCharacter: function(cm, head) { - // Go to the start of the line where the text begins, or the end for - // whitespace-only lines - var cursor = head; - return Pos(cursor.line, - findFirstNonWhiteSpaceCharacter(cm.getLine(cursor.line))); - }, - moveToMatchedSymbol: function(cm, head) { - var cursor = head; - var line = cursor.line; - var ch = cursor.ch; - var lineText = cm.getLine(line); - var symbol; - do { - symbol = lineText.charAt(ch++); - if (symbol && isMatchableSymbol(symbol)) { - var style = cm.getTokenTypeAt(Pos(line, ch)); - if (style !== "string" && style !== "comment") { - break; - } - } - } while (symbol); - if (symbol) { - var matched = cm.findMatchingBracket(Pos(line, ch)); - return matched.to; - } else { - return cursor; - } - }, - moveToStartOfLine: function(_cm, head) { - return Pos(head.line, 0); - }, - moveToLineOrEdgeOfDocument: function(cm, _head, motionArgs) { - var lineNum = motionArgs.forward ? cm.lastLine() : cm.firstLine(); - if (motionArgs.repeatIsExplicit) { - lineNum = motionArgs.repeat - cm.getOption('firstLineNumber'); - } - return Pos(lineNum, - findFirstNonWhiteSpaceCharacter(cm.getLine(lineNum))); - }, - textObjectManipulation: function(cm, head, motionArgs, vim) { - // TODO: lots of possible exceptions that can be thrown here. Try da( - // outside of a () block. - - // TODO: adding <> >< to this map doesn't work, presumably because - // they're operators - var mirroredPairs = {'(': ')', ')': '(', - '{': '}', '}': '{', - '[': ']', ']': '['}; - var selfPaired = {'\'': true, '"': true}; - - var character = motionArgs.selectedCharacter; - // 'b' refers to '()' block. - // 'B' refers to '{}' block. - if (character == 'b') { - character = '('; - } else if (character == 'B') { - character = '{'; - } - - // Inclusive is the difference between a and i - // TODO: Instead of using the additional text object map to perform text - // object operations, merge the map into the defaultKeyMap and use - // motionArgs to define behavior. Define separate entries for 'aw', - // 'iw', 'a[', 'i[', etc. - var inclusive = !motionArgs.textObjectInner; - - var tmp; - if (mirroredPairs[character]) { - tmp = selectCompanionObject(cm, head, character, inclusive); - } else if (selfPaired[character]) { - tmp = findBeginningAndEnd(cm, head, character, inclusive); - } else if (character === 'W') { - tmp = expandWordUnderCursor(cm, inclusive, true /** forward */, - true /** bigWord */); - } else if (character === 'w') { - tmp = expandWordUnderCursor(cm, inclusive, true /** forward */, - false /** bigWord */); - } else if (character === 'p') { - tmp = findParagraph(cm, head, motionArgs.repeat, 0, inclusive); - motionArgs.linewise = true; - if (vim.visualMode) { - if (!vim.visualLine) { vim.visualLine = true; } - } else { - var operatorArgs = vim.inputState.operatorArgs; - if (operatorArgs) { operatorArgs.linewise = true; } - tmp.end.line--; - } - } else { - // No text object defined for this, don't move. - return null; - } - - if (!cm.state.vim.visualMode) { - return [tmp.start, tmp.end]; - } else { - return expandSelection(cm, tmp.start, tmp.end); - } - }, - - repeatLastCharacterSearch: function(cm, head, motionArgs) { - var lastSearch = vimGlobalState.lastChararacterSearch; - var repeat = motionArgs.repeat; - var forward = motionArgs.forward === lastSearch.forward; - var increment = (lastSearch.increment ? 1 : 0) * (forward ? -1 : 1); - cm.moveH(-increment, 'char'); - motionArgs.inclusive = forward ? true : false; - var curEnd = moveToCharacter(cm, repeat, forward, lastSearch.selectedCharacter); - if (!curEnd) { - cm.moveH(increment, 'char'); - return head; - } - curEnd.ch += increment; - return curEnd; - } - }; - - function defineMotion(name, fn) { - motions[name] = fn; - } - - function fillArray(val, times) { - var arr = []; - for (var i = 0; i < times; i++) { - arr.push(val); - } - return arr; - } - /** - * An operator acts on a text selection. It receives the list of selections - * as input. The corresponding CodeMirror selection is guaranteed to - * match the input selection. - */ - var operators = { - change: function(cm, args, ranges) { - var finalHead, text; - var vim = cm.state.vim; - vimGlobalState.macroModeState.lastInsertModeChanges.inVisualBlock = vim.visualBlock; - if (!vim.visualMode) { - var anchor = ranges[0].anchor, - head = ranges[0].head; - text = cm.getRange(anchor, head); - var lastState = vim.lastEditInputState || {}; - if (lastState.motion == "moveByWords" && !isWhiteSpaceString(text)) { - // Exclude trailing whitespace if the range is not all whitespace. - var match = (/\s+$/).exec(text); - if (match && lastState.motionArgs && lastState.motionArgs.forward) { - head = offsetCursor(head, 0, - match[0].length); - text = text.slice(0, - match[0].length); - } - } - var wasLastLine = head.line - 1 == cm.lastLine(); - cm.replaceRange('', anchor, head); - if (args.linewise && !wasLastLine) { - // Push the next line back down, if there is a next line. - CodeMirror.commands.newlineAndIndent(cm); - // null ch so setCursor moves to end of line. - anchor.ch = null; - } - finalHead = anchor; - } else { - text = cm.getSelection(); - var replacement = fillArray('', ranges.length); - cm.replaceSelections(replacement); - finalHead = cursorMin(ranges[0].head, ranges[0].anchor); - } - vimGlobalState.registerController.pushText( - args.registerName, 'change', text, - args.linewise, ranges.length > 1); - actions.enterInsertMode(cm, {head: finalHead}, cm.state.vim); - }, - // delete is a javascript keyword. - 'delete': function(cm, args, ranges) { - var finalHead, text; - var vim = cm.state.vim; - if (!vim.visualBlock) { - var anchor = ranges[0].anchor, - head = ranges[0].head; - if (args.linewise && - head.line != cm.firstLine() && - anchor.line == cm.lastLine() && - anchor.line == head.line - 1) { - // Special case for dd on last line (and first line). - if (anchor.line == cm.firstLine()) { - anchor.ch = 0; - } else { - anchor = Pos(anchor.line - 1, lineLength(cm, anchor.line - 1)); - } - } - text = cm.getRange(anchor, head); - cm.replaceRange('', anchor, head); - finalHead = anchor; - if (args.linewise) { - finalHead = motions.moveToFirstNonWhiteSpaceCharacter(cm, anchor); - } - } else { - text = cm.getSelection(); - var replacement = fillArray('', ranges.length); - cm.replaceSelections(replacement); - finalHead = ranges[0].anchor; - } - vimGlobalState.registerController.pushText( - args.registerName, 'delete', text, - args.linewise, vim.visualBlock); - return clipCursorToContent(cm, finalHead); - }, - indent: function(cm, args, ranges) { - var vim = cm.state.vim; - var startLine = ranges[0].anchor.line; - var endLine = vim.visualBlock ? - ranges[ranges.length - 1].anchor.line : - ranges[0].head.line; - // In visual mode, n> shifts the selection right n times, instead of - // shifting n lines right once. - var repeat = (vim.visualMode) ? args.repeat : 1; - if (args.linewise) { - // The only way to delete a newline is to delete until the start of - // the next line, so in linewise mode evalInput will include the next - // line. We don't want this in indent, so we go back a line. - endLine--; - } - for (var i = startLine; i <= endLine; i++) { - for (var j = 0; j < repeat; j++) { - cm.indentLine(i, args.indentRight); - } - } - return motions.moveToFirstNonWhiteSpaceCharacter(cm, ranges[0].anchor); - }, - changeCase: function(cm, args, ranges, oldAnchor, newHead) { - var selections = cm.getSelections(); - var swapped = []; - var toLower = args.toLower; - for (var j = 0; j < selections.length; j++) { - var toSwap = selections[j]; - var text = ''; - if (toLower === true) { - text = toSwap.toLowerCase(); - } else if (toLower === false) { - text = toSwap.toUpperCase(); - } else { - for (var i = 0; i < toSwap.length; i++) { - var character = toSwap.charAt(i); - text += isUpperCase(character) ? character.toLowerCase() : - character.toUpperCase(); - } - } - swapped.push(text); - } - cm.replaceSelections(swapped); - if (args.shouldMoveCursor){ - return newHead; - } else if (!cm.state.vim.visualMode && args.linewise && ranges[0].anchor.line + 1 == ranges[0].head.line) { - return motions.moveToFirstNonWhiteSpaceCharacter(cm, oldAnchor); - } else if (args.linewise){ - return oldAnchor; - } else { - return cursorMin(ranges[0].anchor, ranges[0].head); - } - }, - yank: function(cm, args, ranges, oldAnchor) { - var vim = cm.state.vim; - var text = cm.getSelection(); - var endPos = vim.visualMode - ? cursorMin(vim.sel.anchor, vim.sel.head, ranges[0].head, ranges[0].anchor) - : oldAnchor; - vimGlobalState.registerController.pushText( - args.registerName, 'yank', - text, args.linewise, vim.visualBlock); - return endPos; - } - }; - - function defineOperator(name, fn) { - operators[name] = fn; - } - - var actions = { - jumpListWalk: function(cm, actionArgs, vim) { - if (vim.visualMode) { - return; - } - var repeat = actionArgs.repeat; - var forward = actionArgs.forward; - var jumpList = vimGlobalState.jumpList; - - var mark = jumpList.move(cm, forward ? repeat : -repeat); - var markPos = mark ? mark.find() : undefined; - markPos = markPos ? markPos : cm.getCursor(); - cm.setCursor(markPos); - cm.ace.curOp.command.scrollIntoView = "center-animate"; // ace patch - }, - scroll: function(cm, actionArgs, vim) { - if (vim.visualMode) { - return; - } - var repeat = actionArgs.repeat || 1; - var lineHeight = cm.defaultTextHeight(); - var top = cm.getScrollInfo().top; - var delta = lineHeight * repeat; - var newPos = actionArgs.forward ? top + delta : top - delta; - var cursor = copyCursor(cm.getCursor()); - var cursorCoords = cm.charCoords(cursor, 'local'); - if (actionArgs.forward) { - if (newPos > cursorCoords.top) { - cursor.line += (newPos - cursorCoords.top) / lineHeight; - cursor.line = Math.ceil(cursor.line); - cm.setCursor(cursor); - cursorCoords = cm.charCoords(cursor, 'local'); - cm.scrollTo(null, cursorCoords.top); - } else { - // Cursor stays within bounds. Just reposition the scroll window. - cm.scrollTo(null, newPos); - } - } else { - var newBottom = newPos + cm.getScrollInfo().clientHeight; - if (newBottom < cursorCoords.bottom) { - cursor.line -= (cursorCoords.bottom - newBottom) / lineHeight; - cursor.line = Math.floor(cursor.line); - cm.setCursor(cursor); - cursorCoords = cm.charCoords(cursor, 'local'); - cm.scrollTo( - null, cursorCoords.bottom - cm.getScrollInfo().clientHeight); - } else { - // Cursor stays within bounds. Just reposition the scroll window. - cm.scrollTo(null, newPos); - } - } - }, - scrollToCursor: function(cm, actionArgs) { - var lineNum = cm.getCursor().line; - var charCoords = cm.charCoords(Pos(lineNum, 0), 'local'); - var height = cm.getScrollInfo().clientHeight; - var y = charCoords.top; - var lineHeight = charCoords.bottom - y; - switch (actionArgs.position) { - case 'center': y = y - (height / 2) + lineHeight; - break; - case 'bottom': y = y - height + lineHeight*1.4; - break; - case 'top': y = y + lineHeight*0.4; - break; - } - cm.scrollTo(null, y); - }, - replayMacro: function(cm, actionArgs, vim) { - var registerName = actionArgs.selectedCharacter; - var repeat = actionArgs.repeat; - var macroModeState = vimGlobalState.macroModeState; - if (registerName == '@') { - registerName = macroModeState.latestRegister; - } - while(repeat--){ - executeMacroRegister(cm, vim, macroModeState, registerName); - } - }, - enterMacroRecordMode: function(cm, actionArgs) { - var macroModeState = vimGlobalState.macroModeState; - var registerName = actionArgs.selectedCharacter; - macroModeState.enterMacroRecordMode(cm, registerName); - }, - enterInsertMode: function(cm, actionArgs, vim) { - if (cm.getOption('readOnly')) { return; } - vim.insertMode = true; - vim.insertModeRepeat = actionArgs && actionArgs.repeat || 1; - var insertAt = (actionArgs) ? actionArgs.insertAt : null; - var sel = vim.sel; - var head = actionArgs.head || cm.getCursor('head'); - var height = cm.listSelections().length; - if (insertAt == 'eol') { - head = Pos(head.line, lineLength(cm, head.line)); - } else if (insertAt == 'charAfter') { - head = offsetCursor(head, 0, 1); - } else if (insertAt == 'firstNonBlank') { - head = motions.moveToFirstNonWhiteSpaceCharacter(cm, head); - } else if (insertAt == 'startOfSelectedArea') { - if (!vim.visualBlock) { - if (sel.head.line < sel.anchor.line) { - head = sel.head; - } else { - head = Pos(sel.anchor.line, 0); - } - } else { - head = Pos( - Math.min(sel.head.line, sel.anchor.line), - Math.min(sel.head.ch, sel.anchor.ch)); - height = Math.abs(sel.head.line - sel.anchor.line) + 1; - } - } else if (insertAt == 'endOfSelectedArea') { - if (!vim.visualBlock) { - if (sel.head.line >= sel.anchor.line) { - head = offsetCursor(sel.head, 0, 1); - } else { - head = Pos(sel.anchor.line, 0); - } - } else { - head = Pos( - Math.min(sel.head.line, sel.anchor.line), - Math.max(sel.head.ch + 1, sel.anchor.ch)); - height = Math.abs(sel.head.line - sel.anchor.line) + 1; - } - } else if (insertAt == 'inplace') { - if (vim.visualMode){ - return; - } - } - cm.setOption('keyMap', 'vim-insert'); - cm.setOption('disableInput', false); - if (actionArgs && actionArgs.replace) { - // Handle Replace-mode as a special case of insert mode. - cm.toggleOverwrite(true); - cm.setOption('keyMap', 'vim-replace'); - CodeMirror.signal(cm, "vim-mode-change", {mode: "replace"}); - } else { - cm.setOption('keyMap', 'vim-insert'); - CodeMirror.signal(cm, "vim-mode-change", {mode: "insert"}); - } - if (!vimGlobalState.macroModeState.isPlaying) { - // Only record if not replaying. - cm.on('change', onChange); - CodeMirror.on(cm.getInputField(), 'keydown', onKeyEventTargetKeyDown); - } - if (vim.visualMode) { - exitVisualMode(cm); - } - selectForInsert(cm, head, height); - }, - toggleVisualMode: function(cm, actionArgs, vim) { - var repeat = actionArgs.repeat; - var anchor = cm.getCursor(); - var head; - // TODO: The repeat should actually select number of characters/lines - // equal to the repeat times the size of the previous visual - // operation. - if (!vim.visualMode) { - // Entering visual mode - vim.visualMode = true; - vim.visualLine = !!actionArgs.linewise; - vim.visualBlock = !!actionArgs.blockwise; - head = clipCursorToContent( - cm, Pos(anchor.line, anchor.ch + repeat - 1), - true /** includeLineBreak */); - vim.sel = { - anchor: anchor, - head: head - }; - CodeMirror.signal(cm, "vim-mode-change", {mode: "visual", subMode: vim.visualLine ? "linewise" : vim.visualBlock ? "blockwise" : ""}); - updateCmSelection(cm); - updateMark(cm, vim, '<', cursorMin(anchor, head)); - updateMark(cm, vim, '>', cursorMax(anchor, head)); - } else if (vim.visualLine ^ actionArgs.linewise || - vim.visualBlock ^ actionArgs.blockwise) { - // Toggling between modes - vim.visualLine = !!actionArgs.linewise; - vim.visualBlock = !!actionArgs.blockwise; - CodeMirror.signal(cm, "vim-mode-change", {mode: "visual", subMode: vim.visualLine ? "linewise" : vim.visualBlock ? "blockwise" : ""}); - updateCmSelection(cm); - } else { - exitVisualMode(cm); - } - }, - reselectLastSelection: function(cm, _actionArgs, vim) { - var lastSelection = vim.lastSelection; - if (vim.visualMode) { - updateLastSelection(cm, vim); - } - if (lastSelection) { - var anchor = lastSelection.anchorMark.find(); - var head = lastSelection.headMark.find(); - if (!anchor || !head) { - // If the marks have been destroyed due to edits, do nothing. - return; - } - vim.sel = { - anchor: anchor, - head: head - }; - vim.visualMode = true; - vim.visualLine = lastSelection.visualLine; - vim.visualBlock = lastSelection.visualBlock; - updateCmSelection(cm); - updateMark(cm, vim, '<', cursorMin(anchor, head)); - updateMark(cm, vim, '>', cursorMax(anchor, head)); - CodeMirror.signal(cm, 'vim-mode-change', { - mode: 'visual', - subMode: vim.visualLine ? 'linewise' : - vim.visualBlock ? 'blockwise' : ''}); - } - }, - joinLines: function(cm, actionArgs, vim) { - var curStart, curEnd; - if (vim.visualMode) { - curStart = cm.getCursor('anchor'); - curEnd = cm.getCursor('head'); - if (cursorIsBefore(curEnd, curStart)) { - var tmp = curEnd; - curEnd = curStart; - curStart = tmp; - } - curEnd.ch = lineLength(cm, curEnd.line) - 1; - } else { - // Repeat is the number of lines to join. Minimum 2 lines. - var repeat = Math.max(actionArgs.repeat, 2); - curStart = cm.getCursor(); - curEnd = clipCursorToContent(cm, Pos(curStart.line + repeat - 1, - Infinity)); - } - var finalCh = 0; - for (var i = curStart.line; i < curEnd.line; i++) { - finalCh = lineLength(cm, curStart.line); - var tmp = Pos(curStart.line + 1, - lineLength(cm, curStart.line + 1)); - var text = cm.getRange(curStart, tmp); - text = text.replace(/\n\s*/g, ' '); - cm.replaceRange(text, curStart, tmp); - } - var curFinalPos = Pos(curStart.line, finalCh); - if (vim.visualMode) { - exitVisualMode(cm, false); - } - cm.setCursor(curFinalPos); - }, - newLineAndEnterInsertMode: function(cm, actionArgs, vim) { - vim.insertMode = true; - var insertAt = copyCursor(cm.getCursor()); - if (insertAt.line === cm.firstLine() && !actionArgs.after) { - // Special case for inserting newline before start of document. - cm.replaceRange('\n', Pos(cm.firstLine(), 0)); - cm.setCursor(cm.firstLine(), 0); - } else { - insertAt.line = (actionArgs.after) ? insertAt.line : - insertAt.line - 1; - insertAt.ch = lineLength(cm, insertAt.line); - cm.setCursor(insertAt); - var newlineFn = CodeMirror.commands.newlineAndIndentContinueComment || - CodeMirror.commands.newlineAndIndent; - newlineFn(cm); - } - this.enterInsertMode(cm, { repeat: actionArgs.repeat }, vim); - }, - paste: function(cm, actionArgs, vim) { - var cur = copyCursor(cm.getCursor()); - var register = vimGlobalState.registerController.getRegister( - actionArgs.registerName); - var text = register.toString(); - if (!text) { - return; - } - if (actionArgs.matchIndent) { - var tabSize = cm.getOption("tabSize"); - // length that considers tabs and tabSize - var whitespaceLength = function(str) { - var tabs = (str.split("\t").length - 1); - var spaces = (str.split(" ").length - 1); - return tabs * tabSize + spaces * 1; - }; - var currentLine = cm.getLine(cm.getCursor().line); - var indent = whitespaceLength(currentLine.match(/^\s*/)[0]); - // chomp last newline b/c don't want it to match /^\s*/gm - var chompedText = text.replace(/\n$/, ''); - var wasChomped = text !== chompedText; - var firstIndent = whitespaceLength(text.match(/^\s*/)[0]); - var text = chompedText.replace(/^\s*/gm, function(wspace) { - var newIndent = indent + (whitespaceLength(wspace) - firstIndent); - if (newIndent < 0) { - return ""; - } - else if (cm.getOption("indentWithTabs")) { - var quotient = Math.floor(newIndent / tabSize); - return Array(quotient + 1).join('\t'); - } - else { - return Array(newIndent + 1).join(' '); - } - }); - text += wasChomped ? "\n" : ""; - } - if (actionArgs.repeat > 1) { - var text = Array(actionArgs.repeat + 1).join(text); - } - var linewise = register.linewise; - var blockwise = register.blockwise; - if (linewise) { - if(vim.visualMode) { - text = vim.visualLine ? text.slice(0, -1) : '\n' + text.slice(0, text.length - 1) + '\n'; - } else if (actionArgs.after) { - // Move the newline at the end to the start instead, and paste just - // before the newline character of the line we are on right now. - text = '\n' + text.slice(0, text.length - 1); - cur.ch = lineLength(cm, cur.line); - } else { - cur.ch = 0; - } - } else { - if (blockwise) { - text = text.split('\n'); - for (var i = 0; i < text.length; i++) { - text[i] = (text[i] == '') ? ' ' : text[i]; - } - } - cur.ch += actionArgs.after ? 1 : 0; - } - var curPosFinal; - var idx; - if (vim.visualMode) { - // save the pasted text for reselection if the need arises - vim.lastPastedText = text; - var lastSelectionCurEnd; - var selectedArea = getSelectedAreaRange(cm, vim); - var selectionStart = selectedArea[0]; - var selectionEnd = selectedArea[1]; - var selectedText = cm.getSelection(); - var selections = cm.listSelections(); - var emptyStrings = new Array(selections.length).join('1').split('1'); - // save the curEnd marker before it get cleared due to cm.replaceRange. - if (vim.lastSelection) { - lastSelectionCurEnd = vim.lastSelection.headMark.find(); - } - // push the previously selected text to unnamed register - vimGlobalState.registerController.unnamedRegister.setText(selectedText); - if (blockwise) { - // first delete the selected text - cm.replaceSelections(emptyStrings); - // Set new selections as per the block length of the yanked text - selectionEnd = Pos(selectionStart.line + text.length-1, selectionStart.ch); - cm.setCursor(selectionStart); - selectBlock(cm, selectionEnd); - cm.replaceSelections(text); - curPosFinal = selectionStart; - } else if (vim.visualBlock) { - cm.replaceSelections(emptyStrings); - cm.setCursor(selectionStart); - cm.replaceRange(text, selectionStart, selectionStart); - curPosFinal = selectionStart; - } else { - cm.replaceRange(text, selectionStart, selectionEnd); - curPosFinal = cm.posFromIndex(cm.indexFromPos(selectionStart) + text.length - 1); - } - // restore the the curEnd marker - if(lastSelectionCurEnd) { - vim.lastSelection.headMark = cm.setBookmark(lastSelectionCurEnd); - } - if (linewise) { - curPosFinal.ch=0; - } - } else { - if (blockwise) { - cm.setCursor(cur); - for (var i = 0; i < text.length; i++) { - var line = cur.line+i; - if (line > cm.lastLine()) { - cm.replaceRange('\n', Pos(line, 0)); - } - var lastCh = lineLength(cm, line); - if (lastCh < cur.ch) { - extendLineToColumn(cm, line, cur.ch); - } - } - cm.setCursor(cur); - selectBlock(cm, Pos(cur.line + text.length-1, cur.ch)); - cm.replaceSelections(text); - curPosFinal = cur; - } else { - cm.replaceRange(text, cur); - // Now fine tune the cursor to where we want it. - if (linewise && actionArgs.after) { - curPosFinal = Pos( - cur.line + 1, - findFirstNonWhiteSpaceCharacter(cm.getLine(cur.line + 1))); - } else if (linewise && !actionArgs.after) { - curPosFinal = Pos( - cur.line, - findFirstNonWhiteSpaceCharacter(cm.getLine(cur.line))); - } else if (!linewise && actionArgs.after) { - idx = cm.indexFromPos(cur); - curPosFinal = cm.posFromIndex(idx + text.length - 1); - } else { - idx = cm.indexFromPos(cur); - curPosFinal = cm.posFromIndex(idx + text.length); - } - } - } - if (vim.visualMode) { - exitVisualMode(cm, false); - } - cm.setCursor(curPosFinal); - }, - undo: function(cm, actionArgs) { - cm.operation(function() { - repeatFn(cm, CodeMirror.commands.undo, actionArgs.repeat)(); - cm.setCursor(cm.getCursor('anchor')); - }); - }, - redo: function(cm, actionArgs) { - repeatFn(cm, CodeMirror.commands.redo, actionArgs.repeat)(); - }, - setRegister: function(_cm, actionArgs, vim) { - vim.inputState.registerName = actionArgs.selectedCharacter; - }, - setMark: function(cm, actionArgs, vim) { - var markName = actionArgs.selectedCharacter; - updateMark(cm, vim, markName, cm.getCursor()); - }, - replace: function(cm, actionArgs, vim) { - var replaceWith = actionArgs.selectedCharacter; - var curStart = cm.getCursor(); - var replaceTo; - var curEnd; - var selections = cm.listSelections(); - if (vim.visualMode) { - curStart = cm.getCursor('start'); - curEnd = cm.getCursor('end'); - } else { - var line = cm.getLine(curStart.line); - replaceTo = curStart.ch + actionArgs.repeat; - if (replaceTo > line.length) { - replaceTo=line.length; - } - curEnd = Pos(curStart.line, replaceTo); - } - if (replaceWith=='\n') { - if (!vim.visualMode) cm.replaceRange('', curStart, curEnd); - // special case, where vim help says to replace by just one line-break - (CodeMirror.commands.newlineAndIndentContinueComment || CodeMirror.commands.newlineAndIndent)(cm); - } else { - var replaceWithStr = cm.getRange(curStart, curEnd); - //replace all characters in range by selected, but keep linebreaks - replaceWithStr = replaceWithStr.replace(/[^\n]/g, replaceWith); - if (vim.visualBlock) { - // Tabs are split in visua block before replacing - var spaces = new Array(cm.getOption("tabSize")+1).join(' '); - replaceWithStr = cm.getSelection(); - replaceWithStr = replaceWithStr.replace(/\t/g, spaces).replace(/[^\n]/g, replaceWith).split('\n'); - cm.replaceSelections(replaceWithStr); - } else { - cm.replaceRange(replaceWithStr, curStart, curEnd); - } - if (vim.visualMode) { - curStart = cursorIsBefore(selections[0].anchor, selections[0].head) ? - selections[0].anchor : selections[0].head; - cm.setCursor(curStart); - exitVisualMode(cm, false); - } else { - cm.setCursor(offsetCursor(curEnd, 0, -1)); - } - } - }, - incrementNumberToken: function(cm, actionArgs) { - var cur = cm.getCursor(); - var lineStr = cm.getLine(cur.line); - var re = /-?\d+/g; - var match; - var start; - var end; - var numberStr; - var token; - while ((match = re.exec(lineStr)) !== null) { - token = match[0]; - start = match.index; - end = start + token.length; - if (cur.ch < end)break; - } - if (!actionArgs.backtrack && (end <= cur.ch))return; - if (token) { - var increment = actionArgs.increase ? 1 : -1; - var number = parseInt(token) + (increment * actionArgs.repeat); - var from = Pos(cur.line, start); - var to = Pos(cur.line, end); - numberStr = number.toString(); - cm.replaceRange(numberStr, from, to); - } else { - return; - } - cm.setCursor(Pos(cur.line, start + numberStr.length - 1)); - }, - repeatLastEdit: function(cm, actionArgs, vim) { - var lastEditInputState = vim.lastEditInputState; - if (!lastEditInputState) { return; } - var repeat = actionArgs.repeat; - if (repeat && actionArgs.repeatIsExplicit) { - vim.lastEditInputState.repeatOverride = repeat; - } else { - repeat = vim.lastEditInputState.repeatOverride || repeat; - } - repeatLastEdit(cm, vim, repeat, false /** repeatForInsert */); - }, - exitInsertMode: exitInsertMode - }; - - function defineAction(name, fn) { - actions[name] = fn; - } - - /* - * Below are miscellaneous utility functions used by vim.js - */ - - /** - * Clips cursor to ensure that line is within the buffer's range - * If includeLineBreak is true, then allow cur.ch == lineLength. - */ - function clipCursorToContent(cm, cur, includeLineBreak) { - var line = Math.min(Math.max(cm.firstLine(), cur.line), cm.lastLine() ); - var maxCh = lineLength(cm, line) - 1; - maxCh = (includeLineBreak) ? maxCh + 1 : maxCh; - var ch = Math.min(Math.max(0, cur.ch), maxCh); - return Pos(line, ch); - } - function copyArgs(args) { - var ret = {}; - for (var prop in args) { - if (args.hasOwnProperty(prop)) { - ret[prop] = args[prop]; - } - } - return ret; - } - function offsetCursor(cur, offsetLine, offsetCh) { - if (typeof offsetLine === 'object') { - offsetCh = offsetLine.ch; - offsetLine = offsetLine.line; - } - return Pos(cur.line + offsetLine, cur.ch + offsetCh); - } - function getOffset(anchor, head) { - return { - line: head.line - anchor.line, - ch: head.line - anchor.line - }; - } - function commandMatches(keys, keyMap, context, inputState) { - // Partial matches are not applied. They inform the key handler - // that the current key sequence is a subsequence of a valid key - // sequence, so that the key buffer is not cleared. - var match, partial = [], full = []; - for (var i = 0; i < keyMap.length; i++) { - var command = keyMap[i]; - if (context == 'insert' && command.context != 'insert' || - command.context && command.context != context || - inputState.operator && command.type == 'action' || - !(match = commandMatch(keys, command.keys))) { continue; } - if (match == 'partial') { partial.push(command); } - if (match == 'full') { full.push(command); } - } - return { - partial: partial.length && partial, - full: full.length && full - }; - } - function commandMatch(pressed, mapped) { - if (mapped.slice(-11) == '') { - // Last character matches anything. - var prefixLen = mapped.length - 11; - var pressedPrefix = pressed.slice(0, prefixLen); - var mappedPrefix = mapped.slice(0, prefixLen); - return pressedPrefix == mappedPrefix && pressed.length > prefixLen ? 'full' : - mappedPrefix.indexOf(pressedPrefix) == 0 ? 'partial' : false; - } else { - return pressed == mapped ? 'full' : - mapped.indexOf(pressed) == 0 ? 'partial' : false; - } - } - function lastChar(keys) { - var match = /^.*(<[\w\-]+>)$/.exec(keys); - var selectedCharacter = match ? match[1] : keys.slice(-1); - if (selectedCharacter.length > 1){ - switch(selectedCharacter){ - case '': - selectedCharacter='\n'; - break; - case '': - selectedCharacter=' '; - break; - default: - break; - } - } - return selectedCharacter; - } - function repeatFn(cm, fn, repeat) { - return function() { - for (var i = 0; i < repeat; i++) { - fn(cm); - } - }; - } - function copyCursor(cur) { - return Pos(cur.line, cur.ch); - } - function cursorEqual(cur1, cur2) { - return cur1.ch == cur2.ch && cur1.line == cur2.line; - } - function cursorIsBefore(cur1, cur2) { - if (cur1.line < cur2.line) { - return true; - } - if (cur1.line == cur2.line && cur1.ch < cur2.ch) { - return true; - } - return false; - } - function cursorMin(cur1, cur2) { - if (arguments.length > 2) { - cur2 = cursorMin.apply(undefined, Array.prototype.slice.call(arguments, 1)); - } - return cursorIsBefore(cur1, cur2) ? cur1 : cur2; - } - function cursorMax(cur1, cur2) { - if (arguments.length > 2) { - cur2 = cursorMax.apply(undefined, Array.prototype.slice.call(arguments, 1)); - } - return cursorIsBefore(cur1, cur2) ? cur2 : cur1; - } - function cursorIsBetween(cur1, cur2, cur3) { - // returns true if cur2 is between cur1 and cur3. - var cur1before2 = cursorIsBefore(cur1, cur2); - var cur2before3 = cursorIsBefore(cur2, cur3); - return cur1before2 && cur2before3; - } - function lineLength(cm, lineNum) { - return cm.getLine(lineNum).length; - } - function trim(s) { - if (s.trim) { - return s.trim(); - } - return s.replace(/^\s+|\s+$/g, ''); - } - function escapeRegex(s) { - return s.replace(/([.?*+$\[\]\/\\(){}|\-])/g, '\\$1'); - } - function extendLineToColumn(cm, lineNum, column) { - var endCh = lineLength(cm, lineNum); - var spaces = new Array(column-endCh+1).join(' '); - cm.setCursor(Pos(lineNum, endCh)); - cm.replaceRange(spaces, cm.getCursor()); - } - // This functions selects a rectangular block - // of text with selectionEnd as any of its corner - // Height of block: - // Difference in selectionEnd.line and first/last selection.line - // Width of the block: - // Distance between selectionEnd.ch and any(first considered here) selection.ch - function selectBlock(cm, selectionEnd) { - var selections = [], ranges = cm.listSelections(); - var head = copyCursor(cm.clipPos(selectionEnd)); - var isClipped = !cursorEqual(selectionEnd, head); - var curHead = cm.getCursor('head'); - var primIndex = getIndex(ranges, curHead); - var wasClipped = cursorEqual(ranges[primIndex].head, ranges[primIndex].anchor); - var max = ranges.length - 1; - var index = max - primIndex > primIndex ? max : 0; - var base = ranges[index].anchor; - - var firstLine = Math.min(base.line, head.line); - var lastLine = Math.max(base.line, head.line); - var baseCh = base.ch, headCh = head.ch; - - var dir = ranges[index].head.ch - baseCh; - var newDir = headCh - baseCh; - if (dir > 0 && newDir <= 0) { - baseCh++; - if (!isClipped) { headCh--; } - } else if (dir < 0 && newDir >= 0) { - baseCh--; - if (!wasClipped) { headCh++; } - } else if (dir < 0 && newDir == -1) { - baseCh--; - headCh++; - } - for (var line = firstLine; line <= lastLine; line++) { - var range = {anchor: new Pos(line, baseCh), head: new Pos(line, headCh)}; - selections.push(range); - } - primIndex = head.line == lastLine ? selections.length - 1 : 0; - cm.setSelections(selections); - selectionEnd.ch = headCh; - base.ch = baseCh; - return base; - } - function selectForInsert(cm, head, height) { - var sel = []; - for (var i = 0; i < height; i++) { - var lineHead = offsetCursor(head, i, 0); - sel.push({anchor: lineHead, head: lineHead}); - } - cm.setSelections(sel, 0); - } - // getIndex returns the index of the cursor in the selections. - function getIndex(ranges, cursor, end) { - for (var i = 0; i < ranges.length; i++) { - var atAnchor = end != 'head' && cursorEqual(ranges[i].anchor, cursor); - var atHead = end != 'anchor' && cursorEqual(ranges[i].head, cursor); - if (atAnchor || atHead) { - return i; - } - } - return -1; - } - function getSelectedAreaRange(cm, vim) { - var lastSelection = vim.lastSelection; - var getCurrentSelectedAreaRange = function() { - var selections = cm.listSelections(); - var start = selections[0]; - var end = selections[selections.length-1]; - var selectionStart = cursorIsBefore(start.anchor, start.head) ? start.anchor : start.head; - var selectionEnd = cursorIsBefore(end.anchor, end.head) ? end.head : end.anchor; - return [selectionStart, selectionEnd]; - }; - var getLastSelectedAreaRange = function() { - var selectionStart = cm.getCursor(); - var selectionEnd = cm.getCursor(); - var block = lastSelection.visualBlock; - if (block) { - var width = block.width; - var height = block.height; - selectionEnd = Pos(selectionStart.line + height, selectionStart.ch + width); - var selections = []; - // selectBlock creates a 'proper' rectangular block. - // We do not want that in all cases, so we manually set selections. - for (var i = selectionStart.line; i < selectionEnd.line; i++) { - var anchor = Pos(i, selectionStart.ch); - var head = Pos(i, selectionEnd.ch); - var range = {anchor: anchor, head: head}; - selections.push(range); - } - cm.setSelections(selections); - } else { - var start = lastSelection.anchorMark.find(); - var end = lastSelection.headMark.find(); - var line = end.line - start.line; - var ch = end.ch - start.ch; - selectionEnd = {line: selectionEnd.line + line, ch: line ? selectionEnd.ch : ch + selectionEnd.ch}; - if (lastSelection.visualLine) { - selectionStart = Pos(selectionStart.line, 0); - selectionEnd = Pos(selectionEnd.line, lineLength(cm, selectionEnd.line)); - } - cm.setSelection(selectionStart, selectionEnd); - } - return [selectionStart, selectionEnd]; - }; - if (!vim.visualMode) { - // In case of replaying the action. - return getLastSelectedAreaRange(); - } else { - return getCurrentSelectedAreaRange(); - } - } - // Updates the previous selection with the current selection's values. This - // should only be called in visual mode. - function updateLastSelection(cm, vim) { - var anchor = vim.sel.anchor; - var head = vim.sel.head; - // To accommodate the effect of lastPastedText in the last selection - if (vim.lastPastedText) { - head = cm.posFromIndex(cm.indexFromPos(anchor) + vim.lastPastedText.length); - vim.lastPastedText = null; - } - vim.lastSelection = {'anchorMark': cm.setBookmark(anchor), - 'headMark': cm.setBookmark(head), - 'anchor': copyCursor(anchor), - 'head': copyCursor(head), - 'visualMode': vim.visualMode, - 'visualLine': vim.visualLine, - 'visualBlock': vim.visualBlock}; - } - function expandSelection(cm, start, end) { - var sel = cm.state.vim.sel; - var head = sel.head; - var anchor = sel.anchor; - var tmp; - if (cursorIsBefore(end, start)) { - tmp = end; - end = start; - start = tmp; - } - if (cursorIsBefore(head, anchor)) { - head = cursorMin(start, head); - anchor = cursorMax(anchor, end); - } else { - anchor = cursorMin(start, anchor); - head = cursorMax(head, end); - head = offsetCursor(head, 0, -1); - if (head.ch == -1 && head.line != cm.firstLine()) { - head = Pos(head.line - 1, lineLength(cm, head.line - 1)); - } - } - return [anchor, head]; - } - /** - * Updates the CodeMirror selection to match the provided vim selection. - * If no arguments are given, it uses the current vim selection state. - */ - function updateCmSelection(cm, sel, mode) { - var vim = cm.state.vim; - sel = sel || vim.sel; - var mode = mode || - vim.visualLine ? 'line' : vim.visualBlock ? 'block' : 'char'; - var cmSel = makeCmSelection(cm, sel, mode); - cm.setSelections(cmSel.ranges, cmSel.primary); - updateFakeCursor(cm); - } - function makeCmSelection(cm, sel, mode, exclusive) { - var head = copyCursor(sel.head); - var anchor = copyCursor(sel.anchor); - if (mode == 'char') { - var headOffset = !exclusive && !cursorIsBefore(sel.head, sel.anchor) ? 1 : 0; - var anchorOffset = cursorIsBefore(sel.head, sel.anchor) ? 1 : 0; - head = offsetCursor(sel.head, 0, headOffset); - anchor = offsetCursor(sel.anchor, 0, anchorOffset); - return { - ranges: [{anchor: anchor, head: head}], - primary: 0 - }; - } else if (mode == 'line') { - if (!cursorIsBefore(sel.head, sel.anchor)) { - anchor.ch = 0; - - var lastLine = cm.lastLine(); - if (head.line > lastLine) { - head.line = lastLine; - } - head.ch = lineLength(cm, head.line); - } else { - head.ch = 0; - anchor.ch = lineLength(cm, anchor.line); - } - return { - ranges: [{anchor: anchor, head: head}], - primary: 0 - }; - } else if (mode == 'block') { - var top = Math.min(anchor.line, head.line), - left = Math.min(anchor.ch, head.ch), - bottom = Math.max(anchor.line, head.line), - right = Math.max(anchor.ch, head.ch) + 1; - var height = bottom - top + 1; - var primary = head.line == top ? 0 : height - 1; - var ranges = []; - for (var i = 0; i < height; i++) { - ranges.push({ - anchor: Pos(top + i, left), - head: Pos(top + i, right) - }); - } - return { - ranges: ranges, - primary: primary - }; - } - } - function getHead(cm) { - var cur = cm.getCursor('head'); - if (cm.getSelection().length == 1) { - // Small corner case when only 1 character is selected. The "real" - // head is the left of head and anchor. - cur = cursorMin(cur, cm.getCursor('anchor')); - } - return cur; - } - - /** - * If moveHead is set to false, the CodeMirror selection will not be - * touched. The caller assumes the responsibility of putting the cursor - * in the right place. - */ - function exitVisualMode(cm, moveHead) { - var vim = cm.state.vim; - if (moveHead !== false) { - cm.setCursor(clipCursorToContent(cm, vim.sel.head)); - } - updateLastSelection(cm, vim); - vim.visualMode = false; - vim.visualLine = false; - vim.visualBlock = false; - CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"}); - if (vim.fakeCursor) { - vim.fakeCursor.clear(); - } - } - - // Remove any trailing newlines from the selection. For - // example, with the caret at the start of the last word on the line, - // 'dw' should word, but not the newline, while 'w' should advance the - // caret to the first character of the next line. - function clipToLine(cm, curStart, curEnd) { - var selection = cm.getRange(curStart, curEnd); - // Only clip if the selection ends with trailing newline + whitespace - if (/\n\s*$/.test(selection)) { - var lines = selection.split('\n'); - // We know this is all whitepsace. - lines.pop(); - - // Cases: - // 1. Last word is an empty line - do not clip the trailing '\n' - // 2. Last word is not an empty line - clip the trailing '\n' - var line; - // Find the line containing the last word, and clip all whitespace up - // to it. - for (var line = lines.pop(); lines.length > 0 && line && isWhiteSpaceString(line); line = lines.pop()) { - curEnd.line--; - curEnd.ch = 0; - } - // If the last word is not an empty line, clip an additional newline - if (line) { - curEnd.line--; - curEnd.ch = lineLength(cm, curEnd.line); - } else { - curEnd.ch = 0; - } - } - } - - // Expand the selection to line ends. - function expandSelectionToLine(_cm, curStart, curEnd) { - curStart.ch = 0; - curEnd.ch = 0; - curEnd.line++; - } - - function findFirstNonWhiteSpaceCharacter(text) { - if (!text) { - return 0; - } - var firstNonWS = text.search(/\S/); - return firstNonWS == -1 ? text.length : firstNonWS; - } - - function expandWordUnderCursor(cm, inclusive, _forward, bigWord, noSymbol) { - var cur = getHead(cm); - var line = cm.getLine(cur.line); - var idx = cur.ch; - - // Seek to first word or non-whitespace character, depending on if - // noSymbol is true. - var test = noSymbol ? wordCharTest[0] : bigWordCharTest [0]; - while (!test(line.charAt(idx))) { - idx++; - if (idx >= line.length) { return null; } - } - - if (bigWord) { - test = bigWordCharTest[0]; - } else { - test = wordCharTest[0]; - if (!test(line.charAt(idx))) { - test = wordCharTest[1]; - } - } - - var end = idx, start = idx; - while (test(line.charAt(end)) && end < line.length) { end++; } - while (test(line.charAt(start)) && start >= 0) { start--; } - start++; - - if (inclusive) { - // If present, include all whitespace after word. - // Otherwise, include all whitespace before word, except indentation. - var wordEnd = end; - while (/\s/.test(line.charAt(end)) && end < line.length) { end++; } - if (wordEnd == end) { - var wordStart = start; - while (/\s/.test(line.charAt(start - 1)) && start > 0) { start--; } - if (!start) { start = wordStart; } - } - } - return { start: Pos(cur.line, start), end: Pos(cur.line, end) }; - } - - function recordJumpPosition(cm, oldCur, newCur) { - if (!cursorEqual(oldCur, newCur)) { - vimGlobalState.jumpList.add(cm, oldCur, newCur); - } - } - - function recordLastCharacterSearch(increment, args) { - vimGlobalState.lastChararacterSearch.increment = increment; - vimGlobalState.lastChararacterSearch.forward = args.forward; - vimGlobalState.lastChararacterSearch.selectedCharacter = args.selectedCharacter; - } - - var symbolToMode = { - '(': 'bracket', ')': 'bracket', '{': 'bracket', '}': 'bracket', - '[': 'section', ']': 'section', - '*': 'comment', '/': 'comment', - 'm': 'method', 'M': 'method', - '#': 'preprocess' - }; - var findSymbolModes = { - bracket: { - isComplete: function(state) { - if (state.nextCh === state.symb) { - state.depth++; - if (state.depth >= 1)return true; - } else if (state.nextCh === state.reverseSymb) { - state.depth--; - } - return false; - } - }, - section: { - init: function(state) { - state.curMoveThrough = true; - state.symb = (state.forward ? ']' : '[') === state.symb ? '{' : '}'; - }, - isComplete: function(state) { - return state.index === 0 && state.nextCh === state.symb; - } - }, - comment: { - isComplete: function(state) { - var found = state.lastCh === '*' && state.nextCh === '/'; - state.lastCh = state.nextCh; - return found; - } - }, - // TODO: The original Vim implementation only operates on level 1 and 2. - // The current implementation doesn't check for code block level and - // therefore it operates on any levels. - method: { - init: function(state) { - state.symb = (state.symb === 'm' ? '{' : '}'); - state.reverseSymb = state.symb === '{' ? '}' : '{'; - }, - isComplete: function(state) { - if (state.nextCh === state.symb)return true; - return false; - } - }, - preprocess: { - init: function(state) { - state.index = 0; - }, - isComplete: function(state) { - if (state.nextCh === '#') { - var token = state.lineText.match(/#(\w+)/)[1]; - if (token === 'endif') { - if (state.forward && state.depth === 0) { - return true; - } - state.depth++; - } else if (token === 'if') { - if (!state.forward && state.depth === 0) { - return true; - } - state.depth--; - } - if (token === 'else' && state.depth === 0)return true; - } - return false; - } - } - }; - function findSymbol(cm, repeat, forward, symb) { - var cur = copyCursor(cm.getCursor()); - var increment = forward ? 1 : -1; - var endLine = forward ? cm.lineCount() : -1; - var curCh = cur.ch; - var line = cur.line; - var lineText = cm.getLine(line); - var state = { - lineText: lineText, - nextCh: lineText.charAt(curCh), - lastCh: null, - index: curCh, - symb: symb, - reverseSymb: (forward ? { ')': '(', '}': '{' } : { '(': ')', '{': '}' })[symb], - forward: forward, - depth: 0, - curMoveThrough: false - }; - var mode = symbolToMode[symb]; - if (!mode)return cur; - var init = findSymbolModes[mode].init; - var isComplete = findSymbolModes[mode].isComplete; - if (init) { init(state); } - while (line !== endLine && repeat) { - state.index += increment; - state.nextCh = state.lineText.charAt(state.index); - if (!state.nextCh) { - line += increment; - state.lineText = cm.getLine(line) || ''; - if (increment > 0) { - state.index = 0; - } else { - var lineLen = state.lineText.length; - state.index = (lineLen > 0) ? (lineLen-1) : 0; - } - state.nextCh = state.lineText.charAt(state.index); - } - if (isComplete(state)) { - cur.line = line; - cur.ch = state.index; - repeat--; - } - } - if (state.nextCh || state.curMoveThrough) { - return Pos(line, state.index); - } - return cur; - } - - /* - * Returns the boundaries of the next word. If the cursor in the middle of - * the word, then returns the boundaries of the current word, starting at - * the cursor. If the cursor is at the start/end of a word, and we are going - * forward/backward, respectively, find the boundaries of the next word. - * - * @param {CodeMirror} cm CodeMirror object. - * @param {Cursor} cur The cursor position. - * @param {boolean} forward True to search forward. False to search - * backward. - * @param {boolean} bigWord True if punctuation count as part of the word. - * False if only [a-zA-Z0-9] characters count as part of the word. - * @param {boolean} emptyLineIsWord True if empty lines should be treated - * as words. - * @return {Object{from:number, to:number, line: number}} The boundaries of - * the word, or null if there are no more words. - */ - function findWord(cm, cur, forward, bigWord, emptyLineIsWord) { - var lineNum = cur.line; - var pos = cur.ch; - var line = cm.getLine(lineNum); - var dir = forward ? 1 : -1; - var charTests = bigWord ? bigWordCharTest: wordCharTest; - - if (emptyLineIsWord && line == '') { - lineNum += dir; - line = cm.getLine(lineNum); - if (!isLine(cm, lineNum)) { - return null; - } - pos = (forward) ? 0 : line.length; - } - - while (true) { - if (emptyLineIsWord && line == '') { - return { from: 0, to: 0, line: lineNum }; - } - var stop = (dir > 0) ? line.length : -1; - var wordStart = stop, wordEnd = stop; - // Find bounds of next word. - while (pos != stop) { - var foundWord = false; - for (var i = 0; i < charTests.length && !foundWord; ++i) { - if (charTests[i](line.charAt(pos))) { - wordStart = pos; - // Advance to end of word. - while (pos != stop && charTests[i](line.charAt(pos))) { - pos += dir; - } - wordEnd = pos; - foundWord = wordStart != wordEnd; - if (wordStart == cur.ch && lineNum == cur.line && - wordEnd == wordStart + dir) { - // We started at the end of a word. Find the next one. - continue; - } else { - return { - from: Math.min(wordStart, wordEnd + 1), - to: Math.max(wordStart, wordEnd), - line: lineNum }; - } - } - } - if (!foundWord) { - pos += dir; - } - } - // Advance to next/prev line. - lineNum += dir; - if (!isLine(cm, lineNum)) { - return null; - } - line = cm.getLine(lineNum); - pos = (dir > 0) ? 0 : line.length; - } - // Should never get here. - throw new Error('The impossible happened.'); - } - - /** - * @param {CodeMirror} cm CodeMirror object. - * @param {Pos} cur The position to start from. - * @param {int} repeat Number of words to move past. - * @param {boolean} forward True to search forward. False to search - * backward. - * @param {boolean} wordEnd True to move to end of word. False to move to - * beginning of word. - * @param {boolean} bigWord True if punctuation count as part of the word. - * False if only alphabet characters count as part of the word. - * @return {Cursor} The position the cursor should move to. - */ - function moveToWord(cm, cur, repeat, forward, wordEnd, bigWord) { - var curStart = copyCursor(cur); - var words = []; - if (forward && !wordEnd || !forward && wordEnd) { - repeat++; - } - // For 'e', empty lines are not considered words, go figure. - var emptyLineIsWord = !(forward && wordEnd); - for (var i = 0; i < repeat; i++) { - var word = findWord(cm, cur, forward, bigWord, emptyLineIsWord); - if (!word) { - var eodCh = lineLength(cm, cm.lastLine()); - words.push(forward - ? {line: cm.lastLine(), from: eodCh, to: eodCh} - : {line: 0, from: 0, to: 0}); - break; - } - words.push(word); - cur = Pos(word.line, forward ? (word.to - 1) : word.from); - } - var shortCircuit = words.length != repeat; - var firstWord = words[0]; - var lastWord = words.pop(); - if (forward && !wordEnd) { - // w - if (!shortCircuit && (firstWord.from != curStart.ch || firstWord.line != curStart.line)) { - // We did not start in the middle of a word. Discard the extra word at the end. - lastWord = words.pop(); - } - return Pos(lastWord.line, lastWord.from); - } else if (forward && wordEnd) { - return Pos(lastWord.line, lastWord.to - 1); - } else if (!forward && wordEnd) { - // ge - if (!shortCircuit && (firstWord.to != curStart.ch || firstWord.line != curStart.line)) { - // We did not start in the middle of a word. Discard the extra word at the end. - lastWord = words.pop(); - } - return Pos(lastWord.line, lastWord.to); - } else { - // b - return Pos(lastWord.line, lastWord.from); - } - } - - function moveToCharacter(cm, repeat, forward, character) { - var cur = cm.getCursor(); - var start = cur.ch; - var idx; - for (var i = 0; i < repeat; i ++) { - var line = cm.getLine(cur.line); - idx = charIdxInLine(start, line, character, forward, true); - if (idx == -1) { - return null; - } - start = idx; - } - return Pos(cm.getCursor().line, idx); - } - - function moveToColumn(cm, repeat) { - // repeat is always >= 1, so repeat - 1 always corresponds - // to the column we want to go to. - var line = cm.getCursor().line; - return clipCursorToContent(cm, Pos(line, repeat - 1)); - } - - function updateMark(cm, vim, markName, pos) { - if (!inArray(markName, validMarks)) { - return; - } - if (vim.marks[markName]) { - vim.marks[markName].clear(); - } - vim.marks[markName] = cm.setBookmark(pos); - } - - function charIdxInLine(start, line, character, forward, includeChar) { - // Search for char in line. - // motion_options: {forward, includeChar} - // If includeChar = true, include it too. - // If forward = true, search forward, else search backwards. - // If char is not found on this line, do nothing - var idx; - if (forward) { - idx = line.indexOf(character, start + 1); - if (idx != -1 && !includeChar) { - idx -= 1; - } - } else { - idx = line.lastIndexOf(character, start - 1); - if (idx != -1 && !includeChar) { - idx += 1; - } - } - return idx; - } - - function findParagraph(cm, head, repeat, dir, inclusive) { - var line = head.line; - var min = cm.firstLine(); - var max = cm.lastLine(); - var start, end, i = line; - function isEmpty(i) { return !/\S/.test(cm.getLine(i)); } - function isBoundary(i, dir, any) { - if (any) { return isEmpty(i) != isEmpty(i + dir); } - return !isEmpty(i) && isEmpty(i + dir); - } - if (dir) { - while (min <= i && i <= max && repeat > 0) { - if (isBoundary(i, dir)) { repeat--; } - i += dir; - } - return new Pos(i, 0); - } - - var vim = cm.state.vim; - if (vim.visualLine && isBoundary(line, 1, true)) { - var anchor = vim.sel.anchor; - if (isBoundary(anchor.line, -1, true)) { - if (!inclusive || anchor.line != line) { - line += 1; - } - } - } - var startState = isEmpty(line); - for (i = line; i <= max && repeat; i++) { - if (isBoundary(i, 1, true)) { - if (!inclusive || isEmpty(i) != startState) { - repeat--; - } - } - } - end = new Pos(i, 0); - // select boundary before paragraph for the last one - if (i > max && !startState) { startState = true; } - else { inclusive = false; } - for (i = line; i > min; i--) { - if (!inclusive || isEmpty(i) == startState || i == line) { - if (isBoundary(i, -1, true)) { break; } - } - } - start = new Pos(i, 0); - return { start: start, end: end }; - } - - // TODO: perhaps this finagling of start and end positions belonds - // in codmirror/replaceRange? - function selectCompanionObject(cm, head, symb, inclusive) { - var cur = head, start, end; - - var bracketRegexp = ({ - '(': /[()]/, ')': /[()]/, - '[': /[[\]]/, ']': /[[\]]/, - '{': /[{}]/, '}': /[{}]/})[symb]; - var openSym = ({ - '(': '(', ')': '(', - '[': '[', ']': '[', - '{': '{', '}': '{'})[symb]; - var curChar = cm.getLine(cur.line).charAt(cur.ch); - // Due to the behavior of scanForBracket, we need to add an offset if the - // cursor is on a matching open bracket. - var offset = curChar === openSym ? 1 : 0; - - start = cm.scanForBracket(Pos(cur.line, cur.ch + offset), -1, null, {'bracketRegex': bracketRegexp}); - end = cm.scanForBracket(Pos(cur.line, cur.ch + offset), 1, null, {'bracketRegex': bracketRegexp}); - - if (!start || !end) { - return { start: cur, end: cur }; - } - - start = start.pos; - end = end.pos; - - if ((start.line == end.line && start.ch > end.ch) - || (start.line > end.line)) { - var tmp = start; - start = end; - end = tmp; - } - - if (inclusive) { - end.ch += 1; - } else { - start.ch += 1; - } - - return { start: start, end: end }; - } - - // Takes in a symbol and a cursor and tries to simulate text objects that - // have identical opening and closing symbols - // TODO support across multiple lines - function findBeginningAndEnd(cm, head, symb, inclusive) { - var cur = copyCursor(head); - var line = cm.getLine(cur.line); - var chars = line.split(''); - var start, end, i, len; - var firstIndex = chars.indexOf(symb); - - // the decision tree is to always look backwards for the beginning first, - // but if the cursor is in front of the first instance of the symb, - // then move the cursor forward - if (cur.ch < firstIndex) { - cur.ch = firstIndex; - // Why is this line even here??? - // cm.setCursor(cur.line, firstIndex+1); - } - // otherwise if the cursor is currently on the closing symbol - else if (firstIndex < cur.ch && chars[cur.ch] == symb) { - end = cur.ch; // assign end to the current cursor - --cur.ch; // make sure to look backwards - } - - // if we're currently on the symbol, we've got a start - if (chars[cur.ch] == symb && !end) { - start = cur.ch + 1; // assign start to ahead of the cursor - } else { - // go backwards to find the start - for (i = cur.ch; i > -1 && !start; i--) { - if (chars[i] == symb) { - start = i + 1; - } - } - } - - // look forwards for the end symbol - if (start && !end) { - for (i = start, len = chars.length; i < len && !end; i++) { - if (chars[i] == symb) { - end = i; - } - } - } - - // nothing found - if (!start || !end) { - return { start: cur, end: cur }; - } - - // include the symbols - if (inclusive) { - --start; ++end; - } - - return { - start: Pos(cur.line, start), - end: Pos(cur.line, end) - }; - } - - // Search functions - defineOption('pcre', true, 'boolean'); - function SearchState() {} - SearchState.prototype = { - getQuery: function() { - return vimGlobalState.query; - }, - setQuery: function(query) { - vimGlobalState.query = query; - }, - getOverlay: function() { - return this.searchOverlay; - }, - setOverlay: function(overlay) { - this.searchOverlay = overlay; - }, - isReversed: function() { - return vimGlobalState.isReversed; - }, - setReversed: function(reversed) { - vimGlobalState.isReversed = reversed; - }, - getScrollbarAnnotate: function() { - return this.annotate; - }, - setScrollbarAnnotate: function(annotate) { - this.annotate = annotate; - } - }; - function getSearchState(cm) { - var vim = cm.state.vim; - return vim.searchState_ || (vim.searchState_ = new SearchState()); - } - function dialog(cm, template, shortText, onClose, options) { - if (cm.openDialog) { - cm.openDialog(template, onClose, { bottom: true, value: options.value, - onKeyDown: options.onKeyDown, onKeyUp: options.onKeyUp, - selectValueOnOpen: false}); - } - else { - onClose(prompt(shortText, '')); - } - } - function splitBySlash(argString) { - var slashes = findUnescapedSlashes(argString) || []; - if (!slashes.length) return []; - var tokens = []; - // in case of strings like foo/bar - if (slashes[0] !== 0) return; - for (var i = 0; i < slashes.length; i++) { - if (typeof slashes[i] == 'number') - tokens.push(argString.substring(slashes[i] + 1, slashes[i+1])); - } - return tokens; - } - - function findUnescapedSlashes(str) { - var escapeNextChar = false; - var slashes = []; - for (var i = 0; i < str.length; i++) { - var c = str.charAt(i); - if (!escapeNextChar && c == '/') { - slashes.push(i); - } - escapeNextChar = !escapeNextChar && (c == '\\'); - } - return slashes; - } - - // Translates a search string from ex (vim) syntax into javascript form. - function translateRegex(str) { - // When these match, add a '\' if unescaped or remove one if escaped. - var specials = '|(){'; - // Remove, but never add, a '\' for these. - var unescape = '}'; - var escapeNextChar = false; - var out = []; - for (var i = -1; i < str.length; i++) { - var c = str.charAt(i) || ''; - var n = str.charAt(i+1) || ''; - var specialComesNext = (n && specials.indexOf(n) != -1); - if (escapeNextChar) { - if (c !== '\\' || !specialComesNext) { - out.push(c); - } - escapeNextChar = false; - } else { - if (c === '\\') { - escapeNextChar = true; - // Treat the unescape list as special for removing, but not adding '\'. - if (n && unescape.indexOf(n) != -1) { - specialComesNext = true; - } - // Not passing this test means removing a '\'. - if (!specialComesNext || n === '\\') { - out.push(c); - } - } else { - out.push(c); - if (specialComesNext && n !== '\\') { - out.push('\\'); - } - } - } - } - return out.join(''); - } - - // Translates the replace part of a search and replace from ex (vim) syntax into - // javascript form. Similar to translateRegex, but additionally fixes back references - // (translates '\[0..9]' to '$[0..9]') and follows different rules for escaping '$'. - function translateRegexReplace(str) { - var escapeNextChar = false; - var out = []; - for (var i = -1; i < str.length; i++) { - var c = str.charAt(i) || ''; - var n = str.charAt(i+1) || ''; - if (escapeNextChar) { - // At any point in the loop, escapeNextChar is true if the previous - // character was a '\' and was not escaped. - out.push(c); - escapeNextChar = false; - } else { - if (c === '\\') { - escapeNextChar = true; - if ((isNumber(n) || n === '$')) { - out.push('$'); - } else if (n !== '/' && n !== '\\') { - out.push('\\'); - } - } else { - if (c === '$') { - out.push('$'); - } - out.push(c); - if (n === '/') { - out.push('\\'); - } - } - } - } - return out.join(''); - } - - // Unescape \ and / in the replace part, for PCRE mode. - function unescapeRegexReplace(str) { - var stream = new CodeMirror.StringStream(str); - var output = []; - while (!stream.eol()) { - // Search for \. - while (stream.peek() && stream.peek() != '\\') { - output.push(stream.next()); - } - if (stream.match('\\/', true)) { - // \/ => / - output.push('/'); - } else if (stream.match('\\\\', true)) { - // \\ => \ - output.push('\\'); - } else { - // Don't change anything - output.push(stream.next()); - } - } - return output.join(''); - } - - /** - * Extract the regular expression from the query and return a Regexp object. - * Returns null if the query is blank. - * If ignoreCase is passed in, the Regexp object will have the 'i' flag set. - * If smartCase is passed in, and the query contains upper case letters, - * then ignoreCase is overridden, and the 'i' flag will not be set. - * If the query contains the /i in the flag part of the regular expression, - * then both ignoreCase and smartCase are ignored, and 'i' will be passed - * through to the Regex object. - */ - function parseQuery(query, ignoreCase, smartCase) { - // First update the last search register - var lastSearchRegister = vimGlobalState.registerController.getRegister('/'); - lastSearchRegister.setText(query); - // Check if the query is already a regex. - if (query instanceof RegExp) { return query; } - // First try to extract regex + flags from the input. If no flags found, - // extract just the regex. IE does not accept flags directly defined in - // the regex string in the form /regex/flags - var slashes = findUnescapedSlashes(query); - var regexPart; - var forceIgnoreCase; - if (!slashes.length) { - // Query looks like 'regexp' - regexPart = query; - } else { - // Query looks like 'regexp/...' - regexPart = query.substring(0, slashes[0]); - var flagsPart = query.substring(slashes[0]); - forceIgnoreCase = (flagsPart.indexOf('i') != -1); - } - if (!regexPart) { - return null; - } - if (!getOption('pcre')) { - regexPart = translateRegex(regexPart); - } - if (smartCase) { - ignoreCase = (/^[^A-Z]*$/).test(regexPart); - } - var regexp = new RegExp(regexPart, - (ignoreCase || forceIgnoreCase) ? 'i' : undefined); - return regexp; - } - function showConfirm(cm, text) { - if (cm.openNotification) { - cm.openNotification('' + text + '', - {bottom: true, duration: 5000}); - } else { - alert(text); - } - } - function makePrompt(prefix, desc) { - var raw = ''; - if (prefix) { - raw += '' + prefix + ''; - } - raw += ' ' + - ''; - if (desc) { - raw += ''; - raw += desc; - raw += ''; - } - return raw; - } - var searchPromptDesc = '(Javascript regexp)'; - function showPrompt(cm, options) { - var shortText = (options.prefix || '') + ' ' + (options.desc || ''); - var prompt = makePrompt(options.prefix, options.desc); - dialog(cm, prompt, shortText, options.onClose, options); - } - function regexEqual(r1, r2) { - if (r1 instanceof RegExp && r2 instanceof RegExp) { - var props = ['global', 'multiline', 'ignoreCase', 'source']; - for (var i = 0; i < props.length; i++) { - var prop = props[i]; - if (r1[prop] !== r2[prop]) { - return false; - } - } - return true; - } - return false; - } - // Returns true if the query is valid. - function updateSearchQuery(cm, rawQuery, ignoreCase, smartCase) { - if (!rawQuery) { - return; - } - var state = getSearchState(cm); - var query = parseQuery(rawQuery, !!ignoreCase, !!smartCase); - if (!query) { - return; - } - highlightSearchMatches(cm, query); - if (regexEqual(query, state.getQuery())) { - return query; - } - state.setQuery(query); - return query; - } - function searchOverlay(query) { - if (query.source.charAt(0) == '^') { - var matchSol = true; - } - return { - token: function(stream) { - if (matchSol && !stream.sol()) { - stream.skipToEnd(); - return; - } - var match = stream.match(query, false); - if (match) { - if (match[0].length == 0) { - // Matched empty string, skip to next. - stream.next(); - return 'searching'; - } - if (!stream.sol()) { - // Backtrack 1 to match \b - stream.backUp(1); - if (!query.exec(stream.next() + match[0])) { - stream.next(); - return null; - } - } - stream.match(query); - return 'searching'; - } - while (!stream.eol()) { - stream.next(); - if (stream.match(query, false)) break; - } - }, - query: query - }; - } - function highlightSearchMatches(cm, query) { - var searchState = getSearchState(cm); - var overlay = searchState.getOverlay(); - if (!overlay || query != overlay.query) { - if (overlay) { - cm.removeOverlay(overlay); - } - overlay = searchOverlay(query); - cm.addOverlay(overlay); - if (cm.showMatchesOnScrollbar) { - if (searchState.getScrollbarAnnotate()) { - searchState.getScrollbarAnnotate().clear(); - } - searchState.setScrollbarAnnotate(cm.showMatchesOnScrollbar(query)); - } - searchState.setOverlay(overlay); - } - } - function findNext(cm, prev, query, repeat) { - if (repeat === undefined) { repeat = 1; } - return cm.operation(function() { - var pos = cm.getCursor(); - var cursor = cm.getSearchCursor(query, pos); - for (var i = 0; i < repeat; i++) { - var found = cursor.find(prev); - if (i == 0 && found && cursorEqual(cursor.from(), pos)) { found = cursor.find(prev); } - if (!found) { - // SearchCursor may have returned null because it hit EOF, wrap - // around and try again. - cursor = cm.getSearchCursor(query, - (prev) ? Pos(cm.lastLine()) : Pos(cm.firstLine(), 0) ); - if (!cursor.find(prev)) { - return; - } - } - } - return cursor.from(); - }); - } - function clearSearchHighlight(cm) { - var state = getSearchState(cm); - cm.removeOverlay(getSearchState(cm).getOverlay()); - state.setOverlay(null); - if (state.getScrollbarAnnotate()) { - state.getScrollbarAnnotate().clear(); - state.setScrollbarAnnotate(null); - } - } - /** - * Check if pos is in the specified range, INCLUSIVE. - * Range can be specified with 1 or 2 arguments. - * If the first range argument is an array, treat it as an array of line - * numbers. Match pos against any of the lines. - * If the first range argument is a number, - * if there is only 1 range argument, check if pos has the same line - * number - * if there are 2 range arguments, then check if pos is in between the two - * range arguments. - */ - function isInRange(pos, start, end) { - if (typeof pos != 'number') { - // Assume it is a cursor position. Get the line number. - pos = pos.line; - } - if (start instanceof Array) { - return inArray(pos, start); - } else { - if (end) { - return (pos >= start && pos <= end); - } else { - return pos == start; - } - } - } - function getUserVisibleLines(cm) { - var renderer = cm.ace.renderer; - return { - top: renderer.getFirstFullyVisibleRow(), - bottom: renderer.getLastFullyVisibleRow() - } - } - - // Ex command handling - // Care must be taken when adding to the default Ex command map. For any - // pair of commands that have a shared prefix, at least one of their - // shortNames must not match the prefix of the other command. - var defaultExCommandMap = [ - { name: 'colorscheme', shortName: 'colo' }, - { name: 'map' }, - { name: 'imap', shortName: 'im' }, - { name: 'nmap', shortName: 'nm' }, - { name: 'vmap', shortName: 'vm' }, - { name: 'unmap' }, - { name: 'write', shortName: 'w' }, - { name: 'undo', shortName: 'u' }, - { name: 'redo', shortName: 'red' }, - { name: 'set', shortName: 'se' }, - { name: 'set', shortName: 'se' }, - { name: 'setlocal', shortName: 'setl' }, - { name: 'setglobal', shortName: 'setg' }, - { name: 'sort', shortName: 'sor' }, - { name: 'substitute', shortName: 's', possiblyAsync: true }, - { name: 'nohlsearch', shortName: 'noh' }, - { name: 'delmarks', shortName: 'delm' }, - { name: 'registers', shortName: 'reg', excludeFromCommandHistory: true }, - { name: 'global', shortName: 'g' } - ]; - var ExCommandDispatcher = function() { - this.buildCommandMap_(); - }; - ExCommandDispatcher.prototype = { - processCommand: function(cm, input, opt_params) { - var that = this; - cm.operation(function () { - cm.curOp.isVimOp = true; - that._processCommand(cm, input, opt_params); - }); - }, - _processCommand: function(cm, input, opt_params) { - var vim = cm.state.vim; - var commandHistoryRegister = vimGlobalState.registerController.getRegister(':'); - var previousCommand = commandHistoryRegister.toString(); - if (vim.visualMode) { - exitVisualMode(cm); - } - var inputStream = new CodeMirror.StringStream(input); - // update ": with the latest command whether valid or invalid - commandHistoryRegister.setText(input); - var params = opt_params || {}; - params.input = input; - try { - this.parseInput_(cm, inputStream, params); - } catch(e) { - showConfirm(cm, e); - throw e; - } - var command; - var commandName; - if (!params.commandName) { - // If only a line range is defined, move to the line. - if (params.line !== undefined) { - commandName = 'move'; - } - } else { - command = this.matchCommand_(params.commandName); - if (command) { - commandName = command.name; - if (command.excludeFromCommandHistory) { - commandHistoryRegister.setText(previousCommand); - } - this.parseCommandArgs_(inputStream, params, command); - if (command.type == 'exToKey') { - // Handle Ex to Key mapping. - for (var i = 0; i < command.toKeys.length; i++) { - CodeMirror.Vim.handleKey(cm, command.toKeys[i], 'mapping'); - } - return; - } else if (command.type == 'exToEx') { - // Handle Ex to Ex mapping. - this.processCommand(cm, command.toInput); - return; - } - } - } - if (!commandName) { - showConfirm(cm, 'Not an editor command ":' + input + '"'); - return; - } - try { - exCommands[commandName](cm, params); - // Possibly asynchronous commands (e.g. substitute, which might have a - // user confirmation), are responsible for calling the callback when - // done. All others have it taken care of for them here. - if ((!command || !command.possiblyAsync) && params.callback) { - params.callback(); - } - } catch(e) { - showConfirm(cm, e); - throw e; - } - }, - parseInput_: function(cm, inputStream, result) { - inputStream.eatWhile(':'); - // Parse range. - if (inputStream.eat('%')) { - result.line = cm.firstLine(); - result.lineEnd = cm.lastLine(); - } else { - result.line = this.parseLineSpec_(cm, inputStream); - if (result.line !== undefined && inputStream.eat(',')) { - result.lineEnd = this.parseLineSpec_(cm, inputStream); - } - } - - // Parse command name. - var commandMatch = inputStream.match(/^(\w+)/); - if (commandMatch) { - result.commandName = commandMatch[1]; - } else { - result.commandName = inputStream.match(/.*/)[0]; - } - - return result; - }, - parseLineSpec_: function(cm, inputStream) { - var numberMatch = inputStream.match(/^(\d+)/); - if (numberMatch) { - return parseInt(numberMatch[1], 10) - 1; - } - switch (inputStream.next()) { - case '.': - return cm.getCursor().line; - case '$': - return cm.lastLine(); - case '\'': - var mark = cm.state.vim.marks[inputStream.next()]; - if (mark && mark.find()) { - return mark.find().line; - } - throw new Error('Mark not set'); - default: - inputStream.backUp(1); - return undefined; - } - }, - parseCommandArgs_: function(inputStream, params, command) { - if (inputStream.eol()) { - return; - } - params.argString = inputStream.match(/.*/)[0]; - // Parse command-line arguments - var delim = command.argDelimiter || /\s+/; - var args = trim(params.argString).split(delim); - if (args.length && args[0]) { - params.args = args; - } - }, - matchCommand_: function(commandName) { - // Return the command in the command map that matches the shortest - // prefix of the passed in command name. The match is guaranteed to be - // unambiguous if the defaultExCommandMap's shortNames are set up - // correctly. (see @code{defaultExCommandMap}). - for (var i = commandName.length; i > 0; i--) { - var prefix = commandName.substring(0, i); - if (this.commandMap_[prefix]) { - var command = this.commandMap_[prefix]; - if (command.name.indexOf(commandName) === 0) { - return command; - } - } - } - return null; - }, - buildCommandMap_: function() { - this.commandMap_ = {}; - for (var i = 0; i < defaultExCommandMap.length; i++) { - var command = defaultExCommandMap[i]; - var key = command.shortName || command.name; - this.commandMap_[key] = command; - } - }, - map: function(lhs, rhs, ctx) { - if (lhs != ':' && lhs.charAt(0) == ':') { - if (ctx) { throw Error('Mode not supported for ex mappings'); } - var commandName = lhs.substring(1); - if (rhs != ':' && rhs.charAt(0) == ':') { - // Ex to Ex mapping - this.commandMap_[commandName] = { - name: commandName, - type: 'exToEx', - toInput: rhs.substring(1), - user: true - }; - } else { - // Ex to key mapping - this.commandMap_[commandName] = { - name: commandName, - type: 'exToKey', - toKeys: rhs, - user: true - }; - } - } else { - if (rhs != ':' && rhs.charAt(0) == ':') { - // Key to Ex mapping. - var mapping = { - keys: lhs, - type: 'keyToEx', - exArgs: { input: rhs.substring(1) }, - user: true}; - if (ctx) { mapping.context = ctx; } - defaultKeymap.unshift(mapping); - } else { - // Key to key mapping - var mapping = { - keys: lhs, - type: 'keyToKey', - toKeys: rhs, - user: true - }; - if (ctx) { mapping.context = ctx; } - defaultKeymap.unshift(mapping); - } - } - }, - unmap: function(lhs, ctx) { - if (lhs != ':' && lhs.charAt(0) == ':') { - // Ex to Ex or Ex to key mapping - if (ctx) { throw Error('Mode not supported for ex mappings'); } - var commandName = lhs.substring(1); - if (this.commandMap_[commandName] && this.commandMap_[commandName].user) { - delete this.commandMap_[commandName]; - return; - } - } else { - // Key to Ex or key to key mapping - var keys = lhs; - for (var i = 0; i < defaultKeymap.length; i++) { - if (keys == defaultKeymap[i].keys - && defaultKeymap[i].context === ctx - && defaultKeymap[i].user) { - defaultKeymap.splice(i, 1); - return; - } - } - } - throw Error('No such mapping.'); - } - }; - - var exCommands = { - colorscheme: function(cm, params) { - if (!params.args || params.args.length < 1) { - showConfirm(cm, cm.getOption('theme')); - return; - } - cm.setOption('theme', params.args[0]); - }, - map: function(cm, params, ctx) { - var mapArgs = params.args; - if (!mapArgs || mapArgs.length < 2) { - if (cm) { - showConfirm(cm, 'Invalid mapping: ' + params.input); - } - return; - } - exCommandDispatcher.map(mapArgs[0], mapArgs[1], ctx); - }, - imap: function(cm, params) { this.map(cm, params, 'insert'); }, - nmap: function(cm, params) { this.map(cm, params, 'normal'); }, - vmap: function(cm, params) { this.map(cm, params, 'visual'); }, - unmap: function(cm, params, ctx) { - var mapArgs = params.args; - if (!mapArgs || mapArgs.length < 1) { - if (cm) { - showConfirm(cm, 'No such mapping: ' + params.input); - } - return; - } - exCommandDispatcher.unmap(mapArgs[0], ctx); - }, - move: function(cm, params) { - commandDispatcher.processCommand(cm, cm.state.vim, { - type: 'motion', - motion: 'moveToLineOrEdgeOfDocument', - motionArgs: { forward: false, explicitRepeat: true, - linewise: true }, - repeatOverride: params.line+1}); - }, - set: function(cm, params) { - var setArgs = params.args; - // Options passed through to the setOption/getOption calls. May be passed in by the - // local/global versions of the set command - var setCfg = params.setCfg || {}; - if (!setArgs || setArgs.length < 1) { - if (cm) { - showConfirm(cm, 'Invalid mapping: ' + params.input); - } - return; - } - var expr = setArgs[0].split('='); - var optionName = expr[0]; - var value = expr[1]; - var forceGet = false; - - if (optionName.charAt(optionName.length - 1) == '?') { - // If post-fixed with ?, then the set is actually a get. - if (value) { throw Error('Trailing characters: ' + params.argString); } - optionName = optionName.substring(0, optionName.length - 1); - forceGet = true; - } - if (value === undefined && optionName.substring(0, 2) == 'no') { - // To set boolean options to false, the option name is prefixed with - // 'no'. - optionName = optionName.substring(2); - value = false; - } - - var optionIsBoolean = options[optionName] && options[optionName].type == 'boolean'; - if (optionIsBoolean && value == undefined) { - // Calling set with a boolean option sets it to true. - value = true; - } - // If no value is provided, then we assume this is a get. - if (!optionIsBoolean && value === undefined || forceGet) { - var oldValue = getOption(optionName, cm, setCfg); - if (oldValue === true || oldValue === false) { - showConfirm(cm, ' ' + (oldValue ? '' : 'no') + optionName); - } else { - showConfirm(cm, ' ' + optionName + '=' + oldValue); - } - } else { - setOption(optionName, value, cm, setCfg); - } - }, - setlocal: function (cm, params) { - // setCfg is passed through to setOption - params.setCfg = {scope: 'local'}; - this.set(cm, params); - }, - setglobal: function (cm, params) { - // setCfg is passed through to setOption - params.setCfg = {scope: 'global'}; - this.set(cm, params); - }, - registers: function(cm, params) { - var regArgs = params.args; - var registers = vimGlobalState.registerController.registers; - var regInfo = '----------Registers----------

                                                                                                                                                                                                                                                                                                                                                                                                                                                              '; - if (!regArgs) { - for (var registerName in registers) { - var text = registers[registerName].toString(); - if (text.length) { - regInfo += '"' + registerName + ' ' + text + '
                                                                                                                                                                                                                                                                                                                                                                                                                                                              '; - } - } - } else { - var registerName; - regArgs = regArgs.join(''); - for (var i = 0; i < regArgs.length; i++) { - registerName = regArgs.charAt(i); - if (!vimGlobalState.registerController.isValidRegister(registerName)) { - continue; - } - var register = registers[registerName] || new Register(); - regInfo += '"' + registerName + ' ' + register.toString() + '
                                                                                                                                                                                                                                                                                                                                                                                                                                                              '; - } - } - showConfirm(cm, regInfo); - }, - sort: function(cm, params) { - var reverse, ignoreCase, unique, number; - function parseArgs() { - if (params.argString) { - var args = new CodeMirror.StringStream(params.argString); - if (args.eat('!')) { reverse = true; } - if (args.eol()) { return; } - if (!args.eatSpace()) { return 'Invalid arguments'; } - var opts = args.match(/[a-z]+/); - if (opts) { - opts = opts[0]; - ignoreCase = opts.indexOf('i') != -1; - unique = opts.indexOf('u') != -1; - var decimal = opts.indexOf('d') != -1 && 1; - var hex = opts.indexOf('x') != -1 && 1; - var octal = opts.indexOf('o') != -1 && 1; - if (decimal + hex + octal > 1) { return 'Invalid arguments'; } - number = decimal && 'decimal' || hex && 'hex' || octal && 'octal'; - } - if (args.eatSpace() && args.match(/\/.*\//)) { 'patterns not supported'; } - } - } - var err = parseArgs(); - if (err) { - showConfirm(cm, err + ': ' + params.argString); - return; - } - var lineStart = params.line || cm.firstLine(); - var lineEnd = params.lineEnd || params.line || cm.lastLine(); - if (lineStart == lineEnd) { return; } - var curStart = Pos(lineStart, 0); - var curEnd = Pos(lineEnd, lineLength(cm, lineEnd)); - var text = cm.getRange(curStart, curEnd).split('\n'); - var numberRegex = (number == 'decimal') ? /(-?)([\d]+)/ : - (number == 'hex') ? /(-?)(?:0x)?([0-9a-f]+)/i : - (number == 'octal') ? /([0-7]+)/ : null; - var radix = (number == 'decimal') ? 10 : (number == 'hex') ? 16 : (number == 'octal') ? 8 : null; - var numPart = [], textPart = []; - if (number) { - for (var i = 0; i < text.length; i++) { - if (numberRegex.exec(text[i])) { - numPart.push(text[i]); - } else { - textPart.push(text[i]); - } - } - } else { - textPart = text; - } - function compareFn(a, b) { - if (reverse) { var tmp; tmp = a; a = b; b = tmp; } - if (ignoreCase) { a = a.toLowerCase(); b = b.toLowerCase(); } - var anum = number && numberRegex.exec(a); - var bnum = number && numberRegex.exec(b); - if (!anum) { return a < b ? -1 : 1; } - anum = parseInt((anum[1] + anum[2]).toLowerCase(), radix); - bnum = parseInt((bnum[1] + bnum[2]).toLowerCase(), radix); - return anum - bnum; - } - numPart.sort(compareFn); - textPart.sort(compareFn); - text = (!reverse) ? textPart.concat(numPart) : numPart.concat(textPart); - if (unique) { // Remove duplicate lines - var textOld = text; - var lastLine; - text = []; - for (var i = 0; i < textOld.length; i++) { - if (textOld[i] != lastLine) { - text.push(textOld[i]); - } - lastLine = textOld[i]; - } - } - cm.replaceRange(text.join('\n'), curStart, curEnd); - }, - global: function(cm, params) { - // a global command is of the form - // :[range]g/pattern/[cmd] - // argString holds the string /pattern/[cmd] - var argString = params.argString; - if (!argString) { - showConfirm(cm, 'Regular Expression missing from global'); - return; - } - // range is specified here - var lineStart = (params.line !== undefined) ? params.line : cm.firstLine(); - var lineEnd = params.lineEnd || params.line || cm.lastLine(); - // get the tokens from argString - var tokens = splitBySlash(argString); - var regexPart = argString, cmd; - if (tokens.length) { - regexPart = tokens[0]; - cmd = tokens.slice(1, tokens.length).join('/'); - } - if (regexPart) { - // If regex part is empty, then use the previous query. Otherwise - // use the regex part as the new query. - try { - updateSearchQuery(cm, regexPart, true /** ignoreCase */, - true /** smartCase */); - } catch (e) { - showConfirm(cm, 'Invalid regex: ' + regexPart); - return; - } - } - // now that we have the regexPart, search for regex matches in the - // specified range of lines - var query = getSearchState(cm).getQuery(); - var matchedLines = [], content = ''; - for (var i = lineStart; i <= lineEnd; i++) { - var matched = query.test(cm.getLine(i)); - if (matched) { - matchedLines.push(i+1); - content+= cm.getLine(i) + '
                                                                                                                                                                                                                                                                                                                                                                                                                                                              '; - } - } - // if there is no [cmd], just display the list of matched lines - if (!cmd) { - showConfirm(cm, content); - return; - } - var index = 0; - var nextCommand = function() { - if (index < matchedLines.length) { - var command = matchedLines[index] + cmd; - exCommandDispatcher.processCommand(cm, command, { - callback: nextCommand - }); - } - index++; - }; - nextCommand(); - }, - substitute: function(cm, params) { - if (!cm.getSearchCursor) { - throw new Error('Search feature not available. Requires searchcursor.js or ' + - 'any other getSearchCursor implementation.'); - } - var argString = params.argString; - var tokens = argString ? splitBySlash(argString) : []; - var regexPart, replacePart = '', trailing, flagsPart, count; - var confirm = false; // Whether to confirm each replace. - var global = false; // True to replace all instances on a line, false to replace only 1. - if (tokens.length) { - regexPart = tokens[0]; - replacePart = tokens[1]; - if (replacePart !== undefined) { - if (getOption('pcre')) { - replacePart = unescapeRegexReplace(replacePart); - } else { - replacePart = translateRegexReplace(replacePart); - } - vimGlobalState.lastSubstituteReplacePart = replacePart; - } - trailing = tokens[2] ? tokens[2].split(' ') : []; - } else { - // either the argString is empty or its of the form ' hello/world' - // actually splitBySlash returns a list of tokens - // only if the string starts with a '/' - if (argString && argString.length) { - showConfirm(cm, 'Substitutions should be of the form ' + - ':s/pattern/replace/'); - return; - } - } - // After the 3rd slash, we can have flags followed by a space followed - // by count. - if (trailing) { - flagsPart = trailing[0]; - count = parseInt(trailing[1]); - if (flagsPart) { - if (flagsPart.indexOf('c') != -1) { - confirm = true; - flagsPart.replace('c', ''); - } - if (flagsPart.indexOf('g') != -1) { - global = true; - flagsPart.replace('g', ''); - } - regexPart = regexPart + '/' + flagsPart; - } - } - if (regexPart) { - // If regex part is empty, then use the previous query. Otherwise use - // the regex part as the new query. - try { - updateSearchQuery(cm, regexPart, true /** ignoreCase */, - true /** smartCase */); - } catch (e) { - showConfirm(cm, 'Invalid regex: ' + regexPart); - return; - } - } - replacePart = replacePart || vimGlobalState.lastSubstituteReplacePart; - if (replacePart === undefined) { - showConfirm(cm, 'No previous substitute regular expression'); - return; - } - var state = getSearchState(cm); - var query = state.getQuery(); - var lineStart = (params.line !== undefined) ? params.line : cm.getCursor().line; - var lineEnd = params.lineEnd || lineStart; - if (count) { - lineStart = lineEnd; - lineEnd = lineStart + count - 1; - } - var startPos = clipCursorToContent(cm, Pos(lineStart, 0)); - var cursor = cm.getSearchCursor(query, startPos); - doReplace(cm, confirm, global, lineStart, lineEnd, cursor, query, replacePart, params.callback); - }, - redo: CodeMirror.commands.redo, - undo: CodeMirror.commands.undo, - write: function(cm) { - if (CodeMirror.commands.save) { - // If a save command is defined, call it. - CodeMirror.commands.save(cm); - } else { - // Saves to text area if no save command is defined. - cm.save(); - } - }, - nohlsearch: function(cm) { - clearSearchHighlight(cm); - }, - delmarks: function(cm, params) { - if (!params.argString || !trim(params.argString)) { - showConfirm(cm, 'Argument required'); - return; - } - - var state = cm.state.vim; - var stream = new CodeMirror.StringStream(trim(params.argString)); - while (!stream.eol()) { - stream.eatSpace(); - - // Record the streams position at the beginning of the loop for use - // in error messages. - var count = stream.pos; - - if (!stream.match(/[a-zA-Z]/, false)) { - showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count)); - return; - } - - var sym = stream.next(); - // Check if this symbol is part of a range - if (stream.match('-', true)) { - // This symbol is part of a range. - - // The range must terminate at an alphabetic character. - if (!stream.match(/[a-zA-Z]/, false)) { - showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count)); - return; - } - - var startMark = sym; - var finishMark = stream.next(); - // The range must terminate at an alphabetic character which - // shares the same case as the start of the range. - if (isLowerCase(startMark) && isLowerCase(finishMark) || - isUpperCase(startMark) && isUpperCase(finishMark)) { - var start = startMark.charCodeAt(0); - var finish = finishMark.charCodeAt(0); - if (start >= finish) { - showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count)); - return; - } - - // Because marks are always ASCII values, and we have - // determined that they are the same case, we can use - // their char codes to iterate through the defined range. - for (var j = 0; j <= finish - start; j++) { - var mark = String.fromCharCode(start + j); - delete state.marks[mark]; - } - } else { - showConfirm(cm, 'Invalid argument: ' + startMark + '-'); - return; - } - } else { - // This symbol is a valid mark, and is not part of a range. - delete state.marks[sym]; - } - } - } - }; - - var exCommandDispatcher = new ExCommandDispatcher(); - - /** - * @param {CodeMirror} cm CodeMirror instance we are in. - * @param {boolean} confirm Whether to confirm each replace. - * @param {Cursor} lineStart Line to start replacing from. - * @param {Cursor} lineEnd Line to stop replacing at. - * @param {RegExp} query Query for performing matches with. - * @param {string} replaceWith Text to replace matches with. May contain $1, - * $2, etc for replacing captured groups using Javascript replace. - * @param {function()} callback A callback for when the replace is done. - */ - function doReplace(cm, confirm, global, lineStart, lineEnd, searchCursor, query, - replaceWith, callback) { - // Set up all the functions. - cm.state.vim.exMode = true; - var done = false; - var lastPos = searchCursor.from(); - function replaceAll() { - cm.operation(function() { - while (!done) { - replace(); - next(); - } - stop(); - }); - } - function replace() { - var text = cm.getRange(searchCursor.from(), searchCursor.to()); - var newText = text.replace(query, replaceWith); - searchCursor.replace(newText); - } - function next() { - var found; - // The below only loops to skip over multiple occurrences on the same - // line when 'global' is not true. - while(found = searchCursor.findNext() && - isInRange(searchCursor.from(), lineStart, lineEnd)) { - if (!global && lastPos && searchCursor.from().line == lastPos.line) { - continue; - } - cm.scrollIntoView(searchCursor.from(), 30); - cm.setSelection(searchCursor.from(), searchCursor.to()); - lastPos = searchCursor.from(); - done = false; - return; - } - done = true; - } - function stop(close) { - if (close) { close(); } - cm.focus(); - if (lastPos) { - cm.setCursor(lastPos); - var vim = cm.state.vim; - vim.exMode = false; - vim.lastHPos = vim.lastHSPos = lastPos.ch; - } - if (callback) { callback(); } - } - function onPromptKeyDown(e, _value, close) { - // Swallow all keys. - CodeMirror.e_stop(e); - var keyName = CodeMirror.keyName(e); - switch (keyName) { - case 'Y': - replace(); next(); break; - case 'N': - next(); break; - case 'A': - // replaceAll contains a call to close of its own. We don't want it - // to fire too early or multiple times. - var savedCallback = callback; - callback = undefined; - cm.operation(replaceAll); - callback = savedCallback; - break; - case 'L': - replace(); - // fall through and exit. - case 'Q': - case 'Esc': - case 'Ctrl-C': - case 'Ctrl-[': - stop(close); - break; - } - if (done) { stop(close); } - return true; - } - - // Actually do replace. - next(); - if (done) { - showConfirm(cm, 'No matches for ' + query.source); - return; - } - if (!confirm) { - replaceAll(); - if (callback) { callback(); }; - return; - } - showPrompt(cm, { - prefix: 'replace with ' + replaceWith + ' (y/n/a/q/l)', - onKeyDown: onPromptKeyDown - }); - } - - CodeMirror.keyMap.vim = { - attach: attachVimMap, - detach: detachVimMap, - call: cmKey - }; - - function exitInsertMode(cm) { - var vim = cm.state.vim; - var macroModeState = vimGlobalState.macroModeState; - var insertModeChangeRegister = vimGlobalState.registerController.getRegister('.'); - var isPlaying = macroModeState.isPlaying; - var lastChange = macroModeState.lastInsertModeChanges; - // In case of visual block, the insertModeChanges are not saved as a - // single word, so we convert them to a single word - // so as to update the ". register as expected in real vim. - var text = []; - if (!isPlaying) { - var selLength = lastChange.inVisualBlock ? vim.lastSelection.visualBlock.height : 1; - var changes = lastChange.changes; - var text = []; - var i = 0; - // In case of multiple selections in blockwise visual, - // the inserted text, for example: 'foo', is stored as - // 'f', 'f', InsertModeKey 'o', 'o', 'o', 'o'. (if you have a block with 2 lines). - // We push the contents of the changes array as per the following: - // 1. In case of InsertModeKey, just increment by 1. - // 2. In case of a character, jump by selLength (2 in the example). - while (i < changes.length) { - // This loop will convert 'ffoooo' to 'foo'. - text.push(changes[i]); - if (changes[i] instanceof InsertModeKey) { - i++; - } else { - i+= selLength; - } - } - lastChange.changes = text; - cm.off('change', onChange); - CodeMirror.off(cm.getInputField(), 'keydown', onKeyEventTargetKeyDown); - } - if (!isPlaying && vim.insertModeRepeat > 1) { - // Perform insert mode repeat for commands like 3,a and 3,o. - repeatLastEdit(cm, vim, vim.insertModeRepeat - 1, - true /** repeatForInsert */); - vim.lastEditInputState.repeatOverride = vim.insertModeRepeat; - } - delete vim.insertModeRepeat; - vim.insertMode = false; - cm.setCursor(cm.getCursor().line, cm.getCursor().ch-1); - cm.setOption('keyMap', 'vim'); - cm.setOption('disableInput', true); - cm.toggleOverwrite(false); // exit replace mode if we were in it. - // update the ". register before exiting insert mode - insertModeChangeRegister.setText(lastChange.changes.join('')); - CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"}); - if (macroModeState.isRecording) { - logInsertModeChange(macroModeState); - } - } - - function _mapCommand(command) { - defaultKeymap.push(command); - } - - function mapCommand(keys, type, name, args, extra) { - var command = {keys: keys, type: type}; - command[type] = name; - command[type + "Args"] = args; - for (var key in extra) - command[key] = extra[key]; - _mapCommand(command); - } - - // The timeout in milliseconds for the two-character ESC keymap should be - // adjusted according to your typing speed to prevent false positives. - defineOption('insertModeEscKeysTimeout', 200, 'number'); - - CodeMirror.keyMap['vim-insert'] = { - // TODO: override navigation keys so that Esc will cancel automatic - // indentation from o, O, i_ - 'Ctrl-N': 'autocomplete', - 'Ctrl-P': 'autocomplete', - 'Enter': function(cm) { - var fn = CodeMirror.commands.newlineAndIndentContinueComment || - CodeMirror.commands.newlineAndIndent; - fn(cm); - }, - fallthrough: ['default'], - attach: attachVimMap, - detach: detachVimMap, - call: cmKey - }; - - CodeMirror.keyMap['vim-replace'] = { - 'Backspace': 'goCharLeft', - fallthrough: ['vim-insert'], - attach: attachVimMap, - detach: detachVimMap, - call: cmKey - }; - - function executeMacroRegister(cm, vim, macroModeState, registerName) { - var register = vimGlobalState.registerController.getRegister(registerName); - var keyBuffer = register.keyBuffer; - var imc = 0; - macroModeState.isPlaying = true; - macroModeState.replaySearchQueries = register.searchQueries.slice(0); - for (var i = 0; i < keyBuffer.length; i++) { - var text = keyBuffer[i]; - var match, key; - while (text) { - // Pull off one command key, which is either a single character - // or a special sequence wrapped in '<' and '>', e.g. ''. - match = (/<\w+-.+?>|<\w+>|./).exec(text); - key = match[0]; - text = text.substring(match.index + key.length); - CodeMirror.Vim.handleKey(cm, key, 'macro'); - if (vim.insertMode) { - var changes = register.insertModeChanges[imc++].changes; - vimGlobalState.macroModeState.lastInsertModeChanges.changes = - changes; - repeatInsertModeChanges(cm, changes, 1); - exitInsertMode(cm); - } - } - }; - macroModeState.isPlaying = false; - } - - function logKey(macroModeState, key) { - if (macroModeState.isPlaying) { return; } - var registerName = macroModeState.latestRegister; - var register = vimGlobalState.registerController.getRegister(registerName); - if (register) { - register.pushText(key); - } - } - - function logInsertModeChange(macroModeState) { - if (macroModeState.isPlaying) { return; } - var registerName = macroModeState.latestRegister; - var register = vimGlobalState.registerController.getRegister(registerName); - if (register) { - register.pushInsertModeChanges(macroModeState.lastInsertModeChanges); - } - } - - function logSearchQuery(macroModeState, query) { - if (macroModeState.isPlaying) { return; } - var registerName = macroModeState.latestRegister; - var register = vimGlobalState.registerController.getRegister(registerName); - if (register) { - register.pushSearchQuery(query); - } - } - - /** - * Listens for changes made in insert mode. - * Should only be active in insert mode. - */ - function onChange(_cm, changeObj) { - var macroModeState = vimGlobalState.macroModeState; - var lastChange = macroModeState.lastInsertModeChanges; - if (!macroModeState.isPlaying) { - while(changeObj) { - lastChange.expectCursorActivityForChange = true; - if (changeObj.origin == '+input' || changeObj.origin == 'paste' - || changeObj.origin === undefined /* only in testing */) { - var text = changeObj.text.join('\n'); - lastChange.changes.push(text); - } - // Change objects may be chained with next. - changeObj = changeObj.next; - } - } - } - - /** - * Listens for any kind of cursor activity on CodeMirror. - */ - function onCursorActivity(cm) { - var vim = cm.state.vim; - if (vim.insertMode) { - // Tracking cursor activity in insert mode (for macro support). - var macroModeState = vimGlobalState.macroModeState; - if (macroModeState.isPlaying) { return; } - var lastChange = macroModeState.lastInsertModeChanges; - if (lastChange.expectCursorActivityForChange) { - lastChange.expectCursorActivityForChange = false; - } else { - // Cursor moved outside the context of an edit. Reset the change. - lastChange.changes = []; - } - } else if (!cm.curOp.isVimOp) { - handleExternalSelection(cm, vim); - } - if (vim.visualMode) { - updateFakeCursor(cm); - } - } - function updateFakeCursor(cm) { - var vim = cm.state.vim; - var from = clipCursorToContent(cm, copyCursor(vim.sel.head)); - var to = offsetCursor(from, 0, 1); - if (vim.fakeCursor) { - vim.fakeCursor.clear(); - } - vim.fakeCursor = cm.markText(from, to, {className: 'cm-animate-fat-cursor'}); - } - function handleExternalSelection(cm, vim) { - var anchor = cm.getCursor('anchor'); - var head = cm.getCursor('head'); - // Enter or exit visual mode to match mouse selection. - if (vim.visualMode && !cm.somethingSelected()) { - exitVisualMode(cm, false); - } else if (!vim.visualMode && !vim.insertMode && cm.somethingSelected()) { - vim.visualMode = true; - vim.visualLine = false; - CodeMirror.signal(cm, "vim-mode-change", {mode: "visual"}); - } - if (vim.visualMode) { - // Bind CodeMirror selection model to vim selection model. - // Mouse selections are considered visual characterwise. - var headOffset = !cursorIsBefore(head, anchor) ? -1 : 0; - var anchorOffset = cursorIsBefore(head, anchor) ? -1 : 0; - head = offsetCursor(head, 0, headOffset); - anchor = offsetCursor(anchor, 0, anchorOffset); - vim.sel = { - anchor: anchor, - head: head - }; - updateMark(cm, vim, '<', cursorMin(head, anchor)); - updateMark(cm, vim, '>', cursorMax(head, anchor)); - } else if (!vim.insertMode) { - // Reset lastHPos if selection was modified by something outside of vim mode e.g. by mouse. - vim.lastHPos = cm.getCursor().ch; - } - } - - /** Wrapper for special keys pressed in insert mode */ - function InsertModeKey(keyName) { - this.keyName = keyName; - } - - /** - * Handles raw key down events from the text area. - * - Should only be active in insert mode. - * - For recording deletes in insert mode. - */ - function onKeyEventTargetKeyDown(e) { - var macroModeState = vimGlobalState.macroModeState; - var lastChange = macroModeState.lastInsertModeChanges; - var keyName = CodeMirror.keyName(e); - if (!keyName) { return; } - function onKeyFound() { - lastChange.changes.push(new InsertModeKey(keyName)); - return true; - } - if (keyName.indexOf('Delete') != -1 || keyName.indexOf('Backspace') != -1) { - CodeMirror.lookupKey(keyName, 'vim-insert', onKeyFound); - } - } - - /** - * Repeats the last edit, which includes exactly 1 command and at most 1 - * insert. Operator and motion commands are read from lastEditInputState, - * while action commands are read from lastEditActionCommand. - * - * If repeatForInsert is true, then the function was called by - * exitInsertMode to repeat the insert mode changes the user just made. The - * corresponding enterInsertMode call was made with a count. - */ - function repeatLastEdit(cm, vim, repeat, repeatForInsert) { - var macroModeState = vimGlobalState.macroModeState; - macroModeState.isPlaying = true; - var isAction = !!vim.lastEditActionCommand; - var cachedInputState = vim.inputState; - function repeatCommand() { - if (isAction) { - commandDispatcher.processAction(cm, vim, vim.lastEditActionCommand); - } else { - commandDispatcher.evalInput(cm, vim); - } - } - function repeatInsert(repeat) { - if (macroModeState.lastInsertModeChanges.changes.length > 0) { - // For some reason, repeat cw in desktop VIM does not repeat - // insert mode changes. Will conform to that behavior. - repeat = !vim.lastEditActionCommand ? 1 : repeat; - var changeObject = macroModeState.lastInsertModeChanges; - repeatInsertModeChanges(cm, changeObject.changes, repeat); - } - } - vim.inputState = vim.lastEditInputState; - if (isAction && vim.lastEditActionCommand.interlaceInsertRepeat) { - // o and O repeat have to be interlaced with insert repeats so that the - // insertions appear on separate lines instead of the last line. - for (var i = 0; i < repeat; i++) { - repeatCommand(); - repeatInsert(1); - } - } else { - if (!repeatForInsert) { - // Hack to get the cursor to end up at the right place. If I is - // repeated in insert mode repeat, cursor will be 1 insert - // change set left of where it should be. - repeatCommand(); - } - repeatInsert(repeat); - } - vim.inputState = cachedInputState; - if (vim.insertMode && !repeatForInsert) { - // Don't exit insert mode twice. If repeatForInsert is set, then we - // were called by an exitInsertMode call lower on the stack. - exitInsertMode(cm); - } - macroModeState.isPlaying = false; - }; - - function repeatInsertModeChanges(cm, changes, repeat) { - function keyHandler(binding) { - if (typeof binding == 'string') { - CodeMirror.commands[binding](cm); - } else { - binding(cm); - } - return true; - } - var head = cm.getCursor('head'); - var inVisualBlock = vimGlobalState.macroModeState.lastInsertModeChanges.inVisualBlock; - if (inVisualBlock) { - // Set up block selection again for repeating the changes. - var vim = cm.state.vim; - var lastSel = vim.lastSelection; - var offset = getOffset(lastSel.anchor, lastSel.head); - selectForInsert(cm, head, offset.line + 1); - repeat = cm.listSelections().length; - cm.setCursor(head); - } - for (var i = 0; i < repeat; i++) { - if (inVisualBlock) { - cm.setCursor(offsetCursor(head, i, 0)); - } - for (var j = 0; j < changes.length; j++) { - var change = changes[j]; - if (change instanceof InsertModeKey) { - CodeMirror.lookupKey(change.keyName, 'vim-insert', keyHandler); - } else { - var cur = cm.getCursor(); - cm.replaceRange(change, cur, cur); - } - } - } - if (inVisualBlock) { - cm.setCursor(offsetCursor(head, 0, 1)); - } - } - - resetVimGlobalState(); - //}; - // Initialize Vim and make it available as an API. - CodeMirror.Vim = Vim(); - - Vim = CodeMirror.Vim; - - var specialKey = {'return':'CR',backspace:'BS','delete':'Del',esc:'Esc', - left:'Left',right:'Right',up:'Up',down:'Down',space: 'Space', - home:'Home',end:'End',pageup:'PageUp',pagedown:'PageDown', enter: 'CR' - }; - function lookupKey(hashId, key, e) { - if (key.length > 1 && key[0] == "n") { - key = key.replace("numpad", ""); - } - key = specialKey[key] || key; - var name = ''; - if (e.ctrlKey) { name += 'C-'; } - if (e.altKey) { name += 'A-'; } - if (e.shiftKey) { name += 'S-'; } - - name += key; - if (name.length > 1) { name = '<' + name + '>'; } - return name; - } - var handleKey = Vim.handleKey.bind(Vim); - Vim.handleKey = function(cm, key, origin) { - return cm.operation(function() { - return handleKey(cm, key, origin); - }, true); - } - function cloneVimState(state) { - var n = new state.constructor(); - Object.keys(state).forEach(function(key) { - var o = state[key]; - if (Array.isArray(o)) - o = o.slice(); - else if (o && typeof o == "object" && o.constructor != Object) - o = cloneVimState(o); - n[key] = o; - }); - if (state.sel) { - n.sel = { - head: state.sel.head && copyCursor(state.sel.head), - anchor: state.sel.anchor && copyCursor(state.sel.anchor) - }; - } - return n; - } - function multiSelectHandleKey(cm, key, origin) { - var isHandled = false; - var vim = Vim.maybeInitVimState_(cm); - var visualBlock = vim.visualBlock || vim.wasInVisualBlock; - if (vim.wasInVisualBlock && !cm.ace.inMultiSelectMode) { - vim.wasInVisualBlock = false; - } else if (cm.ace.inMultiSelectMode && vim.visualBlock) { - vim.wasInVisualBlock = true; - } - - if (key == '' && !vim.insertMode && !vim.visualMode && cm.ace.inMultiSelectMode) { - cm.ace.exitMultiSelectMode(); - } else if (visualBlock || !cm.ace.inMultiSelectMode || cm.ace.inVirtualSelectionMode) { - isHandled = Vim.handleKey(cm, key, origin); - } else { - var old = cloneVimState(vim); - cm.operation(function() { - cm.ace.forEachSelection(function() { - var sel = cm.ace.selection; - cm.state.vim.lastHPos = sel.$desiredColumn == null ? sel.lead.column : sel.$desiredColumn; - var head = cm.getCursor("head"); - var anchor = cm.getCursor("anchor"); - var headOffset = !cursorIsBefore(head, anchor) ? -1 : 0; - var anchorOffset = cursorIsBefore(head, anchor) ? -1 : 0; - head = offsetCursor(head, 0, headOffset); - anchor = offsetCursor(anchor, 0, anchorOffset); - cm.state.vim.sel.head = head; - cm.state.vim.sel.anchor = anchor; - - isHandled = handleKey(cm, key, origin); - sel.$desiredColumn = cm.state.vim.lastHPos == -1 ? null : cm.state.vim.lastHPos; - if (cm.virtualSelectionMode()) { - cm.state.vim = cloneVimState(old); - } - }); - if (cm.curOp.cursorActivity && !isHandled) - cm.curOp.cursorActivity = false; - }, true); - } - return isHandled; - } - exports.CodeMirror = CodeMirror; - var getVim = Vim.maybeInitVimState_; - exports.handler = { - $id: "ace/keyboard/vim", - drawCursor: function(style, pixelPos, config, sel, session) { - var vim = this.state.vim || {}; - var w = config.characterWidth; - var h = config.lineHeight; - var top = pixelPos.top; - var left = pixelPos.left; - if (!vim.insertMode) { - var isbackwards = !sel.cursor - ? session.selection.isBackwards() || session.selection.isEmpty() - : Range.comparePoints(sel.cursor, sel.start) <= 0; - if (!isbackwards && left > w) - left -= w; - } - if (!vim.insertMode && vim.status) { - h = h / 2; - top += h; - } - style.left = left + "px"; - style.top = top + "px"; - style.width = w + "px"; - style.height = h + "px"; - }, - handleKeyboard: function(data, hashId, key, keyCode, e) { - var editor = data.editor; - var cm = editor.state.cm; - var vim = getVim(cm); - if (keyCode == -1) return; - - if (key == "c" && hashId == 1) { // key == "ctrl-c" - if (!useragent.isMac && editor.getCopyText()) { - editor.once("copy", function() { - editor.selection.clearSelection(); - }); - return {command: "null", passEvent: true}; - } - } else if (!vim.insertMode) { - if (useragent.isMac && this.handleMacRepeat(data, hashId, key)) { - hashId = -1; - key = data.inputChar; - } - } - - if (hashId == -1 || hashId & 1 || hashId === 0 && key.length > 1) { - var insertMode = vim.insertMode; - var name = lookupKey(hashId, key, e || {}); - if (vim.status == null) - vim.status = ""; - var isHandled = multiSelectHandleKey(cm, name, 'user'); - vim = getVim(cm); // may be changed by multiSelectHandleKey - if (isHandled && vim.status != null) - vim.status += name; - else if (vim.status == null) - vim.status = ""; - cm._signal("changeStatus"); - if (!isHandled && (hashId != -1 || insertMode)) - return; - return {command: "null", passEvent: !isHandled}; - } - }, - attach: function(editor) { - if (!editor.state) editor.state = {}; - var cm = new CodeMirror(editor); - editor.state.cm = cm; - editor.$vimModeHandler = this; - CodeMirror.keyMap.vim.attach(cm); - getVim(cm).status = null; - cm.on('vim-command-done', function() { - if (cm.virtualSelectionMode()) return; - getVim(cm).status = null; - cm.ace._signal("changeStatus"); - cm.ace.session.markUndoGroup(); - }); - cm.on("changeStatus", function() { - cm.ace.renderer.updateCursor(); - cm.ace._signal("changeStatus"); - }); - cm.on("vim-mode-change", function() { - if (cm.virtualSelectionMode()) return; - cm.ace.renderer.setStyle("normal-mode", !getVim(cm).insertMode); - cm._signal("changeStatus"); - }); - cm.ace.renderer.setStyle("normal-mode", !getVim(cm).insertMode); - editor.renderer.$cursorLayer.drawCursor = this.drawCursor.bind(cm); - // renderVirtualNumbers.attach(editor); - this.updateMacCompositionHandlers(editor, true); - }, - detach: function(editor) { - var cm = editor.state.cm; - CodeMirror.keyMap.vim.detach(cm); - cm.destroy(); - editor.state.cm = null; - editor.$vimModeHandler = null; - editor.renderer.$cursorLayer.drawCursor = null; - editor.renderer.setStyle("normal-mode", false); - // renderVirtualNumbers.detach(editor); - this.updateMacCompositionHandlers(editor, false); - }, - getStatusText: function(editor) { - var cm = editor.state.cm; - var vim = getVim(cm); - if (vim.insertMode) - return "INSERT"; - var status = ""; - if (vim.visualMode) { - status += "VISUAL"; - if (vim.visualLine) - status += " LINE"; - if (vim.visualBlock) - status += " BLOCK"; - } - if (vim.status) - status += (status ? " " : "") + vim.status; - return status; - }, +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"; - } - }, - // on mac, with some keyboard layouts (e.g swedish) ^ starts composition, we don't need it in normal mode - updateMacCompositionHandlers: function(editor, enable) { - var onCompositionUpdateOverride = function(text) { - var cm = editor.state.cm; - var vim = getVim(cm); - if (!vim.insertMode) { - var el = this.textInput.getElement(); - el.blur(); - el.focus(); - el.value = text; + 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 { - this.onCompositionUpdateOrig(text); + // reset + data.$lastHash = hashId; + data.$lastKey = key; + data.lastEvent = "keypress"; } - }; - var onCompositionStartOverride = function(text) { - var cm = editor.state.cm; - var vim = getVim(cm); - if (!vim.insertMode) { - this.onCompositionStartOrig(text); - } - }; - if (enable) { - if (!editor.onCompositionUpdateOrig) { - editor.onCompositionUpdateOrig = editor.onCompositionUpdate; - editor.onCompositionUpdate = onCompositionUpdateOverride; - editor.onCompositionStartOrig = editor.onCompositionStart; - editor.onCompositionStart = onCompositionStartOverride; - } - } else { - if (editor.onCompositionUpdateOrig) { - editor.onCompositionUpdate = editor.onCompositionUpdateOrig; - editor.onCompositionUpdateOrig = null; - editor.onCompositionStart = editor.onCompositionStartOrig; - editor.onCompositionStartOrig = null; - } - } - } - }; - var renderVirtualNumbers = { - getText: function(session, row) { - return (Math.abs(session.selection.lead.row - row) || (row + 1 + (row < 9? "\xb7" : "" ))) + ""; }, - getWidth: function(session, lastLineNumber, config) { - return session.getLength().toString().length * config.characterWidth; - }, - update: function(e, editor) { - editor.renderer.$loop.schedule(editor.renderer.CHANGE_GUTTER); - }, - attach: function(editor) { - editor.renderer.$gutterLayer.$renderer = this; - editor.on("changeSelection", this.update); - }, - detach: function(editor) { - editor.renderer.$gutterLayer.$renderer = null; - editor.off("changeSelection", this.update); - } - }; - Vim.defineOption({ - name: "wrap", - set: function(value, cm) { - if (cm) {cm.ace.setOption("wrap", value)} - }, - type: "boolean" - }, false); - Vim.defineEx('write', 'w', function() { - console.log(':write is not implemented') - }); - defaultKeymap.push( - { keys: 'zc', type: 'action', action: 'fold', actionArgs: { open: false } }, - { keys: 'zC', type: 'action', action: 'fold', actionArgs: { open: false, all: true } }, - { keys: 'zo', type: 'action', action: 'fold', actionArgs: { open: true, } }, - { keys: 'zO', type: 'action', action: 'fold', actionArgs: { open: true, all: true } }, - { keys: 'za', type: 'action', action: 'fold', actionArgs: { toggle: true } }, - { keys: 'zA', type: 'action', action: 'fold', actionArgs: { toggle: true, all: true } }, - { keys: 'zf', type: 'action', action: 'fold', actionArgs: { open: true, all: true } }, - { keys: 'zd', type: 'action', action: 'fold', actionArgs: { open: true, all: true } }, - - { keys: '', type: 'action', action: 'aceCommand', actionArgs: { name: "addCursorAbove" } }, - { keys: '', type: 'action', action: 'aceCommand', actionArgs: { name: "addCursorBelow" } }, - { keys: '', type: 'action', action: 'aceCommand', actionArgs: { name: "addCursorAboveSkipCurrent" } }, - { keys: '', type: 'action', action: 'aceCommand', actionArgs: { name: "addCursorBelowSkipCurrent" } }, - { keys: '', type: 'action', action: 'aceCommand', actionArgs: { name: "selectMoreBefore" } }, - { keys: '', type: 'action', action: 'aceCommand', actionArgs: { name: "selectMoreAfter" } }, - { keys: '', type: 'action', action: 'aceCommand', actionArgs: { name: "selectNextBefore" } }, - { keys: '', type: 'action', action: 'aceCommand', actionArgs: { name: "selectNextAfter" } } - ); - actions.aceCommand = function(cm, actionArgs, vim) { - cm.vimCmd = actionArgs; - if (cm.ace.inVirtualSelectionMode) - cm.ace.on("beforeEndOperation", delayedExecAceCommand); - else - delayedExecAceCommand(null, cm.ace); - }; - function delayedExecAceCommand(op, ace) { - ace.off("beforeEndOperation", delayedExecAceCommand); - var cmd = ace.state.cm.vimCmd; - if (cmd) { - ace.execCommand(cmd.exec ? cmd : cmd.name, cmd.args); - } - ace.curOp = ace.prevOp; - } - actions.fold = function(cm, actionArgs, vim) { - cm.ace.execCommand(['toggleFoldWidget', 'toggleFoldWidget', 'foldOther', 'unfoldall' - ][(actionArgs.all ? 2 : 0) + (actionArgs.open ? 1 : 0)]); - }, - exports.handler.defaultKeymap = defaultKeymap; - exports.handler.actions = actions; - exports.Vim = Vim; - - Vim.map("Y", "yy", "normal"); + 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 (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 == "esc" || key == "ctrl-[") { + data.state = "start"; + 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; +}; + }); diff --git a/lib/ace/keyboard/vim/commands.js b/lib/ace/keyboard/vim/commands.js new file mode 100644 index 00000000..7c26ce32 --- /dev/null +++ b/lib/ace/keyboard/vim/commands.js @@ -0,0 +1,569 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Sergi Mansilla + * Harutyun Amirjanyan + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define(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 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; + } +}; +}); diff --git a/lib/ace/keyboard/vim/maps/aliases.js b/lib/ace/keyboard/vim/maps/aliases.js new file mode 100644 index 00000000..6708a5c3 --- /dev/null +++ b/lib/ace/keyboard/vim/maps/aliases.js @@ -0,0 +1,101 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Sergi Mansilla + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +"use strict" + +define(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/lib/ace/keyboard/vim/maps/motions.js b/lib/ace/keyboard/vim/maps/motions.js new file mode 100644 index 00000000..3f0830c3 --- /dev/null +++ b/lib/ace/keyboard/vim/maps/motions.js @@ -0,0 +1,603 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Sergi Mansilla + * Harutyun Amirjanyan + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +"use strict" + +define(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(); + } + }, + "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; + }), + "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"]; + +}); diff --git a/lib/ace/keyboard/vim/maps/operators.js b/lib/ace/keyboard/vim/maps/operators.js new file mode 100644 index 00000000..75bd2e6a --- /dev/null +++ b/lib/ace/keyboard/vim/maps/operators.js @@ -0,0 +1,203 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Sergi Mansilla + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define(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; + } + } + } +}; +}); diff --git a/lib/ace/keyboard/vim/maps/util.js b/lib/ace/keyboard/vim/maps/util.js new file mode 100644 index 00000000..1e8b3e2f --- /dev/null +++ b/lib/ace/keyboard/vim/maps/util.js @@ -0,0 +1,134 @@ +define(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); + } +}; +}); diff --git a/lib/ace/keyboard/vim/registers.js b/lib/ace/keyboard/vim/registers.js new file mode 100644 index 00000000..95fecdf2 --- /dev/null +++ b/lib/ace/keyboard/vim/registers.js @@ -0,0 +1,49 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Sergi Mansilla + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define(function(require, exports, module) { + +"never use strict"; + +module.exports = { + _default: { + text: "", + isLine: false + } +}; + +}); diff --git a/lib/ace/keyboard/vim_test.js b/lib/ace/keyboard/vim_test.js deleted file mode 100644 index 127f0706..00000000 --- a/lib/ace/keyboard/vim_test.js +++ /dev/null @@ -1,4041 +0,0 @@ - -if (typeof process !== "undefined") { - require("amd-loader"); -} - -define(function(require, exports, module) { - -var EditSession = require("./../edit_session").EditSession; -var Editor = require("./../editor").Editor; -var UndoManager = require("./../undomanager").UndoManager; -var MockRenderer = require("./../test/mockrenderer").MockRenderer; -var JavaScriptMode = require("./../mode/javascript").Mode; -var VirtualRenderer = require("./../virtual_renderer").VirtualRenderer; -var assert = require("./../test/assertions"); -var keys = require("./../lib/keys"); -var vim = require("./vim"); - -var el = document.createElement("div"); -el.style.position = "fixed"; -el.style.left = "20px"; -el.style.top = "30px"; -el.style.width = "500px"; -el.style.height = "300px"; -document.body.appendChild(el); - -if (!el.getBoundingClientRect) - return console.log("Skipping test: This test only runs in the browser"); - -var renderer = new VirtualRenderer(el); -editor = new Editor(renderer);//(new MockRenderer()); -editor.session.setUndoManager(new UndoManager()); -editor.session.setUseWorker(false); -editor.session.setMode(new JavaScriptMode()); -function CodeMirror(place, opts) { - if (opts.value != null) - editor.session.setValue(opts.value); - editor.setOption("indentedSoftWrap", false); - editor.setOption("wrap", opts.lineWrapping); - editor.setOption("useSoftTabs", !opts.indentWithTabs); - editor.setKeyboardHandler(null); - editor.setKeyboardHandler(vim.handler); - var cm = editor.state.cm; - cm.setOption("tabSize", opts.tabSize || 4); - cm.setOption("indentUnit", opts.indentUnit || 2); - - cm.setSize = function(w, h) { - var changed = false; - if (w && editor.w != w) { - changed = true; - el.style.width = (editor.w = w) + "px"; - } - if (h && editor.h != h) { - changed = true; - el.style.height = (editor.h = h) + "px"; - } - if (changed) - editor.resize(true); - }; - cm.setSize(500, 300); - return cm; -} -CodeMirror.defineMode = function() {} -for (var key in vim.CodeMirror) - CodeMirror[key] = vim.CodeMirror[key]; -var editor; -var i = 0; -function test(name, fn) { - // if (name != 'vim_search_history') return - // for (i = 0; i < 1000; i++) - // exports["test " + name + i] = fn; // vim_ex_global_confirm - if (i++ < 0 || /- /.test(name)) - exports["test " + name] = function() {}; - else - exports["test " + name] = fn; -} - -vim.CodeMirror.Vim.unmap("Y"); -vim.CodeMirror.Vim.defineEx('write', 'w', function(cm) { - CodeMirror.commands.save(cm); -}); - - - -// cm.setBookmark({ch: 5, line: 0}) -// cm.setBookmark({ch: 4, line: 0}) -// cm.replaceRange("x-", {ch: 4, line: 0}, {ch: 5, line: 0}); [editor.$vimModeHandler.cm.marks[0].find(),editor.$vimModeHandler.cm.marks[1].find()] - -var lineText, verbose, phantom; -var Pos = CodeMirror.Pos; -var place = document.createElement("div"); -var eqPos = assert.deepEqual; -var eq = assert.equal; -var is = assert.ok; - - -var code = '' + -' wOrd1 (#%\n' + -' word3] \n' + -'aopop pop 0 1 2 3 4\n' + -' (a) [b] {c} \n' + -'int getchar(void) {\n' + -' static char buf[BUFSIZ];\n' + -' static char *bufp = buf;\n' + -' if (n == 0) { /* buffer is empty */\n' + -' n = read(0, buf, sizeof buf);\n' + -' bufp = buf;\n' + -' }\n' + -'\n' + -' return (--n >= 0) ? (unsigned char) *bufp++ : EOF;\n' + -' \n' + -'}\n'; - -var lines = (function() { - lineText = code.split('\n'); - var ret = []; - for (var i = 0; i < lineText.length; i++) { - ret[i] = { - line: i, - length: lineText[i].length, - lineText: lineText[i], - textStart: /^\s*/.exec(lineText[i])[0].length - }; - } - return ret; -})(); -var endOfDocument = makeCursor(lines.length - 1, - lines[lines.length - 1].length); -var wordLine = lines[0]; -var bigWordLine = lines[1]; -var charLine = lines[2]; -var bracesLine = lines[3]; -var seekBraceLine = lines[4]; - -var word1 = { - start: { line: wordLine.line, ch: 1 }, - end: { line: wordLine.line, ch: 5 } -}; -var word2 = { - start: { line: wordLine.line, ch: word1.end.ch + 2 }, - end: { line: wordLine.line, ch: word1.end.ch + 4 } -}; -var word3 = { - start: { line: bigWordLine.line, ch: 1 }, - end: { line: bigWordLine.line, ch: 5 } -}; -var bigWord1 = word1; -var bigWord2 = word2; -var bigWord3 = { - start: { line: bigWordLine.line, ch: 1 }, - end: { line: bigWordLine.line, ch: 7 } -}; -var bigWord4 = { - start: { line: bigWordLine.line, ch: bigWord1.end.ch + 3 }, - end: { line: bigWordLine.line, ch: bigWord1.end.ch + 7 } -}; - -var oChars = [ { line: charLine.line, ch: 1 }, - { line: charLine.line, ch: 3 }, - { line: charLine.line, ch: 7 } ]; -var pChars = [ { line: charLine.line, ch: 2 }, - { line: charLine.line, ch: 4 }, - { line: charLine.line, ch: 6 }, - { line: charLine.line, ch: 8 } ]; -var numChars = [ { line: charLine.line, ch: 10 }, - { line: charLine.line, ch: 12 }, - { line: charLine.line, ch: 14 }, - { line: charLine.line, ch: 16 }, - { line: charLine.line, ch: 18 }]; -var parens1 = { - start: { line: bracesLine.line, ch: 1 }, - end: { line: bracesLine.line, ch: 3 } -}; -var squares1 = { - start: { line: bracesLine.line, ch: 5 }, - end: { line: bracesLine.line, ch: 7 } -}; -var curlys1 = { - start: { line: bracesLine.line, ch: 9 }, - end: { line: bracesLine.line, ch: 11 } -}; -var seekOutside = { - start: { line: seekBraceLine.line, ch: 1 }, - end: { line: seekBraceLine.line, ch: 16 } -}; -var seekInside = { - start: { line: seekBraceLine.line, ch: 14 }, - end: { line: seekBraceLine.line, ch: 11 } -}; - -function copyCursor(cur) { - return { ch: cur.ch, line: cur.line }; -} - -function forEach(arr, func) { - for (var i = 0; i < arr.length; i++) { - func(arr[i], i, arr); - } -} - -function testVim(name, run, opts, expectedFail) { - var vimOpts = { - lineNumbers: true, - vimMode: true, - showCursorWhenSelecting: true, - value: code - }; - for (var prop in opts) { - if (opts.hasOwnProperty(prop)) { - vimOpts[prop] = opts[prop]; - } - } - return test('vim_' + name, function() { - var place = document.getElementById("testground"); - var cm = CodeMirror(place, vimOpts); - var vim = CodeMirror.Vim.maybeInitVimState_(cm); - - function doKeysFn(cm) { - return function(args) { - if (args instanceof Array) { - arguments = args; - } - for (var i = 0; i < arguments.length; i++) { - CodeMirror.Vim.handleKey(cm, arguments[i]); - } - } - } - function doInsertModeKeysFn(cm) { - return function(args) { - if (args instanceof Array) { arguments = args; } - function executeHandler(handler) { - if (typeof handler == 'string') { - CodeMirror.commands[handler](cm); - } else { - handler(cm); - } - return true; - } - for (var i = 0; i < arguments.length; i++) { - var key = arguments[i]; - // Find key in keymap and handle. - var handled = CodeMirror.lookupKey(key, 'vim-insert', executeHandler); - // Record for insert mode. - if (handled == "handled" && cm.state.vim.insertMode && arguments[i] != 'Esc') { - var lastChange = CodeMirror.Vim.getVimGlobalState_().macroModeState.lastInsertModeChanges; - if (lastChange) { - lastChange.changes.push(new CodeMirror.Vim.InsertModeKey(key)); - } - } - } - } - } - function doExFn(cm) { - return function(command) { - cm.openDialog = helpers.fakeOpenDialog(command); - helpers.doKeys(':'); - } - } - function assertCursorAtFn(cm) { - return function(line, ch) { - var pos; - if (ch == null && typeof line.line == 'number') { - pos = line; - } else { - pos = makeCursor(line, ch); - } - eqPos(pos, cm.getCursor()); - } - } - function fakeOpenDialog(result) { - return function(text, callback) { - return callback(result); - } - } - function fakeOpenNotification(matcher) { - return function(text) { - matcher(text); - } - } - var helpers = { - doKeys: doKeysFn(cm), - // Warning: Only emulates keymap events, not character insertions. Use - // replaceRange to simulate character insertions. - // Keys are in CodeMirror format, NOT vim format. - doInsertModeKeys: doInsertModeKeysFn(cm), - doEx: doExFn(cm), - assertCursorAt: assertCursorAtFn(cm), - fakeOpenDialog: fakeOpenDialog, - fakeOpenNotification: fakeOpenNotification, - getRegisterController: function() { - return CodeMirror.Vim.getRegisterController(); - } - } - CodeMirror.Vim.resetVimGlobalState_(); - var successful = false; - var savedOpenNotification = cm.openNotification; - try { - run(cm, vim, helpers); - successful = true; - } finally { - cm.openNotification = savedOpenNotification; - // if (!successful || verbose) { - // place.style.visibility = "visible"; - // } else { - // place.removeChild(cm.getWrapperElement()); - // } - } - }, expectedFail); -}; -testVim('qq@q', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'q', 'l', 'l', 'q'); - helpers.assertCursorAt(0,2); - helpers.doKeys('@', 'q'); - helpers.assertCursorAt(0,4); -}, { value: ' '}); -testVim('@@', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'q', 'l', 'l', 'q'); - helpers.assertCursorAt(0,2); - helpers.doKeys('@', 'q'); - helpers.assertCursorAt(0,4); - helpers.doKeys('@', '@'); - helpers.assertCursorAt(0,6); -}, { value: ' '}); -var jumplistScene = ''+ - 'word\n'+ - '(word)\n'+ - '{word\n'+ - 'word.\n'+ - '\n'+ - 'word search\n'+ - '}word\n'+ - 'word\n'+ - 'word\n'; -function testJumplist(name, keys, endPos, startPos, dialog) { - endPos = makeCursor(endPos[0], endPos[1]); - startPos = makeCursor(startPos[0], startPos[1]); - testVim(name, function(cm, vim, helpers) { - CodeMirror.Vim.resetVimGlobalState_(); - if(dialog)cm.openDialog = helpers.fakeOpenDialog('word'); - cm.setCursor(startPos); - helpers.doKeys.apply(null, keys); - helpers.assertCursorAt(endPos); - }, {value: jumplistScene}); -}; -testJumplist('jumplist_H', ['H', ''], [5,2], [5,2]); -testJumplist('jumplist_M', ['M', ''], [2,2], [2,2]); -testJumplist('jumplist_L', ['L', ''], [2,2], [2,2]); -testJumplist('jumplist_[[', ['[', '[', ''], [5,2], [5,2]); -testJumplist('jumplist_]]', [']', ']', ''], [2,2], [2,2]); -testJumplist('jumplist_G', ['G', ''], [5,2], [5,2]); -testJumplist('jumplist_gg', ['g', 'g', ''], [5,2], [5,2]); -testJumplist('jumplist_%', ['%', ''], [1,5], [1,5]); -testJumplist('jumplist_{', ['{', ''], [1,5], [1,5]); -testJumplist('jumplist_}', ['}', ''], [1,5], [1,5]); -testJumplist('jumplist_\'', ['m', 'a', 'h', '\'', 'a', 'h', ''], [1,0], [1,5]); -testJumplist('jumplist_`', ['m', 'a', 'h', '`', 'a', 'h', ''], [1,5], [1,5]); -testJumplist('jumplist_*_cachedCursor', ['*', ''], [1,3], [1,3]); -testJumplist('jumplist_#_cachedCursor', ['#', ''], [1,3], [1,3]); -testJumplist('jumplist_n', ['#', 'n', ''], [1,1], [2,3]); -testJumplist('jumplist_N', ['#', 'N', ''], [1,1], [2,3]); -testJumplist('jumplist_repeat_', ['*', '*', '*', '3', ''], [2,3], [2,3]); -testJumplist('jumplist_repeat_', ['*', '*', '*', '3', '', '2', ''], [5,0], [2,3]); -testJumplist('jumplist_repeated_motion', ['3', '*', ''], [2,3], [2,3]); -testJumplist('jumplist_/', ['/', ''], [2,3], [2,3], 'dialog'); -testJumplist('jumplist_?', ['?', ''], [2,3], [2,3], 'dialog'); -testJumplist('jumplist_skip_delted_mark', - ['*', 'n', 'n', 'k', 'd', 'k', '', '', ''], - [0,2], [0,2]); -testJumplist('jumplist_skip_delted_mark', - ['*', 'n', 'n', 'k', 'd', 'k', '', '', ''], - [1,0], [0,2]); - -/** - * @param name Name of the test - * @param keys An array of keys or a string with a single key to simulate. - * @param endPos The expected end position of the cursor. - * @param startPos The position the cursor should start at, defaults to 0, 0. - */ -function testMotion(name, keys, endPos, startPos) { - testVim(name, function(cm, vim, helpers) { - if (!startPos) { - startPos = { line: 0, ch: 0 }; - } - cm.setCursor(startPos); - helpers.doKeys(keys); - helpers.assertCursorAt(endPos); - }); -}; - -function makeCursor(line, ch) { - return { line: line, ch: ch }; -}; - -function offsetCursor(cur, offsetLine, offsetCh) { - return { line: cur.line + offsetLine, ch: cur.ch + offsetCh }; -}; - -// Motion tests -testMotion('|', '|', makeCursor(0, 0), makeCursor(0,4)); -testMotion('|_repeat', ['3', '|'], makeCursor(0, 2), makeCursor(0,4)); -testMotion('h', 'h', makeCursor(0, 0), word1.start); -testMotion('h_repeat', ['3', 'h'], offsetCursor(word1.end, 0, -3), word1.end); -testMotion('l', 'l', makeCursor(0, 1)); -testMotion('l_repeat', ['2', 'l'], makeCursor(0, 2)); -testMotion('j', 'j', offsetCursor(word1.end, 1, 0), word1.end); -testMotion('j_repeat', ['2', 'j'], offsetCursor(word1.end, 2, 0), word1.end); -testMotion('j_repeat_clip', ['1000', 'j'], endOfDocument); -testMotion('k', 'k', offsetCursor(word3.end, -1, 0), word3.end); -testMotion('k_repeat', ['2', 'k'], makeCursor(0, 4), makeCursor(2, 4)); -testMotion('k_repeat_clip', ['1000', 'k'], makeCursor(0, 4), makeCursor(2, 4)); -testMotion('w', 'w', word1.start); -testMotion('w_multiple_newlines_no_space', 'w', makeCursor(12, 2), makeCursor(11, 2)); -testMotion('w_multiple_newlines_with_space', 'w', makeCursor(14, 0), makeCursor(12, 51)); -testMotion('w_repeat', ['2', 'w'], word2.start); -testMotion('w_wrap', ['w'], word3.start, word2.start); -testMotion('w_endOfDocument', 'w', endOfDocument, endOfDocument); -testMotion('w_start_to_end', ['1000', 'w'], endOfDocument, makeCursor(0, 0)); -testMotion('W', 'W', bigWord1.start); -testMotion('W_repeat', ['2', 'W'], bigWord3.start, bigWord1.start); -testMotion('e', 'e', word1.end); -testMotion('e_repeat', ['2', 'e'], word2.end); -testMotion('e_wrap', 'e', word3.end, word2.end); -testMotion('e_endOfDocument', 'e', endOfDocument, endOfDocument); -testMotion('e_start_to_end', ['1000', 'e'], endOfDocument, makeCursor(0, 0)); -testMotion('b', 'b', word3.start, word3.end); -testMotion('b_repeat', ['2', 'b'], word2.start, word3.end); -testMotion('b_wrap', 'b', word2.start, word3.start); -testMotion('b_startOfDocument', 'b', makeCursor(0, 0), makeCursor(0, 0)); -testMotion('b_end_to_start', ['1000', 'b'], makeCursor(0, 0), endOfDocument); -testMotion('ge', ['g', 'e'], word2.end, word3.end); -testMotion('ge_repeat', ['2', 'g', 'e'], word1.end, word3.start); -testMotion('ge_wrap', ['g', 'e'], word2.end, word3.start); -testMotion('ge_startOfDocument', ['g', 'e'], makeCursor(0, 0), - makeCursor(0, 0)); -testMotion('ge_end_to_start', ['1000', 'g', 'e'], makeCursor(0, 0), endOfDocument); -testMotion('gg', ['g', 'g'], makeCursor(lines[0].line, lines[0].textStart), - makeCursor(3, 1)); -testMotion('gg_repeat', ['3', 'g', 'g'], - makeCursor(lines[2].line, lines[2].textStart)); -testMotion('G', 'G', - makeCursor(lines[lines.length - 1].line, lines[lines.length - 1].textStart), - makeCursor(3, 1)); -testMotion('G_repeat', ['3', 'G'], makeCursor(lines[2].line, - lines[2].textStart)); -// TODO: Make the test code long enough to test Ctrl-F and Ctrl-B. -testMotion('0', '0', makeCursor(0, 0), makeCursor(0, 8)); -testMotion('^', '^', makeCursor(0, lines[0].textStart), makeCursor(0, 8)); -testMotion('+', '+', makeCursor(1, lines[1].textStart), makeCursor(0, 8)); -testMotion('-', '-', makeCursor(0, lines[0].textStart), makeCursor(1, 4)); -testMotion('_', ['6','_'], makeCursor(5, lines[5].textStart), makeCursor(0, 8)); -testMotion('$', '$', makeCursor(0, lines[0].length - 1), makeCursor(0, 1)); -testMotion('$_repeat', ['2', '$'], makeCursor(1, lines[1].length - 1), - makeCursor(0, 3)); -testMotion('f', ['f', 'p'], pChars[0], makeCursor(charLine.line, 0)); -testMotion('f_repeat', ['2', 'f', 'p'], pChars[2], pChars[0]); -testMotion('f_num', ['f', '2'], numChars[2], makeCursor(charLine.line, 0)); -testMotion('t', ['t','p'], offsetCursor(pChars[0], 0, -1), - makeCursor(charLine.line, 0)); -testMotion('t_repeat', ['2', 't', 'p'], offsetCursor(pChars[2], 0, -1), - pChars[0]); -testMotion('F', ['F', 'p'], pChars[0], pChars[1]); -testMotion('F_repeat', ['2', 'F', 'p'], pChars[0], pChars[2]); -testMotion('T', ['T', 'p'], offsetCursor(pChars[0], 0, 1), pChars[1]); -testMotion('T_repeat', ['2', 'T', 'p'], offsetCursor(pChars[0], 0, 1), pChars[2]); -testMotion('%_parens', ['%'], parens1.end, parens1.start); -testMotion('%_squares', ['%'], squares1.end, squares1.start); -testMotion('%_braces', ['%'], curlys1.end, curlys1.start); -testMotion('%_seek_outside', ['%'], seekOutside.end, seekOutside.start); -testMotion('%_seek_inside', ['%'], seekInside.end, seekInside.start); -testVim('%_seek_skip', function(cm, vim, helpers) { - cm.setCursor(0,0); - helpers.doKeys(['%']); - helpers.assertCursorAt(0,9); -}, {value:'01234"("()'}); -testVim('%_skip_string', function(cm, vim, helpers) { - cm.setCursor(0,0); - helpers.doKeys(['%']); - helpers.assertCursorAt(0,4); - cm.setCursor(0,2); - helpers.doKeys(['%']); - helpers.assertCursorAt(0,0); -}, {value:'(")")'}); -(')') -testVim('%_skip_comment', function(cm, vim, helpers) { - cm.setCursor(0,0); - helpers.doKeys(['%']); - helpers.assertCursorAt(0,6); - cm.setCursor(0,3); - helpers.doKeys(['%']); - helpers.assertCursorAt(0,0); -}, {value:'(/*)*/)'}); -// Make sure that moving down after going to the end of a line always leaves you -// at the end of a line, but preserves the offset in other cases -testVim('Changing lines after Eol operation', function(cm, vim, helpers) { - cm.setCursor(0,0); - helpers.doKeys(['$']); - helpers.doKeys(['j']); - // After moving to Eol and then down, we should be at Eol of line 2 - helpers.assertCursorAt({ line: 1, ch: lines[1].length - 1 }); - helpers.doKeys(['j']); - // After moving down, we should be at Eol of line 3 - helpers.assertCursorAt({ line: 2, ch: lines[2].length - 1 }); - helpers.doKeys(['h']); - helpers.doKeys(['j']); - // After moving back one space and then down, since line 4 is shorter than line 2, we should - // be at Eol of line 2 - 1 - helpers.assertCursorAt({ line: 3, ch: lines[3].length - 1 }); - helpers.doKeys(['j']); - helpers.doKeys(['j']); - // After moving down again, since line 3 has enough characters, we should be back to the - // same place we were at on line 1 - helpers.assertCursorAt({ line: 5, ch: lines[2].length - 2 }); -}); -//making sure gj and gk recover from clipping -testVim('gj_gk_clipping', function(cm,vim,helpers){ - cm.setCursor(0, 1); - helpers.doKeys('g','j','g','j'); - helpers.assertCursorAt(2, 1); - helpers.doKeys('g','k','g','k'); - helpers.assertCursorAt(0, 1); -},{value: 'line 1\n\nline 2'}); -//testing a mix of j/k and gj/gk -testVim('j_k_and_gj_gk', function(cm,vim,helpers){ - cm.setSize(120); - cm.setCursor(0, 0); - //go to the last character on the first line - helpers.doKeys('$'); - //move up/down on the column within the wrapped line - //side-effect: cursor is not locked to eol anymore - helpers.doKeys('g','k'); - var cur=cm.getCursor(); - eq(cur.line,0); - is((cur.ch<176),'gk didn\'t move cursor back (1)'); - helpers.doKeys('g','j'); - helpers.assertCursorAt(0, 176); - //should move to character 177 on line 2 (j/k preserve character index within line) - helpers.doKeys('j'); - //due to different line wrapping, the cursor can be on a different screen-x now - //gj and gk preserve screen-x on movement, much like moveV - helpers.doKeys('3','g','k'); - cur=cm.getCursor(); - eq(cur.line,1); - is((cur.ch<176),'gk didn\'t move cursor back (2)'); - helpers.doKeys('g','j','2','g','j'); - //should return to the same character-index - helpers.doKeys('k'); - helpers.assertCursorAt(0, 176); -},{ lineWrapping:true, value: 'This line is intentially long to test movement of gj and gk over wrapped lines. I will start on the end of this line, then make a step up and back to set the origin for j and k.\nThis line is supposed to be even longer than the previous. I will jump here and make another wiggle with gj and gk, before I jump back to the line above. Both wiggles should not change my cursor\'s target character but both j/k and gj/gk change each other\'s reference position.'}); -testVim('gj_gk', function(cm, vim, helpers) { - if (phantom) return; - cm.setSize(120); - // Test top of document edge case. - cm.setCursor(0, 4); - helpers.doKeys('g', 'j'); - helpers.doKeys('10', 'g', 'k'); - helpers.assertCursorAt(0, 4); - - // Test moving down preserves column position. - helpers.doKeys('g', 'j'); - var pos1 = cm.getCursor(); - var expectedPos2 = { line: 0, ch: (pos1.ch - 4) * 2 + 4}; - helpers.doKeys('g', 'j'); - helpers.assertCursorAt(expectedPos2); - - // Move to the last character - cm.setCursor(0, 0); - // Move left to reset HSPos - helpers.doKeys('h'); - // Test bottom of document edge case. - helpers.doKeys('100', 'g', 'j'); - var endingPos = cm.getCursor(); - is(endingPos != 0, 'gj should not be on wrapped line 0'); - var topLeftCharCoords = cm.charCoords(makeCursor(0, 0)); - var endingCharCoords = cm.charCoords(endingPos); - is(topLeftCharCoords.left == endingCharCoords.left, 'gj should end up on column 0'); -},{ lineNumbers: false, lineWrapping:true, value: 'Thislineisintentiallylongtotestmovementofgjandgkoverwrappedlines.' }); -testVim('}', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('}'); - helpers.assertCursorAt(1, 0); - cm.setCursor(0, 0); - helpers.doKeys('2', '}'); - helpers.assertCursorAt(4, 0); - cm.setCursor(0, 0); - helpers.doKeys('6', '}'); - helpers.assertCursorAt(5, 0); -}, { value: 'a\n\nb\nc\n\nd' }); -testVim('{', function(cm, vim, helpers) { - cm.setCursor(5, 0); - helpers.doKeys('{'); - helpers.assertCursorAt(4, 0); - cm.setCursor(5, 0); - helpers.doKeys('2', '{'); - helpers.assertCursorAt(1, 0); - cm.setCursor(5, 0); - helpers.doKeys('6', '{'); - helpers.assertCursorAt(0, 0); -}, { value: 'a\n\nb\nc\n\nd' }); -testVim('paragraph_motions', function(cm, vim, helpers) { - cm.setCursor(10, 0); - helpers.doKeys('{'); - helpers.assertCursorAt(4, 0); - helpers.doKeys('{'); - helpers.assertCursorAt(0, 0); - helpers.doKeys('2', '}'); - helpers.assertCursorAt(7, 0); - helpers.doKeys('2', '}'); - helpers.assertCursorAt(16, 0); - - cm.setCursor(9, 0); - helpers.doKeys('}'); - helpers.assertCursorAt(14, 0); - - cm.setCursor(6, 0); - helpers.doKeys('}'); - helpers.assertCursorAt(7, 0); - - // ip inside empty space - cm.setCursor(10, 0); - helpers.doKeys('v', 'i', 'p'); - eqPos(Pos(7, 0), cm.getCursor('anchor')); - eqPos(Pos(12, 0), cm.getCursor('head')); - helpers.doKeys('i', 'p'); - eqPos(Pos(7, 0), cm.getCursor('anchor')); - eqPos(Pos(13, 1), cm.getCursor('head')); - helpers.doKeys('2', 'i', 'p'); - eqPos(Pos(7, 0), cm.getCursor('anchor')); - eqPos(Pos(16, 1), cm.getCursor('head')); - - // should switch to visualLine mode - cm.setCursor(14, 0); - helpers.doKeys('', 'v', 'i', 'p'); - helpers.assertCursorAt(14, 0); - - cm.setCursor(14, 0); - helpers.doKeys('', 'V', 'i', 'p'); - eqPos(Pos(16, 1), cm.getCursor('head')); - - // ap inside empty space - cm.setCursor(10, 0); - helpers.doKeys('', 'v', 'a', 'p'); - eqPos(Pos(7, 0), cm.getCursor('anchor')); - eqPos(Pos(13, 1), cm.getCursor('head')); - helpers.doKeys('a', 'p'); - eqPos(Pos(7, 0), cm.getCursor('anchor')); - eqPos(Pos(16, 1), cm.getCursor('head')); - - cm.setCursor(13, 0); - helpers.doKeys('v', 'a', 'p'); - eqPos(Pos(13, 0), cm.getCursor('anchor')); - eqPos(Pos(14, 0), cm.getCursor('head')); - - cm.setCursor(16, 0); - helpers.doKeys('v', 'a', 'p'); - eqPos(Pos(14, 0), cm.getCursor('anchor')); - eqPos(Pos(16, 1), cm.getCursor('head')); - - cm.setCursor(0, 0); - helpers.doKeys('v', 'a', 'p'); - eqPos(Pos(0, 0), cm.getCursor('anchor')); - eqPos(Pos(4, 0), cm.getCursor('head')); - - cm.setCursor(0, 0); - helpers.doKeys('d', 'i', 'p'); - var register = helpers.getRegisterController().getRegister(); - eq('a\na\n', register.toString()); - is(register.linewise); - helpers.doKeys('3', 'j', 'p'); - helpers.doKeys('y', 'i', 'p'); - is(register.linewise); - eq('b\na\na\nc\n', register.toString()); -}, { value: 'a\na\n\n\n\nb\nc\n\n\n\n\n\n\nd\n\ne\nf' }); - -// Operator tests -testVim('dl', function(cm, vim, helpers) { - var curStart = makeCursor(0, 0); - cm.setCursor(curStart); - helpers.doKeys('d', 'l'); - eq('word1 ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq(' ', register.toString()); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); -}, { value: ' word1 ' }); -testVim('dl_eol', function(cm, vim, helpers) { - cm.setCursor(0, 6); - helpers.doKeys('d', 'l'); - eq(' word1', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq(' ', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 5); -}, { value: ' word1 ' }); -testVim('dl_repeat', function(cm, vim, helpers) { - var curStart = makeCursor(0, 0); - cm.setCursor(curStart); - helpers.doKeys('2', 'd', 'l'); - eq('ord1 ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq(' w', register.toString()); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); -}, { value: ' word1 ' }); -testVim('dh', function(cm, vim, helpers) { - var curStart = makeCursor(0, 3); - cm.setCursor(curStart); - helpers.doKeys('d', 'h'); - eq(' wrd1 ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('o', register.toString()); - is(!register.linewise); - eqPos(offsetCursor(curStart, 0 , -1), cm.getCursor()); -}, { value: ' word1 ' }); -testVim('dj', function(cm, vim, helpers) { - var curStart = makeCursor(0, 3); - cm.setCursor(curStart); - helpers.doKeys('d', 'j'); - eq(' word3', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq(' word1\nword2\n', register.toString()); - is(register.linewise); - helpers.assertCursorAt(0, 1); -}, { value: ' word1\nword2\n word3' }); -testVim('dj_end_of_document', function(cm, vim, helpers) { - var curStart = makeCursor(0, 3); - cm.setCursor(curStart); - helpers.doKeys('d', 'j'); - eq(' word1 ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 3); -}, { value: ' word1 ' }); -testVim('dk', function(cm, vim, helpers) { - var curStart = makeCursor(1, 3); - cm.setCursor(curStart); - helpers.doKeys('d', 'k'); - eq(' word3', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq(' word1\nword2\n', register.toString()); - is(register.linewise); - helpers.assertCursorAt(0, 1); -}, { value: ' word1\nword2\n word3' }); -testVim('dk_start_of_document', function(cm, vim, helpers) { - var curStart = makeCursor(0, 3); - cm.setCursor(curStart); - helpers.doKeys('d', 'k'); - eq(' word1 ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 3); -}, { value: ' word1 ' }); -testVim('dw_space', function(cm, vim, helpers) { - var curStart = makeCursor(0, 0); - cm.setCursor(curStart); - helpers.doKeys('d', 'w'); - eq('word1 ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq(' ', register.toString()); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); -}, { value: ' word1 ' }); -testVim('dw_word', function(cm, vim, helpers) { - var curStart = makeCursor(0, 1); - cm.setCursor(curStart); - helpers.doKeys('d', 'w'); - eq(' word2', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('word1 ', register.toString()); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); -}, { value: ' word1 word2' }); -testVim('dw_unicode_word', function(cm, vim, helpers) { - helpers.doKeys('d', 'w'); - eq(cm.getValue().length, 10); - helpers.doKeys('d', 'w'); - eq(cm.getValue().length, 6); - helpers.doKeys('d', 'w'); - eq(cm.getValue().length, 5); - helpers.doKeys('d', 'e'); - eq(cm.getValue().length, 2); -}, { value: ' \u0562\u0561\u0580\u0587\xbbe\xb5g ' }); -testVim('dw_only_word', function(cm, vim, helpers) { - // Test that if there is only 1 word left, dw deletes till the end of the - // line. - cm.setCursor(0, 1); - helpers.doKeys('d', 'w'); - eq(' ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('word1 ', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 0); -}, { value: ' word1 ' }); -testVim('dw_eol', function(cm, vim, helpers) { - // Assert that dw does not delete the newline if last word to delete is at end - // of line. - cm.setCursor(0, 1); - helpers.doKeys('d', 'w'); - eq(' \nword2', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('word1', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 0); -}, { value: ' word1\nword2' }); -testVim('dw_eol_with_multiple_newlines', function(cm, vim, helpers) { - // Assert that dw does not delete the newline if last word to delete is at end - // of line and it is followed by multiple newlines. - cm.setCursor(0, 1); - helpers.doKeys('d', 'w'); - eq(' \n\nword2', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('word1', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 0); -}, { value: ' word1\n\nword2' }); -testVim('dw_empty_line_followed_by_whitespace', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('d', 'w'); - eq(' \nword', cm.getValue()); -}, { value: '\n \nword' }); -testVim('dw_empty_line_followed_by_word', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('d', 'w'); - eq('word', cm.getValue()); -}, { value: '\nword' }); -testVim('dw_empty_line_followed_by_empty_line', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('d', 'w'); - eq('\n', cm.getValue()); -}, { value: '\n\n' }); -testVim('dw_whitespace_followed_by_whitespace', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('d', 'w'); - eq('\n \n', cm.getValue()); -}, { value: ' \n \n' }); -testVim('dw_whitespace_followed_by_empty_line', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('d', 'w'); - eq('\n\n', cm.getValue()); -}, { value: ' \n\n' }); -testVim('dw_word_whitespace_word', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('d', 'w'); - eq('\n \nword2', cm.getValue()); -}, { value: 'word1\n \nword2'}) -testVim('dw_end_of_document', function(cm, vim, helpers) { - cm.setCursor(1, 2); - helpers.doKeys('d', 'w'); - eq('\nab', cm.getValue()); -}, { value: '\nabc' }); -testVim('dw_repeat', function(cm, vim, helpers) { - // Assert that dw does delete newline if it should go to the next line, and - // that repeat works properly. - cm.setCursor(0, 1); - helpers.doKeys('d', '2', 'w'); - eq(' ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('word1\nword2', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 0); -}, { value: ' word1\nword2' }); -testVim('de_word_start_and_empty_lines', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('d', 'e'); - eq('\n\n', cm.getValue()); -}, { value: 'word\n\n' }); -testVim('de_word_end_and_empty_lines', function(cm, vim, helpers) { - cm.setCursor(0, 3); - helpers.doKeys('d', 'e'); - eq('wor', cm.getValue()); -}, { value: 'word\n\n\n' }); -testVim('de_whitespace_and_empty_lines', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('d', 'e'); - eq('', cm.getValue()); -}, { value: ' \n\n\n' }); -testVim('de_end_of_document', function(cm, vim, helpers) { - cm.setCursor(1, 2); - helpers.doKeys('d', 'e'); - eq('\nab', cm.getValue()); -}, { value: '\nabc' }); -testVim('db_empty_lines', function(cm, vim, helpers) { - cm.setCursor(2, 0); - helpers.doKeys('d', 'b'); - eq('\n\n', cm.getValue()); -}, { value: '\n\n\n' }); -testVim('db_word_start_and_empty_lines', function(cm, vim, helpers) { - cm.setCursor(2, 0); - helpers.doKeys('d', 'b'); - eq('\nword', cm.getValue()); -}, { value: '\n\nword' }); -testVim('db_word_end_and_empty_lines', function(cm, vim, helpers) { - cm.setCursor(2, 3); - helpers.doKeys('d', 'b'); - eq('\n\nd', cm.getValue()); -}, { value: '\n\nword' }); -testVim('db_whitespace_and_empty_lines', function(cm, vim, helpers) { - cm.setCursor(2, 0); - helpers.doKeys('d', 'b'); - eq('', cm.getValue()); -}, { value: '\n \n' }); -testVim('db_start_of_document', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('d', 'b'); - eq('abc\n', cm.getValue()); -}, { value: 'abc\n' }); -testVim('dge_empty_lines', function(cm, vim, helpers) { - cm.setCursor(1, 0); - helpers.doKeys('d', 'g', 'e'); - // Note: In real VIM the result should be '', but it's not quite consistent, - // since 2 newlines are deleted. But in the similar case of word\n\n, only - // 1 newline is deleted. We'll diverge from VIM's behavior since it's much - // easier this way. - eq('\n', cm.getValue()); -}, { value: '\n\n' }); -testVim('dge_word_and_empty_lines', function(cm, vim, helpers) { - cm.setCursor(1, 0); - helpers.doKeys('d', 'g', 'e'); - eq('wor\n', cm.getValue()); -}, { value: 'word\n\n'}); -testVim('dge_whitespace_and_empty_lines', function(cm, vim, helpers) { - cm.setCursor(2, 0); - helpers.doKeys('d', 'g', 'e'); - eq('', cm.getValue()); -}, { value: '\n \n' }); -testVim('dge_start_of_document', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('d', 'g', 'e'); - eq('bc\n', cm.getValue()); -}, { value: 'abc\n' }); -testVim('d_inclusive', function(cm, vim, helpers) { - // Assert that when inclusive is set, the character the cursor is on gets - // deleted too. - var curStart = makeCursor(0, 1); - cm.setCursor(curStart); - helpers.doKeys('d', 'e'); - eq(' ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('word1', register.toString()); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); -}, { value: ' word1 ' }); -testVim('d_reverse', function(cm, vim, helpers) { - // Test that deleting in reverse works. - cm.setCursor(1, 0); - helpers.doKeys('d', 'b'); - eq(' word2 ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('word1\n', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 1); -}, { value: ' word1\nword2 ' }); -testVim('dd', function(cm, vim, helpers) { - cm.setCursor(0, 3); - var expectedBuffer = cm.getRange({ line: 0, ch: 0 }, - { line: 1, ch: 0 }); - var expectedLineCount = cm.lineCount() - 1; - helpers.doKeys('d', 'd'); - eq(expectedLineCount, cm.lineCount()); - var register = helpers.getRegisterController().getRegister(); - eq(expectedBuffer, register.toString()); - is(register.linewise); - helpers.assertCursorAt(0, lines[1].textStart); -}); -testVim('dd_prefix_repeat', function(cm, vim, helpers) { - cm.setCursor(0, 3); - var expectedBuffer = cm.getRange({ line: 0, ch: 0 }, - { line: 2, ch: 0 }); - var expectedLineCount = cm.lineCount() - 2; - helpers.doKeys('2', 'd', 'd'); - eq(expectedLineCount, cm.lineCount()); - var register = helpers.getRegisterController().getRegister(); - eq(expectedBuffer, register.toString()); - is(register.linewise); - helpers.assertCursorAt(0, lines[2].textStart); -}); -testVim('dd_motion_repeat', function(cm, vim, helpers) { - cm.setCursor(0, 3); - var expectedBuffer = cm.getRange({ line: 0, ch: 0 }, - { line: 2, ch: 0 }); - var expectedLineCount = cm.lineCount() - 2; - helpers.doKeys('d', '2', 'd'); - eq(expectedLineCount, cm.lineCount()); - var register = helpers.getRegisterController().getRegister(); - eq(expectedBuffer, register.toString()); - is(register.linewise); - helpers.assertCursorAt(0, lines[2].textStart); -}); -testVim('dd_multiply_repeat', function(cm, vim, helpers) { - cm.setCursor(0, 3); - var expectedBuffer = cm.getRange({ line: 0, ch: 0 }, - { line: 6, ch: 0 }); - var expectedLineCount = cm.lineCount() - 6; - helpers.doKeys('2', 'd', '3', 'd'); - eq(expectedLineCount, cm.lineCount()); - var register = helpers.getRegisterController().getRegister(); - eq(expectedBuffer, register.toString()); - is(register.linewise); - helpers.assertCursorAt(0, lines[6].textStart); -}); -testVim('dd_lastline', function(cm, vim, helpers) { - cm.setCursor(cm.lineCount(), 0); - var expectedLineCount = cm.lineCount() - 1; - helpers.doKeys('d', 'd'); - eq(expectedLineCount, cm.lineCount()); - helpers.assertCursorAt(cm.lineCount() - 1, 0); -}); -testVim('dd_only_line', function(cm, vim, helpers) { - cm.setCursor(0, 0); - var expectedRegister = cm.getValue() + "\n"; - helpers.doKeys('d','d'); - eq(1, cm.lineCount()); - eq('', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq(expectedRegister, register.toString()); -}, { value: "thisistheonlyline" }); -// Yank commands should behave the exact same as d commands, expect that nothing -// gets deleted. -testVim('yw_repeat', function(cm, vim, helpers) { - // Assert that yw does yank newline if it should go to the next line, and - // that repeat works properly. - var curStart = makeCursor(0, 1); - cm.setCursor(curStart); - helpers.doKeys('y', '2', 'w'); - eq(' word1\nword2', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('word1\nword2', register.toString()); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); -}, { value: ' word1\nword2' }); -testVim('yy_multiply_repeat', function(cm, vim, helpers) { - var curStart = makeCursor(0, 3); - cm.setCursor(curStart); - var expectedBuffer = cm.getRange({ line: 0, ch: 0 }, - { line: 6, ch: 0 }); - var expectedLineCount = cm.lineCount(); - helpers.doKeys('2', 'y', '3', 'y'); - eq(expectedLineCount, cm.lineCount()); - var register = helpers.getRegisterController().getRegister(); - eq(expectedBuffer, register.toString()); - is(register.linewise); - eqPos(curStart, cm.getCursor()); -}); -// Change commands behave like d commands except that it also enters insert -// mode. In addition, when the change is linewise, an additional newline is -// inserted so that insert mode starts on that line. -testVim('cw', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('c', '2', 'w'); - eq(' word3', cm.getValue()); - helpers.assertCursorAt(0, 0); -}, { value: 'word1 word2 word3'}); -testVim('cw_repeat', function(cm, vim, helpers) { - // Assert that cw does delete newline if it should go to the next line, and - // that repeat works properly. - var curStart = makeCursor(0, 1); - cm.setCursor(curStart); - helpers.doKeys('c', '2', 'w'); - eq(' ', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('word1\nword2', register.toString()); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); - eq('vim-insert', cm.getOption('keyMap')); -}, { value: ' word1\nword2' }); -testVim('cc_multiply_repeat', function(cm, vim, helpers) { - cm.setCursor(0, 3); - var expectedBuffer = cm.getRange({ line: 0, ch: 0 }, - { line: 6, ch: 0 }); - var expectedLineCount = cm.lineCount() - 5; - helpers.doKeys('2', 'c', '3', 'c'); - eq(expectedLineCount, cm.lineCount()); - var register = helpers.getRegisterController().getRegister(); - eq(expectedBuffer, register.toString()); - is(register.linewise); - eq('vim-insert', cm.getOption('keyMap')); -}); -testVim('ct', function(cm, vim, helpers) { - cm.setCursor(0, 9); - helpers.doKeys('c', 't', 'w'); - eq(' word1 word3', cm.getValue()); - helpers.doKeys('', 'c', '|'); - eq(' word3', cm.getValue()); - helpers.assertCursorAt(0, 0); - helpers.doKeys('', '2', 'u', 'w', 'h'); - helpers.doKeys('c', '2', 'g', 'e'); - eq(' wordword3', cm.getValue()); -}, { value: ' word1 word2 word3'}); -testVim('cc_should_not_append_to_document', function(cm, vim, helpers) { - var expectedLineCount = cm.lineCount(); - cm.setCursor(cm.lastLine(), 0); - helpers.doKeys('c', 'c'); - eq(expectedLineCount, cm.lineCount()); -}); -function fillArray(val, times) { - var arr = []; - for (var i = 0; i < times; i++) { - arr.push(val); - } - return arr; -} -testVim('c_visual_block', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('', '2', 'j', 'l', 'l', 'l', 'c'); - var replacement = fillArray('hello', 3); - cm.replaceSelections(replacement); - eq('1hello\n5hello\nahellofg', cm.getValue()); - helpers.doKeys(''); - cm.setCursor(2, 3); - helpers.doKeys('', '2', 'k', 'h', 'C'); - replacement = fillArray('world', 3); - cm.replaceSelections(replacement); - eq('1hworld\n5hworld\nahworld', cm.getValue()); -}, {value: '1234\n5678\nabcdefg'}); -testVim('c_visual_block_replay', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('', '2', 'j', 'l', 'c'); - var replacement = fillArray('fo', 3); - cm.replaceSelections(replacement); - eq('1fo4\n5fo8\nafodefg', cm.getValue()); - helpers.doKeys(''); - cm.setCursor(0, 0); - helpers.doKeys('.'); - eq('foo4\nfoo8\nfoodefg', cm.getValue()); -}, {value: '1234\n5678\nabcdefg'}); - -testVim('d_visual_block', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('', '2', 'j', 'l', 'l', 'l', 'd'); - eq('1\n5\nafg', cm.getValue()); -}, {value: '1234\n5678\nabcdefg'}); -testVim('D_visual_block', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('', '2', 'j', 'l', 'D'); - eq('1\n5\na', cm.getValue()); -}, {value: '1234\n5678\nabcdefg'}); - -// Swapcase commands edit in place and do not modify registers. -testVim('g~w_repeat', function(cm, vim, helpers) { - // Assert that dw does delete newline if it should go to the next line, and - // that repeat works properly. - var curStart = makeCursor(0, 1); - cm.setCursor(curStart); - helpers.doKeys('g', '~', '2', 'w'); - eq(' WORD1\nWORD2', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('', register.toString()); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); -}, { value: ' word1\nword2' }); -testVim('g~g~', function(cm, vim, helpers) { - var curStart = makeCursor(0, 3); - cm.setCursor(curStart); - var expectedLineCount = cm.lineCount(); - var expectedValue = cm.getValue().toUpperCase(); - helpers.doKeys('2', 'g', '~', '3', 'g', '~'); - eq(expectedValue, cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('', register.toString()); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); -}, { value: ' word1\nword2\nword3\nword4\nword5\nword6' }); -testVim('gu_and_gU', function(cm, vim, helpers) { - var curStart = makeCursor(0, 7); - var value = cm.getValue(); - cm.setCursor(curStart); - helpers.doKeys('2', 'g', 'U', 'w'); - eq(cm.getValue(), 'wa wb xX WC wd'); - eqPos(curStart, cm.getCursor()); - helpers.doKeys('2', 'g', 'u', 'w'); - eq(cm.getValue(), value); - - helpers.doKeys('2', 'g', 'U', 'B'); - eq(cm.getValue(), 'wa WB Xx wc wd'); - eqPos(makeCursor(0, 3), cm.getCursor()); - - cm.setCursor(makeCursor(0, 4)); - helpers.doKeys('g', 'u', 'i', 'w'); - eq(cm.getValue(), 'wa wb Xx wc wd'); - eqPos(makeCursor(0, 3), cm.getCursor()); - - // TODO: support gUgU guu - // eqPos(makeCursor(0, 0), cm.getCursor()); - - var register = helpers.getRegisterController().getRegister(); - eq('', register.toString()); - is(!register.linewise); -}, { value: 'wa wb xx wc wd' }); -testVim('visual_block_~', function(cm, vim, helpers) { - cm.setCursor(1, 1); - helpers.doKeys('', 'l', 'l', 'j', '~'); - helpers.assertCursorAt(1, 1); - eq('hello\nwoRLd\naBCDe', cm.getValue()); - cm.setCursor(2, 0); - helpers.doKeys('v', 'l', 'l', '~'); - helpers.assertCursorAt(2, 0); - eq('hello\nwoRLd\nAbcDe', cm.getValue()); -},{value: 'hello\nwOrld\nabcde' }); -testVim('._swapCase_visualBlock', function(cm, vim, helpers) { - helpers.doKeys('', 'j', 'j', 'l', '~'); - cm.setCursor(0, 3); - helpers.doKeys('.'); - eq('HelLO\nWorLd\nAbcdE', cm.getValue()); -},{value: 'hEllo\nwOrlD\naBcDe' }); -testVim('._delete_visualBlock', function(cm, vim, helpers) { - helpers.doKeys('', 'j', 'x'); - eq('ive\ne\nsome\nsugar', cm.getValue()); - helpers.doKeys('.'); - eq('ve\n\nsome\nsugar', cm.getValue()); - helpers.doKeys('j', 'j', '.'); - eq('ve\n\nome\nugar', cm.getValue()); - helpers.doKeys('u', '', '.'); - eq('ve\n\nme\ngar', cm.getValue()); -},{value: 'give\nme\nsome\nsugar' }); -testVim('>{motion}', function(cm, vim, helpers) { - cm.setCursor(1, 3); - var expectedLineCount = cm.lineCount(); - var expectedValue = ' word1\n word2\nword3 '; - helpers.doKeys('>', 'k'); - eq(expectedValue, cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 3); -}, { value: ' word1\nword2\nword3 ', indentUnit: 2 }); -testVim('>>', function(cm, vim, helpers) { - cm.setCursor(0, 3); - var expectedLineCount = cm.lineCount(); - var expectedValue = ' word1\n word2\nword3 '; - helpers.doKeys('2', '>', '>'); - eq(expectedValue, cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 3); -}, { value: ' word1\nword2\nword3 ', indentUnit: 2 }); -testVim('<{motion}', function(cm, vim, helpers) { - cm.setCursor(1, 3); - var expectedLineCount = cm.lineCount(); - var expectedValue = ' word1\nword2\nword3 '; - helpers.doKeys('<', 'k'); - eq(expectedValue, cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 1); -}, { value: ' word1\n word2\nword3 ', indentUnit: 2 }); -testVim('<<', function(cm, vim, helpers) { - cm.setCursor(0, 3); - var expectedLineCount = cm.lineCount(); - var expectedValue = ' word1\nword2\nword3 '; - helpers.doKeys('2', '<', '<'); - eq(expectedValue, cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 1); -}, { value: ' word1\n word2\nword3 ', indentUnit: 2 }); - -// Edit tests -function testEdit(name, before, pos, edit, after) { - return testVim(name, function(cm, vim, helpers) { - var ch = before.search(pos) - var line = before.substring(0, ch).split('\n').length - 1; - if (line) { - ch = before.substring(0, ch).split('\n').pop().length; - } - cm.setCursor(line, ch); - helpers.doKeys.apply(this, edit.split('')); - eq(after, cm.getValue()); - }, {value: before}); -} - -// These Delete tests effectively cover word-wise Change, Visual & Yank. -// Tabs are used as differentiated whitespace to catch edge cases. -// Normal word: -testEdit('diw_mid_spc', 'foo \tbAr\t baz', /A/, 'diw', 'foo \t\t baz'); -testEdit('daw_mid_spc', 'foo \tbAr\t baz', /A/, 'daw', 'foo \tbaz'); -testEdit('diw_mid_punct', 'foo \tbAr.\t baz', /A/, 'diw', 'foo \t.\t baz'); -testEdit('daw_mid_punct', 'foo \tbAr.\t baz', /A/, 'daw', 'foo.\t baz'); -testEdit('diw_mid_punct2', 'foo \t,bAr.\t baz', /A/, 'diw', 'foo \t,.\t baz'); -testEdit('daw_mid_punct2', 'foo \t,bAr.\t baz', /A/, 'daw', 'foo \t,.\t baz'); -testEdit('diw_start_spc', 'bAr \tbaz', /A/, 'diw', ' \tbaz'); -testEdit('daw_start_spc', 'bAr \tbaz', /A/, 'daw', 'baz'); -testEdit('diw_start_punct', 'bAr. \tbaz', /A/, 'diw', '. \tbaz'); -testEdit('daw_start_punct', 'bAr. \tbaz', /A/, 'daw', '. \tbaz'); -testEdit('diw_end_spc', 'foo \tbAr', /A/, 'diw', 'foo \t'); -testEdit('daw_end_spc', 'foo \tbAr', /A/, 'daw', 'foo'); -testEdit('diw_end_punct', 'foo \tbAr.', /A/, 'diw', 'foo \t.'); -testEdit('daw_end_punct', 'foo \tbAr.', /A/, 'daw', 'foo.'); -// Big word: -testEdit('diW_mid_spc', 'foo \tbAr\t baz', /A/, 'diW', 'foo \t\t baz'); -testEdit('daW_mid_spc', 'foo \tbAr\t baz', /A/, 'daW', 'foo \tbaz'); -testEdit('diW_mid_punct', 'foo \tbAr.\t baz', /A/, 'diW', 'foo \t\t baz'); -testEdit('daW_mid_punct', 'foo \tbAr.\t baz', /A/, 'daW', 'foo \tbaz'); -testEdit('diW_mid_punct2', 'foo \t,bAr.\t baz', /A/, 'diW', 'foo \t\t baz'); -testEdit('daW_mid_punct2', 'foo \t,bAr.\t baz', /A/, 'daW', 'foo \tbaz'); -testEdit('diW_start_spc', 'bAr\t baz', /A/, 'diW', '\t baz'); -testEdit('daW_start_spc', 'bAr\t baz', /A/, 'daW', 'baz'); -testEdit('diW_start_punct', 'bAr.\t baz', /A/, 'diW', '\t baz'); -testEdit('daW_start_punct', 'bAr.\t baz', /A/, 'daW', 'baz'); -testEdit('diW_end_spc', 'foo \tbAr', /A/, 'diW', 'foo \t'); -testEdit('daW_end_spc', 'foo \tbAr', /A/, 'daW', 'foo'); -testEdit('diW_end_punct', 'foo \tbAr.', /A/, 'diW', 'foo \t'); -testEdit('daW_end_punct', 'foo \tbAr.', /A/, 'daW', 'foo'); -// Deleting text objects -// Open and close on same line -testEdit('di(_open_spc', 'foo (bAr) baz', /\(/, 'di(', 'foo () baz'); -testEdit('di)_open_spc', 'foo (bAr) baz', /\(/, 'di)', 'foo () baz'); -testEdit('dib_open_spc', 'foo (bAr) baz', /\(/, 'dib', 'foo () baz'); -testEdit('da(_open_spc', 'foo (bAr) baz', /\(/, 'da(', 'foo baz'); -testEdit('da)_open_spc', 'foo (bAr) baz', /\(/, 'da)', 'foo baz'); - -testEdit('di(_middle_spc', 'foo (bAr) baz', /A/, 'di(', 'foo () baz'); -testEdit('di)_middle_spc', 'foo (bAr) baz', /A/, 'di)', 'foo () baz'); -testEdit('da(_middle_spc', 'foo (bAr) baz', /A/, 'da(', 'foo baz'); -testEdit('da)_middle_spc', 'foo (bAr) baz', /A/, 'da)', 'foo baz'); - -testEdit('di(_close_spc', 'foo (bAr) baz', /\)/, 'di(', 'foo () baz'); -testEdit('di)_close_spc', 'foo (bAr) baz', /\)/, 'di)', 'foo () baz'); -testEdit('da(_close_spc', 'foo (bAr) baz', /\)/, 'da(', 'foo baz'); -testEdit('da)_close_spc', 'foo (bAr) baz', /\)/, 'da)', 'foo baz'); - -// delete around and inner b. -testEdit('dab_on_(_should_delete_around_()block', 'o( in(abc) )', /\(a/, 'dab', 'o( in )'); - -// delete around and inner B. -testEdit('daB_on_{_should_delete_around_{}block', 'o{ in{abc} }', /{a/, 'daB', 'o{ in }'); -testEdit('diB_on_{_should_delete_inner_{}block', 'o{ in{abc} }', /{a/, 'diB', 'o{ in{} }'); - -testEdit('da{_on_{_should_delete_inner_block', 'o{ in{abc} }', /{a/, 'da{', 'o{ in }'); -testEdit('di[_on_(_should_not_delete', 'foo (bAr) baz', /\(/, 'di[', 'foo (bAr) baz'); -testEdit('di[_on_)_should_not_delete', 'foo (bAr) baz', /\)/, 'di[', 'foo (bAr) baz'); -testEdit('da[_on_(_should_not_delete', 'foo (bAr) baz', /\(/, 'da[', 'foo (bAr) baz'); -testEdit('da[_on_)_should_not_delete', 'foo (bAr) baz', /\)/, 'da[', 'foo (bAr) baz'); -testMotion('di(_outside_should_stay', ['d', 'i', '('], { line: 0, ch: 0}, { line: 0, ch: 0}); - -// Open and close on different lines, equally indented -testEdit('di{_middle_spc', 'a{\n\tbar\n}b', /r/, 'di{', 'a{}b'); -testEdit('di}_middle_spc', 'a{\n\tbar\n}b', /r/, 'di}', 'a{}b'); -testEdit('da{_middle_spc', 'a{\n\tbar\n}b', /r/, 'da{', 'ab'); -testEdit('da}_middle_spc', 'a{\n\tbar\n}b', /r/, 'da}', 'ab'); -testEdit('daB_middle_spc', 'a{\n\tbar\n}b', /r/, 'daB', 'ab'); - -// open and close on diff lines, open indented less than close -testEdit('di{_middle_spc', 'a{\n\tbar\n\t}b', /r/, 'di{', 'a{}b'); -testEdit('di}_middle_spc', 'a{\n\tbar\n\t}b', /r/, 'di}', 'a{}b'); -testEdit('da{_middle_spc', 'a{\n\tbar\n\t}b', /r/, 'da{', 'ab'); -testEdit('da}_middle_spc', 'a{\n\tbar\n\t}b', /r/, 'da}', 'ab'); - -// open and close on diff lines, open indented more than close -testEdit('di[_middle_spc', 'a\t[\n\tbar\n]b', /r/, 'di[', 'a\t[]b'); -testEdit('di]_middle_spc', 'a\t[\n\tbar\n]b', /r/, 'di]', 'a\t[]b'); -testEdit('da[_middle_spc', 'a\t[\n\tbar\n]b', /r/, 'da[', 'a\tb'); -testEdit('da]_middle_spc', 'a\t[\n\tbar\n]b', /r/, 'da]', 'a\tb'); - -function testSelection(name, before, pos, keys, sel) { - return testVim(name, function(cm, vim, helpers) { - var ch = before.search(pos) - var line = before.substring(0, ch).split('\n').length - 1; - if (line) { - ch = before.substring(0, ch).split('\n').pop().length; - } - cm.setCursor(line, ch); - helpers.doKeys.apply(this, keys.split('')); - eq(sel, cm.getSelection()); - }, {value: before}); -} -testSelection('viw_middle_spc', 'foo \tbAr\t baz', /A/, 'viw', 'bAr'); -testSelection('vaw_middle_spc', 'foo \tbAr\t baz', /A/, 'vaw', 'bAr\t '); -testSelection('viw_middle_punct', 'foo \tbAr,\t baz', /A/, 'viw', 'bAr'); -testSelection('vaW_middle_punct', 'foo \tbAr,\t baz', /A/, 'vaW', 'bAr,\t '); -testSelection('viw_start_spc', 'foo \tbAr\t baz', /b/, 'viw', 'bAr'); -testSelection('viw_end_spc', 'foo \tbAr\t baz', /r/, 'viw', 'bAr'); -testSelection('viw_eol', 'foo \tbAr', /r/, 'viw', 'bAr'); -testSelection('vi{_middle_spc', 'a{\n\tbar\n\t}b', /r/, 'vi{', '\n\tbar\n\t'); -testSelection('va{_middle_spc', 'a{\n\tbar\n\t}b', /r/, 'va{', '{\n\tbar\n\t}'); - -testVim('mouse_select', function(cm, vim, helpers) { - cm.setSelection(Pos(0, 2), Pos(0, 4), {origin: '*mouse'}); - is(cm.state.vim.visualMode); - is(!cm.state.vim.visualLine); - is(!cm.state.vim.visualBlock); - helpers.doKeys(''); - is(!cm.somethingSelected()); - helpers.doKeys('g', 'v'); - eq('cd', cm.getSelection()); -}, {value: 'abcdef'}); - -// Operator-motion tests -testVim('D', function(cm, vim, helpers) { - cm.setCursor(0, 3); - helpers.doKeys('D'); - eq(' wo\nword2\n word3', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('rd1', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 2); -}, { value: ' word1\nword2\n word3' }); -testVim('C', function(cm, vim, helpers) { - var curStart = makeCursor(0, 3); - cm.setCursor(curStart); - helpers.doKeys('C'); - eq(' wo\nword2\n word3', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('rd1', register.toString()); - is(!register.linewise); - eqPos(curStart, cm.getCursor()); - eq('vim-insert', cm.getOption('keyMap')); -}, { value: ' word1\nword2\n word3' }); -testVim('Y', function(cm, vim, helpers) { - var curStart = makeCursor(0, 3); - cm.setCursor(curStart); - helpers.doKeys('Y'); - eq(' word1\nword2\n word3', cm.getValue()); - var register = helpers.getRegisterController().getRegister(); - eq('rd1', register.toString()); - is(!register.linewise); - helpers.assertCursorAt(0, 3); -}, { value: ' word1\nword2\n word3' }); -testVim('~', function(cm, vim, helpers) { - helpers.doKeys('3', '~'); - eq('ABCdefg', cm.getValue()); - helpers.assertCursorAt(0, 3); -}, { value: 'abcdefg' }); - -// Action tests -testVim('ctrl-a', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys(''); - eq('-9', cm.getValue()); - helpers.assertCursorAt(0, 1); - helpers.doKeys('2',''); - eq('-7', cm.getValue()); -}, {value: '-10'}); -testVim('ctrl-x', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys(''); - eq('-1', cm.getValue()); - helpers.assertCursorAt(0, 1); - helpers.doKeys('2',''); - eq('-3', cm.getValue()); -}, {value: '0'}); -testVim('/ search forward', function(cm, vim, helpers) { - forEach(['', ''], function(key) { - cm.setCursor(0, 0); - helpers.doKeys(key); - helpers.assertCursorAt(0, 5); - helpers.doKeys('l'); - helpers.doKeys(key); - helpers.assertCursorAt(0, 10); - cm.setCursor(0, 11); - helpers.doKeys(key); - helpers.assertCursorAt(0, 11); - }); -}, {value: '__jmp1 jmp2 jmp'}); -testVim('a', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('a'); - helpers.assertCursorAt(0, 2); - eq('vim-insert', cm.getOption('keyMap')); -}); -testVim('a_eol', function(cm, vim, helpers) { - cm.setCursor(0, lines[0].length - 1); - helpers.doKeys('a'); - helpers.assertCursorAt(0, lines[0].length); - eq('vim-insert', cm.getOption('keyMap')); -}); -testVim('A_endOfSelectedArea', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('v', 'j', 'l'); - helpers.doKeys('A'); - helpers.assertCursorAt(1, 2); - eq('vim-insert', cm.getOption('keyMap')); -}, {value: 'foo\nbar'}); -testVim('i', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('i'); - helpers.assertCursorAt(0, 1); - eq('vim-insert', cm.getOption('keyMap')); -}); -testVim('i_repeat', function(cm, vim, helpers) { - helpers.doKeys('3', 'i'); - cm.replaceRange('test', cm.getCursor()); - helpers.doKeys(''); - eq('testtesttest', cm.getValue()); - helpers.assertCursorAt(0, 11); -}, { value: '' }); -testVim('i_repeat_delete', function(cm, vim, helpers) { - cm.setCursor(0, 4); - helpers.doKeys('2', 'i'); - cm.replaceRange('z', cm.getCursor()); - helpers.doInsertModeKeys('Backspace', 'Backspace'); - helpers.doKeys(''); - eq('abe', cm.getValue()); - helpers.assertCursorAt(0, 1); -}, { value: 'abcde' }); -testVim('A', function(cm, vim, helpers) { - helpers.doKeys('A'); - helpers.assertCursorAt(0, lines[0].length); - eq('vim-insert', cm.getOption('keyMap')); -}); -testVim('A_visual_block', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('', '2', 'j', 'l', 'l', 'A'); - var replacement = new Array(cm.listSelections().length+1).join('hello ').split(' '); - replacement.pop(); - cm.replaceSelections(replacement); - eq('testhello\nmehello\npleahellose', cm.getValue()); - helpers.doKeys(''); - cm.setCursor(0, 0); - helpers.doKeys('.'); - // TODO this doesn't work yet - // eq('teshellothello\nme hello hello\nplehelloahellose', cm.getValue()); -}, {value: 'test\nme\nplease'}); -testVim('I', function(cm, vim, helpers) { - cm.setCursor(0, 4); - helpers.doKeys('I'); - helpers.assertCursorAt(0, lines[0].textStart); - eq('vim-insert', cm.getOption('keyMap')); -}); -testVim('I_repeat', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('3', 'I'); - cm.replaceRange('test', cm.getCursor()); - helpers.doKeys(''); - eq('testtesttestblah', cm.getValue()); - helpers.assertCursorAt(0, 11); -}, { value: 'blah' }); -testVim('I_visual_block', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('', '2', 'j', 'l', 'l', 'I'); - var replacement = new Array(cm.listSelections().length+1).join('hello ').split(' '); - replacement.pop(); - cm.replaceSelections(replacement); - eq('hellotest\nhellome\nhelloplease', cm.getValue()); -}, {value: 'test\nme\nplease'}); -testVim('o', function(cm, vim, helpers) { - cm.setCursor(0, 4); - helpers.doKeys('o'); - eq('word1\n\nword2', cm.getValue()); - helpers.assertCursorAt(1, 0); - eq('vim-insert', cm.getOption('keyMap')); -}, { value: 'word1\nword2' }); -testVim('o_repeat', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('3', 'o'); - cm.replaceRange('test', cm.getCursor()); - helpers.doKeys(''); - eq('\ntest\ntest\ntest', cm.getValue()); - helpers.assertCursorAt(3, 3); -}, { value: '' }); -testVim('O', function(cm, vim, helpers) { - cm.setCursor(0, 4); - helpers.doKeys('O'); - eq('\nword1\nword2', cm.getValue()); - helpers.assertCursorAt(0, 0); - eq('vim-insert', cm.getOption('keyMap')); -}, { value: 'word1\nword2' }); -testVim('J', function(cm, vim, helpers) { - cm.setCursor(0, 4); - helpers.doKeys('J'); - var expectedValue = 'word1 word2\nword3\n word4'; - eq(expectedValue, cm.getValue()); - helpers.assertCursorAt(0, expectedValue.indexOf('word2') - 1); -}, { value: 'word1 \n word2\nword3\n word4' }); -testVim('J_repeat', function(cm, vim, helpers) { - cm.setCursor(0, 4); - helpers.doKeys('3', 'J'); - var expectedValue = 'word1 word2 word3\n word4'; - eq(expectedValue, cm.getValue()); - helpers.assertCursorAt(0, expectedValue.indexOf('word3') - 1); -}, { value: 'word1 \n word2\nword3\n word4' }); -testVim('p', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.getRegisterController().pushText('"', 'yank', 'abc\ndef', false); - helpers.doKeys('p'); - eq('__abc\ndef_', cm.getValue()); - helpers.assertCursorAt(1, 2); -}, { value: '___' }); -testVim('p_register', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.getRegisterController().getRegister('a').setText('abc\ndef', false); - helpers.doKeys('"', 'a', 'p'); - eq('__abc\ndef_', cm.getValue()); - helpers.assertCursorAt(1, 2); -}, { value: '___' }); -testVim('p_wrong_register', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.getRegisterController().getRegister('a').setText('abc\ndef', false); - helpers.doKeys('p'); - eq('___', cm.getValue()); - helpers.assertCursorAt(0, 1); -}, { value: '___' }); -testVim('p_line', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.getRegisterController().pushText('"', 'yank', ' a\nd\n', true); - helpers.doKeys('2', 'p'); - eq('___\n a\nd\n a\nd', cm.getValue()); - helpers.assertCursorAt(1, 2); -}, { value: '___' }); -testVim('p_lastline', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.getRegisterController().pushText('"', 'yank', ' a\nd', true); - helpers.doKeys('2', 'p'); - eq('___\n a\nd\n a\nd', cm.getValue()); - helpers.assertCursorAt(1, 2); -}, { value: '___' }); -testVim(']p_first_indent_is_smaller', function(cm, vim, helpers) { - helpers.getRegisterController().pushText('"', 'yank', ' abc\n def\n', true); - helpers.doKeys(']', 'p'); - eq(' ___\n abc\n def', cm.getValue()); -}, { value: ' ___' }); -testVim(']p_first_indent_is_larger', function(cm, vim, helpers) { - helpers.getRegisterController().pushText('"', 'yank', ' abc\n def\n', true); - helpers.doKeys(']', 'p'); - eq(' ___\n abc\ndef', cm.getValue()); -}, { value: ' ___' }); -testVim(']p_with_tab_indents', function(cm, vim, helpers) { - helpers.getRegisterController().pushText('"', 'yank', '\t\tabc\n\t\t\tdef\n', true); - helpers.doKeys(']', 'p'); - eq('\t___\n\tabc\n\t\tdef', cm.getValue()); -}, { value: '\t___', indentWithTabs: true}); -testVim(']p_with_spaces_translated_to_tabs', function(cm, vim, helpers) { - helpers.getRegisterController().pushText('"', 'yank', ' abc\n def\n', true); - helpers.doKeys(']', 'p'); - eq('\t___\n\tabc\n\t\tdef', cm.getValue()); -}, { value: '\t___', indentWithTabs: true, tabSize: 2 }); -testVim('[p', function(cm, vim, helpers) { - helpers.getRegisterController().pushText('"', 'yank', ' abc\n def\n', true); - helpers.doKeys('[', 'p'); - eq(' abc\n def\n ___', cm.getValue()); -}, { value: ' ___' }); -testVim('P', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.getRegisterController().pushText('"', 'yank', 'abc\ndef', false); - helpers.doKeys('P'); - eq('_abc\ndef__', cm.getValue()); - helpers.assertCursorAt(1, 3); -}, { value: '___' }); -testVim('P_line', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.getRegisterController().pushText('"', 'yank', ' a\nd\n', true); - helpers.doKeys('2', 'P'); - eq(' a\nd\n a\nd\n___', cm.getValue()); - helpers.assertCursorAt(0, 2); -}, { value: '___' }); -testVim('r', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('3', 'r', 'u'); - eq('wuuuet\nanother', cm.getValue(),'3r failed'); - helpers.assertCursorAt(0, 3); - cm.setCursor(0, 4); - helpers.doKeys('v', 'j', 'h', 'r', ''); - eq('wuuu \n her', cm.getValue(),'Replacing selection by space-characters failed'); -}, { value: 'wordet\nanother' }); -testVim('r_visual_block', function(cm, vim, helpers) { - cm.setCursor(2, 3); - helpers.doKeys('', 'k', 'k', 'h', 'h', 'r', 'l'); - eq('1lll\n5lll\nalllefg', cm.getValue()); - helpers.doKeys('', 'l', 'j', 'r', ''); - eq('1 l\n5 l\nalllefg', cm.getValue()); - cm.setCursor(2, 0); - helpers.doKeys('o'); - helpers.doKeys(''); - cm.replaceRange('\t\t', cm.getCursor()); - helpers.doKeys('', 'h', 'h', 'r', 'r'); - eq('1 l\n5 l\nalllefg\nrrrrrrrr', cm.getValue()); -}, {value: '1234\n5678\nabcdefg'}); -testVim('R', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('R'); - helpers.assertCursorAt(0, 1); - eq('vim-replace', cm.getOption('keyMap')); - is(cm.state.overwrite, 'Setting overwrite state failed'); -}); -testVim('mark', function(cm, vim, helpers) { - cm.setCursor(2, 2); - helpers.doKeys('m', 't'); - cm.setCursor(0, 0); - helpers.doKeys('`', 't'); - helpers.assertCursorAt(2, 2); - cm.setCursor(2, 0); - cm.replaceRange(' h', cm.getCursor()); - cm.setCursor(0, 0); - helpers.doKeys('\'', 't'); - helpers.assertCursorAt(2, 3); -}); -testVim('jumpToMark_next', function(cm, vim, helpers) { - cm.setCursor(2, 2); - helpers.doKeys('m', 't'); - cm.setCursor(0, 0); - helpers.doKeys(']', '`'); - helpers.assertCursorAt(2, 2); - cm.setCursor(0, 0); - helpers.doKeys(']', '\''); - helpers.assertCursorAt(2, 0); -}); -testVim('jumpToMark_next_repeat', function(cm, vim, helpers) { - cm.setCursor(2, 2); - helpers.doKeys('m', 'a'); - cm.setCursor(3, 2); - helpers.doKeys('m', 'b'); - cm.setCursor(4, 2); - helpers.doKeys('m', 'c'); - cm.setCursor(0, 0); - helpers.doKeys('2', ']', '`'); - helpers.assertCursorAt(3, 2); - cm.setCursor(0, 0); - helpers.doKeys('2', ']', '\''); - helpers.assertCursorAt(3, 1); -}); -testVim('jumpToMark_next_sameline', function(cm, vim, helpers) { - cm.setCursor(2, 0); - helpers.doKeys('m', 'a'); - cm.setCursor(2, 4); - helpers.doKeys('m', 'b'); - cm.setCursor(2, 2); - helpers.doKeys(']', '`'); - helpers.assertCursorAt(2, 4); -}); -testVim('jumpToMark_next_onlyprev', function(cm, vim, helpers) { - cm.setCursor(2, 0); - helpers.doKeys('m', 'a'); - cm.setCursor(4, 0); - helpers.doKeys(']', '`'); - helpers.assertCursorAt(4, 0); -}); -testVim('jumpToMark_next_nomark', function(cm, vim, helpers) { - cm.setCursor(2, 2); - helpers.doKeys(']', '`'); - helpers.assertCursorAt(2, 2); - helpers.doKeys(']', '\''); - helpers.assertCursorAt(2, 0); -}); -testVim('jumpToMark_next_linewise_over', function(cm, vim, helpers) { - cm.setCursor(2, 2); - helpers.doKeys('m', 'a'); - cm.setCursor(3, 4); - helpers.doKeys('m', 'b'); - cm.setCursor(2, 1); - helpers.doKeys(']', '\''); - helpers.assertCursorAt(3, 1); -}); -testVim('jumpToMark_next_action', function(cm, vim, helpers) { - cm.setCursor(2, 2); - helpers.doKeys('m', 't'); - cm.setCursor(0, 0); - helpers.doKeys('d', ']', '`'); - helpers.assertCursorAt(0, 0); - var actual = cm.getLine(0); - var expected = 'pop pop 0 1 2 3 4'; - eq(actual, expected, "Deleting while jumping to the next mark failed."); -}); -testVim('jumpToMark_next_line_action', function(cm, vim, helpers) { - cm.setCursor(2, 2); - helpers.doKeys('m', 't'); - cm.setCursor(0, 0); - helpers.doKeys('d', ']', '\''); - helpers.assertCursorAt(0, 1); - var actual = cm.getLine(0); - var expected = ' (a) [b] {c} ' - eq(actual, expected, "Deleting while jumping to the next mark line failed."); -}); -testVim('jumpToMark_prev', function(cm, vim, helpers) { - cm.setCursor(2, 2); - helpers.doKeys('m', 't'); - cm.setCursor(4, 0); - helpers.doKeys('[', '`'); - helpers.assertCursorAt(2, 2); - cm.setCursor(4, 0); - helpers.doKeys('[', '\''); - helpers.assertCursorAt(2, 0); -}); -testVim('jumpToMark_prev_repeat', function(cm, vim, helpers) { - cm.setCursor(2, 2); - helpers.doKeys('m', 'a'); - cm.setCursor(3, 2); - helpers.doKeys('m', 'b'); - cm.setCursor(4, 2); - helpers.doKeys('m', 'c'); - cm.setCursor(5, 0); - helpers.doKeys('2', '[', '`'); - helpers.assertCursorAt(3, 2); - cm.setCursor(5, 0); - helpers.doKeys('2', '[', '\''); - helpers.assertCursorAt(3, 1); -}); -testVim('jumpToMark_prev_sameline', function(cm, vim, helpers) { - cm.setCursor(2, 0); - helpers.doKeys('m', 'a'); - cm.setCursor(2, 4); - helpers.doKeys('m', 'b'); - cm.setCursor(2, 2); - helpers.doKeys('[', '`'); - helpers.assertCursorAt(2, 0); -}); -testVim('jumpToMark_prev_onlynext', function(cm, vim, helpers) { - cm.setCursor(4, 4); - helpers.doKeys('m', 'a'); - cm.setCursor(2, 0); - helpers.doKeys('[', '`'); - helpers.assertCursorAt(2, 0); -}); -testVim('jumpToMark_prev_nomark', function(cm, vim, helpers) { - cm.setCursor(2, 2); - helpers.doKeys('[', '`'); - helpers.assertCursorAt(2, 2); - helpers.doKeys('[', '\''); - helpers.assertCursorAt(2, 0); -}); -testVim('jumpToMark_prev_linewise_over', function(cm, vim, helpers) { - cm.setCursor(2, 2); - helpers.doKeys('m', 'a'); - cm.setCursor(3, 4); - helpers.doKeys('m', 'b'); - cm.setCursor(3, 6); - helpers.doKeys('[', '\''); - helpers.assertCursorAt(2, 0); -}); -testVim('delmark_single', function(cm, vim, helpers) { - cm.setCursor(1, 2); - helpers.doKeys('m', 't'); - helpers.doEx('delmarks t'); - cm.setCursor(0, 0); - helpers.doKeys('`', 't'); - helpers.assertCursorAt(0, 0); -}); -testVim('delmark_range', function(cm, vim, helpers) { - cm.setCursor(1, 2); - helpers.doKeys('m', 'a'); - cm.setCursor(2, 2); - helpers.doKeys('m', 'b'); - cm.setCursor(3, 2); - helpers.doKeys('m', 'c'); - cm.setCursor(4, 2); - helpers.doKeys('m', 'd'); - cm.setCursor(5, 2); - helpers.doKeys('m', 'e'); - helpers.doEx('delmarks b-d'); - cm.setCursor(0, 0); - helpers.doKeys('`', 'a'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'b'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'c'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'd'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'e'); - helpers.assertCursorAt(5, 2); -}); -testVim('delmark_multi', function(cm, vim, helpers) { - cm.setCursor(1, 2); - helpers.doKeys('m', 'a'); - cm.setCursor(2, 2); - helpers.doKeys('m', 'b'); - cm.setCursor(3, 2); - helpers.doKeys('m', 'c'); - cm.setCursor(4, 2); - helpers.doKeys('m', 'd'); - cm.setCursor(5, 2); - helpers.doKeys('m', 'e'); - helpers.doEx('delmarks bcd'); - cm.setCursor(0, 0); - helpers.doKeys('`', 'a'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'b'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'c'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'd'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'e'); - helpers.assertCursorAt(5, 2); -}); -testVim('delmark_multi_space', function(cm, vim, helpers) { - cm.setCursor(1, 2); - helpers.doKeys('m', 'a'); - cm.setCursor(2, 2); - helpers.doKeys('m', 'b'); - cm.setCursor(3, 2); - helpers.doKeys('m', 'c'); - cm.setCursor(4, 2); - helpers.doKeys('m', 'd'); - cm.setCursor(5, 2); - helpers.doKeys('m', 'e'); - helpers.doEx('delmarks b c d'); - cm.setCursor(0, 0); - helpers.doKeys('`', 'a'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'b'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'c'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'd'); - helpers.assertCursorAt(1, 2); - helpers.doKeys('`', 'e'); - helpers.assertCursorAt(5, 2); -}); -testVim('delmark_all', function(cm, vim, helpers) { - cm.setCursor(1, 2); - helpers.doKeys('m', 'a'); - cm.setCursor(2, 2); - helpers.doKeys('m', 'b'); - cm.setCursor(3, 2); - helpers.doKeys('m', 'c'); - cm.setCursor(4, 2); - helpers.doKeys('m', 'd'); - cm.setCursor(5, 2); - helpers.doKeys('m', 'e'); - helpers.doEx('delmarks a b-de'); - cm.setCursor(0, 0); - helpers.doKeys('`', 'a'); - helpers.assertCursorAt(0, 0); - helpers.doKeys('`', 'b'); - helpers.assertCursorAt(0, 0); - helpers.doKeys('`', 'c'); - helpers.assertCursorAt(0, 0); - helpers.doKeys('`', 'd'); - helpers.assertCursorAt(0, 0); - helpers.doKeys('`', 'e'); - helpers.assertCursorAt(0, 0); -}); -testVim('visual', function(cm, vim, helpers) { - helpers.doKeys('l', 'v', 'l', 'l'); - helpers.assertCursorAt(0, 4); - eqPos(makeCursor(0, 1), cm.getCursor('anchor')); - helpers.doKeys('d'); - eq('15', cm.getValue()); -}, { value: '12345' }); -testVim('visual_yank', function(cm, vim, helpers) { - helpers.doKeys('v', '3', 'l', 'y'); - helpers.assertCursorAt(0, 0); - helpers.doKeys('p'); - eq('aa te test for yank', cm.getValue()); -}, { value: 'a test for yank' }) -testVim('visual_w', function(cm, vim, helpers) { - helpers.doKeys('v', 'w'); - eq(cm.getSelection(), 'motion t'); -}, { value: 'motion test'}); -testVim('visual_initial_selection', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('v'); - cm.getSelection('n'); -}, { value: 'init'}); -testVim('visual_crossover_left', function(cm, vim, helpers) { - cm.setCursor(0, 2); - helpers.doKeys('v', 'l', 'h', 'h'); - cm.getSelection('ro'); -}, { value: 'cross'}); -testVim('visual_crossover_left', function(cm, vim, helpers) { - cm.setCursor(0, 2); - helpers.doKeys('v', 'h', 'l', 'l'); - cm.getSelection('os'); -}, { value: 'cross'}); -testVim('visual_crossover_up', function(cm, vim, helpers) { - cm.setCursor(3, 2); - helpers.doKeys('v', 'j', 'k', 'k'); - eqPos(Pos(2, 2), cm.getCursor('head')); - eqPos(Pos(3, 3), cm.getCursor('anchor')); - helpers.doKeys('k'); - eqPos(Pos(1, 2), cm.getCursor('head')); - eqPos(Pos(3, 3), cm.getCursor('anchor')); -}, { value: 'cross\ncross\ncross\ncross\ncross\n'}); -testVim('visual_crossover_down', function(cm, vim, helpers) { - cm.setCursor(1, 2); - helpers.doKeys('v', 'k', 'j', 'j'); - eqPos(Pos(2, 3), cm.getCursor('head')); - eqPos(Pos(1, 2), cm.getCursor('anchor')); - helpers.doKeys('j'); - eqPos(Pos(3, 3), cm.getCursor('head')); - eqPos(Pos(1, 2), cm.getCursor('anchor')); -}, { value: 'cross\ncross\ncross\ncross\ncross\n'}); -testVim('visual_exit', function(cm, vim, helpers) { - helpers.doKeys('', 'l', 'j', 'j', ''); - eqPos(cm.getCursor('anchor'), cm.getCursor('head')); - eq(vim.visualMode, false); -}, { value: 'hello\nworld\nfoo' }); -testVim('visual_line', function(cm, vim, helpers) { - helpers.doKeys('l', 'V', 'l', 'j', 'j', 'd'); - eq(' 4\n 5', cm.getValue()); -}, { value: ' 1\n 2\n 3\n 4\n 5' }); -testVim('visual_block_move_to_eol', function(cm, vim, helpers) { - // moveToEol should move all block cursors to end of line - cm.setCursor(0, 0); - helpers.doKeys('', 'G', '$'); - var selections = cm.getSelections().join(); - eq('123,45,6', selections); - // Checks that with cursor at Infinity, finding words backwards still works. - helpers.doKeys('2', 'k', 'b'); - selections = cm.getSelections().join(); - eq('1', selections); -}, {value: '123\n45\n6'}); -testVim('visual_block_different_line_lengths', function(cm, vim, helpers) { - // test the block selection with lines of different length - // i.e. extending the selection - // till the end of the longest line. - helpers.doKeys('', 'l', 'j', 'j', '6', 'l', 'd'); - helpers.doKeys('d', 'd', 'd', 'd'); - eq('', cm.getValue()); -}, {value: '1234\n5678\nabcdefg'}); -testVim('visual_block_truncate_on_short_line', function(cm, vim, helpers) { - // check for left side selection in case - // of moving up to a shorter line. - cm.replaceRange('', cm.getCursor()); - cm.setCursor(3, 4); - helpers.doKeys('', 'l', 'k', 'k', 'd'); - eq('hello world\n{\ntis\nsa!', cm.getValue()); -}, {value: 'hello world\n{\nthis is\nsparta!'}); -testVim('visual_block_corners', function(cm, vim, helpers) { - cm.setCursor(1, 2); - helpers.doKeys('', '2', 'l', 'k'); - // circle around the anchor - // and check the selections - var selections = cm.getSelections(); - eq('345891', selections.join('')); - helpers.doKeys('4', 'h'); - selections = cm.getSelections(); - eq('123678', selections.join('')); - helpers.doKeys('j', 'j'); - selections = cm.getSelections(); - eq('678abc', selections.join('')); - helpers.doKeys('4', 'l'); - selections = cm.getSelections(); - eq('891cde', selections.join('')); -}, {value: '12345\n67891\nabcde'}); -testVim('visual_block_mode_switch', function(cm, vim, helpers) { - // switch between visual modes - cm.setCursor(1, 1); - // blockwise to characterwise visual - helpers.doKeys('', 'j', 'l', 'v'); - selections = cm.getSelections(); - eq('7891\nabc', selections.join('')); - // characterwise to blockwise - helpers.doKeys(''); - selections = cm.getSelections(); - eq('78bc', selections.join('')); - // blockwise to linewise visual - helpers.doKeys('V'); - selections = cm.getSelections(); - eq('67891\nabcde', selections.join('')); -}, {value: '12345\n67891\nabcde'}); -testVim('visual_block_crossing_short_line', function(cm, vim, helpers) { - // visual block with long and short lines - cm.setCursor(0, 3); - helpers.doKeys('', 'j', 'j', 'j'); - var selections = cm.getSelections().join(); - eq('4,,d,b', selections); - helpers.doKeys('3', 'k'); - selections = cm.getSelections().join(); - eq('4', selections); - helpers.doKeys('5', 'j', 'k'); - selections = cm.getSelections().join(""); - eq(10, selections.length); -}, {value: '123456\n78\nabcdefg\nfoobar\n}\n'}); -testVim('visual_block_curPos_on_exit', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('', '3' , 'l', ''); - eqPos(makeCursor(0, 3), cm.getCursor()); - helpers.doKeys('h', '', '2' , 'j' ,'3' , 'l'); - eq(cm.getSelections().join(), "3456,,cdef"); - helpers.doKeys('4' , 'h'); - eq(cm.getSelections().join(), "23,8,bc"); - helpers.doKeys('2' , 'l'); - eq(cm.getSelections().join(), "34,,cd"); -}, {value: '123456\n78\nabcdefg\nfoobar'}); - -testVim('visual_marks', function(cm, vim, helpers) { - helpers.doKeys('l', 'v', 'l', 'l', 'j', 'j', 'v'); - // Test visual mode marks - cm.setCursor(2, 1); - helpers.doKeys('\'', '<'); - helpers.assertCursorAt(0, 1); - helpers.doKeys('\'', '>'); - helpers.assertCursorAt(2, 0); -}); -testVim('visual_join', function(cm, vim, helpers) { - helpers.doKeys('l', 'V', 'l', 'j', 'j', 'J'); - eq(' 1 2 3\n 4\n 5', cm.getValue()); - is(!vim.visualMode); -}, { value: ' 1\n 2\n 3\n 4\n 5' }); -testVim('visual_join_2', function(cm, vim, helpers) { - helpers.doKeys('G', 'V', 'g', 'g', 'J'); - eq('1 2 3 4 5 6 ', cm.getValue()); - is(!vim.visualMode); -}, { value: '1\n2\n3\n4\n5\n6\n'}); -testVim('visual_blank', function(cm, vim, helpers) { - helpers.doKeys('v', 'k'); - eq(vim.visualMode, true); -}, { value: '\n' }); -testVim('reselect_visual', function(cm, vim, helpers) { - helpers.doKeys('l', 'v', 'l', 'l', 'l', 'y', 'g', 'v'); - helpers.assertCursorAt(0, 5); - eqPos(makeCursor(0, 1), cm.getCursor('anchor')); - helpers.doKeys('v'); - cm.setCursor(1, 0); - helpers.doKeys('v', 'l', 'l', 'p'); - eq('123456\n2345\nbar', cm.getValue()); - cm.setCursor(0, 0); - helpers.doKeys('g', 'v'); - // here the fake cursor is at (1, 3) - helpers.assertCursorAt(1, 4); - eqPos(makeCursor(1, 0), cm.getCursor('anchor')); - helpers.doKeys('v'); - cm.setCursor(2, 0); - helpers.doKeys('v', 'l', 'l', 'g', 'v'); - helpers.assertCursorAt(1, 4); - eqPos(makeCursor(1, 0), cm.getCursor('anchor')); - helpers.doKeys('g', 'v'); - helpers.assertCursorAt(2, 3); - eqPos(makeCursor(2, 0), cm.getCursor('anchor')); - eq('123456\n2345\nbar', cm.getValue()); -}, { value: '123456\nfoo\nbar' }); -testVim('reselect_visual_line', function(cm, vim, helpers) { - helpers.doKeys('l', 'V', 'j', 'j', 'V', 'g', 'v', 'd'); - eq('foo\nand\nbar', cm.getValue()); - cm.setCursor(1, 0); - helpers.doKeys('V', 'y', 'j'); - helpers.doKeys('V', 'p' , 'g', 'v', 'd'); - eq('foo\nand', cm.getValue()); -}, { value: 'hello\nthis\nis\nfoo\nand\nbar' }); -testVim('reselect_visual_block', function(cm, vim, helpers) { - cm.setCursor(1, 2); - helpers.doKeys('', 'k', 'h', ''); - cm.setCursor(2, 1); - helpers.doKeys('v', 'l', 'g', 'v'); - eqPos(Pos(1, 2), vim.sel.anchor); - eqPos(Pos(0, 1), vim.sel.head); - // Ensure selection is done with visual block mode rather than one - // continuous range. - eq(cm.getSelections().join(''), '23oo') - helpers.doKeys('g', 'v'); - eqPos(Pos(2, 1), vim.sel.anchor); - eqPos(Pos(2, 2), vim.sel.head); - helpers.doKeys(''); - // Ensure selection of deleted range - cm.setCursor(1, 1); - helpers.doKeys('v', '', 'j', 'd', 'g', 'v'); - eq(cm.getSelections().join(''), 'or'); -}, { value: '123456\nfoo\nbar' }); -testVim('s_normal', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('s'); - helpers.doKeys(''); - eq('ac', cm.getValue()); -}, { value: 'abc'}); -testVim('s_visual', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('v', 's'); - helpers.doKeys(''); - helpers.assertCursorAt(0, 0); - eq('ac', cm.getValue()); -}, { value: 'abc'}); -testVim('o_visual', function(cm, vim, helpers) { - cm.setCursor(0,0); - helpers.doKeys('v','l','l','l','o'); - helpers.assertCursorAt(0,0); - helpers.doKeys('v','v','j','j','j','o'); - helpers.assertCursorAt(0,0); - helpers.doKeys('O'); - helpers.doKeys('l','l') - helpers.assertCursorAt(3, 3); - helpers.doKeys('d'); - eq('p',cm.getValue()); -}, { value: 'abcd\nefgh\nijkl\nmnop'}); -testVim('o_visual_block', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('','3','j','l','l', 'o'); - eqPos(Pos(3, 3), vim.sel.anchor); - eqPos(Pos(0, 1), vim.sel.head); - helpers.doKeys('O'); - eqPos(Pos(3, 1), vim.sel.anchor); - eqPos(Pos(0, 3), vim.sel.head); - helpers.doKeys('o'); - eqPos(Pos(0, 3), vim.sel.anchor); - eqPos(Pos(3, 1), vim.sel.head); -}, { value: 'abcd\nefgh\nijkl\nmnop'}); -testVim('changeCase_visual', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('v', 'l', 'l'); - helpers.doKeys('U'); - helpers.assertCursorAt(0, 0); - helpers.doKeys('v', 'l', 'l'); - helpers.doKeys('u'); - helpers.assertCursorAt(0, 0); - helpers.doKeys('l', 'l', 'l', '.'); - helpers.assertCursorAt(0, 3); - cm.setCursor(0, 0); - helpers.doKeys('q', 'a', 'v', 'j', 'U', 'q'); - helpers.assertCursorAt(0, 0); - helpers.doKeys('j', '@', 'a'); - helpers.assertCursorAt(1, 0); - cm.setCursor(3, 0); - helpers.doKeys('V', 'U', 'j', '.'); - eq('ABCDEF\nGHIJKL\nMnopq\nSHORT LINE\nLONG LINE OF TEXT', cm.getValue()); -}, { value: 'abcdef\nghijkl\nmnopq\nshort line\nlong line of text'}); -testVim('changeCase_visual_block', function(cm, vim, helpers) { - cm.setCursor(2, 1); - helpers.doKeys('', 'k', 'k', 'h', 'U'); - eq('ABcdef\nGHijkl\nMNopq\nfoo', cm.getValue()); - cm.setCursor(0, 2); - helpers.doKeys('.'); - eq('ABCDef\nGHIJkl\nMNOPq\nfoo', cm.getValue()); - // check when last line is shorter. - cm.setCursor(2, 2); - helpers.doKeys('.'); - eq('ABCDef\nGHIJkl\nMNOPq\nfoO', cm.getValue()); -}, { value: 'abcdef\nghijkl\nmnopq\nfoo'}); -testVim('visual_paste', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('v', 'l', 'l', 'y'); - helpers.assertCursorAt(0, 0); - helpers.doKeys('3', 'l', 'j', 'v', 'l', 'p'); - helpers.assertCursorAt(1, 5); - eq('this is a\nunithitest for visual paste', cm.getValue()); - cm.setCursor(0, 0); - // in case of pasting whole line - helpers.doKeys('y', 'y'); - cm.setCursor(1, 6); - helpers.doKeys('v', 'l', 'l', 'l', 'p'); - helpers.assertCursorAt(2, 0); - eq('this is a\nunithi\nthis is a\n for visual paste', cm.getValue()); -}, { value: 'this is a\nunit test for visual paste'}); - -// This checks the contents of the register used to paste the text -testVim('v_paste_from_register', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('"', 'a', 'y', 'w'); - cm.setCursor(1, 0); - helpers.doKeys('v', 'p'); - cm.openDialog = helpers.fakeOpenDialog('registers'); - cm.openNotification = helpers.fakeOpenNotification(function(text) { - is(/a\s+register/.test(text)); - }); -}, { value: 'register contents\nare not erased'}); -testVim('S_normal', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('j', 'S'); - helpers.doKeys(''); - helpers.assertCursorAt(1, 0); - eq('aa\n\ncc', cm.getValue()); -}, { value: 'aa\nbb\ncc'}); -testVim('blockwise_paste', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('', '3', 'j', 'l', 'y'); - cm.setCursor(0, 2); - // paste one char after the current cursor position - helpers.doKeys('p'); - eq('helhelo\nworwold\nfoofo\nbarba', cm.getValue()); - cm.setCursor(0, 0); - helpers.doKeys('v', '4', 'l', 'y'); - cm.setCursor(0, 0); - helpers.doKeys('', '3', 'j', 'p'); - eq('helheelhelo\norwold\noofo\narba', cm.getValue()); -}, { value: 'hello\nworld\nfoo\nbar'}); -testVim('blockwise_paste_long/short_line', function(cm, vim, helpers) { - // extend short lines in case of different line lengths. - cm.setCursor(0, 0); - helpers.doKeys('', 'j', 'j', 'y'); - cm.setCursor(0, 3); - helpers.doKeys('p'); - eq('hellho\nfoo f\nbar b', cm.getValue()); -}, { value: 'hello\nfoo\nbar'}); -testVim('blockwise_paste_cut_paste', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('', '2', 'j', 'x'); - cm.setCursor(0, 0); - helpers.doKeys('P'); - eq('cut\nand\npaste\nme', cm.getValue()); -}, { value: 'cut\nand\npaste\nme'}); -testVim('blockwise_paste_from_register', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('', '2', 'j', '"', 'a', 'y'); - cm.setCursor(0, 3); - helpers.doKeys('"', 'a', 'p'); - eq('foobfar\nhellho\nworlwd', cm.getValue()); -}, { value: 'foobar\nhello\nworld'}); -testVim('blockwise_paste_last_line', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('', '2', 'j', 'l', 'y'); - cm.setCursor(3, 0); - helpers.doKeys('p'); - eq('cut\nand\npaste\nmcue\n an\n pa', cm.getValue()); -}, { value: 'cut\nand\npaste\nme'}); - -testVim('S_visual', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('v', 'j', 'S'); - helpers.doKeys(''); - helpers.assertCursorAt(0, 0); - eq('\ncc', cm.getValue()); -}, { value: 'aa\nbb\ncc'}); - -testVim('d_/', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('match'); - helpers.doKeys('2', 'd', '/'); - helpers.assertCursorAt(0, 0); - eq('match \n next', cm.getValue()); - cm.openDialog = helpers.fakeOpenDialog('2'); - helpers.doKeys('d', ':'); - // TODO eq(' next', cm.getValue()); -}, { value: 'text match match \n next' }); -testVim('/ and n/N', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('match'); - helpers.doKeys('/'); - helpers.assertCursorAt(0, 11); - helpers.doKeys('n'); - helpers.assertCursorAt(1, 6); - helpers.doKeys('N'); - helpers.assertCursorAt(0, 11); - - cm.setCursor(0, 0); - helpers.doKeys('2', '/'); - helpers.assertCursorAt(1, 6); -}, { value: 'match nope match \n nope Match' }); -testVim('/_case', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('Match'); - helpers.doKeys('/'); - helpers.assertCursorAt(1, 6); -}, { value: 'match nope match \n nope Match' }); -testVim('/_2_pcre', function(cm, vim, helpers) { - CodeMirror.Vim.setOption('pcre', true); - cm.openDialog = helpers.fakeOpenDialog('(word){2}'); - helpers.doKeys('/'); - helpers.assertCursorAt(1, 9); - helpers.doKeys('n'); - helpers.assertCursorAt(2, 1); -}, { value: 'word\n another wordword\n wordwordword\n' }); -testVim('/_2_nopcre', function(cm, vim, helpers) { - CodeMirror.Vim.setOption('pcre', false); - cm.openDialog = helpers.fakeOpenDialog('\\(word\\)\\{2}'); - helpers.doKeys('/'); - helpers.assertCursorAt(1, 9); - helpers.doKeys('n'); - helpers.assertCursorAt(2, 1); -}, { value: 'word\n another wordword\n wordwordword\n' }); -testVim('/_nongreedy', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('aa'); - helpers.doKeys('/'); - helpers.assertCursorAt(0, 4); - helpers.doKeys('n'); - helpers.assertCursorAt(1, 3); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 0); -}, { value: 'aaa aa \n a aa'}); -testVim('?_nongreedy', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('aa'); - helpers.doKeys('?'); - helpers.assertCursorAt(1, 3); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 4); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 0); -}, { value: 'aaa aa \n a aa'}); -testVim('/_greedy', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('a+'); - helpers.doKeys('/'); - helpers.assertCursorAt(0, 4); - helpers.doKeys('n'); - helpers.assertCursorAt(1, 1); - helpers.doKeys('n'); - helpers.assertCursorAt(1, 3); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 0); -}, { value: 'aaa aa \n a aa'}); -testVim('?_greedy', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('a+'); - helpers.doKeys('?'); - helpers.assertCursorAt(1, 3); - helpers.doKeys('n'); - helpers.assertCursorAt(1, 1); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 4); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 0); -}, { value: 'aaa aa \n a aa'}); -testVim('/_greedy_0_or_more', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('a*'); - helpers.doKeys('/'); - helpers.assertCursorAt(0, 3); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 4); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 5); - helpers.doKeys('n'); - helpers.assertCursorAt(1, 0); - helpers.doKeys('n'); - helpers.assertCursorAt(1, 1); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 0); -}, { value: 'aaa aa\n aa'}); -testVim('?_greedy_0_or_more', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('a*'); - helpers.doKeys('?'); - helpers.assertCursorAt(1, 1); - helpers.doKeys('n'); - helpers.assertCursorAt(1, 0); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 5); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 4); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 3); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 0); -}, { value: 'aaa aa\n aa'}); -testVim('? and n/N', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('match'); - helpers.doKeys('?'); - helpers.assertCursorAt(1, 6); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 11); - helpers.doKeys('N'); - helpers.assertCursorAt(1, 6); - - cm.setCursor(0, 0); - helpers.doKeys('2', '?'); - helpers.assertCursorAt(0, 11); -}, { value: 'match nope match \n nope Match' }); -testVim('*', function(cm, vim, helpers) { - cm.setCursor(0, 9); - helpers.doKeys('*'); - helpers.assertCursorAt(0, 22); - - cm.setCursor(0, 9); - helpers.doKeys('2', '*'); - helpers.assertCursorAt(1, 8); -}, { value: 'nomatch match nomatch match \nnomatch Match' }); -testVim('*_no_word', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('*'); - helpers.assertCursorAt(0, 0); -}, { value: ' \n match \n' }); -testVim('*_symbol', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('*'); - helpers.assertCursorAt(1, 0); -}, { value: ' /}\n/} match \n' }); -testVim('#', function(cm, vim, helpers) { - cm.setCursor(0, 9); - helpers.doKeys('#'); - helpers.assertCursorAt(1, 8); - - cm.setCursor(0, 9); - helpers.doKeys('2', '#'); - helpers.assertCursorAt(0, 22); -}, { value: 'nomatch match nomatch match \nnomatch Match' }); -testVim('*_seek', function(cm, vim, helpers) { - // Should skip over space and symbols. - cm.setCursor(0, 3); - helpers.doKeys('*'); - helpers.assertCursorAt(0, 22); -}, { value: ' := match nomatch match \nnomatch Match' }); -testVim('#', function(cm, vim, helpers) { - // Should skip over space and symbols. - cm.setCursor(0, 3); - helpers.doKeys('#'); - helpers.assertCursorAt(1, 8); -}, { value: ' := match nomatch match \nnomatch Match' }); -testVim('g*', function(cm, vim, helpers) { - cm.setCursor(0, 8); - helpers.doKeys('g', '*'); - helpers.assertCursorAt(0, 18); - cm.setCursor(0, 8); - helpers.doKeys('3', 'g', '*'); - helpers.assertCursorAt(1, 8); -}, { value: 'matches match alsoMatch\nmatchme matching' }); -testVim('g#', function(cm, vim, helpers) { - cm.setCursor(0, 8); - helpers.doKeys('g', '#'); - helpers.assertCursorAt(0, 0); - cm.setCursor(0, 8); - helpers.doKeys('3', 'g', '#'); - helpers.assertCursorAt(1, 0); -}, { value: 'matches match alsoMatch\nmatchme matching' }); -testVim('macro_insert', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'a', '0', 'i'); - cm.replaceRange('foo', cm.getCursor()); - helpers.doKeys(''); - helpers.doKeys('q', '@', 'a'); - eq('foofoo', cm.getValue()); -}, { value: ''}); -testVim('macro_insert_repeat', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'a', '$', 'a'); - cm.replaceRange('larry.', cm.getCursor()); - helpers.doKeys(''); - helpers.doKeys('a'); - cm.replaceRange('curly.', cm.getCursor()); - helpers.doKeys(''); - helpers.doKeys('q'); - helpers.doKeys('a'); - cm.replaceRange('moe.', cm.getCursor()); - helpers.doKeys(''); - helpers.doKeys('@', 'a'); - // At this point, the most recent edit should be the 2nd insert change - // inside the macro, i.e. "curly.". - helpers.doKeys('.'); - eq('larry.curly.moe.larry.curly.curly.', cm.getValue()); -}, { value: ''}); -testVim('macro_space', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('', ''); - helpers.assertCursorAt(0, 2); - helpers.doKeys('q', 'a', '', '', 'q'); - helpers.assertCursorAt(0, 4); - helpers.doKeys('@', 'a'); - helpers.assertCursorAt(0, 6); - helpers.doKeys('@', 'a'); - helpers.assertCursorAt(0, 8); -}, { value: 'one line of text.'}); -testVim('macro_t_search', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'a', 't', 'e', 'q'); - helpers.assertCursorAt(0, 1); - helpers.doKeys('l', '@', 'a'); - helpers.assertCursorAt(0, 6); - helpers.doKeys('l', ';'); - helpers.assertCursorAt(0, 12); -}, { value: 'one line of text.'}); -testVim('macro_f_search', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'b', 'f', 'e', 'q'); - helpers.assertCursorAt(0, 2); - helpers.doKeys('@', 'b'); - helpers.assertCursorAt(0, 7); - helpers.doKeys(';'); - helpers.assertCursorAt(0, 13); -}, { value: 'one line of text.'}); -testVim('macro_slash_search', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'c'); - cm.openDialog = helpers.fakeOpenDialog('e'); - helpers.doKeys('/', 'q'); - helpers.assertCursorAt(0, 2); - helpers.doKeys('@', 'c'); - helpers.assertCursorAt(0, 7); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 13); -}, { value: 'one line of text.'}); -testVim('macro_multislash_search', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'd'); - cm.openDialog = helpers.fakeOpenDialog('e'); - helpers.doKeys('/'); - cm.openDialog = helpers.fakeOpenDialog('t'); - helpers.doKeys('/', 'q'); - helpers.assertCursorAt(0, 12); - helpers.doKeys('@', 'd'); - helpers.assertCursorAt(0, 15); -}, { value: 'one line of text to rule them all.'}); -testVim('macro_parens', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'z', 'i'); - cm.replaceRange('(', cm.getCursor()); - helpers.doKeys(''); - helpers.doKeys('e', 'a'); - cm.replaceRange(')', cm.getCursor()); - helpers.doKeys(''); - helpers.doKeys('q'); - helpers.doKeys('w', '@', 'z'); - helpers.doKeys('w', '@', 'z'); - eq('(see) (spot) (run)', cm.getValue()); -}, { value: 'see spot run'}); -testVim('macro_overwrite', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'z', '0', 'i'); - cm.replaceRange('I ', cm.getCursor()); - helpers.doKeys(''); - helpers.doKeys('q'); - helpers.doKeys('e'); - // Now replace the macro with something else. - helpers.doKeys('q', 'z', 'a'); - cm.replaceRange('.', cm.getCursor()); - helpers.doKeys(''); - helpers.doKeys('q'); - helpers.doKeys('e', '@', 'z'); - helpers.doKeys('e', '@', 'z'); - eq('I see. spot. run.', cm.getValue()); -}, { value: 'see spot run'}); -testVim('macro_search_f', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'a', 'f', ' '); - helpers.assertCursorAt(0,3); - helpers.doKeys('q', '0'); - helpers.assertCursorAt(0,0); - helpers.doKeys('@', 'a'); - helpers.assertCursorAt(0,3); -}, { value: 'The quick brown fox jumped over the lazy dog.'}); -testVim('macro_search_2f', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'a', '2', 'f', ' '); - helpers.assertCursorAt(0,9); - helpers.doKeys('q', '0'); - helpers.assertCursorAt(0,0); - helpers.doKeys('@', 'a'); - helpers.assertCursorAt(0,9); -}, { value: 'The quick brown fox jumped over the lazy dog.'}); -testVim('yank_register', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('"', 'a', 'y', 'y'); - helpers.doKeys('j', '"', 'b', 'y', 'y'); - cm.openDialog = helpers.fakeOpenDialog('registers'); - cm.openNotification = helpers.fakeOpenNotification(function(text) { - is(/a\s+foo/.test(text)); - is(/b\s+bar/.test(text)); - }); - helpers.doKeys(':'); -}, { value: 'foo\nbar'}); -testVim('yank_visual_block', function(cm, vim, helpers) { - cm.setCursor(0, 1); - helpers.doKeys('', 'l', 'j', '"', 'a', 'y'); - cm.openNotification = helpers.fakeOpenNotification(function(text) { - is(/a\s+oo\nar/.test(text)); - }); - helpers.doKeys(':'); -}, { value: 'foo\nbar'}); -testVim('yank_append_line_to_line_register', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('"', 'a', 'y', 'y'); - helpers.doKeys('j', '"', 'A', 'y', 'y'); - cm.openDialog = helpers.fakeOpenDialog('registers'); - cm.openNotification = helpers.fakeOpenNotification(function(text) { - is(/a\s+foo\nbar/.test(text)); - is(/"\s+foo\nbar/.test(text)); - }); - helpers.doKeys(':'); -}, { value: 'foo\nbar'}); -testVim('yank_append_word_to_word_register', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('"', 'a', 'y', 'w'); - helpers.doKeys('j', '"', 'A', 'y', 'w'); - cm.openDialog = helpers.fakeOpenDialog('registers'); - cm.openNotification = helpers.fakeOpenNotification(function(text) { - is(/a\s+foobar/.test(text)); - is(/"\s+foobar/.test(text)); - }); - helpers.doKeys(':'); -}, { value: 'foo\nbar'}); -testVim('yank_append_line_to_word_register', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('"', 'a', 'y', 'w'); - helpers.doKeys('j', '"', 'A', 'y', 'y'); - cm.openDialog = helpers.fakeOpenDialog('registers'); - cm.openNotification = helpers.fakeOpenNotification(function(text) { - is(/a\s+foo\nbar/.test(text)); - is(/"\s+foo\nbar/.test(text)); - }); - helpers.doKeys(':'); -}, { value: 'foo\nbar'}); -testVim('yank_append_word_to_line_register', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('"', 'a', 'y', 'y'); - helpers.doKeys('j', '"', 'A', 'y', 'w'); - cm.openDialog = helpers.fakeOpenDialog('registers'); - cm.openNotification = helpers.fakeOpenNotification(function(text) { - is(/a\s+foo\nbar/.test(text)); - is(/"\s+foo\nbar/.test(text)); - }); - helpers.doKeys(':'); -}, { value: 'foo\nbar'}); -testVim('macro_register', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('q', 'a', 'i'); - cm.replaceRange('gangnam', cm.getCursor()); - helpers.doKeys(''); - helpers.doKeys('q'); - helpers.doKeys('q', 'b', 'o'); - cm.replaceRange('style', cm.getCursor()); - helpers.doKeys(''); - helpers.doKeys('q'); - cm.openDialog = helpers.fakeOpenDialog('registers'); - cm.openNotification = helpers.fakeOpenNotification(function(text) { - is(/a\s+i/.test(text)); - is(/b\s+o/.test(text)); - }); - helpers.doKeys(':'); -}, { value: ''}); -testVim('._register', function(cm,vim,helpers) { - cm.setCursor(0,0); - helpers.doKeys('i'); - cm.replaceRange('foo',cm.getCursor()); - helpers.doKeys(''); - cm.openDialog = helpers.fakeOpenDialog('registers'); - cm.openNotification = helpers.fakeOpenNotification(function(text) { - is(/\.\s+foo/.test(text)); - }); - helpers.doKeys(':'); -}, {value: ''}); -testVim(':_register', function(cm,vim,helpers) { - helpers.doEx('bar'); - cm.openDialog = helpers.fakeOpenDialog('registers'); - cm.openNotification = helpers.fakeOpenNotification(function(text) { - is(/:\s+bar/.test(text)); - }); - helpers.doKeys(':'); -}, {value: ''}); -testVim('search_register_escape', function(cm, vim, helpers) { - // Check that the register is restored if the user escapes rather than confirms. - cm.openDialog = helpers.fakeOpenDialog('waldo'); - helpers.doKeys('/'); - var onKeyDown; - var onKeyUp; - var KEYCODES = { - f: 70, - o: 79, - Esc: 27 - }; - cm.openDialog = function(template, callback, options) { - onKeyDown = options.onKeyDown; - onKeyUp = options.onKeyUp; - }; - var close = function() {}; - helpers.doKeys('/'); - // Fake some keyboard events coming in. - onKeyDown({keyCode: KEYCODES.f}, '', close); - onKeyUp({keyCode: KEYCODES.f}, '', close); - onKeyDown({keyCode: KEYCODES.o}, 'f', close); - onKeyUp({keyCode: KEYCODES.o}, 'f', close); - onKeyDown({keyCode: KEYCODES.o}, 'fo', close); - onKeyUp({keyCode: KEYCODES.o}, 'fo', close); - onKeyDown({keyCode: KEYCODES.Esc}, 'foo', close); - cm.openDialog = helpers.fakeOpenDialog('registers'); - cm.openNotification = helpers.fakeOpenNotification(function(text) { - is(/waldo/.test(text)); - is(!/foo/.test(text)); - }); - helpers.doKeys(':'); -}, {value: ''}); -testVim('search_register', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('foo'); - helpers.doKeys('/'); - cm.openDialog = helpers.fakeOpenDialog('registers'); - cm.openNotification = helpers.fakeOpenNotification(function(text) { - is(/\/\s+foo/.test(text)); - }); - helpers.doKeys(':'); -}, {value: ''}); -testVim('search_history', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('this'); - helpers.doKeys('/'); - cm.openDialog = helpers.fakeOpenDialog('checks'); - helpers.doKeys('/'); - cm.openDialog = helpers.fakeOpenDialog('search'); - helpers.doKeys('/'); - cm.openDialog = helpers.fakeOpenDialog('history'); - helpers.doKeys('/'); - cm.openDialog = helpers.fakeOpenDialog('checks'); - helpers.doKeys('/'); - var onKeyDown; - var onKeyUp; - var query = ''; - var keyCodes = { - Up: 38, - Down: 40 - }; - cm.openDialog = function(template, callback, options) { - onKeyUp = options.onKeyUp; - onKeyDown = options.onKeyDown; - }; - var close = function(newVal) { - if (typeof newVal == 'string') query = newVal; - } - helpers.doKeys('/'); - onKeyDown({keyCode: keyCodes.Up}, query, close); - onKeyUp({keyCode: keyCodes.Up}, query, close); - eq(query, 'checks'); - onKeyDown({keyCode: keyCodes.Up}, query, close); - onKeyUp({keyCode: keyCodes.Up}, query, close); - eq(query, 'history'); - onKeyDown({keyCode: keyCodes.Up}, query, close); - onKeyUp({keyCode: keyCodes.Up}, query, close); - eq(query, 'search'); - onKeyDown({keyCode: keyCodes.Up}, query, close); - onKeyUp({keyCode: keyCodes.Up}, query, close); - eq(query, 'this'); - onKeyDown({keyCode: keyCodes.Down}, query, close); - onKeyUp({keyCode: keyCodes.Down}, query, close); - eq(query, 'search'); -}, {value: ''}); -testVim('exCommand_history', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('registers'); - helpers.doKeys(':'); - cm.openDialog = helpers.fakeOpenDialog('sort'); - helpers.doKeys(':'); - cm.openDialog = helpers.fakeOpenDialog('map'); - helpers.doKeys(':'); - cm.openDialog = helpers.fakeOpenDialog('invalid'); - helpers.doKeys(':'); - var onKeyDown; - var onKeyUp; - var input = ''; - var keyCodes = { - Up: 38, - Down: 40, - s: 115 - }; - cm.openDialog = function(template, callback, options) { - onKeyUp = options.onKeyUp; - onKeyDown = options.onKeyDown; - }; - var close = function(newVal) { - if (typeof newVal == 'string') input = newVal; - } - helpers.doKeys(':'); - onKeyDown({keyCode: keyCodes.Up}, input, close); - eq(input, 'invalid'); - onKeyDown({keyCode: keyCodes.Up}, input, close); - eq(input, 'map'); - onKeyDown({keyCode: keyCodes.Up}, input, close); - eq(input, 'sort'); - onKeyDown({keyCode: keyCodes.Up}, input, close); - eq(input, 'registers'); - onKeyDown({keyCode: keyCodes.s}, '', close); - input = 's'; - onKeyDown({keyCode: keyCodes.Up}, input, close); - eq(input, 'sort'); -}, {value: ''}); -testVim('search_clear', function(cm, vim, helpers) { - var onKeyDown; - var input = ''; - var keyCodes = { - Ctrl: 17, - u: 85 - }; - cm.openDialog = function(template, callback, options) { - onKeyDown = options.onKeyDown; - }; - var close = function(newVal) { - if (typeof newVal == 'string') input = newVal; - } - helpers.doKeys('/'); - input = 'foo'; - onKeyDown({keyCode: keyCodes.Ctrl}, input, close); - onKeyDown({keyCode: keyCodes.u, ctrlKey: true}, input, close); - eq(input, ''); -}); -testVim('exCommand_clear', function(cm, vim, helpers) { - var onKeyDown; - var input = ''; - var keyCodes = { - Ctrl: 17, - u: 85 - }; - cm.openDialog = function(template, callback, options) { - onKeyDown = options.onKeyDown; - }; - var close = function(newVal) { - if (typeof newVal == 'string') input = newVal; - } - helpers.doKeys(':'); - input = 'foo'; - onKeyDown({keyCode: keyCodes.Ctrl}, input, close); - onKeyDown({keyCode: keyCodes.u, ctrlKey: true}, input, close); - eq(input, ''); -}); -testVim('.', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('2', 'd', 'w'); - helpers.doKeys('.'); - eq('5 6', cm.getValue()); -}, { value: '1 2 3 4 5 6'}); -testVim('._repeat', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('2', 'd', 'w'); - helpers.doKeys('3', '.'); - eq('6', cm.getValue()); -}, { value: '1 2 3 4 5 6'}); -testVim('._insert', function(cm, vim, helpers) { - helpers.doKeys('i'); - cm.replaceRange('test', cm.getCursor()); - helpers.doKeys(''); - helpers.doKeys('.'); - eq('testestt', cm.getValue()); - helpers.assertCursorAt(0, 6); -}, { value: ''}); -testVim('._insert_repeat', function(cm, vim, helpers) { - helpers.doKeys('i'); - cm.replaceRange('test', cm.getCursor()); - cm.setCursor(0, 4); - helpers.doKeys(''); - helpers.doKeys('2', '.'); - eq('testesttestt', cm.getValue()); - helpers.assertCursorAt(0, 10); -}, { value: ''}); -testVim('._repeat_insert', function(cm, vim, helpers) { - helpers.doKeys('3', 'i'); - cm.replaceRange('te', cm.getCursor()); - cm.setCursor(0, 2); - helpers.doKeys(''); - helpers.doKeys('.'); - eq('tetettetetee', cm.getValue()); - helpers.assertCursorAt(0, 10); -}, { value: ''}); -testVim('._insert_o', function(cm, vim, helpers) { - helpers.doKeys('o'); - cm.replaceRange('z', cm.getCursor()); - cm.setCursor(1, 1); - helpers.doKeys(''); - helpers.doKeys('.'); - eq('\nz\nz', cm.getValue()); - helpers.assertCursorAt(2, 0); -}, { value: ''}); -testVim('._insert_o_repeat', function(cm, vim, helpers) { - helpers.doKeys('o'); - cm.replaceRange('z', cm.getCursor()); - helpers.doKeys(''); - cm.setCursor(1, 0); - helpers.doKeys('2', '.'); - eq('\nz\nz\nz', cm.getValue()); - helpers.assertCursorAt(3, 0); -}, { value: ''}); -testVim('._insert_o_indent', function(cm, vim, helpers) { - helpers.doKeys('o'); - cm.replaceRange('z', cm.getCursor()); - helpers.doKeys(''); - cm.setCursor(1, 2); - helpers.doKeys('.'); - eq('{\n z\n z', cm.getValue()); - helpers.assertCursorAt(2, 2); -}, { value: '{'}); -testVim('._insert_cw', function(cm, vim, helpers) { - helpers.doKeys('c', 'w'); - cm.replaceRange('test', cm.getCursor()); - helpers.doKeys(''); - cm.setCursor(0, 3); - helpers.doKeys('2', 'l'); - helpers.doKeys('.'); - eq('test test word3', cm.getValue()); - helpers.assertCursorAt(0, 8); -}, { value: 'word1 word2 word3' }); -testVim('._insert_cw_repeat', function(cm, vim, helpers) { - // For some reason, repeat cw in desktop VIM will does not repeat insert mode - // changes. Will conform to that behavior. - helpers.doKeys('c', 'w'); - cm.replaceRange('test', cm.getCursor()); - helpers.doKeys(''); - cm.setCursor(0, 4); - helpers.doKeys('l'); - helpers.doKeys('2', '.'); - eq('test test', cm.getValue()); - helpers.assertCursorAt(0, 8); -}, { value: 'word1 word2 word3' }); -testVim('._delete', function(cm, vim, helpers) { - cm.setCursor(0, 5); - helpers.doKeys('i'); - helpers.doInsertModeKeys('Backspace'); - helpers.doKeys(''); - helpers.doKeys('.'); - eq('zace', cm.getValue()); - helpers.assertCursorAt(0, 1); -}, { value: 'zabcde'}); -testVim('._delete_repeat', function(cm, vim, helpers) { - cm.setCursor(0, 6); - helpers.doKeys('i'); - helpers.doInsertModeKeys('Backspace'); - helpers.doKeys(''); - helpers.doKeys('2', '.'); - eq('zzce', cm.getValue()); - helpers.assertCursorAt(0, 1); -}, { value: 'zzabcde'}); -testVim('._visual_>', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('V', 'j', '>'); - cm.setCursor(2, 0) - helpers.doKeys('.'); - eq(' 1\n 2\n 3\n 4', cm.getValue()); - helpers.assertCursorAt(2, 2); -}, { value: '1\n2\n3\n4'}); -testVim('f;', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('f', 'x'); - helpers.doKeys(';'); - helpers.doKeys('2', ';'); - eq(9, cm.getCursor().ch); -}, { value: '01x3xx678x'}); -testVim('F;', function(cm, vim, helpers) { - cm.setCursor(0, 8); - helpers.doKeys('F', 'x'); - helpers.doKeys(';'); - helpers.doKeys('2', ';'); - eq(2, cm.getCursor().ch); -}, { value: '01x3xx6x8x'}); -testVim('t;', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('t', 'x'); - helpers.doKeys(';'); - helpers.doKeys('2', ';'); - eq(8, cm.getCursor().ch); -}, { value: '01x3xx678x'}); -testVim('T;', function(cm, vim, helpers) { - cm.setCursor(0, 9); - helpers.doKeys('T', 'x'); - helpers.doKeys(';'); - helpers.doKeys('2', ';'); - eq(2, cm.getCursor().ch); -}, { value: '0xx3xx678x'}); -testVim('f,', function(cm, vim, helpers) { - cm.setCursor(0, 6); - helpers.doKeys('f', 'x'); - helpers.doKeys(','); - helpers.doKeys('2', ','); - eq(2, cm.getCursor().ch); -}, { value: '01x3xx678x'}); -testVim('F,', function(cm, vim, helpers) { - cm.setCursor(0, 3); - helpers.doKeys('F', 'x'); - helpers.doKeys(','); - helpers.doKeys('2', ','); - eq(9, cm.getCursor().ch); -}, { value: '01x3xx678x'}); -testVim('t,', function(cm, vim, helpers) { - cm.setCursor(0, 6); - helpers.doKeys('t', 'x'); - helpers.doKeys(','); - helpers.doKeys('2', ','); - eq(3, cm.getCursor().ch); -}, { value: '01x3xx678x'}); -testVim('T,', function(cm, vim, helpers) { - cm.setCursor(0, 4); - helpers.doKeys('T', 'x'); - helpers.doKeys(','); - helpers.doKeys('2', ','); - eq(8, cm.getCursor().ch); -}, { value: '01x3xx67xx'}); -testVim('fd,;', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('f', '4'); - cm.setCursor(0, 0); - helpers.doKeys('d', ';'); - eq('56789', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 9); - helpers.doKeys('d', ','); - eq('01239', cm.getValue()); -}, { value: '0123456789'}); -testVim('Fd,;', function(cm, vim, helpers) { - cm.setCursor(0, 9); - helpers.doKeys('F', '4'); - cm.setCursor(0, 9); - helpers.doKeys('d', ';'); - eq('01239', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 0); - helpers.doKeys('d', ','); - eq('56789', cm.getValue()); -}, { value: '0123456789'}); -testVim('td,;', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('t', '4'); - cm.setCursor(0, 0); - helpers.doKeys('d', ';'); - eq('456789', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 9); - helpers.doKeys('d', ','); - eq('012349', cm.getValue()); -}, { value: '0123456789'}); -testVim('Td,;', function(cm, vim, helpers) { - cm.setCursor(0, 9); - helpers.doKeys('T', '4'); - cm.setCursor(0, 9); - helpers.doKeys('d', ';'); - eq('012349', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 0); - helpers.doKeys('d', ','); - eq('456789', cm.getValue()); -}, { value: '0123456789'}); -testVim('fc,;', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('f', '4'); - cm.setCursor(0, 0); - helpers.doKeys('c', ';', ''); - eq('56789', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 9); - helpers.doKeys('c', ','); - eq('01239', cm.getValue()); -}, { value: '0123456789'}); -testVim('Fc,;', function(cm, vim, helpers) { - cm.setCursor(0, 9); - helpers.doKeys('F', '4'); - cm.setCursor(0, 9); - helpers.doKeys('c', ';', ''); - eq('01239', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 0); - helpers.doKeys('c', ','); - eq('56789', cm.getValue()); -}, { value: '0123456789'}); -testVim('tc,;', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('t', '4'); - cm.setCursor(0, 0); - helpers.doKeys('c', ';', ''); - eq('456789', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 9); - helpers.doKeys('c', ','); - eq('012349', cm.getValue()); -}, { value: '0123456789'}); -testVim('Tc,;', function(cm, vim, helpers) { - cm.setCursor(0, 9); - helpers.doKeys('T', '4'); - cm.setCursor(0, 9); - helpers.doKeys('c', ';', ''); - eq('012349', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 0); - helpers.doKeys('c', ','); - eq('456789', cm.getValue()); -}, { value: '0123456789'}); -testVim('fy,;', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('f', '4'); - cm.setCursor(0, 0); - helpers.doKeys('y', ';', 'P'); - eq('012340123456789', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 9); - helpers.doKeys('y', ',', 'P'); - eq('012345678456789', cm.getValue()); -}, { value: '0123456789'}); -testVim('Fy,;', function(cm, vim, helpers) { - cm.setCursor(0, 9); - helpers.doKeys('F', '4'); - cm.setCursor(0, 9); - helpers.doKeys('y', ';', 'p'); - eq('012345678945678', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 0); - helpers.doKeys('y', ',', 'P'); - eq('012340123456789', cm.getValue()); -}, { value: '0123456789'}); -testVim('ty,;', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys('t', '4'); - cm.setCursor(0, 0); - helpers.doKeys('y', ';', 'P'); - eq('01230123456789', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 9); - helpers.doKeys('y', ',', 'p'); - eq('01234567895678', cm.getValue()); -}, { value: '0123456789'}); -testVim('Ty,;', function(cm, vim, helpers) { - cm.setCursor(0, 9); - helpers.doKeys('T', '4'); - cm.setCursor(0, 9); - helpers.doKeys('y', ';', 'p'); - eq('01234567895678', cm.getValue()); - helpers.doKeys('u'); - cm.setCursor(0, 0); - helpers.doKeys('y', ',', 'P'); - eq('01230123456789', cm.getValue()); -}, { value: '0123456789'}); -testVim('HML', function(cm, vim, helpers) { - var lines = 35; - var textHeight = cm.defaultTextHeight(); - cm.setSize(600, lines*textHeight); - cm.setCursor(120, 0); - cm.refresh(); //ace! - helpers.doKeys('H'); - helpers.assertCursorAt(86, 2); - helpers.doKeys('L'); - helpers.assertCursorAt(120, 4); - helpers.doKeys('M'); - helpers.assertCursorAt(103,4); -}, { value: (function(){ - var lines = new Array(100); - var upper = ' xx\n'; - var lower = ' xx\n'; - upper = lines.join(upper); - lower = lines.join(lower); - return upper + lower; -})()}); - -var zVals = []; -forEach(['zb','zz','zt','z-','z.','z'], function(e, idx){ - var lineNum = 250; - var lines = 35; - testVim(e, function(cm, vim, helpers) { - var k1 = e[0]; - var k2 = e.substring(1); - var textHeight = cm.defaultTextHeight(); - cm.setSize(600, lines*textHeight); - cm.setCursor(lineNum, 0); - helpers.doKeys(k1, k2); - zVals[idx] = cm.getScrollInfo().top; - }, { value: (function(){ - return new Array(500).join('\n'); - })()}); -}); -testVim('zb', function(cm, vim, helpers){ - eq(zVals[2], zVals[5]); -}); - -var moveTillCharacterSandbox = - 'The quick brown fox \n' - 'jumped over the lazy dog.' -testVim('moveTillCharacter', function(cm, vim, helpers){ - cm.setCursor(0, 0); - // Search for the 'q'. - cm.openDialog = helpers.fakeOpenDialog('q'); - helpers.doKeys('/'); - eq(4, cm.getCursor().ch); - // Jump to just before the first o in the list. - helpers.doKeys('t'); - helpers.doKeys('o'); - eq('The quick brown fox \n', cm.getValue()); - // Delete that one character. - helpers.doKeys('d'); - helpers.doKeys('t'); - helpers.doKeys('o'); - eq('The quick bown fox \n', cm.getValue()); - // Delete everything until the next 'o'. - helpers.doKeys('.'); - eq('The quick box \n', cm.getValue()); - // An unmatched character should have no effect. - helpers.doKeys('d'); - helpers.doKeys('t'); - helpers.doKeys('q'); - eq('The quick box \n', cm.getValue()); - // Matches should only be possible on single lines. - helpers.doKeys('d'); - helpers.doKeys('t'); - helpers.doKeys('z'); - eq('The quick box \n', cm.getValue()); - // After all that, the search for 'q' should still be active, so the 'N' command - // can run it again in reverse. Use that to delete everything back to the 'q'. - helpers.doKeys('d'); - helpers.doKeys('N'); - eq('The ox \n', cm.getValue()); - eq(4, cm.getCursor().ch); -}, { value: moveTillCharacterSandbox}); -testVim('searchForPipe', function(cm, vim, helpers){ - CodeMirror.Vim.setOption('pcre', false); - cm.setCursor(0, 0); - // Search for the '|'. - cm.openDialog = helpers.fakeOpenDialog('|'); - helpers.doKeys('/'); - eq(4, cm.getCursor().ch); -}, { value: 'this|that'}); - - -var scrollMotionSandbox = - '\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n' - '\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n' - '\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n' - '\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n'; -testVim('scrollMotion', function(cm, vim, helpers){ - var prevCursor, prevScrollInfo; - cm.setCursor(0, 0); - // ctrl-y at the top of the file should have no effect. - helpers.doKeys(''); - eq(0, cm.getCursor().line); - prevScrollInfo = cm.getScrollInfo(); - helpers.doKeys(''); - eq(1, cm.getCursor().line); - is(prevScrollInfo.top < cm.getScrollInfo().top); - // Jump to the end of the sandbox. - cm.setCursor(1000, 0); - cm.refresh(); //ace! - prevCursor = cm.getCursor(); - // ctrl-e at the bottom of the file should have no effect. - helpers.doKeys(''); - eq(prevCursor.line, cm.getCursor().line); - cm.refresh(); //ace! - prevScrollInfo = cm.getScrollInfo(); - helpers.doKeys(''); - eq(prevCursor.line - 1, cm.getCursor().line, "Y"); - is(prevScrollInfo.top > cm.getScrollInfo().top); -}, { value: scrollMotionSandbox}); - -var squareBracketMotionSandbox = ''+ - '({\n'+//0 - ' ({\n'+//11 - ' /*comment {\n'+//2 - ' */(\n'+//3 - '#else \n'+//4 - ' /* )\n'+//5 - '#if }\n'+//6 - ' )}*/\n'+//7 - ')}\n'+//8 - '{}\n'+//9 - '#else {{\n'+//10 - '{}\n'+//11 - '}\n'+//12 - '{\n'+//13 - '#endif\n'+//14 - '}\n'+//15 - '}\n'+//16 - '#else';//17 -testVim('[[, ]]', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys(']', ']'); - helpers.assertCursorAt(9,0); - helpers.doKeys('2', ']', ']'); - helpers.assertCursorAt(13,0); - helpers.doKeys(']', ']'); - helpers.assertCursorAt(17,0); - helpers.doKeys('[', '['); - helpers.assertCursorAt(13,0); - helpers.doKeys('2', '[', '['); - helpers.assertCursorAt(9,0); - helpers.doKeys('[', '['); - helpers.assertCursorAt(0,0); -}, { value: squareBracketMotionSandbox}); -testVim('[], ][', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doKeys(']', '['); - helpers.assertCursorAt(12,0); - helpers.doKeys('2', ']', '['); - helpers.assertCursorAt(16,0); - helpers.doKeys(']', '['); - helpers.assertCursorAt(17,0); - helpers.doKeys('[', ']'); - helpers.assertCursorAt(16,0); - helpers.doKeys('2', '[', ']'); - helpers.assertCursorAt(12,0); - helpers.doKeys('[', ']'); - helpers.assertCursorAt(0,0); -}, { value: squareBracketMotionSandbox}); -testVim('[{, ]}', function(cm, vim, helpers) { - cm.setCursor(4, 10); - helpers.doKeys('[', '{'); - helpers.assertCursorAt(2,12); - helpers.doKeys('2', '[', '{'); - helpers.assertCursorAt(0,1); - cm.setCursor(4, 10); - helpers.doKeys(']', '}'); - helpers.assertCursorAt(6,11); - helpers.doKeys('2', ']', '}'); - helpers.assertCursorAt(8,1); - cm.setCursor(0,1); - helpers.doKeys(']', '}'); - helpers.assertCursorAt(8,1); - helpers.doKeys('[', '{'); - helpers.assertCursorAt(0,1); -}, { value: squareBracketMotionSandbox}); -testVim('[(, ])', function(cm, vim, helpers) { - cm.setCursor(4, 10); - helpers.doKeys('[', '('); - helpers.assertCursorAt(3,14); - helpers.doKeys('2', '[', '('); - helpers.assertCursorAt(0,0); - cm.setCursor(4, 10); - helpers.doKeys(']', ')'); - helpers.assertCursorAt(5,11); - helpers.doKeys('2', ']', ')'); - helpers.assertCursorAt(8,0); - helpers.doKeys('[', '('); - helpers.assertCursorAt(0,0); - helpers.doKeys(']', ')'); - helpers.assertCursorAt(8,0); -}, { value: squareBracketMotionSandbox}); -testVim('[*, ]*, [/, ]/', function(cm, vim, helpers) { - forEach(['*', '/'], function(key){ - cm.setCursor(7, 0); - helpers.doKeys('2', '[', key); - helpers.assertCursorAt(2,2); - helpers.doKeys('2', ']', key); - helpers.assertCursorAt(7,5); - }); -}, { value: squareBracketMotionSandbox}); -testVim('[#, ]#', function(cm, vim, helpers) { - cm.setCursor(10, 3); - helpers.doKeys('2', '[', '#'); - helpers.assertCursorAt(4,0); - helpers.doKeys('5', ']', '#'); - helpers.assertCursorAt(17,0); - cm.setCursor(10, 3); - helpers.doKeys(']', '#'); - helpers.assertCursorAt(14,0); -}, { value: squareBracketMotionSandbox}); -testVim('[m, ]m, [M, ]M', function(cm, vim, helpers) { - cm.setCursor(11, 0); - helpers.doKeys('[', 'm'); - helpers.assertCursorAt(10,7); - helpers.doKeys('4', '[', 'm'); - helpers.assertCursorAt(1,3); - helpers.doKeys('5', ']', 'm'); - helpers.assertCursorAt(11,0); - helpers.doKeys('[', 'M'); - helpers.assertCursorAt(9,1); - helpers.doKeys('3', ']', 'M'); - helpers.assertCursorAt(15,0); - helpers.doKeys('5', '[', 'M'); - helpers.assertCursorAt(7,3); -}, { value: squareBracketMotionSandbox}); - -// Ex mode tests -testVim('ex_go_to_line', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doEx('4'); - helpers.assertCursorAt(3, 0); -}, { value: 'a\nb\nc\nd\ne\n'}); -testVim('ex_write', function(cm, vim, helpers) { - var tmp = CodeMirror.commands.save; - var written; - var actualCm; - CodeMirror.commands.save = function(cm) { - written = true; - actualCm = cm; - }; - // Test that w, wr, wri ... write all trigger :write. - var command = 'write'; - for (var i = 1; i < command.length; i++) { - written = false; - actualCm = null; - helpers.doEx(command.substring(0, i)); - eq(written, true); - eq(actualCm, cm); - } - CodeMirror.commands.save = tmp; -}); -testVim('ex_sort', function(cm, vim, helpers) { - helpers.doEx('sort'); - eq('Z\na\nb\nc\nd', cm.getValue()); -}, { value: 'b\nZ\nd\nc\na'}); -testVim('ex_sort_reverse', function(cm, vim, helpers) { - helpers.doEx('sort!'); - eq('d\nc\nb\na', cm.getValue()); -}, { value: 'b\nd\nc\na'}); -testVim('ex_sort_range', function(cm, vim, helpers) { - helpers.doEx('2,3sort'); - eq('b\nc\nd\na', cm.getValue()); -}, { value: 'b\nd\nc\na'}); -testVim('ex_sort_oneline', function(cm, vim, helpers) { - helpers.doEx('2sort'); - // Expect no change. - eq('b\nd\nc\na', cm.getValue()); -}, { value: 'b\nd\nc\na'}); -testVim('ex_sort_ignoreCase', function(cm, vim, helpers) { - helpers.doEx('sort i'); - eq('a\nb\nc\nd\nZ', cm.getValue()); -}, { value: 'b\nZ\nd\nc\na'}); -testVim('ex_sort_unique', function(cm, vim, helpers) { - helpers.doEx('sort u'); - eq('Z\na\nb\nc\nd', cm.getValue()); -}, { value: 'b\nZ\na\na\nd\na\nc\na'}); -testVim('ex_sort_decimal', function(cm, vim, helpers) { - helpers.doEx('sort d'); - eq('d3\n s5\n6\n.9', cm.getValue()); -}, { value: '6\nd3\n s5\n.9'}); -testVim('ex_sort_decimal_negative', function(cm, vim, helpers) { - helpers.doEx('sort d'); - eq('z-9\nd3\n s5\n6\n.9', cm.getValue()); -}, { value: '6\nd3\n s5\n.9\nz-9'}); -testVim('ex_sort_decimal_reverse', function(cm, vim, helpers) { - helpers.doEx('sort! d'); - eq('.9\n6\n s5\nd3', cm.getValue()); -}, { value: '6\nd3\n s5\n.9'}); -testVim('ex_sort_hex', function(cm, vim, helpers) { - helpers.doEx('sort x'); - eq(' s5\n6\n.9\n&0xB\nd3', cm.getValue()); -}, { value: '6\nd3\n s5\n&0xB\n.9'}); -testVim('ex_sort_octal', function(cm, vim, helpers) { - helpers.doEx('sort o'); - eq('.8\n.9\nd3\n s5\n6', cm.getValue()); -}, { value: '6\nd3\n s5\n.9\n.8'}); -testVim('ex_sort_decimal_mixed', function(cm, vim, helpers) { - helpers.doEx('sort d'); - eq('y\nz\nc1\nb2\na3', cm.getValue()); -}, { value: 'a3\nz\nc1\ny\nb2'}); -testVim('ex_sort_decimal_mixed_reverse', function(cm, vim, helpers) { - helpers.doEx('sort! d'); - eq('a3\nb2\nc1\nz\ny', cm.getValue()); -}, { value: 'a3\nz\nc1\ny\nb2'}); -// test for :global command -testVim('ex_global', function(cm, vim, helpers) { - cm.setCursor(0, 0); - helpers.doEx('g/one/s//two'); - eq('two two\n two two\n two two', cm.getValue()); - helpers.doEx('1,2g/two/s//one'); - eq('one one\n one one\n two two', cm.getValue()); -}, {value: 'one one\n one one\n one one'}); -testVim('ex_global_confirm', function(cm, vim, helpers) { - cm.setCursor(0, 0); - var onKeyDown; - var openDialogSave = cm.openDialog; - var KEYCODES = { - a: 65, - n: 78, - q: 81, - y: 89 - }; - // Intercept the ex command, 'global' - cm.openDialog = function(template, callback, options) { - // Intercept the prompt for the embedded ex command, 'substitute' - cm.openDialog = function(template, callback, options) { - onKeyDown = options.onKeyDown; - }; - callback('g/one/s//two/gc'); - }; - helpers.doKeys(':'); - var close = function() {}; - onKeyDown({keyCode: KEYCODES.n}, '', close); - onKeyDown({keyCode: KEYCODES.y}, '', close); - onKeyDown({keyCode: KEYCODES.a}, '', close); - onKeyDown({keyCode: KEYCODES.q}, '', close); - onKeyDown({keyCode: KEYCODES.y}, '', close); - eq('one two\n two two\n one one\n two one\n one one', cm.getValue()); -}, {value: 'one one\n one one\n one one\n one one\n one one'}); -// Basic substitute tests. -testVim('ex_substitute_same_line', function(cm, vim, helpers) { - cm.setCursor(1, 0); - helpers.doEx('s/one/two/g'); - eq('one one\n two two', cm.getValue()); -}, { value: 'one one\n one one'}); -testVim('ex_substitute_full_file', function(cm, vim, helpers) { - cm.setCursor(1, 0); - helpers.doEx('%s/one/two/g'); - eq('two two\n two two', cm.getValue()); -}, { value: 'one one\n one one'}); -testVim('ex_substitute_input_range', function(cm, vim, helpers) { - cm.setCursor(1, 0); - helpers.doEx('1,3s/\\d/0/g'); - eq('0\n0\n0\n4', cm.getValue()); -}, { value: '1\n2\n3\n4' }); -testVim('ex_substitute_visual_range', function(cm, vim, helpers) { - cm.setCursor(1, 0); - // Set last visual mode selection marks '< and '> at lines 2 and 4 - helpers.doKeys('V', '2', 'j', 'v'); - helpers.doEx('\'<,\'>s/\\d/0/g'); - eq('1\n0\n0\n0\n5', cm.getValue()); -}, { value: '1\n2\n3\n4\n5' }); -testVim('ex_substitute_empty_query', function(cm, vim, helpers) { - // If the query is empty, use last query. - cm.setCursor(1, 0); - cm.openDialog = helpers.fakeOpenDialog('1'); - helpers.doKeys('/'); - helpers.doEx('s//b/g'); - eq('abb ab2 ab3', cm.getValue()); -}, { value: 'a11 a12 a13' }); -testVim('ex_substitute_javascript', function(cm, vim, helpers) { - CodeMirror.Vim.setOption('pcre', false); - cm.setCursor(1, 0); - // Throw all the things that javascript likes to treat as special values - // into the replace part. All should be literal (this is VIM). - helpers.doEx('s/\\(\\d+\\)/$$ $\' $` $& \\1/g') - eq('a $$ $\' $` $& 0 b', cm.getValue()); -}, { value: 'a 0 b' }); -testVim('ex_substitute_empty_arguments', function(cm,vim,helpers) { - cm.setCursor(0, 0); - helpers.doEx('s/a/b/g'); - cm.setCursor(1, 0); - helpers.doEx('s'); - eq('b b\nb a', cm.getValue()); -}, {value: 'a a\na a'}); - -// More complex substitute tests that test both pcre and nopcre options. -function testSubstitute(name, options) { - testVim(name + '_pcre', function(cm, vim, helpers) { - cm.setCursor(1, 0); - CodeMirror.Vim.setOption('pcre', true); - helpers.doEx(options.expr); - eq(options.expectedValue, cm.getValue()); - }, options); - // If no noPcreExpr is defined, assume that it's the same as the expr. - var noPcreExpr = options.noPcreExpr ? options.noPcreExpr : options.expr; - testVim(name + '_nopcre', function(cm, vim, helpers) { - cm.setCursor(1, 0); - CodeMirror.Vim.setOption('pcre', false); - helpers.doEx(noPcreExpr); - eq(options.expectedValue, cm.getValue()); - }, options); -} -testSubstitute('ex_substitute_capture', { - value: 'a11 a12 a13', - expectedValue: 'a1111 a1212 a1313', - // $n is a backreference - expr: 's/(\\d+)/$1$1/g', - // \n is a backreference. - noPcreExpr: 's/\\(\\d+\\)/\\1\\1/g'}); -testSubstitute('ex_substitute_capture2', { - value: 'a 0 b', - expectedValue: 'a $00 b', - expr: 's/(\\d+)/$$$1$1/g', - noPcreExpr: 's/\\(\\d+\\)/$\\1\\1/g'}); -testSubstitute('ex_substitute_nocapture', { - value: 'a11 a12 a13', - expectedValue: 'a$1$1 a$1$1 a$1$1', - expr: 's/(\\d+)/$$1$$1/g', - noPcreExpr: 's/\\(\\d+\\)/$1$1/g'}); -testSubstitute('ex_substitute_nocapture2', { - value: 'a 0 b', - expectedValue: 'a $10 b', - expr: 's/(\\d+)/$$1$1/g', - noPcreExpr: 's/\\(\\d+\\)/\\$1\\1/g'}); -testSubstitute('ex_substitute_nocapture', { - value: 'a b c', - expectedValue: 'a $ c', - expr: 's/b/$$/', - noPcreExpr: 's/b/$/'}); -testSubstitute('ex_substitute_slash_regex', { - value: 'one/two \n three/four', - expectedValue: 'one|two \n three|four', - expr: '%s/\\//|'}); -testSubstitute('ex_substitute_pipe_regex', { - value: 'one|two \n three|four', - expectedValue: 'one,two \n three,four', - expr: '%s/\\|/,/', - noPcreExpr: '%s/|/,/'}); -testSubstitute('ex_substitute_or_regex', { - value: 'one|two \n three|four', - expectedValue: 'ana|twa \n thraa|faar', - expr: '%s/o|e|u/a/g', - noPcreExpr: '%s/o\\|e\\|u/a/g'}); -testSubstitute('ex_substitute_or_word_regex', { - value: 'one|two \n three|four', - expectedValue: 'five|five \n three|four', - expr: '%s/(one|two)/five/g', - noPcreExpr: '%s/\\(one\\|two\\)/five/g'}); -testSubstitute('ex_substitute_backslashslash_regex', { - value: 'one\\two \n three\\four', - expectedValue: 'one,two \n three,four', - expr: '%s/\\\\/,'}); -testSubstitute('ex_substitute_slash_replacement', { - value: 'one,two \n three,four', - expectedValue: 'one/two \n three/four', - expr: '%s/,/\\/'}); -testSubstitute('ex_substitute_backslash_replacement', { - value: 'one,two \n three,four', - expectedValue: 'one\\two \n three\\four', - expr: '%s/,/\\\\/g'}); -testSubstitute('ex_substitute_multibackslash_replacement', { - value: 'one,two \n three,four', - expectedValue: 'one\\\\\\\\two \n three\\\\\\\\four', // 2*8 backslashes. - expr: '%s/,/\\\\\\\\\\\\\\\\/g'}); // 16 backslashes. -testSubstitute('ex_substitute_braces_word', { - value: 'ababab abb ab{2}', - expectedValue: 'ab abb ab{2}', - expr: '%s/(ab){2}//g', - noPcreExpr: '%s/\\(ab\\)\\{2\\}//g'}); -testSubstitute('ex_substitute_braces_range', { - value: 'a aa aaa aaaa', - expectedValue: 'a a', - expr: '%s/a{2,3}//g', - noPcreExpr: '%s/a\\{2,3\\}//g'}); -testSubstitute('ex_substitute_braces_literal', { - value: 'ababab abb ab{2}', - expectedValue: 'ababab abb ', - expr: '%s/ab\\{2\\}//g', - noPcreExpr: '%s/ab{2}//g'}); -testSubstitute('ex_substitute_braces_char', { - value: 'ababab abb ab{2}', - expectedValue: 'ababab ab{2}', - expr: '%s/ab{2}//g', - noPcreExpr: '%s/ab\\{2\\}//g'}); -testSubstitute('ex_substitute_braces_no_escape', { - value: 'ababab abb ab{2}', - expectedValue: 'ababab ab{2}', - expr: '%s/ab{2}//g', - noPcreExpr: '%s/ab\\{2}//g'}); -testSubstitute('ex_substitute_count', { - value: '1\n2\n3\n4', - expectedValue: '1\n0\n0\n4', - expr: 's/\\d/0/i 2'}); -testSubstitute('ex_substitute_count_with_range', { - value: '1\n2\n3\n4', - expectedValue: '1\n2\n0\n0', - expr: '1,3s/\\d/0/ 3'}); -testSubstitute('ex_substitute_not_global', { - value: 'aaa\nbaa\ncaa', - expectedValue: 'xaa\nbxa\ncxa', - expr: '%s/a/x/'}); -function testSubstituteConfirm(name, command, initialValue, expectedValue, keys, finalPos) { - testVim(name, function(cm, vim, helpers) { - var savedOpenDialog = cm.openDialog; - var savedKeyName = CodeMirror.keyName; - var onKeyDown; - var recordedCallback; - var closed = true; // Start out closed, set false on second openDialog. - function close() { - closed = true; - } - // First openDialog should save callback. - cm.openDialog = function(template, callback, options) { - recordedCallback = callback; - } - // Do first openDialog. - helpers.doKeys(':'); - // Second openDialog should save keyDown handler. - cm.openDialog = function(template, callback, options) { - onKeyDown = options.onKeyDown; - closed = false; - }; - // Return the command to Vim and trigger second openDialog. - recordedCallback(command); - // The event should really use keyCode, but here just mock it out and use - // key and replace keyName to just return key. - CodeMirror.keyName = function (e) { return e.key; } - keys = keys.toUpperCase(); - for (var i = 0; i < keys.length; i++) { - is(!closed); - onKeyDown({ key: keys.charAt(i) }, '', close); - } - try { - eq(expectedValue, cm.getValue()); - helpers.assertCursorAt(finalPos); - is(closed); - } catch(e) { - throw e - } finally { - // Restore overriden functions. - CodeMirror.keyName = savedKeyName; - cm.openDialog = savedOpenDialog; - } - }, { value: initialValue }); -}; -testSubstituteConfirm('ex_substitute_confirm_emptydoc', - '%s/x/b/c', '', '', '', makeCursor(0, 0)); -testSubstituteConfirm('ex_substitute_confirm_nomatch', - '%s/x/b/c', 'ba a\nbab', 'ba a\nbab', '', makeCursor(0, 0)); -testSubstituteConfirm('ex_substitute_confirm_accept', - '%s/a/b/cg', 'ba a\nbab', 'bb b\nbbb', 'yyy', makeCursor(1, 1)); -testSubstituteConfirm('ex_substitute_confirm_random_keys', - '%s/a/b/cg', 'ba a\nbab', 'bb b\nbbb', 'ysdkywerty', makeCursor(1, 1)); -testSubstituteConfirm('ex_substitute_confirm_some', - '%s/a/b/cg', 'ba a\nbab', 'bb a\nbbb', 'yny', makeCursor(1, 1)); -testSubstituteConfirm('ex_substitute_confirm_all', - '%s/a/b/cg', 'ba a\nbab', 'bb b\nbbb', 'a', makeCursor(1, 1)); -testSubstituteConfirm('ex_substitute_confirm_accept_then_all', - '%s/a/b/cg', 'ba a\nbab', 'bb b\nbbb', 'ya', makeCursor(1, 1)); -testSubstituteConfirm('ex_substitute_confirm_quit', - '%s/a/b/cg', 'ba a\nbab', 'bb a\nbab', 'yq', makeCursor(0, 3)); -testSubstituteConfirm('ex_substitute_confirm_last', - '%s/a/b/cg', 'ba a\nbab', 'bb b\nbab', 'yl', makeCursor(0, 3)); -testSubstituteConfirm('ex_substitute_confirm_oneline', - '1s/a/b/cg', 'ba a\nbab', 'bb b\nbab', 'yl', makeCursor(0, 3)); -testSubstituteConfirm('ex_substitute_confirm_range_accept', - '1,2s/a/b/cg', 'aa\na \na\na', 'bb\nb \na\na', 'yyy', makeCursor(1, 0)); -testSubstituteConfirm('ex_substitute_confirm_range_some', - '1,3s/a/b/cg', 'aa\na \na\na', 'ba\nb \nb\na', 'ynyy', makeCursor(2, 0)); -testSubstituteConfirm('ex_substitute_confirm_range_all', - '1,3s/a/b/cg', 'aa\na \na\na', 'bb\nb \nb\na', 'a', makeCursor(2, 0)); -testSubstituteConfirm('ex_substitute_confirm_range_last', - '1,3s/a/b/cg', 'aa\na \na\na', 'bb\nb \na\na', 'yyl', makeCursor(1, 0)); -//:noh should clear highlighting of search-results but allow to resume search through n -testVim('ex_noh_clearSearchHighlight', function(cm, vim, helpers) { - cm.openDialog = helpers.fakeOpenDialog('match'); - helpers.doKeys('?'); - helpers.doEx('noh'); - eq(vim.searchState_.getOverlay(),null,'match-highlighting wasn\'t cleared'); - helpers.doKeys('n'); - helpers.assertCursorAt(0, 11,'can\'t resume search after clearing highlighting'); -}, { value: 'match nope match \n nope Match' }); -testVim('set_boolean', function(cm, vim, helpers) { - CodeMirror.Vim.defineOption('testoption', true, 'boolean'); - // Test default value is set. - is(CodeMirror.Vim.getOption('testoption')); - try { - // Test fail to set to non-boolean - CodeMirror.Vim.setOption('testoption', '5'); - fail(); - } catch (expected) {}; - // Test setOption - CodeMirror.Vim.setOption('testoption', false); - is(!CodeMirror.Vim.getOption('testoption')); -}); -testVim('ex_set_boolean', function(cm, vim, helpers) { - CodeMirror.Vim.defineOption('testoption', true, 'boolean'); - // Test default value is set. - is(CodeMirror.Vim.getOption('testoption')); - try { - // Test fail to set to non-boolean - helpers.doEx('set testoption=22'); - fail(); - } catch (expected) {}; - // Test setOption - helpers.doEx('set notestoption'); - is(!CodeMirror.Vim.getOption('testoption')); -}); -testVim('set_string', function(cm, vim, helpers) { - CodeMirror.Vim.defineOption('testoption', 'a', 'string'); - // Test default value is set. - eq('a', CodeMirror.Vim.getOption('testoption')); - try { - // Test fail to set non-string. - CodeMirror.Vim.setOption('testoption', true); - fail(); - } catch (expected) {}; - try { - // Test fail to set 'notestoption' - CodeMirror.Vim.setOption('notestoption', 'b'); - fail(); - } catch (expected) {}; - // Test setOption - CodeMirror.Vim.setOption('testoption', 'c'); - eq('c', CodeMirror.Vim.getOption('testoption')); -}); -testVim('ex_set_string', function(cm, vim, helpers) { - CodeMirror.Vim.defineOption('testopt', 'a', 'string'); - // Test default value is set. - eq('a', CodeMirror.Vim.getOption('testopt')); - try { - // Test fail to set 'notestopt' - helpers.doEx('set notestopt=b'); - fail(); - } catch (expected) {}; - // Test setOption - helpers.doEx('set testopt=c') - eq('c', CodeMirror.Vim.getOption('testopt')); - helpers.doEx('set testopt=c') - eq('c', CodeMirror.Vim.getOption('testopt', cm)); //local || global - eq('c', CodeMirror.Vim.getOption('testopt', cm, {scope: 'local'})); // local - eq('c', CodeMirror.Vim.getOption('testopt', cm, {scope: 'global'})); // global - eq('c', CodeMirror.Vim.getOption('testopt')); // global - // Test setOption global - helpers.doEx('setg testopt=d') - eq('c', CodeMirror.Vim.getOption('testopt', cm)); - eq('c', CodeMirror.Vim.getOption('testopt', cm, {scope: 'local'})); - eq('d', CodeMirror.Vim.getOption('testopt', cm, {scope: 'global'})); - eq('d', CodeMirror.Vim.getOption('testopt')); - // Test setOption local - helpers.doEx('setl testopt=e') - eq('e', CodeMirror.Vim.getOption('testopt', cm)); - eq('e', CodeMirror.Vim.getOption('testopt', cm, {scope: 'local'})); - eq('d', CodeMirror.Vim.getOption('testopt', cm, {scope: 'global'})); - eq('d', CodeMirror.Vim.getOption('testopt')); -}); -testVim('ex_set_callback', function(cm, vim, helpers) { - var global; - - function cb(val, cm, cfg) { - if (val === undefined) { - // Getter - if (cm) { - return cm._local; - } else { - return global; - } - } else { - // Setter - if (cm) { - cm._local = val; - } else { - global = val; - } - } - } - - CodeMirror.Vim.defineOption('testopt', 'a', 'string', cb); - // Test default value is set. - eq('a', CodeMirror.Vim.getOption('testopt')); - try { - // Test fail to set 'notestopt' - helpers.doEx('set notestopt=b'); - fail(); - } catch (expected) {}; - // Test setOption (Identical to the string tests, but via callback instead) - helpers.doEx('set testopt=c') - eq('c', CodeMirror.Vim.getOption('testopt', cm)); //local || global - eq('c', CodeMirror.Vim.getOption('testopt', cm, {scope: 'local'})); // local - eq('c', CodeMirror.Vim.getOption('testopt', cm, {scope: 'global'})); // global - eq('c', CodeMirror.Vim.getOption('testopt')); // global - // Test setOption global - helpers.doEx('setg testopt=d') - eq('c', CodeMirror.Vim.getOption('testopt', cm)); - eq('c', CodeMirror.Vim.getOption('testopt', cm, {scope: 'local'})); - eq('d', CodeMirror.Vim.getOption('testopt', cm, {scope: 'global'})); - eq('d', CodeMirror.Vim.getOption('testopt')); - // Test setOption local - helpers.doEx('setl testopt=e') - eq('e', CodeMirror.Vim.getOption('testopt', cm)); - eq('e', CodeMirror.Vim.getOption('testopt', cm, {scope: 'local'})); - eq('d', CodeMirror.Vim.getOption('testopt', cm, {scope: 'global'})); - eq('d', CodeMirror.Vim.getOption('testopt')); -}) -testVim('ex_set_filetype', function(cm, vim, helpers) { - CodeMirror.defineMode('test_mode', function() { - return {token: function(stream) { - stream.match(/^\s+|^\S+/); - }}; - }); - CodeMirror.defineMode('test_mode_2', function() { - return {token: function(stream) { - stream.match(/^\s+|^\S+/); - }}; - }); - // Test mode is set. - helpers.doEx('set filetype=test_mode'); - eq('test_mode', cm.getMode().name); - // Test 'ft' alias also sets mode. - helpers.doEx('set ft=test_mode_2'); - eq('test_mode_2', cm.getMode().name); -}); -testVim('ex_set_filetype_null', function(cm, vim, helpers) { - CodeMirror.defineMode('test_mode', function() { - return {token: function(stream) { - stream.match(/^\s+|^\S+/); - }}; - }); - cm.setOption('mode', 'test_mode'); - // Test mode is set to null. - helpers.doEx('set filetype='); - eq('null', cm.getMode().name); -}); -// TODO: Reset key maps after each test. -testVim('ex_map_key2key', function(cm, vim, helpers) { - helpers.doEx('map a x'); - helpers.doKeys('a'); - helpers.assertCursorAt(0, 0); - eq('bc', cm.getValue()); -}, { value: 'abc' }); -testVim('ex_unmap_key2key', function(cm, vim, helpers) { - helpers.doEx('unmap a'); - helpers.doKeys('a'); - eq('vim-insert', cm.getOption('keyMap')); -}, { value: 'abc' }); -testVim('ex_unmap_key2key_does_not_remove_default', function(cm, vim, helpers) { - try { - helpers.doEx('unmap a'); - fail(); - } catch (expected) {} - helpers.doKeys('a'); - eq('vim-insert', cm.getOption('keyMap')); -}, { value: 'abc' }); -testVim('ex_map_key2key_to_colon', function(cm, vim, helpers) { - helpers.doEx('map ; :'); - var dialogOpened = false; - cm.openDialog = function() { - dialogOpened = true; - } - helpers.doKeys(';'); - eq(dialogOpened, true); -}); -testVim('ex_map_ex2key:', function(cm, vim, helpers) { - helpers.doEx('map :del x'); - helpers.doEx('del'); - helpers.assertCursorAt(0, 0); - eq('bc', cm.getValue()); -}, { value: 'abc' }); -testVim('ex_map_ex2ex', function(cm, vim, helpers) { - helpers.doEx('map :del :w'); - var tmp = CodeMirror.commands.save; - var written = false; - var actualCm; - CodeMirror.commands.save = function(cm) { - written = true; - actualCm = cm; - }; - helpers.doEx('del'); - CodeMirror.commands.save = tmp; - eq(written, true); - eq(actualCm, cm); -}); -testVim('ex_map_key2ex', function(cm, vim, helpers) { - helpers.doEx('map a :w'); - var tmp = CodeMirror.commands.save; - var written = false; - var actualCm; - CodeMirror.commands.save = function(cm) { - written = true; - actualCm = cm; - }; - helpers.doKeys('a'); - CodeMirror.commands.save = tmp; - eq(written, true); - eq(actualCm, cm); -}); -testVim('ex_map_key2key_visual_api', function(cm, vim, helpers) { - CodeMirror.Vim.map('b', ':w', 'visual'); - var tmp = CodeMirror.commands.save; - var written = false; - var actualCm; - CodeMirror.commands.save = function(cm) { - written = true; - actualCm = cm; - }; - // Mapping should not work in normal mode. - helpers.doKeys('b'); - eq(written, false); - // Mapping should work in visual mode. - helpers.doKeys('v', 'b'); - eq(written, true); - eq(actualCm, cm); - - CodeMirror.commands.save = tmp; -}); -testVim('ex_imap', function(cm, vim, helpers) { - CodeMirror.Vim.map('jk', '', 'insert'); - helpers.doKeys('i'); - is(vim.insertMode); - helpers.doKeys('j', 'k'); - is(!vim.insertMode); -}) - -// Testing registration of functions as ex-commands and mapping to -keys -testVim('ex_api_test', function(cm, vim, helpers) { - var res=false; - var val='from'; - CodeMirror.Vim.defineEx('extest','ext',function(cm,params){ - if(params.args)val=params.args[0]; - else res=true; - }); - helpers.doEx(':ext to'); - eq(val,'to','Defining ex-command failed'); - CodeMirror.Vim.map('',':ext'); - helpers.doKeys('',''); - is(res,'Mapping to key failed'); -}); -// For now, this test needs to be last because it messes up : for future tests. -testVim('ex_map_key2key_from_colon', function(cm, vim, helpers) { - helpers.doEx('map : x'); - helpers.doKeys(':'); - helpers.assertCursorAt(0, 0); - eq('bc', cm.getValue()); -}, { value: 'abc' }); - -// Test event handlers -testVim('beforeSelectionChange', function(cm, vim, helpers) { - cm.setCursor(0, 100); - eqPos(cm.getCursor('head'), cm.getCursor('anchor')); -}, { value: 'abc' }); - - -}); - - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec(); -} diff --git a/lib/ace/layer/cursor.js b/lib/ace/layer/cursor.js index 53c30e56..f43b36b7 100644 --- a/lib/ace/layer/cursor.js +++ b/lib/ace/layer/cursor.js @@ -1,30 +1,39 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: +/* vim:ts=4:sts=4:sw=4: + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * Julian Viereck + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,40 +41,19 @@ define(function(require, exports, module) { "use strict"; var dom = require("../lib/dom"); -var IE8; var Cursor = function(parentEl) { this.element = dom.createElement("div"); this.element.className = "ace_layer ace_cursor-layer"; parentEl.appendChild(this.element); - - if (IE8 === undefined) - IE8 = "opacity" in this.element; this.isVisible = false; - this.isBlinking = true; - this.blinkInterval = 1000; - this.smoothBlinking = false; this.cursors = []; this.cursor = this.addCursor(); - dom.addCssClass(this.element, "ace_hidden-cursors"); - this.$updateCursors = this.$updateVisibility.bind(this); }; (function() { - - this.$updateVisibility = function(val) { - var cursors = this.cursors; - for (var i = cursors.length; i--; ) - cursors[i].style.visibility = val ? "" : "hidden"; - }; - this.$updateOpacity = function(val) { - var cursors = this.cursors; - for (var i = cursors.length; i--; ) - cursors[i].style.opacity = val ? "" : "0"; - }; - this.$padding = 0; this.setPadding = function(padding) { @@ -76,35 +64,15 @@ var Cursor = function(parentEl) { this.session = session; }; - this.setBlinking = function(blinking) { - if (blinking != this.isBlinking){ - this.isBlinking = blinking; - this.restartTimer(); - } - }; - - this.setBlinkInterval = function(blinkInterval) { - if (blinkInterval != this.blinkInterval){ - this.blinkInterval = blinkInterval; - this.restartTimer(); - } - }; - - this.setSmoothBlinking = function(smoothBlinking) { - if (smoothBlinking != this.smoothBlinking && !IE8) { - this.smoothBlinking = smoothBlinking; - dom.setCssClass(this.element, "ace_smooth-blinking", smoothBlinking); - this.$updateCursors(true); - this.$updateCursors = (smoothBlinking - ? this.$updateOpacity - : this.$updateVisibility).bind(this); - this.restartTimer(); - } - }; - this.addCursor = function() { var el = dom.createElement("div"); - el.className = "ace_cursor"; + 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; @@ -120,118 +88,112 @@ var Cursor = function(parentEl) { this.hideCursor = function() { this.isVisible = false; - dom.addCssClass(this.element, "ace_hidden-cursors"); - this.restartTimer(); + for (var i = this.cursors.length; i--; ) + dom.addCssClass(this.cursors[i], "ace_hidden"); + clearInterval(this.blinkId); }; this.showCursor = function() { this.isVisible = true; - dom.removeCssClass(this.element, "ace_hidden-cursors"); + for (var i = this.cursors.length; i--; ) + dom.removeCssClass(this.cursors[i], "ace_hidden"); + + this.element.style.visibility = ""; this.restartTimer(); }; this.restartTimer = function() { - var update = this.$updateCursors; - clearInterval(this.intervalId); - clearTimeout(this.timeoutId); - if (this.smoothBlinking) { - dom.removeCssClass(this.element, "ace_smooth-blinking"); - } - - update(true); - - if (!this.isBlinking || !this.blinkInterval || !this.isVisible) + clearInterval(this.blinkId); + if (!this.isVisible) return; - if (this.smoothBlinking) { - setTimeout(function(){ - dom.addCssClass(this.element, "ace_smooth-blinking"); - }.bind(this)); - } - - var blink = function(){ - this.timeoutId = setTimeout(function() { - update(false); - }, 0.6 * this.blinkInterval); - }.bind(this); - - this.intervalId = setInterval(function() { - update(true); - blink(); - }, this.blinkInterval); - - blink(); + 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 (!this.config || !this.session) { + return { + left : 0, + top : 0 + }; + } if (!position) position = this.session.selection.getCursor(); var pos = this.session.documentToScreenPosition(position); - var cursorLeft = this.$padding + pos.column * this.config.characterWidth; + var 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}; + return { + left : cursorLeft, + top : cursorTop + }; }; this.update = function(config) { this.config = config; - var selections = this.session.$selectionMarkers; - var i = 0, cursorIndex = 0; + if (this.session.selectionMarkerCount > 0) { + var selections = this.session.$selectionMarkers; + var i = 0, sel, cursorIndex = 0; - if (selections === undefined || selections.length === 0){ - selections = [{cursor: null}]; - } + for (var i = selections.length; i--; ) { + sel = selections[i]; + var pixelPos = this.getPixelPosition(sel.cursor, true); - for (var i = 0, n = selections.length; i < n; i++) { - var pixelPos = this.getPixelPosition(selections[i].cursor, true); - if ((pixelPos.top > config.height + config.offset || - pixelPos.top < 0) && i > 1) { - continue; - } + var style = (this.cursors[cursorIndex++] || this.addCursor()).style; - var style = (this.cursors[cursorIndex++] || this.addCursor()).style; - - if (!this.drawCursor) { style.left = pixelPos.left + "px"; style.top = pixelPos.top + "px"; style.width = config.characterWidth + "px"; style.height = config.lineHeight + "px"; - } else { - this.drawCursor(style, pixelPos, config, selections[i], this.session); } + 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(); } - while (this.cursors.length > cursorIndex) - this.removeCursor(); var overwrite = this.session.getOverwrite(); - this.$setOverwrite(overwrite); + if (overwrite != this.overwrite) + this.$setOverite(overwrite); // cache for textarea and gutter highlight this.$pixelPos = pixelPos; + this.restartTimer(); }; - - this.drawCursor = null; - this.$setOverwrite = function(overwrite) { - if (overwrite != this.overwrite) { - this.overwrite = overwrite; + this.$setOverite = function(overwrite) { + this.overwrite = overwrite; + for (var i = this.cursors.length; i--; ) { if (overwrite) - dom.addCssClass(this.element, "ace_overwrite-cursors"); + dom.addCssClass(this.cursors[i], "ace_overwrite"); else - dom.removeCssClass(this.element, "ace_overwrite-cursors"); + dom.removeCssClass(this.cursors[i], "ace_overwrite"); } }; this.destroy = function() { - clearInterval(this.intervalId); - clearTimeout(this.timeoutId); - }; + clearInterval(this.blinkId); + } }).call(Cursor.prototype); diff --git a/lib/ace/layer/font_metrics.js b/lib/ace/layer/font_metrics.js deleted file mode 100644 index 715c6cf3..00000000 --- a/lib/ace/layer/font_metrics.js +++ /dev/null @@ -1,176 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(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 CHAR_COUNT = 0; - -var FontMetrics = exports.FontMetrics = function(parentEl, interval) { - this.el = dom.createElement("div"); - this.$setMeasureNodeStyles(this.el.style, true); - - this.$main = dom.createElement("div"); - this.$setMeasureNodeStyles(this.$main.style); - - this.$measureNode = dom.createElement("div"); - this.$setMeasureNodeStyles(this.$measureNode.style); - - - this.el.appendChild(this.$main); - this.el.appendChild(this.$measureNode); - parentEl.appendChild(this.el); - - if (!CHAR_COUNT) - this.$testFractionalRect(); - this.$measureNode.innerHTML = lang.stringRepeat("X", CHAR_COUNT); - - this.$characterSize = {width: 0, height: 0}; - this.checkForSizeChanges(); -}; - -(function() { - - oop.implement(this, EventEmitter); - - this.$characterSize = {width: 0, height: 0}; - - this.$testFractionalRect = function() { - var el = dom.createElement("div"); - this.$setMeasureNodeStyles(el.style); - el.style.width = "0.2px"; - document.documentElement.appendChild(el); - var w = el.getBoundingClientRect().width; - if (w > 0 && w < 1) - CHAR_COUNT = 50; - else - CHAR_COUNT = 100; - el.parentNode.removeChild(el); - }; - - this.$setMeasureNodeStyles = function(style, isRoot) { - style.width = style.height = "auto"; - style.left = style.top = "0px"; - style.visibility = "hidden"; - style.position = "absolute"; - style.whiteSpace = "pre"; - - if (useragent.isIE < 8) { - style["font-family"] = "inherit"; - } else { - style.font = "inherit"; - } - style.overflow = isRoot ? "hidden" : "visible"; - }; - - this.checkForSizeChanges = function() { - var size = this.$measureSizes(); - if (size && (this.$characterSize.width !== size.width || this.$characterSize.height !== size.height)) { - this.$measureNode.style.fontWeight = "bold"; - var boldSize = this.$measureSizes(); - this.$measureNode.style.fontWeight = ""; - this.$characterSize = size; - this.charSizes = Object.create(null); - this.allowBoldFonts = boldSize && boldSize.width === size.width && boldSize.height === size.height; - this._emit("changeCharacterSize", {data: size}); - } - }; - - this.$pollSizeChanges = function() { - if (this.$pollSizeChangesTimer) - return this.$pollSizeChangesTimer; - var self = this; - return this.$pollSizeChangesTimer = setInterval(function() { - self.checkForSizeChanges(); - }, 500); - }; - - this.setPolling = function(val) { - if (val) { - this.$pollSizeChanges(); - } else if (this.$pollSizeChangesTimer) { - clearInterval(this.$pollSizeChangesTimer); - this.$pollSizeChangesTimer = 0; - } - }; - - this.$measureSizes = function() { - if (CHAR_COUNT === 50) { - var rect = null; - try { - rect = this.$measureNode.getBoundingClientRect(); - } catch(e) { - rect = {width: 0, height:0 }; - }; - var size = { - height: rect.height, - width: rect.width / CHAR_COUNT - }; - } else { - var size = { - height: this.$measureNode.clientHeight, - width: this.$measureNode.clientWidth / CHAR_COUNT - }; - } - // 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.$measureCharWidth = function(ch) { - this.$main.innerHTML = lang.stringRepeat(ch, CHAR_COUNT); - var rect = this.$main.getBoundingClientRect(); - return rect.width / CHAR_COUNT; - }; - - this.getCharacterWidth = function(ch) { - var w = this.charSizes[ch]; - if (w === undefined) { - this.charSizes[ch] = this.$measureCharWidth(ch) / this.$characterSize.width; - } - return w; - }; - - this.destroy = function() { - clearInterval(this.$pollSizeChangesTimer); - if (this.el && this.el.parentNode) - this.el.parentNode.removeChild(this.el); - }; - -}).call(FontMetrics.prototype); - -}); diff --git a/lib/ace/layer/gutter.js b/lib/ace/layer/gutter.js index dc1055c2..fde13a0e 100644 --- a/lib/ace/layer/gutter.js +++ b/lib/ace/layer/gutter.js @@ -1,30 +1,39 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: +/* vim:ts=4:sts=4:sw=4: + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * Julian Viereck + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -33,7 +42,6 @@ define(function(require, exports, module) { var dom = require("../lib/dom"); var oop = require("../lib/oop"); -var lang = require("../lib/lang"); var EventEmitter = require("../lib/event_emitter").EventEmitter; var Gutter = function(parentEl) { @@ -45,21 +53,14 @@ var Gutter = function(parentEl) { this.gutterWidth = 0; this.$annotations = []; - this.$updateAnnotations = this.$updateAnnotations.bind(this); - - this.$cells = []; }; (function() { oop.implement(this, EventEmitter); - + this.setSession = function(session) { - if (this.session) - this.session.removeEventListener("change", this.$updateAnnotations); this.session = session; - if (session) - session.on("change", this.$updateAnnotations); }; this.addGutterDecoration = function(row, className){ @@ -77,173 +78,93 @@ var Gutter = function(parentEl) { this.setAnnotations = function(annotations) { // iterate over sparse array this.$annotations = []; - for (var i = 0; i < annotations.length; i++) { - var annotation = annotations[i]; - var row = annotation.row; - var rowInfo = this.$annotations[row]; - if (!rowInfo) - rowInfo = this.$annotations[row] = {text: []}; - - var annoText = annotation.text; - annoText = annoText ? lang.escapeHTML(annoText) : annotation.html || ""; + for (var row in annotations) if (annotations.hasOwnProperty(row)) { + var rowAnnotations = annotations[row]; + if (!rowAnnotations) + continue; - 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.$updateAnnotations = function (delta) { - if (!this.$annotations.length) - return; - var firstRow = delta.start.row; - var len = delta.end.row - firstRow; - if (len === 0) { - // do nothing - } else if (delta.action == 'remove') { - this.$annotations.splice(firstRow, len + 1, null); - } else { - var args = new Array(len + 1); - args.unshift(firstRow, 1); - this.$annotations.splice.apply(this.$annotations, args); + var rowInfo = this.$annotations[row] = { + text: [] + }; + for (var i=0; i foldStart) { - row = fold.end.row + 1; - fold = session.getNextFoldLine(row, fold); - foldStart = fold ? fold.start.row : Infinity; + if(i > foldStart) { + i = fold.end.row + 1; + fold = this.session.getNextFoldLine(i, fold); + foldStart = fold ?fold.start.row :Infinity; } - if (row > lastRow) { - while (this.$cells.length > index + 1) { - cell = this.$cells.pop(); - this.element.removeChild(cell.element); - } + if(i > lastRow) break; - } - cell = this.$cells[++index]; - if (!cell) { - cell = {element: null, textNode: null, foldWidget: null}; - cell.element = dom.createElement("div"); - cell.textNode = document.createTextNode(''); - cell.element.appendChild(cell.textNode); - this.element.appendChild(cell.element); - this.$cells[index] = cell; - } - - var className = "ace_gutter-cell "; - if (breakpoints[row]) - className += breakpoints[row]; - if (decorations[row]) - className += decorations[row]; - if (this.$annotations[row]) - className += this.$annotations[row].className; - if (cell.element.className != className) - cell.element.className = className; - - var height = session.getRowLength(row) * config.lineHeight + "px"; - if (height != cell.element.style.height) - cell.element.style.height = height; + var annotation = this.$annotations[i] || emptyAnno; + html.push( + "
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ", + lastLineNumber = i + 1 + ); if (foldWidgets) { - var c = foldWidgets[row]; + var c = foldWidgets[i]; // check if cached value is invalidated and we need to recompute if (c == null) - c = foldWidgets[row] = session.getFoldWidget(row); + c = foldWidgets[i] = this.session.getFoldWidget(i); + if (c) + html.push( + "" + ); } - if (c) { - if (!cell.foldWidget) { - cell.foldWidget = dom.createElement("span"); - cell.element.appendChild(cell.foldWidget); - } - var className = "ace_fold-widget ace_" + c; - if (c == "start" && row == foldStart && row < fold.end.row) - className += " ace_closed"; - else - className += " ace_open"; - if (cell.foldWidget.className != className) - cell.foldWidget.className = className; + html.push("
                                                                                                                                                                                                                                                                                                                                                                                                                                                              "); - var height = config.lineHeight + "px"; - if (cell.foldWidget.style.height != height) - cell.foldWidget.style.height = height; - } else { - if (cell.foldWidget) { - cell.element.removeChild(cell.foldWidget); - cell.foldWidget = null; - } - } - - var text = lastLineNumber = gutterRenderer - ? gutterRenderer.getText(session, row) - : row + firstLineNumber; - if (text != cell.textNode.data) - cell.textNode.data = text; - - row++; + i++; } + this.element = dom.setInnerHtml(this.element, html.join("")); this.element.style.height = config.minHeight + "px"; - - if (this.$fixedWidth || session.$useWrapMode) - lastLineNumber = session.getLength() + firstLineNumber; - - var gutterWidth = gutterRenderer - ? gutterRenderer.getWidth(session, lastLineNumber, config) - : lastLineNumber.toString().length * config.characterWidth; + 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 && !isNaN(gutterWidth)) { + if (gutterWidth !== this.gutterWidth) { this.gutterWidth = gutterWidth; this.element.style.width = Math.ceil(this.gutterWidth) + "px"; this._emit("changeGutterWidth", gutterWidth); } }; - this.$fixedWidth = false; - - this.$showLineNumbers = true; - this.$renderer = ""; - this.setShowLineNumbers = function(show) { - this.$renderer = !show && { - getWidth: function() {return ""}, - getText: function() {return ""} - }; - }; - - this.getShowLineNumbers = function() { - return this.$showLineNumbers; - }; - this.$showFoldWidgets = true; this.setShowFoldWidgets = function(show) { if (show) @@ -263,9 +184,9 @@ var Gutter = function(parentEl) { 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 || 0; - this.$padding.right = parseInt(style.paddingRight) || 0; + this.$padding = {} + this.$padding.left = parseInt(style.paddingLeft) + 1; + this.$padding.right = parseInt(style.paddingRight); return this.$padding; }; diff --git a/lib/ace/layer/marker.js b/lib/ace/layer/marker.js index 9818d225..127cf7f3 100644 --- a/lib/ace/layer/marker.js +++ b/lib/ace/layer/marker.js @@ -1,30 +1,39 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: +/* vim:ts=4:sts=4:sw=4: + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * Julian Viereck + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -78,141 +87,123 @@ var Marker = function(parentEl) { range = range.toScreenRange(this.session); if (marker.renderer) { var top = this.$getTop(range.start.row, config); - var left = this.$padding + range.start.column * config.characterWidth; + var left = Math.round( + this.$padding + range.start.column * config.characterWidth + ); marker.renderer(html, range, left, top, config); - } else if (marker.type == "fullLine") { - this.drawFullLineMarker(html, range, marker.clazz, config); - } else if (marker.type == "screenLine") { - this.drawScreenLineMarker(html, range, marker.clazz, config); - } else if (range.isMultiLine()) { - if (marker.type == "text") + } + else if (range.isMultiLine()) { + if (marker.type == "text") { this.drawTextMarker(html, range, marker.clazz, config); - else - this.drawMultiLineMarker(html, range, marker.clazz, config); - } else { - this.drawSingleLineMarker(html, range, marker.clazz + " ace_start" + " ace_br15", 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.innerHTML = html.join(""); + this.element = dom.setInnerHtml(this.element, html.join("")); }; this.$getTop = function(row, layerConfig) { return (row - layerConfig.firstRowScreen) * layerConfig.lineHeight; }; - function getBorderClass(tl, tr, br, bl) { - return (tl ? 1 : 0) | (tr ? 2 : 0) | (br ? 4 : 0) | (bl ? 8 : 0); - } // Draws a marker, which spans a range of text on multiple lines - this.drawTextMarker = function(stringBuilder, range, clazz, layerConfig, extraStyle) { - var session = this.session; - var start = range.start.row; - var end = range.end.row; - var row = start; - var prev = 0; - var curr = 0; - var next = session.getScreenLastRowColumn(row); - var lineRange = new Range(row, range.start.column, row, curr); - for (; row <= end; row++) { - lineRange.start.row = lineRange.end.row = row; - lineRange.start.column = row == start ? range.start.column : session.getRowWrapIndent(row); - lineRange.end.column = next; - prev = curr; - curr = next; - next = row + 1 < end ? session.getScreenLastRowColumn(row + 1) : row == end ? 0 : range.end.column; - this.drawSingleLineMarker(stringBuilder, lineRange, - clazz + (row == start ? " ace_start" : "") + " ace_br" - + getBorderClass(row == start || row == start + 1 && range.start.column, prev < curr, curr > next, row == end), - layerConfig, row == end ? 0 : 1, extraStyle); + 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, extraStyle) { + 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 padding = this.$padding; var height = config.lineHeight; var top = this.$getTop(range.start.row, config); - var left = padding + range.start.column * config.characterWidth; - extraStyle = extraStyle || ""; + var left = Math.round(padding + range.start.column * config.characterWidth); stringBuilder.push( - "
                                                                                                                                                                                                                                                                                                                                                                                                                                                              " + "left:", left, "px;'>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              " ); // from start of the last line to the selection end top = this.$getTop(range.end.row, config); - var width = range.end.column * config.characterWidth; + var width = Math.round(range.end.column * config.characterWidth); stringBuilder.push( - "
                                                                                                                                                                                                                                                                                                                                                                                                                                                              " + "left:", padding, "px;'>
                                                                                                                                                                                                                                                                                                                                                                                                                                                              " ); // all the complete lines height = (range.end.row - range.start.row - 1) * config.lineHeight; - if (height <= 0) + if (height < 0) return; top = this.$getTop(range.start.row + 1, config); - - var radiusClass = (range.start.column ? 1 : 0) | (range.end.column ? 0 : 8); stringBuilder.push( - "
                                                                                                                                                                                                                                                                                                                                                                                                                                                              " + "left:", padding, "px;'>" ); }; // Draws a marker which covers part or whole width of a single screen line - this.drawSingleLineMarker = function(stringBuilder, range, clazz, config, extraLength, extraStyle) { - var height = config.lineHeight; - var width = (range.end.column + (extraLength || 0) - range.start.column) * config.characterWidth; + this.drawSingleLineMarker = function(stringBuilder, range, clazz, layerConfig, extraLength, type) { + var padding = type === "background" ? 0 : this.$padding; + var height = layerConfig.lineHeight; - var top = this.$getTop(range.start.row, config); - var left = this.$padding + range.start.column * config.characterWidth; + 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( "
                                                                                                                                                                                                                                                                                                                                                                                                                                                              " - ); - }; - - this.drawFullLineMarker = function(stringBuilder, range, clazz, config, extraStyle) { - var top = this.$getTop(range.start.row, config); - var height = config.lineHeight; - if (range.start.row != range.end.row) - height += this.$getTop(range.end.row, config) - top; - - stringBuilder.push( - "
                                                                                                                                                                                                                                                                                                                                                                                                                                                              " - ); - }; - - this.drawScreenLineMarker = function(stringBuilder, range, clazz, config, extraStyle) { - var top = this.$getTop(range.start.row, config); - var height = config.lineHeight; - - stringBuilder.push( - "
                                                                                                                                                                                                                                                                                                                                                                                                                                                              " + "left:", left,"px;'>" ); }; diff --git a/lib/ace/layer/text.js b/lib/ace/layer/text.js index 01afb9f3..3bf73d24 100644 --- a/lib/ace/layer/text.js +++ b/lib/ace/layer/text.js @@ -1,30 +1,41 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: +/* vim:ts=4:sts=4:sw=4: + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * Julian Viereck + * Mihai Sucan + * Irakli Gozalishvili (http://jeditoolkit.com) + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -41,62 +52,151 @@ var Text = function(parentEl) { this.element = dom.createElement("div"); this.element.className = "ace_layer ace_text-layer"; parentEl.appendChild(this.element); - this.$updateEolChar = this.$updateEolChar.bind(this); + + this.$characterSize = this.$measureSizes() || {width: 0, height: 0}; + this.$pollSizeChanges(); }; (function() { oop.implement(this, EventEmitter); - this.EOF_CHAR = "\xB6"; - this.EOL_CHAR_LF = "\xAC"; - this.EOL_CHAR_CRLF = "\xa4"; - this.EOL_CHAR = this.EOL_CHAR_LF; - this.TAB_CHAR = "\u2014"; //"\u21E5"; - this.SPACE_CHAR = "\xB7"; + this.EOF_CHAR = "\xB6"; //"¶"; + this.EOL_CHAR = "\xAC"; //"¬"; + this.TAB_CHAR = "\u2192"; //"→" "\u21E5"; + this.SPACE_CHAR = "\xB7"; //"·"; this.$padding = 0; - this.$updateEolChar = function() { - var EOL_CHAR = this.session.doc.getNewLineCharacter() == "\n" - ? this.EOL_CHAR_LF - : this.EOL_CHAR_CRLF; - if (this.EOL_CHAR != EOL_CHAR) { - this.EOL_CHAR = EOL_CHAR; - return true; - } - } - this.setPadding = function(padding) { this.$padding = padding; this.element.style.padding = "0 " + padding + "px"; }; this.getLineHeight = function() { - return this.$fontMetrics.$characterSize.height || 0; + return this.$characterSize.height || 1; }; this.getCharacterWidth = function() { - return this.$fontMetrics.$characterSize.width || 0; + return this.$characterSize.width || 1; }; - - this.$setFontMetrics = function(measure) { - this.$fontMetrics = measure; - this.$fontMetrics.on("changeCharacterSize", function(e) { - this._signal("changeCharacterSize", e); - }.bind(this)); - this.$pollSizeChanges(); - } this.checkForSizeChanges = function() { - this.$fontMetrics.checkForSizeChanges(); + 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() { - return this.$pollSizeChangesTimer = this.$fontMetrics.$pollSizeChanges(); + 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; - if (session) - this.$computeTabString(); + this.$computeTabString(); }; this.showInvisibles = false; @@ -127,31 +227,26 @@ var Text = function(parentEl) { var tabStr = this.$tabStrings = [0]; for (var i = 1; i < tabSize + 1; i++) { if (this.showInvisibles) { - tabStr.push("" - + lang.stringRepeat(this.TAB_CHAR, i) + tabStr.push("" + + this.TAB_CHAR + + Array(i).join(" ") + ""); } else { - tabStr.push(lang.stringRepeat(" ", i)); + tabStr.push(new Array(i+1).join(" ")); } } if (this.displayIndentGuides) { this.$indentGuideRe = /\s\S| \t|\t |\s$/; var className = "ace_indent-guide"; - var spaceClass = ""; - var tabClass = ""; + var content = Array(this.tabSize + 1).join(" "); + var tabContent = content; if (this.showInvisibles) { className += " ace_invisible"; - spaceClass = " ace_invisible_space"; - tabClass = " ace_invisible_tab"; - var spaceContent = lang.stringRepeat(this.SPACE_CHAR, this.tabSize); - var tabContent = lang.stringRepeat(this.TAB_CHAR, this.tabSize); - } else{ - var spaceContent = lang.stringRepeat(" ", this.tabSize); - var tabContent = spaceContent; + tabContent = this.TAB_CHAR + content.substr(6); } - this.$tabStrings[" "] = "" + spaceContent + ""; - this.$tabStrings["\t"] = "" + tabContent + ""; + this.$tabStrings[" "] = "" + content + ""; + this.$tabStrings["\t"] = "" + tabContent + ""; } }; @@ -202,8 +297,7 @@ var Text = function(parentEl) { this.$renderLine( html, row, !this.$useLineGroups(), row == foldStart ? foldLine : false ); - lineElement.style.height = config.lineHeight * this.session.getRowLength(row) + "px"; - lineElement.innerHTML = html.join(""); + dom.setInnerHtml(lineElement, html.join("")); } row++; } @@ -269,11 +363,10 @@ var Text = function(parentEl) { if (this.$useLineGroups()) { container.className = 'ace_line_group'; fragment.appendChild(container); - container.style.height = config.lineHeight * this.session.getRowLength(row) + "px"; - } else { - while(container.firstChild) - fragment.appendChild(container.firstChild); + var lines = container.childNodes + while(lines.length) + fragment.appendChild(lines[0]); } row++; @@ -301,7 +394,7 @@ var Text = function(parentEl) { break; if (this.$useLineGroups()) - html.push("
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ") + html.push("
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ") this.$renderLine(html, row, false, row == foldStart ? foldLine : false); @@ -310,7 +403,7 @@ var Text = function(parentEl) { row++; } - this.element.innerHTML = html.join(""); + this.element = dom.setInnerHtml(this.element, html.join("")); }; this.$textToken = { @@ -321,12 +414,10 @@ var Text = function(parentEl) { this.$renderToken = function(stringBuilder, screenColumn, token, value) { var self = this; - var replaceReg = /\t|&|<|( +)|([\x00-\x1f\x80-\xa0\xad\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 replaceReg = /\t|&|<|( +)|([\x00-\x1f\x80-\xa0\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\u3000\uFEFF])|[\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]/g; var replaceFunc = function(c, a, b, tabIdx, idx4) { if (a) { - return self.showInvisibles - ? "" + lang.stringRepeat(self.SPACE_CHAR, c.length) + "" - : c; + return new Array(c.length+1).join(" "); } else if (c == "&") { return "&"; } else if (c == "<") { @@ -337,14 +428,14 @@ var Text = function(parentEl) { 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_invisible_space" : "ace_cjk"; + var classToUse = self.showInvisibles ? "ace_cjk ace_invisible" : "ace_cjk"; var space = self.showInvisibles ? self.SPACE_CHAR : ""; screenColumn += 1; return "" + space + ""; } else if (b) { - return "" + self.SPACE_CHAR + ""; + return "" + self.SPACE_CHAR + ""; } else { screenColumn += 1; return "" + "
                                                                                                                                                                                                                                                                                                                                                                                                                                                              " ); } @@ -483,7 +569,7 @@ var Text = function(parentEl) { row = foldLine.end.row stringBuilder.push( - "", + "", row == this.session.getLength() - 1 ? this.EOF_CHAR : this.EOL_CHAR, "" ); @@ -536,7 +622,7 @@ var Text = function(parentEl) { var tokens = session.getTokens(row); foldLine.walk(function(placeholder, row, column, lastColumn, isNewRow) { - if (placeholder != null) { + if (placeholder) { renderTokens.push({ type: "fold", value: placeholder diff --git a/lib/ace/layer/text_test.js b/lib/ace/layer/text_test.js index 3946ec66..38708e9c 100644 --- a/lib/ace/layer/text_test.js +++ b/lib/ace/layer/text_test.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -81,17 +88,16 @@ module.exports = { this.textLayer.$renderLine(stringBuilder, 0, true); assert.equal( stringBuilder.join(""), - "" + this.textLayer.SPACE_CHAR + "" - + "\xB6" + "" + this.textLayer.SPACE_CHAR + "" + + "\xB6" ); }, - - "test rendering of indent guides" : function() { + + "test rendering of indent guides" : function() { var textLayer = this.textLayer - var EOL = "" + textLayer.EOL_CHAR + ""; - var SPACE = function(i) {return Array(i+1).join(" ")} - var DOT = function(i) {return Array(i+1).join(textLayer.SPACE_CHAR)} - var TAB = function(i) {return Array(i+1).join(textLayer.TAB_CHAR)} + var EOL = "" + textLayer.EOL_CHAR + ""; + var SPACE = function(i) {return Array(i+1).join(" ")} + var TAB = function(i) {return textLayer.TAB_CHAR + SPACE(i-1)} function testRender(results) { for (var i = results.length; i--; ) { var stringBuilder = []; @@ -108,13 +114,13 @@ module.exports = { ]); this.textLayer.setShowInvisibles(true); testRender([ - "" + DOT(4) + "" + DOT(2) + "" + EOL, - "" + TAB(4) + "" + TAB(4) + "f" + EOL, + "" + SPACE(4) + "" + SPACE(2) + EOL, + "" + TAB(4) + "" + TAB(4) + "f" + EOL, ]); this.textLayer.setDisplayIndentGuides(false); testRender([ - "" + DOT(6) + "" + EOL, - "" + TAB(4) + "" + TAB(4) + "f" + EOL + SPACE(6) + EOL, + "" + TAB(4) + "" + TAB(4) + "f" + EOL ]); } }; diff --git a/lib/ace/lib/app_config.js b/lib/ace/lib/app_config.js deleted file mode 100644 index 4fe78a1d..00000000 --- a/lib/ace/lib/app_config.js +++ /dev/null @@ -1,157 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"no use strict"; - -var oop = require("./oop"); -var EventEmitter = require("./event_emitter").EventEmitter; - -var optionsProvider = { - setOptions: function(optList) { - Object.keys(optList).forEach(function(key) { - this.setOption(key, optList[key]); - }, this); - }, - getOptions: function(optionNames) { - var result = {}; - if (!optionNames) { - optionNames = Object.keys(this.$options); - } else if (!Array.isArray(optionNames)) { - result = optionNames; - optionNames = Object.keys(result); - } - optionNames.forEach(function(key) { - result[key] = this.getOption(key); - }, this); - return result; - }, - setOption: function(name, value) { - if (this["$" + name] === value) - return; - var opt = this.$options[name]; - if (!opt) { - return warn('misspelled option "' + name + '"'); - } - if (opt.forwardTo) - return this[opt.forwardTo] && this[opt.forwardTo].setOption(name, value); - - if (!opt.handlesSet) - this["$" + name] = value; - if (opt && opt.set) - opt.set.call(this, value); - }, - getOption: function(name) { - var opt = this.$options[name]; - if (!opt) { - return warn('misspelled option "' + name + '"'); - } - if (opt.forwardTo) - return this[opt.forwardTo] && this[opt.forwardTo].getOption(name); - return opt && opt.get ? opt.get.call(this) : this["$" + name]; - } -}; - -function warn(message) { - if (typeof console != "undefined" && console.warn) - console.warn.apply(console, arguments); -} - -function reportError(msg, data) { - var e = new Error(msg); - e.data = data; - if (typeof console == "object" && console.error) - console.error(e); - setTimeout(function() { throw e; }); -} - -var AppConfig = function() { - this.$defaultOptions = {}; -}; - -(function() { - // module loading - oop.implement(this, EventEmitter); - /* - * option {name, value, initialValue, setterName, set, get } - */ - this.defineOptions = function(obj, path, options) { - if (!obj.$options) - this.$defaultOptions[path] = obj.$options = {}; - - Object.keys(options).forEach(function(key) { - var opt = options[key]; - if (typeof opt == "string") - opt = {forwardTo: opt}; - - opt.name || (opt.name = key); - obj.$options[opt.name] = opt; - if ("initialValue" in opt) - obj["$" + opt.name] = opt.initialValue; - }); - - // implement option provider interface - oop.implement(obj, optionsProvider); - - return this; - }; - - this.resetOptions = function(obj) { - Object.keys(obj.$options).forEach(function(key) { - var opt = obj.$options[key]; - if ("value" in opt) - obj.setOption(key, opt.value); - }); - }; - - this.setDefaultValue = function(path, name, value) { - var opts = this.$defaultOptions[path] || (this.$defaultOptions[path] = {}); - if (opts[name]) { - if (opts.forwardTo) - this.setDefaultValue(opts.forwardTo, name, value); - else - opts[name].value = value; - } - }; - - this.setDefaultValues = function(path, optionHash) { - Object.keys(optionHash).forEach(function(key) { - this.setDefaultValue(path, key, optionHash[key]); - }, this); - }; - - this.warn = warn; - this.reportError = reportError; - -}).call(AppConfig.prototype); - -exports.AppConfig = AppConfig; - -}); diff --git a/lib/ace/lib/browser_focus.js b/lib/ace/lib/browser_focus.js new file mode 100644 index 00000000..0555dd87 --- /dev/null +++ b/lib/ace/lib/browser_focus.js @@ -0,0 +1,105 @@ +/* vim:ts=4:sts=4:sw=4: + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * Irakli Gozalishvili (http://jeditoolkit.com) + * Julian Viereck + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +define(function(require, exports, module) { +"use strict"; + +var oop = require("./oop"); +var event = require("./event"); +var EventEmitter = require("./event_emitter").EventEmitter; + +/* + * This class keeps track of the focus state of the given window. + * Focus changes for example when the user switches a browser tab, + * goes to the location bar or switches to another application. + */ +var BrowserFocus = function(win) { + win = win || window; + + this.lastFocus = new Date().getTime(); + this._isFocused = true; + + var _self = this; + + // IE < 9 supports focusin and focusout events + if ("onfocusin" in win.document) { + event.addListener(win.document, "focusin", function(e) { + _self._setFocused(true); + }); + + event.addListener(win.document, "focusout", function(e) { + _self._setFocused(!!e.toElement); + }); + } + else { + event.addListener(win, "blur", function(e) { + _self._setFocused(false); + }); + + event.addListener(win, "focus", function(e) { + _self._setFocused(true); + }); + } +}; + +(function(){ + + oop.implement(this, EventEmitter); + + this.isFocused = function() { + return this._isFocused; + }; + + this._setFocused = function(isFocused) { + if (this._isFocused == isFocused) + return; + + if (isFocused) + this.lastFocus = new Date().getTime(); + + this._isFocused = isFocused; + this._emit("changeFocus"); + }; + +}).call(BrowserFocus.prototype); + + +exports.BrowserFocus = BrowserFocus; +}); diff --git a/lib/ace/lib/dom.js b/lib/ace/lib/dom.js index 2cbfe23e..14b2d4ca 100644 --- a/lib/ace/lib/dom.js +++ b/lib/ace/lib/dom.js @@ -1,30 +1,40 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: +/* vim:ts=4:sts=4:sw=4: + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * Mihai Sucan + * Irakli Gozalishvili (http://jeditoolkit.com) + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -33,20 +43,23 @@ define(function(require, exports, module) { var XHTML_NS = "http://www.w3.org/1999/xhtml"; -exports.getDocumentHead = function(doc) { - if (!doc) - doc = document; - return doc.head || doc.getElementsByTagName("head")[0] || doc.documentElement; -} - 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); + var classes = el.className.split(/\s+/g); return classes.indexOf(name) !== -1; }; @@ -91,11 +104,6 @@ exports.toggleCssClass = function(el, name) { return add; }; -if (typeof document == "undefined") { - exports.importCssString = function() {}; - return; -} - /* * Add or remove a CSS class from the list of classes on the given node * depending on the value of include @@ -145,7 +153,8 @@ exports.importCssString = function importCssString(cssText, id, doc) { if (id) style.id = id; - exports.getDocumentHead(doc).appendChild(style); + var head = doc.getElementsByTagName("head")[0] || doc.documentElement; + head.appendChild(style); } }; @@ -157,7 +166,8 @@ exports.importCssStylsheet = function(uri, doc) { link.rel = 'stylesheet'; link.href = uri; - exports.getDocumentHead(doc).appendChild(link); + var head = doc.getElementsByTagName("head")[0] || doc.documentElement; + head.appendChild(link); } }; @@ -177,7 +187,6 @@ exports.getInnerHeight = function(element) { ); }; - if (window.pageYOffset !== undefined) { exports.getPageScrollTop = function() { return window.pageYOffset; @@ -211,13 +220,13 @@ else }; exports.scrollbarWidth = function(document) { - var inner = exports.createElement("ace_inner"); + + var inner = exports.createElement("p"); inner.style.width = "100%"; inner.style.minWidth = "0px"; inner.style.height = "200px"; - inner.style.display = "block"; - var outer = exports.createElement("ace_outer"); + var outer = exports.createElement("div"); var style = outer.style; style.position = "absolute"; @@ -226,11 +235,10 @@ exports.scrollbarWidth = function(document) { style.width = "200px"; style.minWidth = "0px"; style.height = "150px"; - style.display = "block"; outer.appendChild(inner); - var body = document.documentElement; + var body = document.body || document.documentElement; body.appendChild(outer); var noScrollbar = inner.offsetWidth; @@ -260,24 +268,22 @@ exports.setInnerHtml = function(el, innerHtml) { return element; }; -if ("textContent" in document.documentElement) { - exports.setInnerText = function(el, innerText) { +exports.setInnerText = function(el, innerText) { + var document = el.ownerDocument; + if (document.body && "textContent" in document.body) el.textContent = innerText; - }; - - exports.getInnerText = function(el) { - return el.textContent; - }; -} -else { - exports.setInnerText = function(el, innerText) { + else el.innerText = innerText; - }; - exports.getInnerText = function(el) { - return el.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; diff --git a/lib/ace/lib/es5-shim.js b/lib/ace/lib/es5-shim.js index 217bdc61..c0e7999c 100644 --- a/lib/ace/lib/es5-shim.js +++ b/lib/ace/lib/es5-shim.js @@ -1,5 +1,28 @@ -// https://github.com/kriskowal/es5-shim -// Copyright 2009-2012 by contributors, MIT License +// 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(function(require, exports, module) { @@ -9,9 +32,12 @@ define(function(require, exports, module) { * * Annotated ES5: http://es5.github.com/ (specific links below) * ES5 Spec: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf - * Required reading: http://javascriptweblog.wordpress.com/2011/12/05/extending-javascript-natives/ + * + * @module */ +/*whatsupdoc*/ + // // Function // ======== @@ -20,16 +46,13 @@ define(function(require, exports, module) { // ES-5 15.3.4.5 // http://es5.github.com/#x15.3.4.5 -function Empty() {} - 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("Function.prototype.bind called on incompatible " + target); - } + 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 @@ -59,17 +82,20 @@ if (!Function.prototype.bind) { // 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 + // 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( - this, + self, args.concat(slice.call(arguments)) ); - if (Object(result) === result) { + if (result !== null && Object(result) === result) return result; - } - return this; + return self; } else { // 15.3.4.5.1 [[Call]] @@ -83,11 +109,11 @@ if (!Function.prototype.bind) { // 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 + // 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 + // 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) @@ -99,17 +125,11 @@ if (!Function.prototype.bind) { } }; - if(target.prototype) { - Empty.prototype = target.prototype; - bound.prototype = new Empty(); - // Clean up dangling references. - Empty.prototype = null; - } // 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 + // 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 @@ -117,20 +137,20 @@ if (!Function.prototype.bind) { // 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 + // 20. Call the [[DefineOwnProperty]] internal method of F with // arguments "caller", PropertyDescriptor {[[Get]]: thrower, [[Set]]: - // thrower, [[Enumerable]]: false, [[Configurable]]: false}, and + // thrower, [[Enumerable]]: false, [[Configurable]]: false}, and // false. - // 21. Call the [[DefineOwnProperty]] internal method of F with - // arguments "arguments", PropertyDescriptor {[[Get]]: thrower, + // 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 + // 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. @@ -148,8 +168,7 @@ var call = Function.prototype.call; var prototypeOfArray = Array.prototype; var prototypeOfObject = Object.prototype; var slice = prototypeOfArray.slice; -// Having a toString local variable name breaks in Opera so use _toString. -var _toString = call.bind(prototypeOfObject.toString); +var toString = call.bind(prototypeOfObject.toString); var owns = call.bind(prototypeOfObject.hasOwnProperty); // If JS engine supports accessors creating shortcuts. @@ -170,109 +189,12 @@ if ((supportsAccessors = owns(prototypeOfObject, "__defineGetter__"))) { // ===== // -// ES5 15.4.4.12 -// http://es5.github.com/#x15.4.4.12 -// Default value for second param -// [bugfix, ielt9, old browsers] -// IE < 9 bug: [1,2].splice(0).join("") == "" but should be "12" -if ([1,2].splice(0).length != 2) { - if(function() { // test IE < 9 to splice bug - see issue #138 - function makeArray(l) { - var a = new Array(l+2); - a[0] = a[1] = 0; - return a; - } - var array = [], lengthBefore; - - array.splice.apply(array, makeArray(20)); - array.splice.apply(array, makeArray(26)); - - lengthBefore = array.length; //46 - array.splice(5, 0, "XXX"); // add one element - - lengthBefore + 1 == array.length - - if (lengthBefore + 1 == array.length) { - return true;// has right splice implementation without bugs - } - // else { - // IE8 bug - // } - }()) {//IE 6/7 - var array_splice = Array.prototype.splice; - Array.prototype.splice = function(start, deleteCount) { - if (!arguments.length) { - return []; - } else { - return array_splice.apply(this, [ - start === void 0 ? 0 : start, - deleteCount === void 0 ? (this.length - start) : deleteCount - ].concat(slice.call(arguments, 2))) - } - }; - } else {//IE8 - // taken from http://docs.sencha.com/ext-js/4-1/source/Array2.html - Array.prototype.splice = function(pos, removeCount){ - var length = this.length; - if (pos > 0) { - if (pos > length) - pos = length; - } else if (pos == void 0) { - pos = 0; - } else if (pos < 0) { - pos = Math.max(length + pos, 0); - } - - if (!(pos+removeCount < length)) - removeCount = length - pos; - - var removed = this.slice(pos, pos+removeCount); - var insert = slice.call(arguments, 2); - var add = insert.length; - - // we try to use Array.push when we can for efficiency... - if (pos === length) { - if (add) { - this.push.apply(this, insert); - } - } else { - var remove = Math.min(removeCount, length - pos); - var tailOldPos = pos + remove; - var tailNewPos = tailOldPos + add - remove; - var tailCount = length - tailOldPos; - var lengthAfterRemove = length - remove; - - if (tailNewPos < tailOldPos) { // case A - for (var i = 0; i < tailCount; ++i) { - this[tailNewPos+i] = this[tailOldPos+i]; - } - } else if (tailNewPos > tailOldPos) { // case B - for (i = tailCount; i--; ) { - this[tailNewPos+i] = this[tailOldPos+i]; - } - } // else, add == remove (nothing to do) - - if (add && pos === lengthAfterRemove) { - this.length = lengthAfterRemove; // truncate array - this.push.apply(this, insert); - } else { - this.length = lengthAfterRemove + add; // reserves space - for (i = 0; i < add; ++i) { - this[pos+i] = insert[i]; - } - } - } - return removed; - }; - } -} - // 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]"; + return toString(obj) == "[object Array]"; }; } @@ -291,34 +213,25 @@ if (!Array.isArray) { // ES5 15.4.4.18 // http://es5.github.com/#x15.4.4.18 // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/forEach - -// Check failure of by-index access of string characters (IE < 9) -// and failure of `0 in boxedString` (Rhino) -var boxedString = Object("a"), - splitString = boxedString[0] != "a" || !(0 in boxedString); - if (!Array.prototype.forEach) { Array.prototype.forEach = function forEach(fun /*, thisp*/) { - var object = toObject(this), - self = splitString && _toString(this) == "[object String]" ? - this.split("") : - object, + var self = toObject(this), thisp = arguments[1], - i = -1, + i = 0, length = self.length >>> 0; // If no callback function or if callback is not a callable function - if (_toString(fun) != "[object Function]") { + if (toString(fun) != "[object Function]") { throw new TypeError(); // TODO message } - while (++i < length) { + 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, object); + // context, property value, property key, thisArg object context + fun.call(thisp, self[i], i, self); } + i++; } }; } @@ -328,22 +241,19 @@ if (!Array.prototype.forEach) { // 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 object = toObject(this), - self = splitString && _toString(this) == "[object String]" ? - this.split("") : - object, + 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(fun + " is not a 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, object); + result[i] = fun.call(thisp, self[i], i, self); } return result; }; @@ -354,27 +264,19 @@ if (!Array.prototype.map) { // 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 object = toObject(this), - self = splitString && _toString(this) == "[object String]" ? - this.split("") : - object, + var self = toObject(this), length = self.length >>> 0, result = [], - value, thisp = arguments[1]; // If no callback function or if callback is not a callable function - if (_toString(fun) != "[object Function]") { - throw new TypeError(fun + " is not a function"); + if (toString(fun) != "[object Function]") { + throw new TypeError(); // TODO message } for (var i = 0; i < length; i++) { - if (i in self) { - value = self[i]; - if (fun.call(thisp, value, i, object)) { - result.push(value); - } - } + if (i in self && fun.call(thisp, self[i], i, self)) + result.push(self[i]); } return result; }; @@ -385,22 +287,18 @@ if (!Array.prototype.filter) { // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/every if (!Array.prototype.every) { Array.prototype.every = function every(fun /*, thisp */) { - var object = toObject(this), - self = splitString && _toString(this) == "[object String]" ? - this.split("") : - object, + 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(fun + " is not a 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, object)) { + if (i in self && !fun.call(thisp, self[i], i, self)) return false; - } } return true; }; @@ -411,22 +309,18 @@ if (!Array.prototype.every) { // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/some if (!Array.prototype.some) { Array.prototype.some = function some(fun /*, thisp */) { - var object = toObject(this), - self = splitString && _toString(this) == "[object String]" ? - this.split("") : - object, + 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(fun + " is not a 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, object)) { + if (i in self && fun.call(thisp, self[i], i, self)) return true; - } } return false; }; @@ -437,21 +331,17 @@ if (!Array.prototype.some) { // 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 object = toObject(this), - self = splitString && _toString(this) == "[object String]" ? - this.split("") : - object, + 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(fun + " is not a 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("reduce of empty array with no initial value"); - } + if (!length && arguments.length == 1) + throw new TypeError(); // TODO message var i = 0; var result; @@ -465,16 +355,14 @@ if (!Array.prototype.reduce) { } // if array contains no values, no initial value to return - if (++i >= length) { - throw new TypeError("reduce of empty array with no initial value"); - } + 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, object); - } + if (i in self) + result = fun.call(void 0, result, self[i], i, self); } return result; @@ -486,21 +374,17 @@ if (!Array.prototype.reduce) { // 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 object = toObject(this), - self = splitString && _toString(this) == "[object String]" ? - this.split("") : - object, + 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(fun + " is not a 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("reduceRight of empty array with no initial value"); - } + if (!length && arguments.length == 1) + throw new TypeError(); // TODO message var result, i = length - 1; if (arguments.length >= 2) { @@ -513,16 +397,14 @@ if (!Array.prototype.reduceRight) { } // if array contains no values, no initial value to return - if (--i < 0) { - throw new TypeError("reduceRight of empty array with no initial value"); - } + if (--i < 0) + throw new TypeError(); // TODO message } while (true); } do { - if (i in this) { - result = fun.call(void 0, result, self[i], i, object); - } + if (i in this) + result = fun.call(void 0, result, self[i], i, self); } while (i--); return result; @@ -532,21 +414,17 @@ if (!Array.prototype.reduceRight) { // 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 || ([0, 1].indexOf(1, 2) != -1)) { +if (!Array.prototype.indexOf) { Array.prototype.indexOf = function indexOf(sought /*, fromIndex */ ) { - var self = splitString && _toString(this) == "[object String]" ? - this.split("") : - toObject(this), + var self = toObject(this), length = self.length >>> 0; - if (!length) { + if (!length) return -1; - } var i = 0; - if (arguments.length > 1) { + if (arguments.length > 1) i = toInteger(arguments[1]); - } // handle negative indices i = i >= 0 ? i : Math.max(0, length + i); @@ -562,26 +440,21 @@ if (!Array.prototype.indexOf || ([0, 1].indexOf(1, 2) != -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 || ([0, 1].lastIndexOf(0, -3) != -1)) { +if (!Array.prototype.lastIndexOf) { Array.prototype.lastIndexOf = function lastIndexOf(sought /*, fromIndex */) { - var self = splitString && _toString(this) == "[object String]" ? - this.split("") : - toObject(this), + var self = toObject(this), length = self.length >>> 0; - if (!length) { + if (!length) return -1; - } var i = length - 1; - if (arguments.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]) { + if (i in self && sought === self[i]) return i; - } } return -1; }; @@ -670,33 +543,10 @@ if (!Object.getOwnPropertyNames) { // ES5 15.2.3.5 // http://es5.github.com/#x15.2.3.5 if (!Object.create) { - var createEmpty; - if (Object.prototype.__proto__ === null) { - createEmpty = function () { - return { "__proto__": null }; - }; - } else { - // In old IE __proto__ can't be used to manually set `null` - createEmpty = function () { - var empty = {}; - for (var i in empty) - empty[i] = null; - empty.constructor = - empty.hasOwnProperty = - empty.propertyIsEnumerable = - empty.isPrototypeOf = - empty.toLocaleString = - empty.toString = - empty.valueOf = - empty.__proto__ = null; - return empty; - } - } - Object.create = function create(prototype, properties) { var object; if (prototype === null) { - object = createEmpty(); + object = { "__proto__": null }; } else { if (typeof prototype != "object") throw new TypeError("typeof prototype["+(typeof prototype)+"] != 'object'"); @@ -930,18 +780,13 @@ if (!Object.keys) { ], dontEnumsLength = dontEnums.length; - for (var key in {"toString": null}) { + for (var key in {"toString": null}) hasDontEnumBug = false; - } Object.keys = function keys(object) { - if ( - (typeof object != "object" && typeof object != "function") || - object === null - ) { + 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) { @@ -958,16 +803,49 @@ if (!Object.keys) { } } } + return keys; }; } // -// most of es5-shim Date section is removed since ace doesn't need it, it is too intrusive and it causes problems for users +// 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) { @@ -976,6 +854,155 @@ if (!Date.now) { }; } +// 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 @@ -1006,57 +1033,27 @@ if (!String.prototype.trim || ws.trim()) { // ES5 9.4 // http://es5.github.com/#x9.4 // http://jsperf.com/to-integer - -function toInteger(n) { +var toInteger = function (n) { n = +n; - if (n !== n) { // isNaN + if (n !== n) // isNaN n = 0; - } else if (n !== 0 && n !== (1/0) && n !== -(1/0)) { + else if (n !== 0 && n !== (1/0) && n !== -(1/0)) n = (n > 0 || -1) * Math.floor(Math.abs(n)); - } return n; -} - -function isPrimitive(input) { - var type = typeof input; - return ( - input === null || - type === "undefined" || - type === "boolean" || - type === "number" || - type === "string" - ); -} - -function toPrimitive(input) { - var val, valueOf, toString; - if (isPrimitive(input)) { - return input; - } - valueOf = input.valueOf; - if (typeof valueOf === "function") { - val = valueOf.call(input); - if (isPrimitive(val)) { - return val; - } - } - toString = input.toString; - if (typeof toString === "function") { - val = toString.call(input); - if (isPrimitive(val)) { - return val; - } - } - throw new TypeError(); -} - -// ES5 9.9 -// http://es5.github.com/#x9.9 -var toObject = function (o) { - if (o == null) { // this matches both null and undefined - throw new TypeError("can't convert "+o+" to object"); - } - return Object(o); }; +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); + }; }); diff --git a/lib/ace/lib/event.js b/lib/ace/lib/event.js index 57924056..9d03f868 100644 --- a/lib/ace/lib/event.js +++ b/lib/ace/lib/event.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. * - * 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. + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -33,6 +40,7 @@ define(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) { @@ -40,7 +48,7 @@ exports.addListener = function(elem, type, callback) { } if (elem.attachEvent) { var wrapper = function() { - callback.call(elem, window.event); + callback(window.event); }; callback._wrapper = wrapper; elem.attachEvent("on" + type, wrapper); @@ -85,7 +93,7 @@ exports.preventDefault = function(e) { exports.getButton = function(e) { if (e.type == "dblclick") return 0; - if (e.type == "contextmenu" || (useragent.isMac && (e.ctrlKey && !e.altKey && !e.shiftKey))) + if (e.type == "contextmenu" || (e.ctrlKey && useragent.isMac)) return 2; // DOM Event @@ -98,27 +106,51 @@ exports.getButton = function(e) { } }; -exports.capture = function(el, eventHandler, releaseCaptureHandler) { - function onMouseUp(e) { - eventHandler && eventHandler(e); - releaseCaptureHandler && releaseCaptureHandler(e); +if (document.documentElement.setCapture) { + exports.capture = function(el, eventHandler, releaseCaptureHandler) { + var called = false; + function onReleaseCapture(e) { + eventHandler(e); - exports.removeListener(document, "mousemove", eventHandler, true); - exports.removeListener(document, "mouseup", onMouseUp, true); - exports.removeListener(document, "dragstart", onMouseUp, true); - } + if (!called) { + called = true; + releaseCaptureHandler(e); + } - exports.addListener(document, "mousemove", eventHandler, true); - exports.addListener(document, "mouseup", onMouseUp, true); - exports.addListener(document, "dragstart", onMouseUp, true); - - return onMouseUp; -}; + 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) { - if ("onmousewheel" in el) { - exports.addListener(el, "mousewheel", function(e) { - var factor = 8; + 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; @@ -126,27 +158,8 @@ exports.addMouseWheelListener = function(el, callback) { e.wheelX = 0; e.wheelY = -e.wheelDelta / factor; } - callback(e); - }); - } else if ("onwheel" in el) { - exports.addListener(el, "wheel", function(e) { - var factor = 0.35; - switch (e.deltaMode) { - case e.DOM_DELTA_PIXEL: - e.wheelX = e.deltaX * factor || 0; - e.wheelY = e.deltaY * factor || 0; - break; - case e.DOM_DELTA_LINE: - case e.DOM_DELTA_PAGE: - e.wheelX = (e.deltaX || 0) * 5; - e.wheelY = (e.deltaY || 0) * 5; - break; - } - - callback(e); - }); - } else { - exports.addListener(el, "DOMMouseScroll", function(e) { + } + else { if (e.axis && e.axis == e.HORIZONTAL_AXIS) { e.wheelX = (e.detail || 0) * 5; e.wheelY = 0; @@ -154,14 +167,16 @@ exports.addMouseWheelListener = function(el, callback) { e.wheelX = 0; e.wheelY = (e.detail || 0) * 5; } - callback(e); - }); - } + } + 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 startX, startY, timer; var eventNames = { 2: "dblclick", 3: "tripleclick", @@ -169,30 +184,24 @@ exports.addMultiMouseDownListener = function(el, timeouts, eventHandler, callbac }; exports.addListener(el, "mousedown", function(e) { - if (exports.getButton(e) !== 0) { + if (exports.getButton(e) != 0) { clicks = 0; - } else if (e.detail > 1) { - clicks++; - if (clicks > 4) - clicks = 1; } else { - clicks = 1; - } - if (useragent.isIE) { var isNewClick = Math.abs(e.clientX - startX) > 5 || Math.abs(e.clientY - startY) > 5; - if (!timer || isNewClick) - clicks = 1; - if (timer) - clearTimeout(timer); - timer = setTimeout(function() {timer = null}, timeouts[clicks - 1] || 600); - if (clicks == 1) { - startX = e.clientX; - startY = e.clientY; - } + 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; } - - e._clicks = clicks; eventHandler[callbackName]("mousedown", e); @@ -214,80 +223,47 @@ exports.addMultiMouseDownListener = function(el, timeouts, eventHandler, callbac } }; -var getModifierHash = useragent.isMac && useragent.isOpera && !("KeyboardEvent" in window) - ? function(e) { - return 0 | (e.metaKey ? 1 : 0) | (e.altKey ? 2 : 0) | (e.shiftKey ? 4 : 0) | (e.ctrlKey ? 8 : 0); - } - : function(e) { - return 0 | (e.ctrlKey ? 1 : 0) | (e.altKey ? 2 : 0) | (e.shiftKey ? 4 : 0) | (e.metaKey ? 8 : 0); - }; - -exports.getModifierString = function(e) { - return keys.KEY_MODS[getModifierHash(e)]; -}; - function normalizeCommandKeys(callback, e, keyCode) { - var hashId = getModifierHash(e); - - if (!useragent.isMac && pressedKeys) { - if (pressedKeys[91] || pressedKeys[92]) - hashId |= 8; - if (pressedKeys.altGr) { - if ((3 & hashId) != 3) - pressedKeys.altGr = 0; - else - return; - } - if (keyCode === 18 || keyCode === 17) { - var location = "location" in e ? e.location : e.keyLocation; - if (keyCode === 17 && location === 1) { - if (pressedKeys[keyCode] == 1) - ts = e.timeStamp; - } else if (keyCode === 18 && hashId === 3 && location === 2) { - var dt = e.timeStamp - ts; - if (dt < 50) - pressedKeys.altGr = true; - } - } + 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) { - keyCode = -1; - } - - if (hashId & 8 && (keyCode === 91 || keyCode === 93)) { - keyCode = -1; - } - - if (!hashId && keyCode === 13) { - var location = "location" in e ? e.location : e.keyLocation; - if (location === 3) { - callback(e, hashId, -keyCode); - if (e.defaultPrevented) - return; + switch (keys.MODIFIER_KEYS[keyCode]) { + case "Alt": + hashId = 2; + break; + case "Shift": + hashId = 4; + break; + case "Ctrl": + hashId = 1; + break; + default: + hashId = 8; + break; } - } - - if (useragent.isChromeOS && hashId & 8) { - callback(e, hashId, keyCode); - if (e.defaultPrevented) - return; - else - hashId &= ~8; + keyCode = 0; } - // If there is no hashId and the keyCode is not a function key, then + 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); } -var pressedKeys = null; -var ts = 0; exports.addCommandKeyListener = function(el, callback) { var addListener = exports.addListener; if (useragent.isOldGecko || (useragent.isOpera && !("KeyboardEvent" in window))) { @@ -305,41 +281,20 @@ exports.addCommandKeyListener = function(el, callback) { return normalizeCommandKeys(callback, e, lastKeyDownKeyCode); }); } else { - var lastDefaultPrevented = null; + var lastDown = null; addListener(el, "keydown", function(e) { - pressedKeys[e.keyCode] = (pressedKeys[e.keyCode] || 0) + 1; - var result = normalizeCommandKeys(callback, e, e.keyCode); - lastDefaultPrevented = e.defaultPrevented; - return result; + lastDown = e.keyIdentifier || e.keyCode; + return normalizeCommandKeys(callback, e, e.keyCode); }); - - addListener(el, "keypress", function(e) { - if (lastDefaultPrevented && (e.ctrlKey || e.altKey || e.shiftKey || e.metaKey)) { - exports.stopEvent(e); - lastDefaultPrevented = null; - } - }); - - addListener(el, "keyup", function(e) { - pressedKeys[e.keyCode] = null; - }); - - if (!pressedKeys) { - resetPressedKeys(); - addListener(window, "focus", resetPressedKeys); - } } }; -function resetPressedKeys(e) { - pressedKeys = Object.create(null); -} if (window.postMessage && !useragent.isOldIE) { var postMessageId = 1; exports.nextTick = function(callback, win) { win = win || window; - var messageName = "zero-timeout-message-" + postMessageId; + var messageName = "zero-timeout-message-" + postMessageId; exports.addListener(win, "message", function listener(e) { if (e.data == messageName) { exports.stopPropagation(e); @@ -350,18 +305,11 @@ if (window.postMessage && !useragent.isOldIE) { win.postMessage(messageName, "*"); }; } - - -exports.nextFrame = window.requestAnimationFrame || - window.mozRequestAnimationFrame || - window.webkitRequestAnimationFrame || - window.msRequestAnimationFrame || - window.oRequestAnimationFrame; - -if (exports.nextFrame) - exports.nextFrame = exports.nextFrame.bind(window); -else - exports.nextFrame = function(callback) { - setTimeout(callback, 17); +else { + exports.nextTick = function(callback, win) { + win = win || window; + window.setTimeout(callback, 0); }; +} + }); diff --git a/lib/ace/lib/event_emitter.js b/lib/ace/lib/event_emitter.js index b9860145..5818864d 100644 --- a/lib/ace/lib/event_emitter.js +++ b/lib/ace/lib/event_emitter.js @@ -1,30 +1,40 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: +/* vim:ts=4:sts=4:sw=4: + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * Irakli Gozalishvili (http://jeditoolkit.com) + * Mike de Boer + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,95 +42,54 @@ define(function(require, exports, module) { "use strict"; var EventEmitter = {}; -var stopPropagation = function() { this.propagationStopped = true; }; -var preventDefault = function() { this.defaultPrevented = true; }; EventEmitter._emit = EventEmitter._dispatchEvent = function(eventName, e) { - this._eventRegistry || (this._eventRegistry = {}); - this._defaultHandlers || (this._defaultHandlers = {}); + 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 = {}; - + e = e || {}; if (!e.type) e.type = eventName; - if (!e.stopPropagation) - e.stopPropagation = stopPropagation; - if (!e.preventDefault) - e.preventDefault = preventDefault; + + if (!e.stopPropagation) { + e.stopPropagation = function() { + this.propagationStopped = true; + }; + } + + if (!e.preventDefault) { + e.preventDefault = function() { + this.defaultPrevented = true; + }; + } - listeners = listeners.slice(); for (var i=0; i + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ diff --git a/lib/ace/lib/keys.js b/lib/ace/lib/keys.js index 465d4a8d..30719ce1 100644 --- a/lib/ace/lib/keys.js +++ b/lib/ace/lib/keys.js @@ -34,8 +34,6 @@ For more information about SproutCore, visit http://www.sproutcore.com define(function(require, exports, module) { "use strict"; -require("./fixoldbrowsers"); - var oop = require("./oop"); /* @@ -48,8 +46,8 @@ var Keys = (function() { }, KEY_MODS: { - "ctrl": 1, "alt": 2, "option" : 2, "shift": 4, - "super": 8, "meta": 8, "command": 8, "cmd": 8 + "ctrl": 1, "alt": 2, "option" : 2, + "shift": 4, "meta": 8, "command": 8 }, FUNCTION_KEYS : { @@ -80,7 +78,6 @@ var Keys = (function() { 103: "Numpad7", 104: "Numpad8", 105: "Numpad9", - '-13': "NumpadEnter", 112: "F1", 113: "F2", 114: "F3", @@ -104,21 +101,14 @@ var Keys = (function() { 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: '.', - 186: ';', 187: '=', 188: ',', 189: '-', 190: '.', 191: '/', 192: '`', - 219: '[', 220: '\\',221: ']', 222: '\'' + 188: ',', 190: '.', 191: '/', 192: '`', 219: '[', 220: '\\', + 221: ']', 222: '\'' } }; // A reverse map of FUNCTION_KEYS - var name, i; - for (i in ret.FUNCTION_KEYS) { - name = ret.FUNCTION_KEYS[i].toLowerCase(); - ret[name] = parseInt(i, 10); - } - - // A reverse map of PRINTABLE_KEYS - for (i in ret.PRINTABLE_KEYS) { - name = ret.PRINTABLE_KEYS[i].toLowerCase(); + for (var i in ret.FUNCTION_KEYS) { + var name = ret.FUNCTION_KEYS[i].toUpperCase(); ret[name] = parseInt(i, 10); } @@ -128,36 +118,12 @@ var Keys = (function() { 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] = '-'; - - (function() { - var mods = ["cmd", "ctrl", "alt", "shift"]; - for (var i = Math.pow(2, mods.length); i--;) { - ret.KEY_MODS[i] = mods.filter(function(x) { - return i & ret.KEY_MODS[x]; - }).join("-") + "-"; - } - })(); - - ret.KEY_MODS[0] = ""; - ret.KEY_MODS[-1] = "input-"; - return ret; })(); oop.mixin(exports, Keys); exports.keyCodeToString = function(keyCode) { - // Language-switching keystroke in Chrome/Linux emits keyCode 0. - var keyString = Keys[keyCode]; - if (typeof keyString != "string") - keyString = String.fromCharCode(keyCode); - return keyString.toLowerCase(); -}; + return (Keys[keyCode] || String.fromCharCode(keyCode)).toLowerCase(); +} }); diff --git a/lib/ace/lib/lang.js b/lib/ace/lib/lang.js index 921dee1d..769bfdda 100644 --- a/lib/ace/lib/lang.js +++ b/lib/ace/lib/lang.js @@ -1,54 +1,49 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ define(function(require, exports, module) { "use strict"; -exports.last = function(a) { - return a[a.length - 1]; -}; - exports.stringReverse = function(string) { return string.split("").reverse().join(""); }; exports.stringRepeat = function (string, count) { - var result = ''; - while (count > 0) { - if (count & 1) - result += string; - - if (count >>= 1) - string += string; - } - return result; + return new Array(count + 1).join(string); }; var trimBeginRegexp = /^\s\s*/; @@ -81,24 +76,18 @@ exports.copyArray = function(array){ return copy; }; -exports.deepCopy = function deepCopy(obj) { - if (typeof obj !== "object" || !obj) +exports.deepCopy = function (obj) { + if (typeof obj != "object") { return obj; - var copy; - if (Array.isArray(obj)) { - copy = []; - for (var key = 0; key < obj.length; key++) { - copy[key] = deepCopy(obj[key]); - } - return copy; } - var cons = obj.constructor; - if (cons === RegExp) - return obj; - copy = cons(); + var copy = obj.constructor(); for (var key in obj) { - copy[key] = deepCopy(obj[key]); + if (typeof obj[key] == "object") { + copy[key] = this.deepCopy(obj[key]); + } else { + copy[key] = obj[key]; + } } return copy; }; @@ -135,10 +124,6 @@ exports.escapeRegExp = function(str) { return str.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1'); }; -exports.escapeHTML = function(str) { - return str.replace(/&/g, "&").replace(/"/g, """).replace(/'/g, "'").replace(/ + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ define(function(require, exports, module) { "use strict"; -exports.inherits = function(ctor, superCtor) { - ctor.super_ = superCtor; - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); -}; +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]; } - return obj; }; exports.implement = function(proto, mixin) { diff --git a/lib/ace/lib/useragent.js b/lib/ace/lib/useragent.js index 0d1d9f4d..dfb51212 100644 --- a/lib/ace/lib/useragent.js +++ b/lib/ace/lib/useragent.js @@ -1,36 +1,81 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ define(function(require, exports, module) { "use strict"; +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; + /* * I hate doing this, but we need some way to determine if the user is on a Mac * The reason is that users have different expectations of their key combinations. @@ -57,50 +102,4 @@ exports.getOS = function() { } }; -// this can be called in non browser environments (e.g. from ace/requirejs/text) -if (typeof navigator != "object") - return; - -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"); - -// Windows Store JavaScript apps (aka Metro apps written in HTML5 and JavaScript) do not use the "Microsoft Internet Explorer" string in their user agent, but "MSAppHost" instead. -exports.isIE = - (navigator.appName == "Microsoft Internet Explorer" || navigator.appName.indexOf("MSAppHost") >= 0) - ? parseFloat((ua.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]) - : parseFloat((ua.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]); // for ie - -exports.isOldIE = exports.isIE && exports.isIE < 9; - -// Is this Firefox or related? -exports.isGecko = exports.isMozilla = (window.Controllers || window.controllers) && window.navigator.product === "Gecko"; - -// oldGecko == rev < 2.0 -exports.isOldGecko = exports.isGecko && parseInt((ua.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.isChromeOS = ua.indexOf(" CrOS ") >= 0; - }); diff --git a/lib/ace/line_widgets.js b/lib/ace/line_widgets.js deleted file mode 100644 index ba87d857..00000000 --- a/lib/ace/line_widgets.js +++ /dev/null @@ -1,295 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("./lib/oop"); -var dom = require("./lib/dom"); -var Range = require("./range").Range; - - -function LineWidgets(session) { - this.session = session; - this.session.widgetManager = this; - this.session.getRowLength = this.getRowLength; - this.session.$getWidgetScreenLength = this.$getWidgetScreenLength; - this.updateOnChange = this.updateOnChange.bind(this); - this.renderWidgets = this.renderWidgets.bind(this); - this.measureWidgets = this.measureWidgets.bind(this); - this.session._changedWidgets = []; - this.$onChangeEditor = this.$onChangeEditor.bind(this); - - this.session.on("change", this.updateOnChange); - this.session.on("changeEditor", this.$onChangeEditor); -} - -(function() { - this.getRowLength = function(row) { - var h; - if (this.lineWidgets) - h = this.lineWidgets[row] && this.lineWidgets[row].rowCount || 0; - else - h = 0; - if (!this.$useWrapMode || !this.$wrapData[row]) { - return 1 + h; - } else { - return this.$wrapData[row].length + 1 + h; - } - }; - - this.$getWidgetScreenLength = function() { - var screenRows = 0; - this.lineWidgets.forEach(function(w){ - if (w && w.rowCount) - screenRows +=w.rowCount; - }); - return screenRows; - }; - - this.$onChangeEditor = function(e) { - this.attach(e.editor); - }; - - this.attach = function(editor) { - if (editor && editor.widgetManager && editor.widgetManager != this) - editor.widgetManager.detach(); - - if (this.editor == editor) - return; - - this.detach(); - this.editor = editor; - - if (editor) { - editor.widgetManager = this; - editor.renderer.on("beforeRender", this.measureWidgets); - editor.renderer.on("afterRender", this.renderWidgets); - } - }; - this.detach = function(e) { - var editor = this.editor; - if (!editor) - return; - - this.editor = null; - editor.widgetManager = null; - - editor.renderer.off("beforeRender", this.measureWidgets); - editor.renderer.off("afterRender", this.renderWidgets); - var lineWidgets = this.session.lineWidgets; - lineWidgets && lineWidgets.forEach(function(w) { - if (w && w.el && w.el.parentNode) { - w._inDocument = false; - w.el.parentNode.removeChild(w.el); - } - }); - }; - - this.updateOnChange = function(delta) { - var lineWidgets = this.session.lineWidgets; - if (!lineWidgets) return; - - var startRow = delta.start.row; - var len = delta.end.row - startRow; - - if (len === 0) { - // return - } else if (delta.action == 'remove') { - var removed = lineWidgets.splice(startRow + 1, len); - removed.forEach(function(w) { - w && this.removeLineWidget(w); - }, this); - this.$updateRows(); - } else { - var args = new Array(len); - args.unshift(startRow, 0); - lineWidgets.splice.apply(lineWidgets, args); - this.$updateRows(); - } - }; - - this.$updateRows = function() { - var lineWidgets = this.session.lineWidgets; - if (!lineWidgets) return; - var noWidgets = true; - lineWidgets.forEach(function(w, i) { - if (w) { - noWidgets = false; - w.row = i; - } - }); - if (noWidgets) - this.session.lineWidgets = null; - }; - - this.addLineWidget = function(w) { - if (!this.session.lineWidgets) - this.session.lineWidgets = new Array(this.session.getLength()); - - this.session.lineWidgets[w.row] = w; - - var renderer = this.editor.renderer; - if (w.html && !w.el) { - w.el = dom.createElement("div"); - w.el.innerHTML = w.html; - } - if (w.el) { - dom.addCssClass(w.el, "ace_lineWidgetContainer"); - w.el.style.position = "absolute"; - w.el.style.zIndex = 5; - renderer.container.appendChild(w.el); - w._inDocument = true; - } - - if (!w.coverGutter) { - w.el.style.zIndex = 3; - } - if (!w.pixelHeight) { - w.pixelHeight = w.el.offsetHeight; - } - if (w.rowCount == null) - w.rowCount = w.pixelHeight / renderer.layerConfig.lineHeight; - - this.session._emit("changeFold", {data:{start:{row: w.row}}}); - - this.$updateRows(); - this.renderWidgets(null, renderer); - return w; - }; - - this.removeLineWidget = function(w) { - w._inDocument = false; - if (w.el && w.el.parentNode) - w.el.parentNode.removeChild(w.el); - if (w.editor && w.editor.destroy) try { - w.editor.destroy(); - } catch(e){} - if (this.session.lineWidgets) - this.session.lineWidgets[w.row] = undefined; - this.session._emit("changeFold", {data:{start:{row: w.row}}}); - this.$updateRows(); - }; - - this.onWidgetChanged = function(w) { - this.session._changedWidgets.push(w); - this.editor && this.editor.renderer.updateFull(); - }; - - this.measureWidgets = function(e, renderer) { - var changedWidgets = this.session._changedWidgets; - var config = renderer.layerConfig; - - if (!changedWidgets || !changedWidgets.length) return; - var min = Infinity; - for (var i = 0; i < changedWidgets.length; i++) { - var w = changedWidgets[i]; - if (!w._inDocument) { - w._inDocument = true; - renderer.container.appendChild(w.el); - } - - w.h = w.el.offsetHeight; - - if (!w.fixedWidth) { - w.w = w.el.offsetWidth; - w.screenWidth = Math.ceil(w.w / config.characterWidth); - } - - var rowCount = w.h / config.lineHeight; - if (w.coverLine) { - rowCount -= this.session.getRowLineCount(w.row); - if (rowCount < 0) - rowCount = 0; - } - if (w.rowCount != rowCount) { - w.rowCount = rowCount; - if (w.row < min) - min = w.row; - } - } - if (min != Infinity) { - this.session._emit("changeFold", {data:{start:{row: min}}}); - this.session.lineWidgetWidth = null; - } - this.session._changedWidgets = []; - }; - - this.renderWidgets = function(e, renderer) { - var config = renderer.layerConfig; - var lineWidgets = this.session.lineWidgets; - if (!lineWidgets) - return; - var first = Math.min(this.firstRow, config.firstRow); - var last = Math.max(this.lastRow, config.lastRow, lineWidgets.length); - - while (first > 0 && !lineWidgets[first]) - first--; - - this.firstRow = config.firstRow; - this.lastRow = config.lastRow; - - renderer.$cursorLayer.config = config; - for (var i = first; i <= last; i++) { - var w = lineWidgets[i]; - if (!w || !w.el) continue; - - if (!w._inDocument) { - w._inDocument = true; - renderer.container.appendChild(w.el); - } - var top = renderer.$cursorLayer.getPixelPosition({row: i, column:0}, true).top; - if (!w.coverLine) - top += config.lineHeight * this.session.getRowLineCount(w.row); - w.el.style.top = top - config.offset + "px"; - - var left = w.coverGutter ? 0 : renderer.gutterWidth; - if (!w.fixedWidth) - left -= renderer.scrollLeft; - w.el.style.left = left + "px"; - - if (w.fixedWidth) { - w.el.style.right = renderer.scrollBar.getWidth() + "px"; - } else { - w.el.style.right = ""; - } - } - }; - -}).call(LineWidgets.prototype); - - -exports.LineWidgets = LineWidgets; - -}); - - - - diff --git a/lib/ace/mode/_test/Readme.md b/lib/ace/mode/_test/Readme.md deleted file mode 100644 index c2871c0d..00000000 --- a/lib/ace/mode/_test/Readme.md +++ /dev/null @@ -1,9 +0,0 @@ -`tokens_.json` files keep information about correct tokens and tokenizer states for all modes supported by ace. -They are generated from `text_.txt` or `demo/kitchen-sink/doc/*` with - -```sh -node highlight_rules_test.js -gen -``` - -command. - diff --git a/lib/ace/mode/_test/highlight_rules_test.js b/lib/ace/mode/_test/highlight_rules_test.js deleted file mode 100644 index c3b877ec..00000000 --- a/lib/ace/mode/_test/highlight_rules_test.js +++ /dev/null @@ -1,210 +0,0 @@ -var fs = require("fs"); -var path = require("path"); -if (!fs.existsSync) - fs.existsSync = path.existsSync; - -require("amd-loader"); - -var cwd = __dirname + "/"; -var root = path.normalize(cwd + Array(5).join("../")); - -function jsFileList(path, filter) { - if (!filter) filter = /_test/; - return fs.readdirSync(path).map(function(x) { - if (x.slice(-3) == ".js" && !filter.test(x) && !/\s/.test(x)) - return x.slice(0, -3); - }).filter(Boolean); -} - -function modeList() { - return jsFileList(cwd + "../", /_highlight_rules|_test|_worker|xml_util|_outdent|behaviour|completions/); -} - -function checkModes() { - modeList().forEach(function(modeName) { - try { - var Mode = require("../" + modeName).Mode; - } catch(e) { - console.warn("Can't load mode :" + modeName, e); - return; - } - var m = new Mode(); - if (!m.lineCommentStart && !m.blockComment) - console.warn("missing comment in " + modeName); - if (!m.$id) - console.warn("missing id in " + modeName); - var tokenizer = (new Mode).getTokenizer(); - if (m.lineCommentStart) { - if (Array.isArray(m.lineCommentStart)) { - m.lineCommentStart.forEach(function(x) { - testLineComment(tokenizer, x, modeName) - }); - } else { - testLineComment(tokenizer, m.lineCommentStart, modeName) - } - } - // if (m.blockComment) { - // var tokens = tok.getLineTokens(m.lineCommentStart, "start"); - // if (!/comment/.test(tokens[0])) - // console.warn("broken lineCommentStart in " + modeName); - // } - }); - - function testLineComment(tokenizer, commentStart, modeName) { - var tokens = tokenizer.getLineTokens(commentStart + " ", "start").tokens; - if (!/comment/.test(tokens[0].type)) - console.warn("broken lineCommentStart in " + modeName); - } -} - -function generateTestData() { - var docRoot = root + "/demo/kitchen-sink/docs"; - var docs = fs.readdirSync(docRoot); - var specialDocs = fs.readdirSync(cwd); - var modes = modeList(); - - // console.log("Docs:", docs); - // console.log("Modes:", modes); - - docs.forEach(function(docName) { - var p = docName.toLowerCase().split("."); - if (!p[1]) - return; - var modeName; - if (modes.indexOf(p[0]) != -1) - modeName = p[0]; - else if (modes.indexOf(p[1]) != -1) - modeName = p[1]; - else - modeName = {"txt": "text", cpp: "c_cpp"}[p[1]]; - - var filePath = "text_" + modeName + ".txt"; - if (specialDocs.indexOf(filePath) == -1) { - filePath = docRoot + "/" + docName; - } else { - filePath = cwd + filePath; - } - - var text = fs.readFileSync(filePath, "utf8"); - try { - var Mode = require("../" + modeName).Mode; - } catch(e) { - console.warn("Can't load mode :" + modeName, p, e); - return; - } - console.log(modeName); - var tokenizer = new Mode().getTokenizer(); - - var state = "start"; - var data = text.split(/\r\n|\r|\n/).map(function(line) { - var data = tokenizer.getLineTokens(line, state); - var tmp = []; - tmp.push(JSON.stringify(data.state)); - var tokenizedLine = ""; - data.tokens.forEach(function(x) { - tokenizedLine += x.value; - tmp.push(JSON.stringify([x.type, x.value])); - }); - if (tokenizedLine != line) - tmp.push(JSON.stringify(line)); - state = data.state; - return tmp.join(",\n "); - }); - - var jsonStr = "[[\n " + data.join("\n],[\n ") + "\n]]"; - fs.writeFileSync(cwd + "tokens_" + modeName + ".json", jsonStr, "utf8"); - }); -} - -function test(startAt) { - var modes = fs.readdirSync(cwd).map(function(x) { - return (x.match(/tokens_(.*).json/) || {})[1]; - }).filter(function(x){return !!x}); - - for (var i = Math.max(0, startAt||0); i < modes.length; i++) - testMode(modes[i], i); - - console.log("\u001b[32m" + "all ok" + "\u001b[0m"); -} -function testMode(modeName, i) { - console.log(padNumber(i+1, 3) + ") testing: \u001b[33m" + modeName + "\u001b[0m"); - - var text = fs.readFileSync(cwd + "tokens_" + modeName + ".json", "utf8"); - var data = JSON.parse(text); - var Mode = require("../" + modeName).Mode; - var tokenizer = new Mode().getTokenizer(); - - var state = "start"; - data.forEach(function(lineData) { - lineData.values = []; - lineData.types = []; - lineData.state = lineData.shift(); - var line = null; - if (typeof lineData[lineData.length - 1] == "string") - line = lineData.pop(); - lineData.forEach(function(x) { - lineData.types.push(x[0]); - lineData.values.push(x[1]); - }); - if (typeof line != "string") - line = lineData.values.join(""); - - var tokens = tokenizer.getLineTokens(line, state); - var values = tokens.tokens.map(function(x) {return x.value;}); - var types = tokens.tokens.map(function(x) {return x.type;}); - - var err = testEqual([ - JSON.stringify(lineData.state), JSON.stringify(tokens.state), - lineData.types, types, - lineData.values, values]); - - if (err) { - console.log(line); - throw "error"; - } - - state = tokens.state; - }); -} -function testEqual(a) { - var err; - if (a[0] + "" !== a[1] + "") { - console.log(a[0],a[1]); - err = 1; - } - - if ( a[2] + "" !== a[3] + "" || a[4] + "" !== a[5] + "") { - arrayDiff(a[2],a[3]); - arrayDiff(a[4],a[5]); - err = 1; - } - return err; -} -function arrayDiff(a1, a2) { - var l = Math.max(a1.length, a2.length); - var out = []; - for (var i = 0; i < l; i++) { - out.push("\n", padNumber(i+1, 3), ") "); - if (a1[i] !== a2[i]) - out.push("\u001b[31m", a1[i], "\u001b[0m != \u001b[32m", a2[i], "\u001b[0m"); - else - out.push(a1[i]); - } - console.log(out.join("")); -} -function padNumber(num, digits) { - return (" " + num).slice(-digits); -} - -// cli -var arg = process.argv[2]; -if (!arg) - test(); -else if (/--?g(en)?/.test(arg)) - generateTestData(process.argv.splice(3)); -else if (/--?c(heck)?/.test(arg)) - checkModes(process.argv.splice(3)); -else if (/\d+/.test(arg)) - test(parseInt(process.argv[2],10) || 0); -else - testMode(arg, -1); \ No newline at end of file diff --git a/lib/ace/mode/_test/package.json b/lib/ace/mode/_test/package.json deleted file mode 100644 index 3fdc706d..00000000 --- a/lib/ace/mode/_test/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "ace-mode-creator", - "version": "0.1.0", - "dependencies": { - "connect": "", - "socket.io": "" - } -} \ No newline at end of file diff --git a/lib/ace/mode/_test/text_asciidoc.txt b/lib/ace/mode/_test/text_asciidoc.txt deleted file mode 100644 index af7eaecc..00000000 --- a/lib/ace/mode/_test/text_asciidoc.txt +++ /dev/null @@ -1,111 +0,0 @@ ------------------------------------- ------------------------------------ -_ita_lic_, *bo*ld*, +mo+no+, normal. -``double quoted'', `single quoted'. - normal, ^super^, ~sub~. - -'''' -Escaped: -\_italic_, +++_italic_+++, -t\__e__st, +++t__e__st+++, -+++bold+++, $$normal$$ -\¶ ¶ -\`not single quoted' -\`\`not double quoted'' - - -[fffff] -+++++++++++++++++++++++++++++++++++++ -(C) {ss} ss -+++++++++++++++++++++++++++++++++++++ - -............. -callout <1> -.............. - -> 1 -1> 2 -<2> 3 - -Escaped: -\_italic_, -t\__e__st, o__ - -.optional title -............. -callout <1> -.............. - - -:macro: dddd - -.lists -. 1 -.. 2 -... d -..... big -+ -continue + -next line -xi) no ++la+tin++ - -xi) la++tin++ -2. num__ber__ [red]#red# --- - 5. f <> {macro} --- -image::path[beauty] ->--<= -- replacements - - image::s -sssss -sss -sssss - - -== 1 - heading -=== not a heading -==================================== - -================================== -====4 -NOTE: above - -NOTE: above - -[[x6]] -WARNING: - -[options[]] ---------------------------- -literal ---------------------------- - - -= Tables -|==================================== -| _italic_ | *bold* | text | (R) - -|==================================== - - -[more, options] -/////////// -comment -/////////// -// one line comment - - - -[red]#red text# [yellow-background]#on yellow# -[big]#large# [red yellow-background big]*all bold* - - -https://site text callto:ace http://ace.ajaxorg.com[awesome] - .still normal text -.break out thoug should not ---------------------------- -/////////////////////////// ---------------------------- - - diff --git a/lib/ace/mode/_test/text_coffee.txt b/lib/ace/mode/_test/text_coffee.txt deleted file mode 100644 index 2d9ba5ad..00000000 --- a/lib/ace/mode/_test/text_coffee.txt +++ /dev/null @@ -1,57 +0,0 @@ -#test: tokenize keyword - for (i 1..2) -#test: tokenize regexp -/"[a]/ -#test: tokenize functions -foo = ({args}) -> - foo = ({a1, a2}) -> - foo = ({@a1, a2}) -> - foo : ({args}) -> - foo = ({args}) -> - foo = ({0abc}) -> - foo = ({/abc}) => - foo = ({abc/}) -> - foo = ({#abc}) -> - foo = ({abc#}) -> - foo = ({)abc}) -> - foo = ({abc)}) -> - foo = ({a{bc}) -> - foo = ({}) -> - foo = ({ }) -> - foo : ({}) -> - foo = (args) -> - foo = (arg1, arg2) -> - foo = (arg1 = 1, arg2 = 'name') -> - foo = (@arg1 = /abc/, arg2 = 'name') -> - #test: tokenize function: invalid case: - foo=(/args) -> - foo = () -> - foo = ( ) -> - foo : ( ) -> - window.foo = (args) -> - foo = -> - foo = -> - foo : -> - #test: tokenize callback function - foo bar: 1, (args) -> - foo = (1, 2 (x) -> -#test: tokenize class -class Foo -class Foo extends Bar -#test: tokenize illegal name property -foo.static.function -#!test tokenize string with interpolation -a = "#{ 22 / 7 + {x: "#{a + b}"} + 2}" -" #{ "" + {} } )" -"""heredoc - """ -do -> - ### - herecomment - ### - re = /regex/imgy.test /// - heregex # comment - ///imgy - this isnt: `just - JavaScript` - undefined diff --git a/lib/ace/mode/_test/text_curly.txt b/lib/ace/mode/_test/text_curly.txt deleted file mode 100644 index 1be54b59..00000000 --- a/lib/ace/mode/_test/text_curly.txt +++ /dev/null @@ -1,9 +0,0 @@ -tokenize Curly template{{test}} -tokenize embedded script -'123' -tokenize multiline attribute value with double quotes - -tokenize multiline attribute value with single quotes - diff --git a/lib/ace/mode/_test/text_html.txt b/lib/ace/mode/_test/text_html.txt deleted file mode 100644 index d2ce8aaa..00000000 --- a/lib/ace/mode/_test/text_html.txt +++ /dev/null @@ -1,10 +0,0 @@ - - -'123' - - - - - \ No newline at end of file diff --git a/lib/ace/mode/_test/text_javascript.txt b/lib/ace/mode/_test/text_javascript.txt deleted file mode 100644 index 48d4af7d..00000000 --- a/lib/ace/mode/_test/text_javascript.txt +++ /dev/null @@ -1,86 +0,0 @@ -//test: tokenize 'standard' functions -string.charCodeAt(23); document.getElementById('test'); console.log('Here it is');"; -test: /**tokenize doc*/ comment -/**tokenize doc comment with @tag {}*/ -//test: tokenize parens - var line = "[{( )}]"; -//test tokenize arithmetic expression which looks like a regexp -a/b/c -a/=b/c -//test tokenize reg exps -a=/b/g -a+/b/g -a = 1 + /2 + 1/gimyxk -a=/a/ / /a/ -case /a/.test(c) -//test tokenize multi-line comment containing a single line comment -noRegex -/* foo // bar */ -canBeRegex; -/* foo // bar */ -// test tokenize identifier with umlauts -fu?e -// test // is not a regexp -{ // 123 -//test skipping escaped chars -'Meh\\nNeh' -console.log('\\u1232Feh' -"test multiline\ - strings" -a=' -b="\ -still a string - - -function foo(items, nada) { - for (var i=0; ihttp://ace.ajaxorg.com - diff --git a/lib/ace/mode/_test/text_php.txt b/lib/ace/mode/_test/text_php.txt deleted file mode 100644 index b76aa8a5..00000000 --- a/lib/ace/mode/_test/text_php.txt +++ /dev/null @@ -1,24 +0,0 @@ - not &js; diff --git a/lib/ace/mode/_test/text_ruby.txt b/lib/ace/mode/_test/text_ruby.txt deleted file mode 100644 index c16ff7c5..00000000 --- a/lib/ace/mode/_test/text_ruby.txt +++ /dev/null @@ -1,34 +0,0 @@ - #test: symbol tokenizer - [:@thing, :$thing, :_thing, :thing, :Thing, :thing1, :thing_a, - :THING, :thing!, :thing=, :thing?, :t?, - :, :@, :$, :1, :1thing, :th?ing, :thi=ng, :1thing, - :th!ing, :thing# - ] - - #test: namespaces aren't symbols" : function() { - Namespaced::Class - #test: hex tokenizer - 0x9a, 0XA1, 0x9_a, 0x, 0x_9a, 0x9a_, - #test: float tokenizer - [1, +1, -1, 12_345, 0.000_1, - _, 3_1, 1_2, 1_.0, 0._1]; - -{:id => ?", :key => "value", anotherKey: [x, y?]} - -=begin -=end - -=begin x -=end- -=end x - - herDocs = [<<'FOO', <//Juhu Kinners -test: two tags in the same lines should be in separate tokens" - -test: multiline attributes" - \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_abap.json b/lib/ace/mode/_test/tokens_abap.json deleted file mode 100644 index 95f2f811..00000000 --- a/lib/ace/mode/_test/tokens_abap.json +++ /dev/null @@ -1,189 +0,0 @@ -[[ - "start", - ["doc.comment","***************************************"] -],[ - "start", - ["doc.comment","** Program: EXAMPLE **"] -],[ - "start", - ["doc.comment","** Author: Joe Byte, 07-Jul-2007 **"] -],[ - "start", - ["doc.comment","***************************************"] -],[ - "start", - ["text"," "] -],[ - "start", - ["keyword","REPORT"], - ["text"," BOOKINGS"], - ["keyword.operator","."] -],[ - "start", - ["text"," "] -],[ - "start", - ["doc.comment","* Read flight bookings from the database"] -],[ - "start", - ["keyword","SELECT"], - ["keyword.operator"," * "], - ["keyword","FROM"], - ["text"," FLIGHTINFO"] -],[ - "start", - ["text"," "], - ["keyword","WHERE"], - ["text"," "], - ["keyword","CLASS"], - ["keyword.operator"," = "], - ["string","'Y'"], - ["text"," "], - ["comment","\"Y = economy"] -],[ - "start", - ["text"," "], - ["keyword","OR"], - ["text"," "], - ["keyword","CLASS"], - ["keyword.operator"," = "], - ["string","'C'"], - ["keyword.operator","."], - ["text"," "], - ["comment","\"C = business"] -],[ - "start", - ["paren.lparen","("], - ["invalid","..."], - ["paren.rparen",")"] -],[ - "start" -],[ - "start", - ["keyword","REPORT"], - ["text"," TEST"], - ["keyword.operator","."] -],[ - "start", - ["keyword","WRITE"], - ["text"," "], - ["string","'Hello World'"], - ["keyword.operator","."] -],[ - "start" -],[ - "start", - ["text","USERPROMPT"], - ["keyword.operator"," = "], - ["string","'Please double-click on a line in the output list '"], - ["text"," "], - ["keyword.operator","&"] -],[ - "start", - ["text"," "], - ["string","'to see the complete details of the transaction.'"], - ["keyword.operator","."] -],[ - "start" -],[ - "start" -],[ - "start", - ["keyword","DATA"], - ["text"," LAST_EOM "], - ["keyword","TYPE"], - ["text"," "], - ["support.type","D"], - ["keyword.operator","."], - ["text"," "], - ["comment","\"last end-of-month date"] -],[ - "start", - ["text"," "] -],[ - "start", - ["doc.comment","* Start from today's date"] -],[ - "start", - ["text"," LAST_EOM"], - ["keyword.operator"," = "], - ["variable.parameter","SY"], - ["keyword.operator","-"], - ["text","DATUM"], - ["keyword.operator","."] -],[ - "start", - ["doc.comment","* Set characters 6 and 7 (0-relative) of the YYYYMMDD string to \"01\","] -],[ - "start", - ["doc.comment","* giving the first day of the current month"] -],[ - "start", - ["text"," LAST_EOM"], - ["constant.numeric","+6"], - ["paren.lparen","("], - ["constant.numeric","2"], - ["paren.rparen",")"], - ["keyword.operator"," = "], - ["string","'01'"], - ["keyword.operator","."] -],[ - "start", - ["doc.comment","* Subtract one day"] -],[ - "start", - ["text"," LAST_EOM"], - ["keyword.operator"," = "], - ["text","LAST_EOM"], - ["keyword.operator"," - "], - ["constant.numeric","1"], - ["keyword.operator","."] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," "], - ["keyword","WRITE"], - ["keyword.operator",":"], - ["text"," "], - ["string","'Last day of previous month was'"], - ["keyword.operator",","], - ["text"," LAST_EOM"], - ["keyword.operator","."] -],[ - "start", - ["text"," "] -],[ - "start", - ["keyword","DATA"], - ["text"," "], - ["keyword.operator",":"], - ["text"," "], - ["keyword","BEGIN OF"], - ["text"," I_VBRK "], - ["keyword","OCCURS"], - ["text"," "], - ["constant.numeric","0"], - ["keyword.operator",","] -],[ - "start", - ["text"," VBELN "], - ["keyword","LIKE"], - ["text"," "], - ["variable.parameter","VBRK-VBELN"], - ["keyword.operator",","] -],[ - "start", - ["text"," ZUONR "], - ["keyword","LIKE"], - ["text"," "], - ["variable.parameter","VBRK-ZUONR"], - ["keyword.operator",","] -],[ - "start", - ["text"," "], - ["keyword","END OF"], - ["text"," I_VBRK"], - ["keyword.operator","."] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_abc.json b/lib/ace/mode/_test/tokens_abc.json deleted file mode 100644 index c65ae2a5..00000000 --- a/lib/ace/mode/_test/tokens_abc.json +++ /dev/null @@ -1,2207 +0,0 @@ -[[ - "start", - ["comment.line.percentage","%abc-2.1"] -],[ - "start", - ["information.keyword","H:"], - ["information.argument.string.unquoted","This file contains some example English tunes"] -],[ - "start", - ["comment.line.percentage","% note that the comments (like this one) are to highlight usages"] -],[ - "start", - ["comment.line.percentage","% and would not normally be included in such detail"] -],[ - "start", - ["information.keyword","O:"], - ["information.argument.string.unquoted","England "], - ["comment.line.percentage","% the origin of all tunes is England"] -],[ - "start" -],[ - "start", - ["information.keyword","X:"], - ["information.argument.string.unquoted","1 "], - ["comment.line.percentage","% tune no 1"] -],[ - "start", - ["information.keyword","T:"], - ["information.argument.string.unquoted","Dusty Miller, The "], - ["comment.line.percentage","% title"] -],[ - "start", - ["information.keyword","T:"], - ["information.argument.string.unquoted","Binny's Jig "], - ["comment.line.percentage","% an alternative title"] -],[ - "start", - ["information.keyword","C:"], - ["information.argument.string.unquoted","Trad. "], - ["comment.line.percentage","% traditional"] -],[ - "start", - ["information.keyword","R:"], - ["information.argument.string.unquoted","DH "], - ["comment.line.percentage","% double hornpipe"] -],[ - "start", - ["information.keyword","M:"], - ["information.argument.string.unquoted","3/4 "], - ["comment.line.percentage","% meter"] -],[ - "start", - ["information.keyword","K:"], - ["information.argument.string.unquoted","G "], - ["comment.line.percentage","% key"] -],[ - "start", - ["pitch.constant.numeric","B"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","d"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","A"], - ["text"," "], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","c"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","A"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","B"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","d"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","D"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","B"], - ["text"," "], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator",":|"] -],[ - "start", - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","d"], - ["text"," "], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","f"], - ["pitch.constant.numeric","g"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","a"], - ["pitch.constant.numeric","A"], - ["text"," "], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","c"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","A"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","d"], - ["text"," "], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","f"], - ["pitch.constant.numeric","a"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","B"], - ["text"," "], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator",":|"] -],[ - "start", - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","/2"], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","/2"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","A"], - ["text"," "], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","c"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","A"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","/2"], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","/2"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","D"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","B"], - ["text"," "], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator",":|"] -],[ - "start", - ["information.keyword","W:"], - ["information.argument.string.unquoted","Hey, the dusty miller, and his dusty coat;"] -],[ - "start", - ["information.keyword","W:"], - ["information.argument.string.unquoted","He will win a shilling, or he spend a groat."] -],[ - "start", - ["information.keyword","W:"], - ["information.argument.string.unquoted","Dusty was the coat, dusty was the colour;"] -],[ - "start", - ["information.keyword","W:"], - ["information.argument.string.unquoted","Dusty was the kiss, that I got frae the miller."] -],[ - "start" -],[ - "start", - ["information.keyword","X:"], - ["information.argument.string.unquoted","2"] -],[ - "start", - ["information.keyword","T:"], - ["information.argument.string.unquoted","Old Sir Simon the King"] -],[ - "start", - ["information.keyword","C:"], - ["information.argument.string.unquoted","Trad."] -],[ - "start", - ["information.keyword","S:"], - ["information.argument.string.unquoted","Offord MSS "], - ["comment.line.percentage","% from Offord manuscript"] -],[ - "start", - ["information.keyword","N:"], - ["information.argument.string.unquoted","see also Playford "], - ["comment.line.percentage","% reference note"] -],[ - "start", - ["information.keyword","M:"], - ["information.argument.string.unquoted","9/8"] -],[ - "start", - ["information.keyword","R:"], - ["information.argument.string.unquoted","SJ "], - ["comment.line.percentage","% slip jig"] -],[ - "start", - ["information.keyword","N:"], - ["information.argument.string.unquoted","originally in C "], - ["comment.line.percentage","% transcription note"] -],[ - "start", - ["information.keyword","K:"], - ["information.argument.string.unquoted","G"] -],[ - "start", - ["pitch.constant.numeric","D"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","D"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","F"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","D"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","E"], - ["text"," "], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","E"], - ["text"," "], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","F"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","E"], - ["text"," "], - ["pitch.constant.numeric","D"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator",":|"] -],[ - "start", - ["pitch.constant.numeric","D"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","B"], - ["text"," "], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","D"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","B"], - ["text"," "], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","D"], - ["barline.keyword.operator","|[1"], - ["text"," "], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","E"], - ["text"," "], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","E"], - ["text"," "], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator","|"], - ["text","["], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","G"], - ["text","] "], - ["pitch.constant.numeric","F"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","E"], - ["text"," "], - ["pitch.constant.numeric","D"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator",":|"], - ["text","\\ "], - ["comment.line.percentage","% no line-break in score"] -],[ - "start", - ["information.keyword","M:"], - ["information.argument.string.unquoted","12/8 "], - ["comment.line.percentage","% change of meter"] -],[ - "start", - ["barline.keyword.operator","[2"], - ["text"," "], - ["pitch.constant.numeric","E"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","E"], - ["text"," "], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","E"], - ["text"," "], - ["pitch.constant.numeric","E"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","E"], - ["text"," "], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator","|"], - ["text","\\ "], - ["comment.line.percentage","% no line-break in score"] -],[ - "start", - ["information.keyword","M:"], - ["information.argument.string.unquoted","9/8 "], - ["comment.line.percentage","% change of meter"] -],[ - "start", - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","F"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","E"], - ["text"," "], - ["pitch.constant.numeric","D"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator","|]"] -],[ - "start" -],[ - "start", - ["information.keyword","X:"], - ["information.argument.string.unquoted","3"] -],[ - "start", - ["information.keyword","T:"], - ["information.argument.string.unquoted","William and Nancy"] -],[ - "start", - ["information.keyword","T:"], - ["information.argument.string.unquoted","New Mown Hay"] -],[ - "start", - ["information.keyword","T:"], - ["information.argument.string.unquoted","Legacy, The"] -],[ - "start", - ["information.keyword","C:"], - ["information.argument.string.unquoted","Trad."] -],[ - "start", - ["information.keyword","O:"], - ["information.argument.string.unquoted","England; Gloucs; Bledington "], - ["comment.line.percentage","% place of origin"] -],[ - "start", - ["information.keyword","B:"], - ["information.argument.string.unquoted","Sussex Tune Book "], - ["comment.line.percentage","% can be found in these books"] -],[ - "start", - ["information.keyword","B:"], - ["information.argument.string.unquoted","Mally's Cotswold Morris vol.1 2"] -],[ - "start", - ["information.keyword","D:"], - ["information.argument.string.unquoted","Morris On "], - ["comment.line.percentage","% can be heard on this record"] -],[ - "start", - ["information.keyword","P:"], - ["information.argument.string.unquoted","(AB)2(AC)2A "], - ["comment.line.percentage","% play the parts in this order"] -],[ - "start", - ["information.keyword","M:"], - ["information.argument.string.unquoted","6/8"] -],[ - "start", - ["information.keyword","K:"], - ["information.argument.string.unquoted","G "] -],[ - "start", - ["information.keyword.embedded","[P:"], - ["information.argument.string.unquoted","A]"], - ["text"," "], - ["pitch.constant.numeric","D"], - ["barline.keyword.operator","|"], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"], - ["string.quoted","\"C\""], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","e"], - ["text"," "], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator","|"], - ["string.quoted","\"D7\""], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","d"], - ["text"," "], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator","|"], - ["string.quoted","\"C\""], - ["pitch.constant.numeric","E"], - ["duration.constant.numeric","2"], - ["string.quoted","\"D7\""], - ["pitch.constant.numeric","F"], - ["text"," "], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator",":|"] -],[ - "start", - ["information.keyword.embedded","[P:"], - ["information.argument.string.unquoted","B]"], - ["text"," "], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","d"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"], - ["string.quoted","\"C\""], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","f"], - ["pitch.constant.numeric","e"], - ["text"," "], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"], - ["text"," "], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","d"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"], - ["string.quoted","\"C\""], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","f"], - ["pitch.constant.numeric","e"], - ["text"," "], - ["string.quoted","\"D7\""], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","c"], - ["barline.keyword.operator","|"] -],[ - "start", - ["text"," "], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","B"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","B"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"], - ["string.quoted","\"C\""], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","e"], - ["text"," "], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator","|"], - ["string.quoted","\"D7\""], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","d"], - ["text"," "], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator","|"], - ["string.quoted","\"C\""], - ["pitch.constant.numeric","E"], - ["duration.constant.numeric","2"], - ["string.quoted","\"D7\""], - ["pitch.constant.numeric","F"], - ["text"," "], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator",":|"] -],[ - "start", - ["comment.line.percentage","% changes of meter, using inline fields"] -],[ - "start", - ["information.keyword.embedded","[T:"], - ["information.argument.string.unquoted","Slows]"], - ["information.keyword.embedded","[M:"], - ["information.argument.string.unquoted","4/4]"], - ["information.keyword.embedded","[L:"], - ["information.argument.string.unquoted","1/4]"], - ["information.keyword.embedded","[P:"], - ["information.argument.string.unquoted","C]"], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator","|"], - ["string.quoted","\"C\""], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","2"], - ["text"," "], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","B"], - ["duration.constant.numeric","2"], - ["text"," "], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator","|"], - ["string.quoted","\"Em\""], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","f"], - ["text"," "], - ["string.quoted","\"A7\""], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator","|"], - ["string.quoted","\"D7\""], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["text"," "], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator","|"], - ["text","\\"] -],[ - "start", - ["text"," "], - ["string.quoted","\"C\""], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","2"], - ["text"," "], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator","|"], - ["information.keyword.embedded","[M:"], - ["information.argument.string.unquoted","3/8]"], - ["information.keyword.embedded","[L:"], - ["information.argument.string.unquoted","1/8]"], - ["text"," "], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","B"], - ["duration.constant.numeric","2"], - ["text"," "], - ["pitch.constant.numeric","d"], - ["text"," "], - ["barline.keyword.operator","|"], - ["information.keyword.embedded","[M:"], - ["information.argument.string.unquoted","6/8]"], - ["text"," "], - ["string.quoted","\"C\""], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","f"], - ["pitch.constant.numeric","e"], - ["text"," "], - ["string.quoted","\"D7\""], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","c"], - ["barline.keyword.operator","|"] -],[ - "start", - ["text"," "], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","B"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","B"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"], - ["string.quoted","\"C\""], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","e"], - ["text"," "], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator","|"], - ["string.quoted","\"D7\""], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","d"], - ["text"," "], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator","|"], - ["string.quoted","\"C\""], - ["pitch.constant.numeric","E"], - ["duration.constant.numeric","2"], - ["string.quoted","\"D7\""], - ["pitch.constant.numeric","F"], - ["text"," "], - ["string.quoted","\"G\""], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator",":|"] -],[ - "start" -],[ - "start", - ["information.keyword","X:"], - ["information.argument.string.unquoted","4"] -],[ - "start", - ["information.keyword","T:"], - ["information.argument.string.unquoted","South Downs Jig"] -],[ - "start", - ["information.keyword","R:"], - ["information.argument.string.unquoted","jig"] -],[ - "start", - ["information.keyword","S:"], - ["information.argument.string.unquoted","Robert Harbron"] -],[ - "start", - ["information.keyword","M:"], - ["information.argument.string.unquoted","6/8"] -],[ - "start", - ["information.keyword","L:"], - ["information.argument.string.unquoted","1/8"] -],[ - "start", - ["information.keyword","K:"], - ["information.argument.string.unquoted","G"] -],[ - "start", - ["barline.keyword.operator","|:"], - ["text"," "], - ["pitch.constant.numeric","d"], - ["text"," "], - ["barline.keyword.operator","|"], - ["text"," "], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","A"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","3"], - ["text"," "], - ["barline.keyword.operator","|"], - ["text"," "], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","E"], - ["text"," "], - ["barline.keyword.operator","|"], - ["text"," "], - ["pitch.constant.numeric","D"], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","F"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","B"], - ["text"," "], - ["barline.keyword.operator","|"], - ["text"," "], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","e"], - ["text"," "], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","d"], - ["text"," "], - ["barline.keyword.operator","|"] -],[ - "start", - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","A"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","3"], - ["text"," "], - ["barline.keyword.operator","|"], - ["text"," "], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","E"], - ["text"," "], - ["barline.keyword.operator","|"], - ["text"," "], - ["pitch.constant.numeric","D"], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","F"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","B"], - ["text"," "], - ["barline.keyword.operator","|"], - ["text"," "], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","F"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","2"], - ["text"," "], - ["barline.keyword.operator",":|"] -],[ - "start", - ["pitch.constant.numeric","B"], - ["text"," "], - ["barline.keyword.operator","|"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","d"], - ["text"," "], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","c"], - ["text"," "], - ["barline.keyword.operator","|"], - ["text"," "], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","B"], - ["text"," "], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","A"], - ["text"," "], - ["barline.keyword.operator","|"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","d"], - ["text"," "], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","c"], - ["text"," "], - ["barline.keyword.operator","|"], - ["text"," "], - ["information.keyword.embedded","[M:"], - ["information.argument.string.unquoted","9/8]"], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","B"], - ["text"," "], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","B"], - ["text"," "], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","3"], - ["text"," "], - ["barline.keyword.operator","|"] -],[ - "start", - ["information.keyword.embedded","[M:"], - ["information.argument.string.unquoted","6/8]"], - ["pitch.constant.numeric","D"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","F"], - ["text"," "], - ["pitch.constant.numeric","E"], - ["duration.constant.numeric","3"], - ["text"," "], - ["barline.keyword.operator","|"], - ["text"," "], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","A"], - ["text"," "], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","D"], - ["text"," "], - ["barline.keyword.operator","|"], - ["text"," "], - ["pitch.constant.numeric","D"], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","F"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","B"], - ["text"," "], - ["barline.keyword.operator","|1"], - ["text"," "], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","F"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","2"], - ["text"," "], - ["barline.keyword.operator",":|2"], - ["text"," "], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","F"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","3"], - ["text"," "], - ["barline.keyword.operator","|]"] -],[ - "start" -],[ - "start", - ["information.keyword","X:"], - ["information.argument.string.unquoted","5"] -],[ - "start", - ["information.keyword","T:"], - ["information.argument.string.unquoted","Atholl Brose"] -],[ - "start", - ["comment.line.percentage","% in this example, which reproduces Highland Bagpipe gracing,"] -],[ - "start", - ["comment.line.percentage","% the large number of grace notes mean that it is more convenient to be specific about"] -],[ - "start", - ["comment.line.percentage","% score line-breaks (using the $ symbol), rather than using code line breaks to indicate them"] -],[ - "start", - ["information.keyword","I:"], - ["information.argument.string.unquoted","linebreak $"] -],[ - "start", - ["information.keyword","K:"], - ["information.argument.string.unquoted","D"] -],[ - "start", - ["text","{"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","d"], - ["text","}"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","<"], - ["text","{"], - ["pitch.constant.numeric","e"], - ["text","}"], - ["pitch.constant.numeric","A"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["text","}"], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","2"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","f"], - ["text","}"], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","A"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["text","}"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"] -],[ - "start", - ["text","{"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","d"], - ["text","}"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","<"], - ["text","{"], - ["pitch.constant.numeric","e"], - ["text","}"], - ["pitch.constant.numeric","A"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["text","}"], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","e"], - ["text"," {"], - ["pitch.constant.numeric","a"], - ["pitch.constant.numeric","g"], - ["text","}"], - ["pitch.constant.numeric","a"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","f"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","f"], - ["text","}"], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"] -],[ - "start", - ["text","{"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","d"], - ["text","}"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","<"], - ["text","{"], - ["pitch.constant.numeric","e"], - ["text","}"], - ["pitch.constant.numeric","A"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["text","}"], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","2"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","f"], - ["text","}"], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","A"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["text","}"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"] -],[ - "start", - ["text","{"], - ["pitch.constant.numeric","g"], - ["text","}"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","/"], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","/"], - ["pitch.constant.numeric","e"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["text","}"], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric",">"], - ["text","{"], - ["pitch.constant.numeric","d"], - ["text","}"], - ["pitch.constant.numeric","B"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","f"], - ["text","}"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","G"], - ["text"," {"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","c"], - ["text","}"], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","B"], - ["barline.keyword.operator",":|"], - ["text","$"] -],[ - "start", - ["text","{"], - ["pitch.constant.numeric","g"], - ["text","}"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","<"], - ["pitch.constant.numeric","e"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","f"], - ["text","}"], - ["pitch.constant.numeric","g"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","e"], - ["text"," {"], - ["pitch.constant.numeric","a"], - ["pitch.constant.numeric","g"], - ["text","}"], - ["pitch.constant.numeric","a"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","e"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","f"], - ["text","}"], - ["pitch.constant.numeric","g"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","e"], - ["barline.keyword.operator","|"] -],[ - "start", - ["text","{"], - ["pitch.constant.numeric","g"], - ["text","}"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","<"], - ["pitch.constant.numeric","e"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","f"], - ["text","}"], - ["pitch.constant.numeric","g"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","e"], - ["text"," {"], - ["pitch.constant.numeric","a"], - ["pitch.constant.numeric","g"], - ["text","}"], - ["pitch.constant.numeric","a"], - ["duration.constant.numeric","2"], - ["text"," {"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","G"], - ["text","}"], - ["pitch.constant.numeric","a"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"] -],[ - "start", - ["text","{"], - ["pitch.constant.numeric","g"], - ["text","}"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","<"], - ["pitch.constant.numeric","e"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","f"], - ["text","}"], - ["pitch.constant.numeric","g"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","e"], - ["text"," {"], - ["pitch.constant.numeric","a"], - ["pitch.constant.numeric","g"], - ["text","}"], - ["pitch.constant.numeric","a"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","e"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","f"], - ["text","}"], - ["pitch.constant.numeric","g"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","f"], - ["barline.keyword.operator","|"] -],[ - "start", - ["text","{"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","f"], - ["text","}"], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","d"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","f"], - ["text","}"], - ["pitch.constant.numeric","g"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","d"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","d"], - ["text","}"], - ["pitch.constant.numeric","B"], - ["duration.constant.numeric","<"], - ["text","{"], - ["pitch.constant.numeric","e"], - ["text","}"], - ["pitch.constant.numeric","G"], - ["text"," {"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","c"], - ["text","}"], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","B"], - ["barline.keyword.operator","|"] -],[ - "start", - ["text","{"], - ["pitch.constant.numeric","g"], - ["text","}"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","<"], - ["pitch.constant.numeric","e"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","f"], - ["text","}"], - ["pitch.constant.numeric","g"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","e"], - ["text"," {"], - ["pitch.constant.numeric","a"], - ["pitch.constant.numeric","g"], - ["text","}"], - ["pitch.constant.numeric","a"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","e"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","f"], - ["text","}"], - ["pitch.constant.numeric","g"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","e"], - ["barline.keyword.operator","|"] -],[ - "start", - ["text","{"], - ["pitch.constant.numeric","g"], - ["text","}"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","<"], - ["pitch.constant.numeric","e"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","f"], - ["text","}"], - ["pitch.constant.numeric","g"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","e"], - ["text"," {"], - ["pitch.constant.numeric","a"], - ["pitch.constant.numeric","g"], - ["text","}"], - ["pitch.constant.numeric","a"], - ["duration.constant.numeric","2"], - ["text"," {"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","G"], - ["text","}"], - ["pitch.constant.numeric","a"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"] -],[ - "start", - ["text","{"], - ["pitch.constant.numeric","g"], - ["text","}"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","<"], - ["text","{"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","G"], - ["text","}"], - ["pitch.constant.numeric","e"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","f"], - ["text","}"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","a"], - ["text"," {"], - ["pitch.constant.numeric","f"], - ["text","}"], - ["pitch.constant.numeric","g"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","e"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["text","}"], - ["pitch.constant.numeric","f"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"] -],[ - "start", - ["text","{"], - ["pitch.constant.numeric","g"], - ["text","}"], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","/"], - ["pitch.constant.numeric","f"], - ["duration.constant.numeric","/"], - ["pitch.constant.numeric","g"], - ["text"," {"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","c"], - ["text","}"], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","c"], - ["text"," {"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","d"], - ["text","}"], - ["pitch.constant.numeric","B"], - ["duration.constant.numeric","<"], - ["text","{"], - ["pitch.constant.numeric","e"], - ["text","}"], - ["pitch.constant.numeric","G"], - ["text"," {"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","c"], - ["text","}"], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator","|]"] -],[ - "start" -],[ - "start", - ["information.keyword","X:"], - ["information.argument.string.unquoted","6"] -],[ - "start", - ["information.keyword","T:"], - ["information.argument.string.unquoted","Untitled Reel"] -],[ - "start", - ["information.keyword","C:"], - ["information.argument.string.unquoted","Trad."] -],[ - "start", - ["information.keyword","K:"], - ["information.argument.string.unquoted","D"] -],[ - "start", - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","g"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","a"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","a"], - ["pitch.constant.numeric","b"], - ["text"," "], - ["pitch.constant.numeric","a"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","g"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","a"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","b"], - ["pitch.constant.numeric","g"], - ["text"," "], - ["pitch.constant.numeric","a"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","f"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","g"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","g"], - ["duration.constant.numeric","2"], - ["text"," "], - ["pitch.constant.numeric","f"], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","a"], - ["pitch.constant.numeric","g"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","f"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["text"," "], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator",":|"], - ["text","\\"] -],[ - "start", - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","A"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","A"], - ["text"," "], - ["pitch.constant.numeric","E"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","A"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","2"], - ["text"," "], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator",":|"] -],[ - "start", - ["information.keyword","K:"], - ["information.argument.string.unquoted","G"] -],[ - "start", - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","B"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","c"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","B"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","F"], - ["text"," "], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","E"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","c"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","B"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","2"], - ["text"," "], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator",":|"] -],[ - "start" -],[ - "start", - ["information.keyword","X:"], - ["information.argument.string.unquoted","7"] -],[ - "start", - ["information.keyword","T:"], - ["information.argument.string.unquoted","Kitchen Girl"] -],[ - "start", - ["information.keyword","C:"], - ["information.argument.string.unquoted","Trad."] -],[ - "start", - ["information.keyword","K:"], - ["information.argument.string.unquoted","D"] -],[ - "start", - ["text","["], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","4"], - ["pitch.constant.numeric","a"], - ["duration.constant.numeric","4"], - ["text","] ["], - ["pitch.constant.numeric","B"], - ["duration.constant.numeric","4"], - ["pitch.constant.numeric","g"], - ["duration.constant.numeric","4"], - ["text","]"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","f"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","d"], - ["text"," "], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","f"], - ["duration.constant.numeric","2"], - ["text"," "], - ["pitch.constant.numeric","g"], - ["pitch.constant.numeric","a"], - ["pitch.constant.numeric","b"], - ["pitch.constant.numeric","a"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","g"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","2"], - ["text"," "], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","f"], - ["pitch.constant.numeric","g"], - ["barline.keyword.operator","|"] -],[ - "start", - ["pitch.constant.numeric","a"], - ["duration.constant.numeric","4"], - ["text"," "], - ["pitch.constant.numeric","g"], - ["duration.constant.numeric","4"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","f"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","d"], - ["text"," "], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","f"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","g"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["text"," "], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","f"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","2"], - ["text"," "], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","4"], - ["barline.keyword.operator",":|"] -],[ - "start", - ["information.keyword","K:"], - ["information.argument.string.unquoted","G"] -],[ - "start", - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","A"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","B"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","D"], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","B"], - ["text"," "], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","3"], - ["pitch.constant.numeric","f"], - ["text"," "], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","B"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","A"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","B"], - ["barline.keyword.operator","|"] -],[ - "start", - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["text"," "], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","B"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","c"], - ["text"," "], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","4"], - ["text"," "], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","4"], - ["barline.keyword.operator",":|"] -],[ - "start" -],[ - "start", - ["comment.line.percentage","%abc-2.1"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","pagewidth 21cm"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","pageheight 29.7cm"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","topspace 0.5cm"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","topmargin 1cm"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","botmargin 0cm"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","leftmargin 1cm"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","rightmargin 1cm"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","titlespace 0cm"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","titlefont Times-Bold 32"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","subtitlefont Times-Bold 24"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","composerfont Times 16"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","vocalfont Times-Roman 14"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","staffsep 60pt"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","sysstaffsep 20pt"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","musicspace 1cm"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","vocalspace 5pt"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","measurenb 0"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","barsperstaff 5"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","scale 0.7"] -],[ - "start", - ["information.keyword","X:"], - ["information.argument.string.unquoted"," 1"] -],[ - "start", - ["information.keyword","T:"], - ["information.argument.string.unquoted"," Canzonetta a tre voci"] -],[ - "start", - ["information.keyword","C:"], - ["information.argument.string.unquoted"," Claudio Monteverdi (1567-1643)"] -],[ - "start", - ["information.keyword","M:"], - ["information.argument.string.unquoted"," C"] -],[ - "start", - ["information.keyword","L:"], - ["information.argument.string.unquoted"," 1/4"] -],[ - "start", - ["information.keyword","Q:"], - ["information.argument.string.unquoted"," \"Andante mosso\" 1/4 = 110"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","score [1 2 3]"] -],[ - "start", - ["information.keyword","V:"], - ["information.argument.string.unquoted"," 1 clef=treble name=\"Soprano\"sname=\"A\""] -],[ - "start", - ["information.keyword","V:"], - ["information.argument.string.unquoted"," 2 clef=treble name=\"Alto\" sname=\"T\""] -],[ - "start", - ["information.keyword","V:"], - ["information.argument.string.unquoted"," 3 clef=bass middle=d name=\"Tenor\" sname=\"B\""] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","MIDI program 1 75 % recorder"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","MIDI program 2 75"] -],[ - "start", - ["information.comment.line.percentage","%%"], - ["information.keyword.embedded","MIDI program 3 75"] -],[ - "start", - ["information.keyword","K:"], - ["information.argument.string.unquoted"," Eb"] -],[ - "start", - ["comment.line.percentage","% 1 - 4"] -],[ - "start", - ["information.keyword.embedded","[V:"], - ["information.argument.string.unquoted"," 1]"], - ["text"," "], - ["barline.keyword.operator","|:"], - ["pitch.constant.numeric","z"], - ["duration.constant.numeric","4"], - ["text"," "], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","z"], - ["duration.constant.numeric","4"], - ["text"," "], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","f"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","c"], - ["text"," "], - ["barline.keyword.operator","|"], - ["accent.constant.language","_"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","c"], - ["text"," "], - ["barline.keyword.operator","|"] -],[ - "start", - ["information.keyword","w:"], - ["information.argument.string.unquoted"," Son que-sti~i cre-spi cri-ni~e"] -],[ - "start", - ["information.keyword","w:"], - ["information.argument.string.unquoted"," Que-sti son gli~oc-chi che mi-"] -],[ - "start", - ["information.keyword.embedded","[V:"], - ["information.argument.string.unquoted"," 2]"], - ["text"," "], - ["barline.keyword.operator","|:"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","G"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","c"], - ["barline.keyword.operator","|"], - ["text","("], - ["pitch.constant.numeric","F"], - ["duration.constant.numeric","/"], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","/"], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","/"], - ["pitch.constant.numeric","B"], - ["duration.constant.numeric","/"], - ["text",")"], - ["pitch.constant.numeric","c"], - ["accent.constant.language","="], - ["pitch.constant.numeric","A"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","B"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","A"], - ["text"," "], - ["barline.keyword.operator","|"] -],[ - "start", - ["information.keyword","w:"], - ["information.argument.string.unquoted"," Son que-sti~i cre-spi cri-ni~e que - - - - sto~il vi-so e"] -],[ - "start", - ["information.keyword","w:"], - ["information.argument.string.unquoted"," Que-sti son~gli oc-chi che mi-ran - - - - do fi-so mi-"] -],[ - "start", - ["information.keyword.embedded","[V:"], - ["information.argument.string.unquoted"," 3]"], - ["text"," "], - ["barline.keyword.operator","|:"], - ["pitch.constant.numeric","z"], - ["duration.constant.numeric","4"], - ["text"," "], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","f"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","c"], - ["barline.keyword.operator","|"], - ["accent.constant.language","_"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","f"], - ["text"," "], - ["barline.keyword.operator","|"], - ["text","("], - ["pitch.constant.numeric","B"], - ["duration.constant.numeric","/"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","/"], - ["accent.constant.language","_"], - ["pitch.constant.numeric","d"], - ["duration.constant.numeric","/"], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","/"], - ["text",")"], - ["pitch.constant.numeric","f"], - ["pitch.constant.numeric","f"], - ["barline.keyword.operator","|"] -],[ - "start", - ["information.keyword","w:"], - ["information.argument.string.unquoted"," Son que-sti~i cre-spi cri-ni~e que - - - - sto~il"] -],[ - "start", - ["information.keyword","w:"], - ["information.argument.string.unquoted"," Que-sti son~gli oc-chi che mi-ran - - - - do"] -],[ - "start", - ["comment.line.percentage","% 5 - 9"] -],[ - "start", - ["information.keyword.embedded","[V:"], - ["information.argument.string.unquoted"," 1]"], - ["text"," "], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","B"], - ["duration.constant.numeric","2"], - ["text"," "], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","A"], - ["text"," "], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","3"], - ["pitch.constant.numeric","B"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","2"], - ["string.quoted","!fermata!"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","z"], - ["text"," "], - ["barline.keyword.operator","::"], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","4"], - ["barline.keyword.operator","|"] -],[ - "start", - ["information.keyword","w:"], - ["information.argument.string.unquoted"," que-sto~il vi-so ond' io ri-man-go~uc-ci-so. Deh,"] -],[ - "start", - ["information.keyword","w:"], - ["information.argument.string.unquoted"," ran-do fi-so, tut-to re-stai con-qui-so."] -],[ - "start", - ["information.keyword.embedded","[V:"], - ["information.argument.string.unquoted"," 2]"], - ["text"," "], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","2"], - ["text"," "], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","F"], - ["text"," "], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","3"], - ["pitch.constant.numeric","F"], - ["barline.keyword.operator","|"], - ["accent.constant.language","="], - ["pitch.constant.numeric","E"], - ["duration.constant.numeric","2"], - ["string.quoted","!fermata!"], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","z"], - ["barline.keyword.operator","::"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","4"], - ["barline.keyword.operator","|"] -],[ - "start", - ["information.keyword","w:"], - ["information.argument.string.unquoted"," que-sto~il vi-so ond' io ri-man-go~uc-ci-so. Deh,"] -],[ - "start", - ["information.keyword","w:"], - ["information.argument.string.unquoted"," ran-do fi-so tut-to re-stai con-qui-so."] -],[ - "start", - ["information.keyword.embedded","[V:"], - ["information.argument.string.unquoted"," 3]"], - ["text"," ("], - ["pitch.constant.numeric","a"], - ["pitch.constant.numeric","g"], - ["duration.constant.numeric","/"], - ["pitch.constant.numeric","f"], - ["duration.constant.numeric","/"], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","2"], - ["text",")"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","A"], - ["accent.constant.language","_"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","3"], - ["pitch.constant.numeric","B"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","2"], - ["string.quoted","!fermata!"], - ["pitch.constant.numeric","c"], - ["pitch.constant.numeric","z"], - ["text"," "], - ["barline.keyword.operator","::"], - ["pitch.constant.numeric","A"], - ["duration.constant.numeric","4"], - ["barline.keyword.operator","|"] -],[ - "start", - ["information.keyword","w:"], - ["information.argument.string.unquoted"," vi - - - so ond' io ti-man-go~uc-ci-so. Deh,"] -],[ - "start", - ["information.keyword","w:"], - ["information.argument.string.unquoted"," fi - - - so tut-to re-stai con-qui-so."] -],[ - "start", - ["comment.line.percentage","% 10 - 15"] -],[ - "start", - ["information.keyword.embedded","[V:"], - ["information.argument.string.unquoted"," 1]"], - ["text"," "], - ["pitch.constant.numeric","f"], - ["accent.constant.language","_"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","e"], - ["pitch.constant.numeric","c"], - ["text"," "], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","B"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","z"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","F"], - ["text"," "], - ["barline.keyword.operator","|"], - ["text","\\"] -],[ - "start", - ["information.keyword","w:"], - ["information.argument.string.unquoted"," dim-me-lo ben mi-o, che que-sto"], - ["text","\\"] -],[ - "start", - ["accent.constant.language","="], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","2"], - ["text"," "], - ["barline.keyword.operator","|1"], - ["pitch.constant.numeric","F"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","z"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator",":|2"], - ["pitch.constant.numeric","F"], - ["duration.constant.numeric","8"], - ["barline.keyword.operator","|]"], - ["text"," "], - ["comment.line.percentage","% more notes"] -],[ - "start", - ["information.keyword","w:"], - ["information.argument.string.unquoted"," sol de-si-o_. "], - ["comment.line.percentage","% more lyrics"] -],[ - "start", - ["information.keyword.embedded","[V:"], - ["information.argument.string.unquoted"," 2]"], - ["text"," "], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","A"], - ["text"," "], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","G"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","A"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","F"], - ["accent.constant.language","="], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","F"], - ["text"," "], - ["barline.keyword.operator","|"], - ["text","("], - ["pitch.constant.numeric","G"], - ["pitch.constant.numeric","F"], - ["duration.constant.numeric","3/2"], - ["accent.constant.language","="], - ["pitch.constant.numeric","E"], - ["duration.constant.numeric","//"], - ["pitch.constant.numeric","D"], - ["duration.constant.numeric","//"], - ["pitch.constant.numeric","E"], - ["text",")"], - ["barline.keyword.operator","|1"], - ["pitch.constant.numeric","F"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","z"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator",":|2"], - ["pitch.constant.numeric","F"], - ["duration.constant.numeric","8"], - ["barline.keyword.operator","|]"] -],[ - "start", - ["information.keyword","w:"], - ["information.argument.string.unquoted"," dim-me-lo ben mi-o, che que-sto sol de-si - - - - o_."] -],[ - "start", - ["information.keyword.embedded","[V:"], - ["information.argument.string.unquoted"," 3]"], - ["text"," "], - ["accent.constant.language","_"], - ["pitch.constant.numeric","d"], - ["pitch.constant.numeric","B"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric",">"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","e"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","A"], - ["pitch.constant.numeric","F"], - ["barline.keyword.operator","|"], - ["accent.constant.language","="], - ["pitch.constant.numeric","E"], - ["pitch.constant.numeric","F"], - ["pitch.constant.numeric","c"], - ["accent.constant.language","_"], - ["pitch.constant.numeric","d"], - ["barline.keyword.operator","|"], - ["pitch.constant.numeric","c"], - ["duration.constant.numeric","4"], - ["text"," "], - ["barline.keyword.operator","|1"], - ["pitch.constant.numeric","F"], - ["duration.constant.numeric","2"], - ["pitch.constant.numeric","z"], - ["duration.constant.numeric","2"], - ["barline.keyword.operator",":|2"], - ["pitch.constant.numeric","F"], - ["duration.constant.numeric","8"], - ["barline.keyword.operator","|]"] -],[ - "start", - ["information.keyword","w:"], - ["information.argument.string.unquoted"," dim-me-lo ben mi-o, che que-sto sol de-si-o_."] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_actionscript.json b/lib/ace/mode/_test/tokens_actionscript.json deleted file mode 100644 index e3fad38f..00000000 --- a/lib/ace/mode/_test/tokens_actionscript.json +++ /dev/null @@ -1,263 +0,0 @@ -[[ - "start", - ["text","package code"] -],[ - "start", - ["text","{"] -],[ - "punctuation.definition.comment.actionscript.2", - ["text"," "], - ["punctuation.definition.comment.actionscript.2","/*"], - ["comment.block.actionscript.2","****************************************"] -],[ - "punctuation.definition.comment.actionscript.2", - ["comment.block.actionscript.2","\t * based on textmate actionscript bundle"] -],[ - "start", - ["comment.block.actionscript.2","\t ***************************************"], - ["punctuation.definition.comment.actionscript.2","*/"] -],[ - "start", - ["text","\t "] -],[ - "start", - ["text","\t"], - ["keyword.control.actionscript.2","import"], - ["text"," fl.events.SliderEvent;"] -],[ - "start", - ["text","\t"] -],[ - "start", - ["text","\t"], - ["keyword.control.actionscript.2","public"], - ["text"," "], - ["storage.type.class.actionscript.2","class"], - ["meta.class.actionscript.2"," "], - ["entity.name.type.class.actionscript.2","Foo"], - ["meta.class.actionscript.2"," "], - ["storage.modifier.extends.actionscript.2","extends"], - ["meta.class.actionscript.2"," "], - ["entity.other.inherited-class.actionscript.2","MovieClip"] -],[ - "start", - ["text","\t{"] -],[ - "start", - ["text","\t\t"], - ["punctuation.definition.comment.actionscript.2","//*************************"] -],[ - "start", - ["text","\t\t"], - ["punctuation.definition.comment.actionscript.2","// Properties:"] -],[ - "start", - ["text","\t\t"] -],[ - "start", - ["text","\t\t"], - ["keyword.control.actionscript.2","public"], - ["text"," "], - ["keyword.control.actionscript.2","var"], - ["text"," activeSwatch"], - ["keyword.operator.symbolic.actionscript.2",":"], - ["support.class.actionscript.2","MovieClip"], - ["text",";"] -],[ - "start", - ["text","\t\t"] -],[ - "start", - ["text","\t\t"], - ["punctuation.definition.comment.actionscript.2","// Color offsets"] -],[ - "start", - ["text","\t\t"], - ["keyword.control.actionscript.2","public"], - ["text"," "], - ["keyword.control.actionscript.2","var"], - ["text"," c1"], - ["keyword.operator.symbolic.actionscript.2",":"], - ["storage.type.actionscript.2","Number"], - ["text"," "], - ["keyword.operator.symbolic.actionscript.2","="], - ["text"," "], - ["constant.numeric.actionscript.2","0"], - ["text",";\t"], - ["punctuation.definition.comment.actionscript.2","// R"] -],[ - "start", - ["text","\t\t"] -],[ - "start", - ["text","\t\t"], - ["punctuation.definition.comment.actionscript.2","//*************************"] -],[ - "start", - ["text","\t\t"], - ["punctuation.definition.comment.actionscript.2","// Constructor:"] -],[ - "start", - ["text","\t\t"] -],[ - "start", - ["text","\t\t"], - ["keyword.control.actionscript.2","public"], - ["text"," "], - ["storage.type.function.actionscript.2","function"], - ["meta.function.actionscript.2"," "], - ["entity.name.function.actionscript.2","Foo"], - ["punctuation.definition.parameters.begin.actionscript.2","("], - ["punctuation.definition.parameters.end.actionscript.2",")"] -],[ - "start", - ["text","\t\t{"] -],[ - "start", - ["text","\t\t\t"], - ["punctuation.definition.comment.actionscript.2","// Respond to mouse events"] -],[ - "start", - ["text","\t\t\tswatch1_btn."], - ["support.function.actionscript.2","addEventListener"], - ["text","(MouseEvent.CLICK,swatchHandler,"], - ["constant.language.actionscript.2","false"], - ["text",","], - ["constant.numeric.actionscript.2","0"], - ["text",","], - ["constant.language.actionscript.2","false"], - ["text",");"] -],[ - "start", - ["text","\t\t\tpreviewBox_btn."], - ["support.function.actionscript.2","addEventListener"], - ["text","(MouseEvent.MOUSE_DOWN,dragPressHandler);"] -],[ - "start", - ["text","\t\t\t"] -],[ - "start", - ["text","\t\t\t"], - ["punctuation.definition.comment.actionscript.2","// Respond to drag events"] -],[ - "start", - ["text","\t\t\tred_slider."], - ["support.function.actionscript.2","addEventListener"], - ["text","(SliderEvent.THUMB_DRAG,sliderHandler);"] -],[ - "start", - ["text","\t\t\t"] -],[ - "start", - ["text","\t\t\t"], - ["punctuation.definition.comment.actionscript.2","// Draw a frame later"] -],[ - "start", - ["text","\t\t\t"], - ["support.function.actionscript.2","addEventListener"], - ["text","(Event.ENTER_FRAME,"], - ["support.function.actionscript.2","draw"], - ["text",");"] -],[ - "start", - ["text","\t\t}"] -],[ - "start", - ["text"," "] -],[ - "start", - ["text","\t\tprotected "], - ["storage.type.function.actionscript.2","function"], - ["meta.function.actionscript.2"," "], - ["entity.name.function.actionscript.2","clickHandler"], - ["punctuation.definition.parameters.begin.actionscript.2","("], - ["variable.parameter.function.actionscript.2","event:MouseEvent"], - ["punctuation.definition.parameters.end.actionscript.2",")"], - ["keyword.operator.symbolic.actionscript.2",":"], - ["support.function.actionscript.2","void"] -],[ - "start", - ["text","\t\t{"] -],[ - "start", - ["text","\t\t\tcar.transform.colorTransform "], - ["keyword.operator.symbolic.actionscript.2","="], - ["text"," "], - ["keyword.control.actionscript.2","new"], - ["text"," ColorTransform("], - ["constant.numeric.actionscript.2","0"], - ["text",","], - ["constant.numeric.actionscript.2","0"], - ["text",","], - ["constant.numeric.actionscript.2","0"], - ["text",","], - ["constant.numeric.actionscript.2","1"], - ["text",",c1,c2,c3);"] -],[ - "start", - ["text","\t\t}"] -],[ - "start", - ["text","\t\t"] -],[ - "start", - ["text","\t\tprotected "], - ["storage.type.function.actionscript.2","function"], - ["meta.function.actionscript.2"," "], - ["entity.name.function.actionscript.2","changeRGBHandler"], - ["punctuation.definition.parameters.begin.actionscript.2","("], - ["variable.parameter.function.actionscript.2","event:Event"], - ["punctuation.definition.parameters.end.actionscript.2",")"], - ["keyword.operator.symbolic.actionscript.2",":"], - ["support.function.actionscript.2","void"] -],[ - "start", - ["text","\t\t{"] -],[ - "start", - ["text","\t\t\tc1 "], - ["keyword.operator.symbolic.actionscript.2","="], - ["text"," "], - ["storage.type.actionscript.2","Number"], - ["text","(c1_txt."], - ["support.function.actionscript.2","text"], - ["text",");"] -],[ - "start", - ["text"," "] -],[ - "start", - ["text","\t\t\t"], - ["keyword.control.actionscript.2","if"], - ["text","("], - ["keyword.operator.symbolic.actionscript.2","!"], - ["text","(c1>"], - ["keyword.operator.symbolic.actionscript.2","="], - ["constant.numeric.actionscript.2","0"], - ["text",")){"] -],[ - "start", - ["text","\t\t\t\tc1 "], - ["keyword.operator.symbolic.actionscript.2","="], - ["text"," "], - ["constant.numeric.actionscript.2","0"], - ["text",";"] -],[ - "start", - ["text","\t\t\t}\t\t\t"] -],[ - "start", - ["text","\t\t\t"] -],[ - "start", - ["text","\t\t\tupdateSliders();"] -],[ - "start", - ["text","\t\t}"] -],[ - "start", - ["text","\t}"] -],[ - "start", - ["text","}"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_ada.json b/lib/ace/mode/_test/tokens_ada.json deleted file mode 100644 index bdef7256..00000000 --- a/lib/ace/mode/_test/tokens_ada.json +++ /dev/null @@ -1,39 +0,0 @@ -[[ - "start", - ["keyword","with"], - ["text"," "], - ["identifier","Ada"], - ["text","."], - ["identifier","Text_IO"], - ["text","; "], - ["keyword","use"], - ["text"," "], - ["identifier","Ada"], - ["text","."], - ["identifier","Text_IO"], - ["text",";"] -],[ - "start", - ["keyword","procedure"], - ["text"," "], - ["identifier","Hello"], - ["text"," "], - ["keyword","is"] -],[ - "start", - ["keyword","begin"] -],[ - "start", - ["text"," "], - ["identifier","Put_Line"], - ["paren.lparen","("], - ["string","\"Hello, world!\""], - ["paren.rparen",")"], - ["text",";"] -],[ - "start", - ["keyword","end"], - ["text"," "], - ["identifier","Hello"], - ["text",";"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_asciidoc.json b/lib/ace/mode/_test/tokens_asciidoc.json deleted file mode 100644 index f54c355e..00000000 --- a/lib/ace/mode/_test/tokens_asciidoc.json +++ /dev/null @@ -1,422 +0,0 @@ -[[ - "literalBlock", - ["support.function","------------------------------------"] -],[ - "dissallowDelimitedBlock", - ["support.function","-----------------------------------"] -],[ - "text", - ["string.italic","_ita_lic_"], - ["text",", "], - ["keyword.bold","*bo*ld*"], - ["text",", "], - ["support.function","+mo+no+"], - ["text",", normal. "] -],[ - "text", - ["keyword","``"], - ["text","double quoted"], - ["keyword","''"], - ["text",", `single quoted'."] -],[ - "text", - ["text"," normal, ^super^, "], - ["keyword","~sub~"], - ["text","."] -],[ - "start" -],[ - "text", - ["text","''''"] -],[ - "text", - ["text","Escaped:"] -],[ - "text", - ["constant.language.escape","\\_"], - ["text","italic_, "], - ["support.function","+++"], - ["text","_italic_"], - ["support.function","+++"], - ["text",","] -],[ - "smallPassthrough", - ["text","t"], - ["constant.language.escape","\\_"], - ["text","_e"], - ["string.italic","__st, +++t__"], - ["text","e__st"], - ["support.function","+++"], - ["text",","] -],[ - "smallPassthrough", - ["support.function","+++"], - ["text","bold"], - ["support.function","+++"], - ["text",", $$<"], - ["support.function","b"], - ["text",">"], - ["support.function","normal"], - ["text","$$"] -],[ - "smallPassthrough", - ["text","\\&#"], - ["support.function","182"], - ["text","; &#"], - ["support.function","182"], - ["text",";"] -],[ - "smallPassthrough", - ["text","\\`"], - ["support.function","not"], - ["text"," "], - ["support.function","single"], - ["text"," "], - ["support.function","quoted"], - ["text","'"] -],[ - "smallPassthrough", - ["text","\\`\\`"], - ["support.function","not"], - ["text"," "], - ["support.function","double"], - ["text"," "], - ["support.function","quoted"], - ["text","''"] -],[ - "dissallowDelimitedBlock" -],[ - "text" -],[ - "start", - ["string.regexp","[fffff]"] -],[ - "passthroughBlock", - ["string","+++++++++++++++++++++++++++++++++++++"] -],[ - "passthroughBlock", - ["support.function","(C) "], - ["constant.character","{ss}"], - ["support.function"," ss"] -],[ - "dissallowDelimitedBlock", - ["support.function","+++++++++++++++++++++++++++++++++++++"] -],[ - "text" -],[ - "listingBlock", - ["support.function","............."] -],[ - "listingBlock", - ["support.function","callout "], - ["constant.numeric","<1>"] -],[ - "dissallowDelimitedBlock", - ["support.function",".............."] -],[ - "text" -],[ - "text", - ["text","> 1"] -],[ - "text", - ["text","1> 2"] -],[ - "text", - ["text","<2> 3"] -],[ - "start" -],[ - "text", - ["text","Escaped:"] -],[ - "text", - ["constant.language.escape","\\_"], - ["text","italic_,"] -],[ - "text", - ["text","t"], - ["constant.language.escape","\\_"], - ["text","_e"], - ["string.italic","__st, o__"] -],[ - "start" -],[ - "start", - ["constant.numeric",".optional title"] -],[ - "listingBlock", - ["support.function","............."] -],[ - "listingBlock", - ["support.function","callout "], - ["constant.numeric","<1>"] -],[ - "dissallowDelimitedBlock", - ["support.function",".............."] -],[ - "text" -],[ - "start" -],[ - "text", - ["keyword",":macro:"], - ["text"," dddd"] -],[ - "start" -],[ - "start", - ["constant.numeric",".lists"] -],[ - "listText", - ["keyword",". "], - ["text","1"] -],[ - "listText", - ["keyword",".. "], - ["text","2"] -],[ - "listText", - ["keyword","... "], - ["text","d"] -],[ - "listText", - ["keyword","..... "], - ["text","big"] -],[ - "start", - ["keyword","+"] -],[ - "text", - ["text","continue"], - ["keyword"," +"] -],[ - "text", - ["text","next line"] -],[ - "text", - ["text","xi) no "], - ["support.function","++la+tin++"] -],[ - "start" -],[ - "listText", - ["keyword","xi) "], - ["text","la"], - ["support.function","++tin++"] -],[ - "listText", - ["keyword","2. "], - ["text","num"], - ["string.italic","__ber__"], - ["text"," [red]"], - ["keyword","#"], - ["text","red"], - ["keyword","#"] -],[ - "start", - ["keyword","--"] -],[ - "listText", - ["keyword"," 5. "], - ["text","f "], - ["keyword","<>"], - ["text"," "], - ["constant.character","{macro}"] -],[ - "start", - ["keyword","--"] -],[ - "text", - ["markup.list.macro","image::"], - ["keyword","path"], - ["string","[beauty]"], - ["text"," "], - ["constant.language.escape","->"], - ["text","--"], - ["constant.language.escape","<= --"], - ["text"," replacements"] -],[ - "start" -],[ - "indentedBlock", - ["support.function"," image::s"] -],[ - "indentedBlock", - ["support.function","sssss"] -],[ - "indentedBlock", - ["support.function","sss "] -],[ - "indentedBlock", - ["support.function","sssss"] -],[ - "start" -],[ - "start" -],[ - "start", - ["markup.heading","== 1"] -],[ - "indentedBlock", - ["support.function"," heading"] -],[ - "start", - ["markup.heading","=== not a heading"] -],[ - "start", - ["keyword","===================================="] -],[ - "start" -],[ - "start", - ["keyword","=================================="] -],[ - "text", - ["text","====4 "] -],[ - "text", - ["text","NOTE: above"] -],[ - "start" -],[ - "text", - ["keyword","NOTE:"], - ["text"," above"] -],[ - "start" -],[ - "start", - ["string.regexp","[[x6]]"] -],[ - "text", - ["keyword","WARNING:"], - ["text"," "] -],[ - "start" -],[ - "start", - ["string.regexp","[options[]]"] -],[ - "literalBlock", - ["support.function","---------------------------"] -],[ - "literalBlock", - ["support.function","literal"] -],[ - "dissallowDelimitedBlock", - ["support.function","---------------------------"] -],[ - "text" -],[ - "start" -],[ - "start", - ["markup.heading","= Tables"] -],[ - "tableBlock", - ["doc.comment","|===================================="] -],[ - "tableBlock", - ["doc.comment","|"], - ["text"," "], - ["string.italic","_italic_"], - ["text"," "], - ["doc.comment","|"], - ["text"," "], - ["keyword.bold","*bold*"], - ["text"," "], - ["doc.comment","|"], - ["text"," text "], - ["doc.comment","|"], - ["text"," "], - ["constant.language.escape","(R)"] -],[ - "tableBlock" -],[ - "dissallowDelimitedBlock", - ["doc.comment","|===================================="] -],[ - "text" -],[ - "start" -],[ - "start", - ["string.regexp","[more, options]"] -],[ - "commentBlock", - ["doc.comment","///////////"] -],[ - "commentBlock", - ["doc.comment","comment"] -],[ - "dissallowDelimitedBlock", - ["doc.comment","///////////"] -],[ - "text", - ["comment","// one line comment"] -],[ - "start" -],[ - "start" -],[ - "start" -],[ - "text", - ["text","[red]"], - ["keyword","#"], - ["text","red text"], - ["keyword","#"], - ["text"," [yellow-background]"], - ["keyword","#"], - ["text","on yellow"], - ["keyword","#"] -],[ - "text", - ["text","[big]"], - ["keyword","#"], - ["text","large"], - ["keyword","#"], - ["text"," [red yellow-background big]"], - ["keyword.bold","*all bold*"] -],[ - "start" -],[ - "start", - ["text","\t"] -],[ - "text", - ["markup.underline.list","https://site"], - ["text"," text <"], - ["markup.underline.list","mail@i.am"], - ["text","> "], - ["markup.underline.list","callto:ace"], - ["text"," "], - ["link","http://ace.ajaxorg.com"], - ["variable.language","[awesome]"] -],[ - "text", - ["text"," .still normal text"] -],[ - "start", - ["constant.numeric",".break out thoug should not"] -],[ - "literalBlock", - ["support.function","---------------------------"] -],[ - "literalBlock", - ["support.function","///////////////////////////"] -],[ - "dissallowDelimitedBlock", - ["support.function","---------------------------"] -],[ - "text" -],[ - "start" -],[ - "start" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_assembly_x86.json b/lib/ace/mode/_test/tokens_assembly_x86.json deleted file mode 100644 index 5da0470e..00000000 --- a/lib/ace/mode/_test/tokens_assembly_x86.json +++ /dev/null @@ -1,114 +0,0 @@ -[[ - "start", - ["support.function.directive.assembly","section"], - ["text","\t.text"] -],[ - "start", - ["text"," "], - ["support.function.directive.assembly","global"], - ["text"," "], - ["entity.name.function.assembly","main"], - ["text"," "], - ["comment.assembly",";must be declared for using gcc"] -],[ - "start" -],[ - "start", - ["entity.name.function.assembly","main:"], - ["text","\t "], - ["comment.assembly",";tell linker entry point"] -],[ - "start" -],[ - "start", - ["text","\t"], - ["keyword.control.assembly","mov"], - ["text","\t"], - ["variable.parameter.register.assembly","edx"], - ["text",", len\t "], - ["comment.assembly",";message length"] -],[ - "start", - ["text","\t"], - ["keyword.control.assembly","mov"], - ["text","\t"], - ["variable.parameter.register.assembly","ecx"], - ["text",", msg\t "], - ["comment.assembly",";message to write"] -],[ - "start", - ["text","\t"], - ["keyword.control.assembly","mov"], - ["text","\t"], - ["variable.parameter.register.assembly","ebx"], - ["text",", "], - ["constant.character.decimal.assembly","1"], - ["text","\t "], - ["comment.assembly",";file descriptor (stdout)"] -],[ - "start", - ["text","\t"], - ["keyword.control.assembly","mov"], - ["text","\t"], - ["variable.parameter.register.assembly","eax"], - ["text",", "], - ["constant.character.decimal.assembly","4"], - ["text","\t "], - ["comment.assembly",";system call number (sys_write)"] -],[ - "start", - ["text","\t"], - ["keyword.control.assembly","int"], - ["text","\t"], - ["constant.character.hexadecimal.assembly","0x80"], - ["text","\t "], - ["comment.assembly",";call kernel"] -],[ - "start" -],[ - "start", - ["text","\t"], - ["keyword.control.assembly","mov"], - ["text","\t"], - ["variable.parameter.register.assembly","eax"], - ["text",", "], - ["constant.character.decimal.assembly","1"], - ["text","\t "], - ["comment.assembly",";system call number (sys_exit)"] -],[ - "start", - ["text","\t"], - ["keyword.control.assembly","int"], - ["text","\t"], - ["constant.character.hexadecimal.assembly","0x80"], - ["text","\t "], - ["comment.assembly",";call kernel"] -],[ - "start" -],[ - "start", - ["support.function.directive.assembly","section"], - ["text","\t.data"] -],[ - "start" -],[ - "start", - ["entity.name.function.assembly","msg"], - ["text","\t"], - ["support.function.directive.assembly","db"], - ["text","\t"], - ["string.assembly","'Hello, world!'"], - ["text",","], - ["constant.character.hexadecimal.assembly","0xa"], - ["text","\t"], - ["comment.assembly",";our dear string"] -],[ - "start", - ["entity.name.function.assembly","len"], - ["text","\t"], - ["support.function.directive.assembly","equ"], - ["text","\t$ - msg\t\t\t"], - ["comment.assembly",";length of our dear string"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_autohotkey.json b/lib/ace/mode/_test/tokens_autohotkey.json deleted file mode 100644 index 374310fb..00000000 --- a/lib/ace/mode/_test/tokens_autohotkey.json +++ /dev/null @@ -1,261 +0,0 @@ -[[ - "start", - ["punctuation.ahk","#"], - ["keyword.command.ahk","NoEnv"] -],[ - "start", - ["keyword.command.ahk","SetBatchLines"], - ["text"," "], - ["constant.numeric","-1"] -],[ - "start" -],[ - "start", - ["keyword.command.ahk","CoordMode"], - ["text"," "], - ["variable.parameter","Mouse"], - ["punctuation.ahk",","], - ["text"," "], - ["variable.parameter","Screen"] -],[ - "start", - ["keyword.command.ahk","OnExit"], - ["text"," "], - ["variable.parameter","GuiClose"] -],[ - "start" -],[ - "start", - ["text","zoom "], - ["keyword.operator.ahk",":="], - ["text"," 9"] -],[ - "start" -],[ - "start", - ["text","computeSize"], - ["punctuation.ahk","(){"] -],[ - "start", - ["text","\t"], - ["keyword.control.ahk","global"], - ["text"," as_x"] -],[ - "start", - ["text","\tas_x "], - ["keyword.operator.ahk",":="], - ["text"," "], - ["support.function.ahk","Round"], - ["punctuation.ahk","("], - ["text","ws_x"], - ["keyword.operator.ahk","/"], - ["text","zoom"], - ["keyword.operator.ahk","/"], - ["text","2 "], - ["keyword.operator.ahk","-"], - ["text"," 0.5"], - ["punctuation.ahk",")"] -],[ - "start", - ["text","\t"], - ["keyword.control.ahk","if"], - ["text"," "], - ["punctuation.ahk","("], - ["text","zoom"], - ["keyword.operator.ahk",">"], - ["text","1"], - ["punctuation.ahk",")"], - ["text"," "], - ["punctuation.ahk","{"] -],[ - "start", - ["text","\t\tpix "], - ["keyword.operator.ahk",":="], - ["text"," "], - ["support.function.ahk","Round"], - ["punctuation.ahk","("], - ["text","zoom"], - ["punctuation.ahk",")"] -],[ - "start", - ["text","\t"], - ["punctuation.ahk","}"], - ["text"," ele "], - ["punctuation.ahk","{"] -],[ - "start", - ["text","\t\tpix "], - ["keyword.operator.ahk",":="], - ["text"," 1"] -],[ - "start", - ["text","\t"], - ["punctuation.ahk","}"] -],[ - "start", - ["text"," "], - ["keyword.command.ahk","ToolTip"], - ["text"," Message "], - ["punctuation.ahk","%"], - ["text","as_x"], - ["punctuation.ahk","%"], - ["text"," "], - ["punctuation.ahk","%"], - ["text","zoom"], - ["punctuation.ahk","%"], - ["text"," "], - ["punctuation.ahk","%"], - ["text","ws_x"], - ["punctuation.ahk","%"], - ["text"," "], - ["punctuation.ahk","%"], - ["text","hws_x"], - ["punctuation.ahk","%"], - ["text"," "] -],[ - "start", - ["punctuation.ahk","}"] -],[ - "start" -],[ - "start", - ["text","hdc_frame "], - ["keyword.operator.ahk",":="], - ["text"," "], - ["support.function.ahk","DllCall"], - ["punctuation.ahk","("], - ["punctuation.quote.double","\""], - ["string.quoted.ahk","GetDC"], - ["punctuation.quote.double","\""], - ["punctuation.ahk",","], - ["text"," UInt"], - ["punctuation.ahk",","], - ["text"," MagnifierID"], - ["punctuation.ahk",")"] -],[ - "start" -],[ - "start", - ["comment.line.ahk","; comment"] -],[ - "start", - ["text","DrawCross"], - ["punctuation.ahk","("], - ["keyword.control.ahk","byRef"], - ["text"," x"], - ["keyword.operator.ahk","="], - ["punctuation.quote.double","\""], - ["punctuation.quote.double","\""], - ["punctuation.ahk",","], - ["text"," rX"], - ["punctuation.ahk",","], - ["text","rY"], - ["punctuation.ahk",","], - ["text","z"], - ["punctuation.ahk",","], - ["text"," dc"], - ["punctuation.ahk","){"] -],[ - "start", - ["text"," "], - ["comment.line.ahk"," ;specify the style, thickness and color of the cross lines"] -],[ - "start", - ["text"," h_pen "], - ["keyword.operator.ahk",":="], - ["text"," "], - ["support.function.ahk","DllCall"], - ["punctuation.ahk","("], - ["text"," "], - ["punctuation.quote.double","\""], - ["string.quoted.ahk","gdi32.dll\\CreatePen"], - ["punctuation.quote.double","\""], - ["punctuation.ahk",","], - ["text"," "], - ["constant.language","Int"], - ["punctuation.ahk",","], - ["text"," 0"], - ["punctuation.ahk",","], - ["text"," "], - ["constant.language","Int"], - ["punctuation.ahk",","], - ["text"," 1"], - ["punctuation.ahk",","], - ["text"," UInt"], - ["punctuation.ahk",","], - ["text"," 0x0000FF"], - ["punctuation.ahk",")"] -],[ - "start", - ["punctuation.ahk","}"] -],[ - "start" -],[ - "start", - ["comment.line.ahk",";Ctrl ^; Shift +; Win #; Alt !"] -],[ - "start", - ["text","^"], - ["support.constant.ahk","NumPadAdd"], - ["keyword.operator.ahk","::"] -],[ - "start", - ["text","^"], - ["support.constant.ahk","WheelUp"], - ["keyword.operator.ahk","::"], - ["text"," "] -],[ - "start", - ["text","^;"], - ["keyword.operator.ahk","::"], - ["text"," "], - ["comment.line.ahk"," ;comment"] -],[ - "start", - ["text"," "], - ["keyword.control.ahk","If"], - ["punctuation.ahk","("], - ["text","zoom "], - ["keyword.operator.ahk","<"], - ["text"," ws_x "], - ["variable.parameter","and"], - ["text"," "], - ["punctuation.ahk","("], - ["text"," "], - ["variable.predefined.ahk","A_ThisHotKey"], - ["text"," "], - ["keyword.operator.ahk","="], - ["text"," "], - ["punctuation.quote.double","\""], - ["string.quoted.ahk","^WheelUp"], - ["punctuation.quote.double","\""], - ["text"," "], - ["variable.parameter","or"], - ["text"," "], - ["variable.predefined.ahk","A_ThisHotKey"], - ["text"," "], - ["keyword.operator.ahk","="], - ["punctuation.quote.double","\""], - ["string.quoted.ahk","^NumPadAdd"], - ["punctuation.quote.double","\""], - ["punctuation.ahk",")"], - ["text"," "], - ["punctuation.ahk",")"] -],[ - "start", - ["text","\t\tzoom "], - ["keyword.operator.ahk","*="], - ["text"," 1.189207115 "], - ["comment.line.ahk"," ; sqrt(sqrt(2))"] -],[ - "start", - ["text","\t"], - ["keyword.command.ahk","Gosub"], - ["punctuation.ahk",","], - ["text","setZoom"] -],[ - "start", - ["keyword.control.ahk","return"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_batchfile.json b/lib/ace/mode/_test/tokens_batchfile.json deleted file mode 100644 index 0f1f138c..00000000 --- a/lib/ace/mode/_test/tokens_batchfile.json +++ /dev/null @@ -1,70 +0,0 @@ -[[ - "start", - ["comment.line.colons.dosbatch",":: batch file highlighting in Ace!"] -],[ - "start", - ["text","@"], - ["keyword.command.dosbatch","echo"], - ["text"," off"] -],[ - "start" -],[ - "start", - ["keyword.control.statement.dosbatch","CALL"], - ["text"," "], - ["keyword.command.dosbatch","set"], - ["text"," var1="], - ["constant.numeric","%cd%"] -],[ - "start", - ["keyword.command.dosbatch","echo"], - ["text"," unhide everything in "], - ["constant.numeric","%var1%"], - ["text","!"] -],[ - "start" -],[ - "start", - ["comment.line.colons.dosbatch",":: FOR loop in bat is super strange!"] -],[ - "start", - ["keyword.control.repeat.dosbatch","FOR"], - ["text"," /f "], - ["punctuation.definition.string.begin.shell","\""], - ["string.quoted.double.dosbatch","tokens=*"], - ["punctuation.definition.string.end.shell","\""], - ["text"," "], - ["constant.numeric","%%G"], - ["text"," IN ('"], - ["keyword.command.dosbatch","dir"], - ["text"," /A:D /b') DO ("] -],[ - "start", - ["keyword.command.dosbatch","echo"], - ["text"," "], - ["constant.numeric","%var1%%%G"] -],[ - "start", - ["keyword.command.dosbatch","attrib"], - ["text"," -r -a -h -s "], - ["punctuation.definition.string.begin.shell","\""], - ["constant.numeric","%var1%%%G"], - ["punctuation.definition.string.end.shell","\""], - ["text"," /D /S"] -],[ - "start", - ["text",")"] -],[ - "start" -],[ - "start", - ["keyword.command.dosbatch","pause"] -],[ - "start" -],[ - "start", - ["doc.comment","REM"], - ["comment"," that's all"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_c9search.json b/lib/ace/mode/_test/tokens_c9search.json deleted file mode 100644 index 902d8dce..00000000 --- a/lib/ace/mode/_test/tokens_c9search.json +++ /dev/null @@ -1,131 +0,0 @@ -[[ - ["start",{}], - ["text","Searching for '"], - ["text","var"], - ["text","' in"], - ["text"," /.c9/metadata/workspace/plugins "], - ["text","(regexp, case sensitive, whole word)"], - "Searching for \u0001var\u0001 in\u0001/.c9/metadata/workspace/plugins\u0001\u0001regexp, case sensitive, whole word\u0001" -],[ - ["start",{}] -],[ - ["start",{}], - ["string","configs/default.js"], - ["text",":"] -],[ - ["start",{}], - ["c9searchresults.constant.numeric"," 1"], - ["c9searchresults.text",": "], - ["c9searchresults.keyword","var"], - ["c9searchresults.text"," fs = require(\"fs\");"] -],[ - ["start",{}], - ["c9searchresults.constant.numeric","\t2"], - ["c9searchresults.text",": "], - ["c9searchresults.keyword","var"], - ["c9searchresults.text"," argv = require('optimist').argv;"] -],[ - ["start",{}], - ["c9searchresults.constant.numeric","\t3"], - ["c9searchresults.text",": "], - ["c9searchresults.keyword","var"], - ["c9searchresults.text"," path = require(\"path\");"] -],[ - ["start",{}], - ["c9searchresults.constant.numeric","\t5"], - ["c9searchresults.text",": "], - ["c9searchresults.keyword","var"], - ["c9searchresults.text"," clientExtensions = {};"] -],[ - ["start",{}], - ["c9searchresults.constant.numeric","\t6"], - ["c9searchresults.text",": "], - ["c9searchresults.keyword","var"], - ["c9searchresults.text"," clientDirs = fs.readdirSync(__dirname + \"/../plugins-client\");"] -],[ - ["start",{}], - ["c9searchresults.constant.numeric","\t7"], - ["c9searchresults.text",": "], - ["c9searchresults.text","for ("], - ["c9searchresults.keyword","var"], - ["c9searchresults.text"," i = 0; i < clientDirs.length; i++) {"] -],[ - ["start",{}], - ["c9searchresults.constant.numeric","\t8"], - ["c9searchresults.text",": "], - ["c9searchresults.text"," "], - ["c9searchresults.keyword","var"], - ["c9searchresults.text"," dir = clientDirs[i];"] -],[ - ["start",{}], - ["c9searchresults.constant.numeric","\t12"], - ["c9searchresults.text",": "], - ["c9searchresults.text"," "], - ["c9searchresults.keyword","var"], - ["c9searchresults.text"," name = dir.split(\".\")[1];"] -],[ - ["start",{}], - ["c9searchresults.constant.numeric","\t16"], - ["c9searchresults.text",": "], - ["c9searchresults.keyword","var"], - ["c9searchresults.text"," projectDir = (argv.w && path.resolve(process.cwd(), argv.w)) || process.cwd();"] -],[ - ["start",{}], - ["c9searchresults.constant.numeric","\t17"], - ["c9searchresults.text",": "], - ["c9searchresults.keyword","var"], - ["c9searchresults.text"," fsUrl = \"/workspace\";"] -],[ - ["start",{}], - ["c9searchresults.constant.numeric","\t19"], - ["c9searchresults.text",": "], - ["c9searchresults.keyword","var"], - ["c9searchresults.text"," port = argv.p || process.env.PORT || 3131;"] -],[ - ["start",{}], - ["c9searchresults.constant.numeric","\t20"], - ["c9searchresults.text",": "], - ["c9searchresults.keyword","var"], - ["c9searchresults.text"," host = argv.l || \"localhost\";"] -],[ - ["start",{}], - ["c9searchresults.constant.numeric","\t22"], - ["c9searchresults.text",": "], - ["c9searchresults.keyword","var"], - ["c9searchresults.text"," config = {"] -],[ - ["start",{}] -],[ - ["start",{}], - ["string","configs/local.js"], - ["text",":"] -],[ - ["start",{}], - ["c9searchresults.constant.numeric","\t2"], - ["c9searchresults.text",": "], - ["c9searchresults.keyword","var"], - ["c9searchresults.text"," config = require(\"./default\");"] -],[ - ["start",{}] -],[ - ["start",{}], - ["string","configs/packed.js"], - ["text",":"] -],[ - ["start",{}], - ["c9searchresults.constant.numeric","\t1"], - ["c9searchresults.text",": "], - ["c9searchresults.keyword","var"], - ["c9searchresults.text"," config = require(\"./default\");"] -],[ - ["start",{}] -],[ - ["start",{}] -],[ - ["start",{}], - ["text","Found "], - ["constant.numeric","15"], - ["text"," matches in "], - ["constant.numeric","3"], - ["text"," files"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_c_cpp.json b/lib/ace/mode/_test/tokens_c_cpp.json deleted file mode 100644 index a8668b0b..00000000 --- a/lib/ace/mode/_test/tokens_c_cpp.json +++ /dev/null @@ -1,190 +0,0 @@ -[[ - "start", - ["comment","// compound assignment operators"] -],[ - "start" -],[ - "start", - ["keyword","#include"], - ["constant.other"," "] -],[ - "start" -],[ - "directive", - ["keyword","#include"], - ["constant.other.multiline"," \\"] -],[ - "start", - ["constant.other"," "] -],[ - "start" -],[ - "directive", - ["keyword","#include"], - ["constant.other.multiline"," \\"] -],[ - "directive", - ["constant.other.multiline"," \\"] -],[ - "start", - ["constant.other"," "] -],[ - "start" -],[ - "directive", - ["keyword","#include"], - ["constant.other.multiline"," \\"] -],[ - "directive", - ["constant.other.multiline"," \\"] -],[ - "start", - ["constant.other"," \"iostream\""] -],[ - "start" -],[ - "start", - ["keyword","#include"], - ["constant.other"," "] -],[ - "start", - ["keyword","#include"], - ["constant.other"," \"boost/asio/io_service.hpp\""] -],[ - "start" -],[ - "directive", - ["keyword","#include"], - ["constant.other.multiline"," \\"] -],[ - "directive", - ["constant.other.multiline"," \\"] -],[ - "directive", - ["constant.other.multiline"," \"iostream\" \\"] -],[ - "directive", - ["constant.other.multiline"," \"string\" \\"] -],[ - "start", - ["constant.other"," "] -],[ - "start", - ["text"," "] -],[ - "start", - ["keyword.control","using"], - ["text"," "], - ["keyword.operator","namespace"], - ["text"," "], - ["identifier","std"], - ["punctuation.operator",";"] -],[ - "start" -],[ - "start", - ["storage.type","int"], - ["text"," "], - ["identifier","main"], - ["text"," "], - ["paren.lparen","("], - ["paren.rparen",")"] -],[ - "start", - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["storage.type","int"], - ["text"," "], - ["identifier","a"], - ["punctuation.operator",","], - ["text"," "], - ["identifier","b"], - ["keyword.operator","="], - ["constant.numeric","3"], - ["punctuation.operator",";"], - ["text"," "], - ["comment","/* foobar */"] -],[ - "start", - ["text"," "], - ["identifier","a"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","b"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["identifier","a"], - ["keyword.operator","+="], - ["constant.numeric","2"], - ["punctuation.operator",";"], - ["text"," "], - ["comment","// equivalent to a=a+2"] -],[ - "start", - ["text"," "], - ["identifier","cout"], - ["text"," "], - ["keyword.operator","<<"], - ["text"," "], - ["identifier","a"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword","#if"], - ["text"," "], - ["identifier","VERBOSE"], - ["text"," "], - ["keyword.operator",">="], - ["text"," "], - ["constant.numeric","2"] -],[ - "start", - ["text"," "], - ["identifier","prints"], - ["paren.lparen","("], - ["string","\"trace message\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword","#endif"] -],[ - "start", - ["text"," "], - ["keyword.control","return"], - ["text"," "], - ["constant.numeric","0"], - ["punctuation.operator",";"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["comment","/* Print an error message and get out */"] -],[ - "directive", - ["keyword","#define"], - ["constant.other.multiline"," ABORT \\"] -],[ - "directive", - ["constant.other.multiline"," do { \\"] -],[ - "directive", - ["constant.other.multiline"," print( \"Abort\\n\" ); \\"] -],[ - "directive", - ["constant.other.multiline"," exit(8); \\"] -],[ - "start", - ["constant.other","} while (0) "], - ["comment","/* Note: No semicolon */"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_cirru.json b/lib/ace/mode/_test/tokens_cirru.json deleted file mode 100644 index de4852e6..00000000 --- a/lib/ace/mode/_test/tokens_cirru.json +++ /dev/null @@ -1,267 +0,0 @@ -[[ - "start", - ["comment.line.double-dash","-- https://github.com/Cirru/cirru-gopher/blob/master/code/scope.cr,"] -],[ - "start" -],[ - "line", - ["support.function","set"], - ["text"," "], - ["variable.parameter","a"], - ["text"," "], - ["storage.modifier","("], - ["support.function","int"], - ["text"," "], - ["constant.numeric","2"], - ["storage.modifier",")"] -],[ - "start" -],[ - "line", - ["support.function","print"], - ["text"," "], - ["storage.modifier","("], - ["support.function","self"], - ["storage.modifier",")"] -],[ - "start" -],[ - "line", - ["support.function","set"], - ["text"," "], - ["variable.parameter","c"], - ["text"," "], - ["storage.modifier","("], - ["support.function","child"], - ["storage.modifier",")"] -],[ - "start" -],[ - "line", - ["support.function","under"], - ["text"," "], - ["variable.parameter","c"] -],[ - "line", - ["markup.raw"," "], - ["support.function","under"], - ["text"," "], - ["variable.parameter","parent"] -],[ - "line", - ["markup.raw"," "], - ["support.function","print"], - ["text"," "], - ["variable.parameter","a"] -],[ - "start" -],[ - "line", - ["support.function","print"], - ["text"," "], - ["storage.modifier","$"], - ["text"," "], - ["support.function","get"], - ["text"," "], - ["variable.parameter","c"], - ["text"," "], - ["variable.parameter","a"] -],[ - "start" -],[ - "line", - ["support.function","set"], - ["text"," "], - ["variable.parameter","c"], - ["text"," "], - ["variable.parameter","x"], - ["text"," "], - ["storage.modifier","("], - ["support.function","int"], - ["text"," "], - ["constant.numeric","3"], - ["storage.modifier",")"] -],[ - "line", - ["support.function","print"], - ["text"," "], - ["storage.modifier","$"], - ["text"," "], - ["support.function","get"], - ["text"," "], - ["variable.parameter","c"], - ["text"," "], - ["variable.parameter","x"] -],[ - "start" -],[ - "line", - ["support.function","set"], - ["text"," "], - ["variable.parameter","just-print"], - ["text"," "], - ["storage.modifier","$"], - ["text"," "], - ["support.function","code"] -],[ - "line", - ["markup.raw"," "], - ["support.function","print"], - ["text"," "], - ["variable.parameter","a"] -],[ - "start" -],[ - "line", - ["support.function","print"], - ["text"," "], - ["variable.parameter","just-print"] -],[ - "start" -],[ - "line", - ["support.function","eval"], - ["text"," "], - ["storage.modifier","("], - ["support.function","self"], - ["storage.modifier",")"], - ["text"," "], - ["variable.parameter","just-print"] -],[ - "line", - ["support.function","eval"], - ["text"," "], - ["variable.parameter","just-print"] -],[ - "start" -],[ - "line", - ["support.function","print"], - ["text"," "], - ["storage.modifier","("], - ["support.function","string"], - ["text"," "], - ["string.quoted.double","\"string with space\""], - ["storage.modifier",")"] -],[ - "line", - ["support.function","print"], - ["text"," "], - ["storage.modifier","("], - ["support.function","string"], - ["text"," "], - ["string.quoted.double","\"escapes "], - ["constant.character.escape","\\n"], - ["string.quoted.double"," "], - ["constant.character.escape","\\\"\\\\"], - ["string.quoted.double","\""], - ["storage.modifier",")"] -],[ - "start" -],[ - "start", - ["support.function","brackets"], - ["text"," "], - ["storage.modifier","((((()))))"] -],[ - "start" -],[ - "line", - ["string.quoted.double","\"eval\""], - ["text"," "], - ["storage.modifier","$"], - ["text"," "], - ["support.function","string"], - ["text"," "], - ["string.quoted.double","\"eval\""] -],[ - "start" -],[ - "line", - ["support.function","print"], - ["text"," "], - ["storage.modifier","("], - ["support.function","add"], - ["text"," "], - ["storage.modifier","$"], - ["text"," "], - ["storage.modifier","("], - ["support.function","int"], - ["text"," "], - ["constant.numeric","1"], - ["storage.modifier",")"], - ["text"," "], - ["storage.modifier","("], - ["support.function","int"], - ["text"," "], - ["constant.numeric","2"], - ["storage.modifier","))"] -],[ - "start" -],[ - "start", - ["support.function","print"], - ["text"," "], - ["storage.modifier","$"], - ["text"," "], - ["support.function","unwrap"], - ["text"," "], - ["storage.modifier","$"] -],[ - "line", - ["text"," "], - ["support.function","map"], - ["text"," "], - ["storage.modifier","("], - ["support.function","a"], - ["text"," "], - ["storage.modifier","$"], - ["text"," "], - ["support.function","int"], - ["text"," "], - ["constant.numeric","1"], - ["storage.modifier",")"], - ["text"," "], - ["storage.modifier","("], - ["support.function","b"], - ["text"," "], - ["storage.modifier","$"], - ["text"," "], - ["support.function","int"], - ["text"," "], - ["constant.numeric","2"], - ["storage.modifier",")"] -],[ - "start" -],[ - "line", - ["support.function","print"], - ["text"," "], - ["variable.parameter","a"] -],[ - "line", - ["markup.raw"," "], - ["support.function","int"], - ["text"," "], - ["constant.numeric","1"] -],[ - "line", - ["markup.raw"," "], - ["storage.modifier",","], - ["text"," "], - ["variable.parameter","b"], - ["text"," "], - ["variable.parameter","c"] -],[ - "line", - ["markup.raw"," "], - ["support.function","int"], - ["text"," "], - ["constant.numeric","2"] -],[ - "line", - ["markup.raw"," "], - ["storage.modifier",","], - ["text"," "], - ["variable.parameter","d"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_clojure.json b/lib/ace/mode/_test/tokens_clojure.json deleted file mode 100644 index 824cba59..00000000 --- a/lib/ace/mode/_test/tokens_clojure.json +++ /dev/null @@ -1,162 +0,0 @@ -[[ - "start", - ["keyword","("], - ["support.function","defn"], - ["text"," "], - ["identifier","parting"] -],[ - "start", - ["text"," "], - ["string","\"returns a String parting in a given language\""] -],[ - "start", - ["text"," "], - ["keyword","([]"], - ["text"," "], - ["keyword","("], - ["identifier","parting"], - ["text"," "], - ["string","\"World\""], - ["keyword","))"] -],[ - "start", - ["text"," "], - ["keyword","(["], - ["support.function","name"], - ["keyword","]"], - ["text"," "], - ["keyword","("], - ["identifier","parting"], - ["text"," "], - ["support.function","name"], - ["text"," "], - ["string","\"en\""], - ["keyword","))"] -],[ - "start", - ["text"," "], - ["keyword","(["], - ["support.function","name"], - ["text"," "], - ["identifier","language"], - ["keyword","]"] -],[ - "start", - ["text"," "], - ["comment","; condp is similar to a case statement in other languages."] -],[ - "start", - ["text"," "], - ["comment","; It is described in more detail later."] -],[ - "start", - ["text"," "], - ["comment","; It is used here to take different actions based on whether the"] -],[ - "start", - ["text"," "], - ["comment","; parameter \"language\" is set to \"en\", \"es\" or something else."] -],[ - "start", - ["text"," "], - ["keyword","("], - ["support.function","condp"], - ["text"," "], - ["constant.language","="], - ["text"," "], - ["identifier","language"] -],[ - "start", - ["text"," "], - ["string","\"en\""], - ["text"," "], - ["keyword","("], - ["support.function","str"], - ["text"," "], - ["string","\"Goodbye, \""], - ["text"," "], - ["support.function","name"], - ["keyword",")"] -],[ - "start", - ["text"," "], - ["string","\"es\""], - ["text"," "], - ["keyword","("], - ["support.function","str"], - ["text"," "], - ["string","\"Adios, \""], - ["text"," "], - ["support.function","name"], - ["keyword",")"] -],[ - "start", - ["text"," "], - ["keyword","(throw"], - ["text"," "], - ["keyword","("], - ["identifier","IllegalArgumentException"], - ["text","."] -],[ - "start", - ["text"," "], - ["keyword","("], - ["support.function","str"], - ["text"," "], - ["string","\"unsupported language \""], - ["text"," "], - ["identifier","language"], - ["keyword","))))))"] -],[ - "start" -],[ - "start", - ["keyword","("], - ["support.function","println"], - ["text"," "], - ["keyword","("], - ["identifier","parting"], - ["keyword","))"], - ["text"," "], - ["comment","; -> Goodbye, World"] -],[ - "start", - ["keyword","("], - ["support.function","println"], - ["text"," "], - ["keyword","("], - ["identifier","parting"], - ["text"," "], - ["string","\"Mark\""], - ["keyword","))"], - ["text"," "], - ["comment","; -> Goodbye, Mark"] -],[ - "start", - ["keyword","("], - ["support.function","println"], - ["text"," "], - ["keyword","("], - ["identifier","parting"], - ["text"," "], - ["string","\"Mark\""], - ["text"," "], - ["string","\"es\""], - ["keyword","))"], - ["text"," "], - ["comment","; -> Adios, Mark"] -],[ - "start", - ["keyword","("], - ["support.function","println"], - ["text"," "], - ["keyword","("], - ["identifier","parting"], - ["text"," "], - ["string","\"Mark\""], - ["text",", "], - ["string","\"xy\""], - ["keyword","))"], - ["text"," "], - ["comment","; -> java.lang.IllegalArgumentException: unsupported language xy"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_cobol.json b/lib/ace/mode/_test/tokens_cobol.json deleted file mode 100644 index 9909eadd..00000000 --- a/lib/ace/mode/_test/tokens_cobol.json +++ /dev/null @@ -1,4 +0,0 @@ -[[ - "start", - ["identifier","TODO"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_coffee.json b/lib/ace/mode/_test/tokens_coffee.json deleted file mode 100644 index b0703b37..00000000 --- a/lib/ace/mode/_test/tokens_coffee.json +++ /dev/null @@ -1,545 +0,0 @@ -[[ - "start", - ["comment","#test: tokenize keyword"] -],[ - "start", - ["text"," "], - ["keyword","for"], - ["text"," "], - ["paren.lparen","("], - ["identifier","i"], - ["text"," "], - ["constant.numeric","1"], - ["punctuation.operator","."], - ["constant.numeric",".2"], - ["paren.rparen",")"] -],[ - "start", - ["comment","#test: tokenize regexp"] -],[ - "start", - ["string.regex","/\"[a]/"] -],[ - "start", - ["comment","#test: tokenize functions"] -],[ - "start", - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","{args}"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","{a1, a2}"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","{@a1, a2}"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator",":"], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","{args}"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","{args}"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","{0abc}"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["identifier","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["paren","{"], - ["keyword.operator","/"], - ["identifier","abc"], - ["paren","}"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","=>"] -],[ - "start", - ["text"," "], - ["identifier","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["paren","{"], - ["identifier","abc"], - ["keyword.operator","/"], - ["paren","}"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","{#abc}"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","{abc#}"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["identifier","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["paren","{"], - ["paren.rparen",")"], - ["identifier","abc"], - ["paren","}"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["identifier","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["paren","{"], - ["identifier","abc"], - ["paren.rparen",")"], - ["paren","}"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","{a{bc}"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","{}"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","{ }"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator",":"], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","{}"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","args"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","arg1, arg2"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","arg1 = 1, arg2 = 'name'"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","@arg1 = /abc/, arg2 = 'name'"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["comment","#test: tokenize function: invalid case:"] -],[ - "start", - ["text"," "], - ["identifier","foo"], - ["keyword.operator","="], - ["paren.lparen","("], - ["keyword.operator","/"], - ["identifier","args"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter"," "], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator",":"], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter"," "], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["variable.language","window"], - ["punctuation.operator","."], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","args"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["entity.name.function","foo"], - ["text"," "], - ["keyword.operator",":"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["comment","#test: tokenize callback function"] -],[ - "start", - ["text"," "], - ["identifier","foo"], - ["text"," "], - ["identifier","bar"], - ["keyword.operator",":"], - ["text"," "], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","args"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["text"," "], - ["identifier","foo"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["text"," "], - ["constant.numeric","2"], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter","x"], - ["paren.rparen",")"], - ["text"," "], - ["storage.type","->"] -],[ - "start", - ["comment","#test: tokenize class"] -],[ - "start", - ["keyword","class"], - ["text"," "], - ["language.support.class","Foo"] -],[ - "start", - ["keyword","class"], - ["text"," "], - ["language.support.class","Foo"], - ["text"," "], - ["keyword","extends"], - ["text"," "], - ["language.support.class","Bar"] -],[ - "start", - ["comment","#test: tokenize illegal name property"] -],[ - "start", - ["identifier","foo"], - ["punctuation.operator","."], - ["identifier","static"], - ["punctuation.operator","."], - ["identifier","function"] -],[ - "start", - ["comment","#!test tokenize string with interpolation"] -],[ - "start", - ["identifier","a"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string.start","\""], - ["paren.string","#{"], - ["text"," "], - ["constant.numeric","22"], - ["text"," "], - ["keyword.operator","/"], - ["text"," "], - ["constant.numeric","7"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["paren","{"], - ["identifier","x"], - ["keyword.operator",":"], - ["text"," "], - ["string.start","\""], - ["paren.string","#{"], - ["identifier","a"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["identifier","b"], - ["paren.string","}"], - ["string.end","\""], - ["paren","}"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric","2"], - ["paren.string","}"], - ["string.end","\""] -],[ - "start", - ["string.start","\""], - ["string"," "], - ["paren.string","#{"], - ["text"," "], - ["string.start","\""], - ["string.end","\""], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["paren","{}"], - ["text"," "], - ["paren.string","}"], - ["string"," )"], - ["string.end","\""], - ["text"," "] -],[ - "qqdoc", - ["string","\"\"\"heredoc"] -],[ - "start", - ["string"," \"\"\""] -],[ - "start", - ["keyword","do"], - ["text"," "], - ["storage.type","->"] -],[ - "comment", - ["text"," "], - ["comment","###"] -],[ - "comment", - ["comment"," herecomment"] -],[ - "start", - ["comment"," ###"] -],[ - "heregex", - ["text"," "], - ["identifier","re"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string.regex","/regex/imgy"], - ["punctuation.operator","."], - ["identifier","test"], - ["text"," "], - ["string.regex","///"] -],[ - "heregex", - ["comment.regex"," "], - ["string.regex","heregex"], - ["comment.regex"," # comment"] -],[ - "start", - ["string.regex"," ///imgy"] -],[ - "js", - ["text"," "], - ["keyword","this"], - ["text"," "], - ["keyword","isnt"], - ["keyword.operator",":"], - ["text"," "], - ["string","`just "] -],[ - "start", - ["string"," JavaScript`"] -],[ - "start", - ["text"," "], - ["constant.language","undefined"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_coldfusion.json b/lib/ace/mode/_test/tokens_coldfusion.json deleted file mode 100644 index 804e647d..00000000 --- a/lib/ace/mode/_test/tokens_coldfusion.json +++ /dev/null @@ -1,26 +0,0 @@ -[[ - "start", - ["comment.xml",""] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","cfset"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","welcome"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"Hello World!\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","cfoutput"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","#welcome#"], - ["meta.tag.punctuation.end-tag-open.xml",""] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_csharp.json b/lib/ace/mode/_test/tokens_csharp.json deleted file mode 100644 index dcc6d0e9..00000000 --- a/lib/ace/mode/_test/tokens_csharp.json +++ /dev/null @@ -1,31 +0,0 @@ -[[ - "start", - ["keyword","public"], - ["text"," "], - ["keyword","void"], - ["text"," "], - ["identifier","HelloWorld"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["comment","//Say Hello!"] -],[ - "start", - ["text"," "], - ["identifier","Console"], - ["punctuation.operator","."], - ["identifier","WriteLine"], - ["paren.lparen","("], - ["string.start","\""], - ["string","Hello World"], - ["string.end","\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["paren.rparen","}"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_css.json b/lib/ace/mode/_test/tokens_css.json deleted file mode 100644 index e1a7ba05..00000000 --- a/lib/ace/mode/_test/tokens_css.json +++ /dev/null @@ -1,148 +0,0 @@ -[[ - "ruleset", - ["variable",".text-layer"], - ["text"," "], - ["paren.lparen","{"] -],[ - "ruleset", - ["text"," "], - ["support.type","font-family"], - ["text",": Monaco, "], - ["string","\"Courier New\""], - ["text",", "], - ["support.constant.fonts","monospace"], - ["text",";"] -],[ - "ruleset", - ["text"," "], - ["support.type","font-size"], - ["text",": "], - ["constant.numeric","12"], - ["keyword","pX"], - ["text",";"] -],[ - "ruleset", - ["text"," "], - ["support.type","cursor"], - ["text",": "], - ["support.constant","text"], - ["text",";"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "ruleset", - ["variable",".blinker"], - ["text"," "], - ["paren.lparen","{"] -],[ - "ruleset", - ["text"," "], - ["support.type","animation-duration"], - ["text",": "], - ["constant.numeric","1"], - ["keyword","s"], - ["text",";"] -],[ - "ruleset", - ["text"," "], - ["support.type","animation-name"], - ["text",": blink;"] -],[ - "ruleset", - ["text"," "], - ["support.type","animation-iteration-count"], - ["text",": infinite;"] -],[ - "ruleset", - ["text"," "], - ["support.type","animation-direction"], - ["text",": alternate;"] -],[ - "ruleset", - ["text"," "], - ["support.type","animation-timing-function"], - ["text",": "], - ["support.constant","linear"], - ["text",";"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "media", - ["string","@keyframes blink {"] -],[ - ["ruleset","media"], - ["text"," "], - ["constant","0"], - ["text","% "], - ["paren.lparen","{"] -],[ - ["ruleset","media"], - ["text"," "], - ["support.type","opacity"], - ["text",": "], - ["constant.numeric","0"], - ["text",";"] -],[ - "media", - ["text"," "], - ["paren.rparen","}"] -],[ - ["ruleset","media"], - ["text"," "], - ["constant","40"], - ["text","% "], - ["paren.lparen","{"] -],[ - ["ruleset","media"], - ["text"," "], - ["support.type","opacity"], - ["text",": "], - ["constant.numeric","0"], - ["text",";"] -],[ - "media", - ["text"," "], - ["paren.rparen","}"] -],[ - ["ruleset","media"], - ["text"," "], - ["constant","40"], - ["variable",".5"], - ["text","% "], - ["paren.lparen","{"] -],[ - ["ruleset","media"], - ["text"," "], - ["support.type","opacity"], - ["text",": "], - ["constant.numeric","1"] -],[ - "media", - ["text"," "], - ["paren.rparen","}"] -],[ - ["ruleset","media"], - ["text"," "], - ["constant","100"], - ["text","% "], - ["paren.lparen","{"] -],[ - ["ruleset","media"], - ["text"," "], - ["support.type","opacity"], - ["text",": "], - ["constant.numeric","1"] -],[ - "media", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["string","}"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_curly.json b/lib/ace/mode/_test/tokens_curly.json deleted file mode 100644 index d87a627a..00000000 --- a/lib/ace/mode/_test/tokens_curly.json +++ /dev/null @@ -1,56 +0,0 @@ -[[ - "start", - ["text.xml","tokenize Curly template"], - ["variable","{{"], - ["text","test"], - ["variable","}}"] -],[ - "start", - ["text.xml","tokenize embedded script"] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.script.tag-name.xml","script"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","a"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","'a'"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["storage.type","var"], - ["meta.tag.punctuation.end-tag-open.xml",""], - ["text.xml","'123'"] -],[ - "start", - ["text.xml","tokenize multiline attribute value with double quotes"] -],[ - ["string.attribute-value.xml0","tag_stuff"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.anchor.tag-name.xml","a"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","href"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"abc{{xyz}}"] -],[ - "start", - ["string.attribute-value.xml","def\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml","tokenize multiline attribute value with single quotes"] -],[ - ["string.attribute-value.xml","tag_stuff"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.anchor.tag-name.xml","a"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","href"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","'abc"] -],[ - "start", - ["string.attribute-value.xml","def\\\"'"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_d.json b/lib/ace/mode/_test/tokens_d.json deleted file mode 100644 index 85831cc3..00000000 --- a/lib/ace/mode/_test/tokens_d.json +++ /dev/null @@ -1,111 +0,0 @@ -[[ - "start", - ["comment.shebang","#!/usr/bin/env rdmd"] -],[ - "start", - ["comment","// Computes average line length for standard input."] -],[ - "start", - ["keyword","import"], - ["text"," "], - ["variable.module","std.stdio"], - ["punctuation.operator",";"] -],[ - "start" -],[ - "start", - ["keyword.type","void"], - ["text"," "], - ["identifier","main"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword.type","ulong"], - ["text"," "], - ["identifier","lines"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","0"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword.type","double"], - ["text"," "], - ["identifier","sumLength"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","0"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword.control","foreach"], - ["text"," "], - ["paren.lparen","("], - ["identifier","line"], - ["punctuation.operator",";"], - ["text"," "], - ["identifier","stdin"], - ["punctuation.operator","."], - ["identifier","byLine"], - ["paren.lparen","("], - ["paren.rparen","))"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword.operator","++"], - ["identifier","lines"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["identifier","sumLength"], - ["text"," "], - ["keyword.operator","+="], - ["text"," "], - ["identifier","line"], - ["punctuation.operator","."], - ["identifier","length"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["identifier","writeln"], - ["paren.lparen","("], - ["string","\"Average line length: \""], - ["punctuation.operator",","] -],[ - "start", - ["text"," "], - ["identifier","lines"], - ["text"," "], - ["keyword.operator","?"], - ["text"," "], - ["identifier","sumLength"], - ["text"," "], - ["keyword.operator","/"], - ["text"," "], - ["identifier","lines"], - ["text"," "], - ["punctuation.operator",":"], - ["text"," "], - ["constant.numeric","0"], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["paren.rparen","}"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_dart.json b/lib/ace/mode/_test/tokens_dart.json deleted file mode 100644 index 37cdc323..00000000 --- a/lib/ace/mode/_test/tokens_dart.json +++ /dev/null @@ -1,368 +0,0 @@ -[[ - "start", - ["identifier","main"], - ["text","() {"] -],[ - "start", - ["text"," "], - ["identifier","print"], - ["text","("], - ["string","'Hello World!'"], - ["text",");"] -],[ - "start", - ["text","}"] -],[ - "start" -],[ - "start" -],[ - "start", - ["storage.type.primitive.dart","int"], - ["text"," "], - ["identifier","fib"], - ["text","("], - ["storage.type.primitive.dart","int"], - ["text"," "], - ["identifier","n"], - ["text",") "], - ["keyword.operator.assignment.dart","="], - ["keyword.operator.comparison.dart",">"], - ["text"," ("], - ["identifier","n"], - ["text"," "], - ["keyword.operator.comparison.dart",">"], - ["text"," "], - ["constant.numeric","1"], - ["text",") "], - ["keyword.control.ternary.dart","?"], - ["text"," ("], - ["identifier","fib"], - ["text","("], - ["identifier","n"], - ["text"," "], - ["keyword.operator.arithmetic.dart","-"], - ["text"," "], - ["constant.numeric","1"], - ["text",") "], - ["keyword.operator.arithmetic.dart","+"], - ["text"," "], - ["identifier","fib"], - ["text","("], - ["identifier","n"], - ["text"," "], - ["keyword.operator.arithmetic.dart","-"], - ["text"," "], - ["constant.numeric","2"], - ["text",")) "], - ["keyword.control.ternary.dart",":"], - ["text"," "], - ["identifier","n"], - ["text",";"] -],[ - "start", - ["identifier","main"], - ["text","() {"] -],[ - "start", - ["text"," "], - ["identifier","print"], - ["text","("], - ["string","'fib(20) = ${fib(20)}'"], - ["text",");"] -],[ - "start", - ["text","}"] -],[ - "comment", - ["comment","/*asd"] -],[ - "comment", - ["comment","asdad"] -],[ - "start", - ["comment","*/"] -],[ - "start", - ["constant.numeric","0.67"] -],[ - "start", - ["constant.numeric","77"] -],[ - "start", - ["text","."], - ["constant.numeric","86"] -],[ - "start" -],[ - "start", - ["keyword.other.import.dart","import"], - ["text","("], - ["string","\"http://dartwatch.com/myOtherLibrary.dart\""], - ["text",");"] -],[ - "start", - ["keyword.other.import.dart","import"], - ["text","("], - ["string","\"myOtherLibrary.dart\""], - ["text",", "], - ["keyword.other.import.dart","prefix"], - ["text",":"], - ["string","\"lib1\""], - ["text",");"] -],[ - "start" -],[ - "qqdoc", - ["string","\"\"\"asdasdads"] -],[ - "qqdoc", - ["string","asdadsadsasd"] -],[ - "start", - ["string","asdasdasdad\"\"\""] -],[ - "start", - ["text"," "] -],[ - "start", - ["string","'23424'"] -],[ - "start" -],[ - "start", - ["constant.numeric","0x234"] -],[ - "start" -],[ - "start", - ["identifier","foo"], - ["text"," "], - ["keyword.operator.dart","is"], - ["text"," "], - ["identifier","bar"] -],[ - "start" -],[ - "start", - ["storage.type.primitive.dart","int"], - ["text"," "], - ["identifier","x"], - ["text"," "], - ["keyword.operator.assignment.dart","="], - ["text"," "], - ["constant.numeric","4"], - ["text"," "], - ["keyword.operator.bitwise.dart","<<"], - ["text"," "], - ["constant.numeric","10"], - ["text"," "] -],[ - "start", - ["comment","// Create a class for Point."] -],[ - "start", - ["keyword.declaration.dart","class"], - ["text"," "], - ["identifier","Point"], - ["text"," {"] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," "], - ["comment","// Final variables cannot be changed once they are assigned."] -],[ - "start", - ["text"," "], - ["comment","// Create two instance variables."] -],[ - "start", - ["text"," "], - ["storage.modifier.dart","final"], - ["text"," "], - ["storage.type.primitive.dart","num"], - ["text"," "], - ["identifier","x"], - ["text",", "], - ["identifier","y"], - ["text",";"] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," "], - ["comment","// A constructor, with syntactic sugar for setting instance variables."] -],[ - "start", - ["text"," "], - ["identifier","Point"], - ["text","("], - ["variable.language.dart","this"], - ["text","."], - ["identifier","x"], - ["text",", "], - ["variable.language.dart","this"], - ["text","."], - ["identifier","y"], - ["text",");"] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," "], - ["comment","// A named constructor with an initializer list."] -],[ - "start", - ["text"," "], - ["identifier","Point"], - ["text","."], - ["identifier","origin"], - ["text","() "], - ["keyword.control.ternary.dart",":"], - ["text"," "], - ["identifier","x"], - ["text"," "], - ["keyword.operator.assignment.dart","="], - ["text"," "], - ["constant.numeric","0"], - ["text",", "], - ["identifier","y"], - ["text"," "], - ["keyword.operator.assignment.dart","="], - ["text"," "], - ["constant.numeric","0"], - ["text",";"] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," "], - ["comment","// A method."] -],[ - "start", - ["text"," "], - ["storage.type.primitive.dart","num"], - ["text"," "], - ["identifier","distanceTo"], - ["text","("], - ["identifier","Point"], - ["text"," "], - ["identifier","other"], - ["text",") {"] -],[ - "start", - ["text"," "], - ["storage.type.primitive.dart","var"], - ["text"," "], - ["identifier","dx"], - ["text"," "], - ["keyword.operator.assignment.dart","="], - ["text"," "], - ["identifier","x"], - ["text"," "], - ["keyword.operator.arithmetic.dart","-"], - ["text"," "], - ["identifier","other"], - ["text","."], - ["identifier","x"], - ["text",";"] -],[ - "start", - ["text"," "], - ["storage.type.primitive.dart","var"], - ["text"," "], - ["identifier","dy"], - ["text"," "], - ["keyword.operator.assignment.dart","="], - ["text"," "], - ["identifier","y"], - ["text"," "], - ["keyword.operator.arithmetic.dart","-"], - ["text"," "], - ["identifier","other"], - ["text","."], - ["identifier","y"], - ["text",";"] -],[ - "start", - ["text"," "], - ["keyword.control.dart","return"], - ["text"," "], - ["identifier","sqrt"], - ["text","("], - ["identifier","dx"], - ["text"," "], - ["keyword.operator.arithmetic.dart","*"], - ["text"," "], - ["identifier","dx"], - ["text"," "], - ["keyword.operator.arithmetic.dart","+"], - ["text"," "], - ["identifier","dy"], - ["text"," "], - ["keyword.operator.arithmetic.dart","*"], - ["text"," "], - ["identifier","dy"], - ["text",");"] -],[ - "start", - ["text"," }"] -],[ - "start", - ["text","}"] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," "], - ["comment","// Check for null."] -],[ - "start", - ["storage.type.primitive.dart","var"], - ["text"," "], - ["identifier","unicorn"], - ["text",";"] -],[ - "start", - ["keyword.control.dart","assert"], - ["text","("], - ["identifier","unicorn"], - ["text"," "], - ["keyword.operator.comparison.dart","=="], - ["text"," "], - ["constant.language.dart","null"], - ["text",");"] -],[ - "start" -],[ - "start", - ["comment","// Check for NaN."] -],[ - "start", - ["storage.type.primitive.dart","var"], - ["text"," "], - ["identifier","iMeantToDoThis"], - ["text"," "], - ["keyword.operator.assignment.dart","="], - ["text"," "], - ["constant.numeric","0"], - ["keyword.operator.arithmetic.dart","/"], - ["constant.numeric","0"], - ["text",";"] -],[ - "start", - ["keyword.control.dart","assert"], - ["text","("], - ["identifier","iMeantToDoThis"], - ["text","."], - ["identifier","isNaN"], - ["text","());"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_diff.json b/lib/ace/mode/_test/tokens_diff.json deleted file mode 100644 index 6c36f5fa..00000000 --- a/lib/ace/mode/_test/tokens_diff.json +++ /dev/null @@ -1,262 +0,0 @@ -[[ - "start", - ["variable","diff"], - ["variable"," --git"], - ["keyword"," a/lib/ace/edit_session.js"], - ["variable"," b/lib/ace/edit_session.js"] -],[ - "start", - ["variable","index 23fc3fc..ed3b273 100644"] -],[ - "start", - ["constant.numeric","---"], - ["meta.tag"," a/lib/ace/edit_session.js"] -],[ - "start", - ["constant.numeric","+++"], - ["meta.tag"," b/lib/ace/edit_session.js"] -],[ - "start", - ["constant","@@"], - ["constant.numeric"," -51,6 +51,7 "], - ["constant","@@"], - ["comment.doc.tag"," var TextMode = require(\"./mode/text\").Mode;"] -],[ - "start", - ["invisible"," var Range = require(\"./range\").Range;"] -],[ - "start", - ["invisible"," var Document = require(\"./document\").Document;"] -],[ - "start", - ["invisible"," var BackgroundTokenizer = require(\"./background_tokenizer\").BackgroundTokenizer;"] -],[ - "start", - ["support.constant","+"], - ["text","var SearchHighlight = require(\"./search_highlight\").SearchHighlight;"] -],[ - "start", - ["text"," "] -],[ - "start", - ["invisible"," /**"] -],[ - "start", - ["invisible"," * class EditSession"] -],[ - "start", - ["constant","@@"], - ["constant.numeric"," -307,6 +308,13 "], - ["constant","@@"], - ["comment.doc.tag"," var EditSession = function(text, mode) {"] -],[ - "start", - ["invisible"," return token;"] -],[ - "start", - ["invisible"," };"] -],[ - "start", - ["text"," "] -],[ - "start", - ["support.constant","+"], - ["text"," this.highlight = function(re) {"] -],[ - "start", - ["support.constant","+"], - ["text"," if (!this.$searchHighlight) {"] -],[ - "start", - ["support.constant","+"], - ["text"," var highlight = new SearchHighlight(null, \"ace_selected-word\", \"text\");"] -],[ - "start", - ["support.constant","+"], - ["text"," this.$searchHighlight = this.addDynamicMarker(highlight);"] -],[ - "start", - ["support.constant","+"], - ["text"," }"] -],[ - "start", - ["support.constant","+"], - ["text"," this.$searchHighlight.setRegexp(re);"] -],[ - "start", - ["support.constant","+"], - ["text"," }"] -],[ - "start", - ["invisible"," /**"] -],[ - "start", - ["invisible"," * EditSession.setUndoManager(undoManager)"] -],[ - "start", - ["invisible"," * - undoManager (UndoManager): The new undo manager"] -],[ - "start", - ["constant","@@"], - ["constant.numeric"," -556,7 +564,8 "], - ["constant","@@"], - ["comment.doc.tag"," var EditSession = function(text, mode) {"] -],[ - "start", - ["invisible"," type : type || \"line\","] -],[ - "start", - ["invisible"," renderer: typeof type == \"function\" ? type : null,"] -],[ - "start", - ["invisible"," clazz : clazz,"] -],[ - "start", - ["support.function","-"], - ["string"," inFront: !!inFront"] -],[ - "start", - ["support.constant","+"], - ["text"," inFront: !!inFront,"] -],[ - "start", - ["support.constant","+"], - ["text"," id: id"] -],[ - "start", - ["invisible"," }"] -],[ - "start", - ["text"," "] -],[ - "start", - ["invisible"," if (inFront) {"] -],[ - "start", - ["variable","diff"], - ["variable"," --git"], - ["keyword"," a/lib/ace/editor.js"], - ["variable"," b/lib/ace/editor.js"] -],[ - "start", - ["variable","index 834e603..b27ec73 100644"] -],[ - "start", - ["constant.numeric","---"], - ["meta.tag"," a/lib/ace/editor.js"] -],[ - "start", - ["constant.numeric","+++"], - ["meta.tag"," b/lib/ace/editor.js"] -],[ - "start", - ["constant","@@"], - ["constant.numeric"," -494,7 +494,7 "], - ["constant","@@"], - ["comment.doc.tag"," var Editor = function(renderer, session) {"] -],[ - "start", - ["invisible"," * Emitted when a selection has changed."] -],[ - "start", - ["invisible"," **/"] -],[ - "start", - ["invisible"," this.onSelectionChange = function(e) {"] -],[ - "start", - ["support.function","-"], - ["string"," var session = this.getSession();"] -],[ - "start", - ["support.constant","+"], - ["text"," var session = this.session;"] -],[ - "start", - ["text"," "] -],[ - "start", - ["invisible"," if (session.$selectionMarker) {"] -],[ - "start", - ["invisible"," session.removeMarker(session.$selectionMarker);"] -],[ - "start", - ["constant","@@"], - ["constant.numeric"," -509,12 +509,40 "], - ["constant","@@"], - ["comment.doc.tag"," var Editor = function(renderer, session) {"] -],[ - "start", - ["invisible"," this.$updateHighlightActiveLine();"] -],[ - "start", - ["invisible"," }"] -],[ - "start", - ["text"," "] -],[ - "start", - ["support.function","-"], - ["string"," var self = this;"] -],[ - "start", - ["support.function","-"], - ["string"," if (this.$highlightSelectedWord && !this.$wordHighlightTimer)"] -],[ - "start", - ["support.function","-"], - ["string"," this.$wordHighlightTimer = setTimeout(function() {"] -],[ - "start", - ["support.function","-"], - ["string"," self.session.$mode.highlightSelection(self);"] -],[ - "start", - ["support.function","-"], - ["string"," self.$wordHighlightTimer = null;"] -],[ - "start", - ["support.function","-"], - ["string"," }, 30, this);"] -],[ - "start", - ["support.constant","+"], - ["text"," var re = this.$highlightSelectedWord && this.$getSelectionHighLightRegexp()"] -],[ - "start", - ["invisible"," };"] -],[ - "start", - ["variable","diff"], - ["variable"," --git"], - ["keyword"," a/lib/ace/search_highlight.js"], - ["variable"," b/lib/ace/search_highlight.js"] -],[ - "start", - ["invisible","new file mode 100644"] -],[ - "start", - ["variable","index 0000000..b2df779"] -],[ - "start", - ["constant.numeric","---"], - ["meta.tag"," /dev/null"] -],[ - "start", - ["constant.numeric","+++"], - ["meta.tag"," b/lib/ace/search_highlight.js"] -],[ - "start", - ["constant","@@"], - ["constant.numeric"," -0,0 +1,3 "], - ["constant","@@"] -],[ - "start", - ["support.constant","+"], - ["text","new"] -],[ - "start", - ["support.constant","+"], - ["text","empty file"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_dot.json b/lib/ace/mode/_test/tokens_dot.json deleted file mode 100644 index fec8b969..00000000 --- a/lib/ace/mode/_test/tokens_dot.json +++ /dev/null @@ -1,2254 +0,0 @@ -[[ - "start", - ["comment","// Original source: http://www.graphviz.org/content/lion_share"] -],[ - "start", - ["comment","##\"A few people in the field of genetics are using dot to draw \"marriage node diagram\" pedigree drawings. Here is one I have done of a test pedigree from the FTREE pedigree drawing package (Lion Share was a racehorse).\" Contributed by David Duffy."] -],[ - "start" -],[ - "start", - ["comment","##Command to get the layout: \"dot -Tpng thisfile > thisfile.png\""] -],[ - "start" -],[ - "start", - ["keyword","digraph"], - ["text"," Ped_Lion_Share "], - ["paren.lparen","{"] -],[ - "start", - ["comment","# page = \"8.2677165,11.692913\" ;"] -],[ - "start", - ["variable","ratio"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string","\"auto\""], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["text","mincross "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","2.0"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["variable","label"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string","\"Pedigree Lion_Share\""], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start" -],[ - "start", - ["string","\"001\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","box "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"002\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","box "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"003\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","circle "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"004\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","box "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"005\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","box "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"006\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","circle "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"007\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","circle "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"009\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","circle "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"014\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","circle "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"015\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","circle "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"016\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","circle "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"ZZ01\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","circle "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"ZZ02\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","circle "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"017\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","circle "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"012\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","circle "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"008\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","box "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"011\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","box "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"013\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","box "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"010\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","box "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"023\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","circle "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"020\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","circle "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"021\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","circle "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"018\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","circle "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"025\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","circle "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"019\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","box "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"022\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","box "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"024\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","box "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"027\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","circle "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"026\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","box "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","white "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"028\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","box "], - ["punctuation.operator",","], - ["text"," "], - ["variable","regular"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","fillcolor"], - ["keyword.operator","="], - ["text","grey "], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0001\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","diamond"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","label"], - ["keyword.operator","="], - ["string","\"\""], - ["punctuation.operator",","], - ["variable","height"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","width"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"001\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0001\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"007\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0001\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0001\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"017\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["text"," "], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","2"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0002\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","diamond"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","label"], - ["keyword.operator","="], - ["string","\"\""], - ["punctuation.operator",","], - ["variable","height"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","width"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"001\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0002\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"ZZ02\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0002\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0002\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"012\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["text"," "], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","2"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0003\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","diamond"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","label"], - ["keyword.operator","="], - ["string","\"\""], - ["punctuation.operator",","], - ["variable","height"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","width"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"002\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0003\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"003\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0003\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0003\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"008\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["text"," "], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","2"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0004\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","diamond"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","label"], - ["keyword.operator","="], - ["string","\"\""], - ["punctuation.operator",","], - ["variable","height"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","width"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"002\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0004\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"006\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0004\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0004\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"011\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["text"," "], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","2"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0005\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","diamond"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","label"], - ["keyword.operator","="], - ["string","\"\""], - ["punctuation.operator",","], - ["variable","height"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","width"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"002\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0005\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"ZZ01\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0005\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0005\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"013\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["text"," "], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","2"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0006\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","diamond"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","label"], - ["keyword.operator","="], - ["string","\"\""], - ["punctuation.operator",","], - ["variable","height"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","width"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"004\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0006\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"009\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0006\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0006\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"010\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["text"," "], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","2"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0007\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","diamond"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","label"], - ["keyword.operator","="], - ["string","\"\""], - ["punctuation.operator",","], - ["variable","height"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","width"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"005\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0007\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"015\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0007\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0007\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"023\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["text"," "], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","2"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0008\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","diamond"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","label"], - ["keyword.operator","="], - ["string","\"\""], - ["punctuation.operator",","], - ["variable","height"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","width"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"005\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0008\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"016\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0008\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0008\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"020\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["text"," "], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","2"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0009\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","diamond"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","label"], - ["keyword.operator","="], - ["string","\"\""], - ["punctuation.operator",","], - ["variable","height"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","width"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"005\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0009\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"012\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0009\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0009\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"021\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["text"," "], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","2"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0010\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","diamond"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","label"], - ["keyword.operator","="], - ["string","\"\""], - ["punctuation.operator",","], - ["variable","height"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","width"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"008\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0010\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"017\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0010\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0010\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"018\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["text"," "], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","2"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0011\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","diamond"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","label"], - ["keyword.operator","="], - ["string","\"\""], - ["punctuation.operator",","], - ["variable","height"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","width"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"011\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0011\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"023\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0011\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0011\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"025\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["text"," "], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","2"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0012\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","diamond"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","label"], - ["keyword.operator","="], - ["string","\"\""], - ["punctuation.operator",","], - ["variable","height"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","width"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"013\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0012\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"014\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0012\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0012\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"019\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["text"," "], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","2"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0013\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","diamond"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","label"], - ["keyword.operator","="], - ["string","\"\""], - ["punctuation.operator",","], - ["variable","height"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","width"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"010\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0013\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"021\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0013\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0013\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"022\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["text"," "], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","2"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0014\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","diamond"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","label"], - ["keyword.operator","="], - ["string","\"\""], - ["punctuation.operator",","], - ["variable","height"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","width"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"019\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0014\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"020\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0014\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0014\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"024\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["text"," "], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","2"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0015\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","diamond"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","label"], - ["keyword.operator","="], - ["string","\"\""], - ["punctuation.operator",","], - ["variable","height"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","width"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"022\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0015\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"025\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0015\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0015\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"027\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["text"," "], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","2"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0016\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","diamond"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","label"], - ["keyword.operator","="], - ["string","\"\""], - ["punctuation.operator",","], - ["variable","height"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","width"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"024\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0016\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"018\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0016\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0016\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"026\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["text"," "], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","2"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0017\""], - ["text"," "], - ["paren.lparen","["], - ["variable","shape"], - ["keyword.operator","="], - ["text","diamond"], - ["punctuation.operator",","], - ["variable","style"], - ["keyword.operator","="], - ["text","filled"], - ["punctuation.operator",","], - ["variable","label"], - ["keyword.operator","="], - ["string","\"\""], - ["punctuation.operator",","], - ["variable","height"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["variable","width"], - ["keyword.operator","="], - ["text","."], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"026\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0017\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"027\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"marr0017\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["string","\"marr0017\""], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["string","\"028\""], - ["text"," "], - ["paren.lparen","["], - ["variable","dir"], - ["keyword.operator","="], - ["text","none"], - ["punctuation.operator",","], - ["text"," "], - ["variable","weight"], - ["keyword.operator","="], - ["constant.numeric","2"], - ["paren.rparen","]"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_eiffel.json b/lib/ace/mode/_test/tokens_eiffel.json deleted file mode 100644 index 344dbc62..00000000 --- a/lib/ace/mode/_test/tokens_eiffel.json +++ /dev/null @@ -1,141 +0,0 @@ -[[ - "start", - ["keyword","note"] -],[ - "start", - ["text","\t"], - ["identifier","description"], - ["keyword.operator",":"], - ["text"," "], - ["string.quoted.double","\"Represents a person.\""] -],[ - "start" -],[ - "start", - ["keyword","class"] -],[ - "start", - ["text","\t"], - ["entity.name.type","PERSON"] -],[ - "start" -],[ - "start", - ["keyword","create"] -],[ - "start", - ["text","\t"], - ["identifier","make"], - ["keyword.operator",","], - ["text"," "], - ["identifier","make_unknown"] -],[ - "start" -],[ - "start", - ["keyword","feature"], - ["text"," "], - ["paren.lparen","{"], - ["entity.name.type","NONE"], - ["paren.rparen","}"], - ["text"," "], - ["comment.line.double-dash","-- Creation"] -],[ - "start" -],[ - "start", - ["text","\t"], - ["identifier","make"], - ["text"," "], - ["paren.lparen","("], - ["identifier","a_name"], - ["keyword.operator",":"], - ["text"," "], - ["keyword","like"], - ["text"," "], - ["identifier","name"], - ["paren.rparen",")"] -],[ - "start", - ["text","\t\t\t"], - ["comment.line.double-dash","-- Create a person with `a_name' as `name'."] -],[ - "start", - ["text","\t\t"], - ["keyword","do"] -],[ - "start", - ["text","\t\t\t"], - ["identifier","name"], - ["text"," "], - ["keyword.operator",":="], - ["text"," "], - ["identifier","a_name"] -],[ - "start", - ["text","\t\t"], - ["keyword","ensure"] -],[ - "start", - ["text","\t\t\t"], - ["identifier","name"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","a_name"] -],[ - "start", - ["text","\t\t"], - ["keyword","end"] -],[ - "start" -],[ - "start", - ["text","\t"], - ["identifier","make_unknown"] -],[ - "start", - ["text","\t\t"], - ["keyword","do"], - ["text"," "], - ["keyword","ensure"] -],[ - "start", - ["text","\t\t\t"], - ["identifier","name"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.language","Void"] -],[ - "start", - ["text","\t\t"], - ["keyword","end"] -],[ - "start" -],[ - "start", - ["keyword","feature"], - ["text"," "], - ["comment.line.double-dash","-- Access"] -],[ - "start" -],[ - "start", - ["text","\t"], - ["identifier","name"], - ["keyword.operator",":"], - ["text"," "], - ["keyword","detachable"], - ["text"," "], - ["entity.name.type","STRING"] -],[ - "start", - ["text","\t\t\t"], - ["comment.line.double-dash","-- Full name or Void if unknown."] -],[ - "start" -],[ - "start", - ["keyword","end"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_ejs.json b/lib/ace/mode/_test/tokens_ejs.json deleted file mode 100644 index 7e54af91..00000000 --- a/lib/ace/mode/_test/tokens_ejs.json +++ /dev/null @@ -1,296 +0,0 @@ -[[ - "start", - ["xml-pe.doctype.xml",""] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","html"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","head"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","title"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Cloud9 Rocks!"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","body"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start" -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","table"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","class"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"table\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","tr"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","th"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Name"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","th"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Size"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["markup.list.meta.tag","<%"], - ["text"," "], - ["keyword","if"], - ["text"," "], - ["paren.lparen","("], - ["keyword.operator","!"], - ["identifier","isRoot"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"], - ["text"," "], - ["markup.list.meta.tag","%>"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","tr"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","td"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.anchor.tag-name.xml","a"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","href"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"..\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml",".."], - ["meta.tag.punctuation.end-tag-open.xml",""], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","td"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.end-tag-open.xml",""], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["markup.list.meta.tag","<%"], - ["text"," "], - ["paren.rparen","}"], - ["text"," "], - ["markup.list.meta.tag","%>"] -],[ - "start", - ["text.xml"," "], - ["markup.list.meta.tag","<%"], - ["text"," "], - ["identifier","entries"], - ["punctuation.operator","."], - ["identifier","forEach"], - ["paren.lparen","("], - ["storage.type","function"], - ["paren.lparen","("], - ["identifier","entry"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"], - ["text"," "], - ["markup.list.meta.tag","%>"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","tr"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","td"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","span"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","class"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"glyphicon "], - ["markup.list.meta.tag","<%="], - ["text"," "], - ["identifier","entry"], - ["punctuation.operator","."], - ["identifier","mime"], - ["text"," "], - ["keyword.operator","=="], - ["text"," "], - ["string","'directory'"], - ["text"," "], - ["punctuation.operator","?"], - ["text"," "], - ["string","'folder'"], - ["punctuation.operator",":"], - ["text"," "], - ["string","'file'"], - ["markup.list.meta.tag","%>"], - ["string.attribute-value.xml","\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.anchor.tag-name.xml","a"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","href"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\""], - ["markup.list.meta.tag","<%="], - ["text"," "], - ["identifier","entry"], - ["punctuation.operator","."], - ["identifier","name"], - ["text"," "], - ["markup.list.meta.tag","%>"], - ["string.attribute-value.xml","\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["markup.list.meta.tag","<%="], - ["text"," "], - ["identifier","entry"], - ["punctuation.operator","."], - ["identifier","name"], - ["text"," "], - ["markup.list.meta.tag","%>"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","td"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["markup.list.meta.tag","<%="], - ["text"," "], - ["identifier","entry"], - ["punctuation.operator","."], - ["identifier","size"], - ["text"," "], - ["markup.list.meta.tag","%>"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["markup.list.meta.tag","<%"], - ["text"," "], - ["paren.rparen","})"], - ["text"," "], - ["markup.list.meta.tag","%>"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_elixir.json b/lib/ace/mode/_test/tokens_elixir.json deleted file mode 100644 index cbbe1fee..00000000 --- a/lib/ace/mode/_test/tokens_elixir.json +++ /dev/null @@ -1,196 +0,0 @@ -[[ - "start", - ["keyword.control.module.elixir","defmodule"], - ["meta.module.elixir"," "], - ["entity.name.type.module.elixir","HelloModule"], - ["text"," "], - ["keyword.control.elixir","do"] -],[ - "comment.documentation.heredoc", - ["text"," "], - ["comment.documentation.heredoc","@moduledoc \"\"\""] -],[ - "comment.documentation.heredoc", - ["comment.documentation.heredoc"," This is supposed to be `markdown`."] -],[ - "comment.documentation.heredoc", - ["comment.documentation.heredoc"," __Yes__ this is [mark](http://down.format)"] -],[ - "comment.documentation.heredoc" -],[ - "comment.documentation.heredoc", - ["comment.documentation.heredoc"," # Truly"] -],[ - "comment.documentation.heredoc" -],[ - "comment.documentation.heredoc", - ["comment.documentation.heredoc"," ## marked"] -],[ - "comment.documentation.heredoc" -],[ - "comment.documentation.heredoc", - ["comment.documentation.heredoc"," * with lists"] -],[ - "comment.documentation.heredoc", - ["comment.documentation.heredoc"," * more"] -],[ - "comment.documentation.heredoc", - ["comment.documentation.heredoc"," * and more"] -],[ - "comment.documentation.heredoc" -],[ - "comment.documentation.heredoc", - ["comment.documentation.heredoc"," Even.with(code)"] -],[ - "comment.documentation.heredoc", - ["comment.documentation.heredoc"," blocks |> with |> samples"] -],[ - "comment.documentation.heredoc" -],[ - "comment.documentation.heredoc", - ["comment.documentation.heredoc"," _Docs are first class citizens in Elixir_ (Jose Valim)"] -],[ - "start", - ["comment.documentation.heredoc"," \"\"\""] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," "], - ["punctuation.definition.comment.elixir","#"], - ["comment.line.number-sign.elixir"," A \"Hello world\" function"] -],[ - "start", - ["text"," "], - ["keyword.control.elixir","def"], - ["text"," some_fun "], - ["keyword.control.elixir","do"] -],[ - "start", - ["text"," "], - ["variable.other.constant.elixir","IO"], - ["punctuation.separator.method.elixir","."], - ["text","puts "], - ["punctuation.definition.string.begin.elixir","\""], - ["string.quoted.double.elixir","Juhu Kinners!"], - ["punctuation.definition.string.end.elixir","\""] -],[ - "start", - ["text"," "], - ["keyword.control.elixir","end"] -],[ - "start", - ["text"," "], - ["punctuation.definition.comment.elixir","#"], - ["comment.line.number-sign.elixir"," A private function"] -],[ - "start", - ["text"," "], - ["keyword.control.elixir","defp"], - ["text"," priv "], - ["keyword.control.elixir","do"] -],[ - "punctuation.definition.string.begin.elixir7", - ["text"," is_regex "], - ["punctuation.definition.string.begin.elixir","~r\"\"\""] -],[ - "punctuation.definition.string.begin.elixir7", - ["string.quoted.double.heredoc.elixir"," This is a regex"] -],[ - "punctuation.definition.string.begin.elixir7", - ["string.quoted.double.heredoc.elixir"," spanning several"] -],[ - "punctuation.definition.string.begin.elixir7", - ["string.quoted.double.heredoc.elixir"," lines."] -],[ - "start", - ["punctuation.definition.string.end.elixir"," \"\"\""] -],[ - "start", - ["text"," x "], - ["keyword.operator.assignment.elixir","="], - ["text"," elem"], - ["punctuation.section.function.elixir","("], - ["punctuation.section.scope.elixir","{"], - ["text"," "], - ["punctuation.definition.constant.elixir",":"], - ["constant.other.symbol.elixir","a"], - ["punctuation.separator.object.elixir",","], - ["text"," "], - ["punctuation.definition.constant.elixir",":"], - ["constant.other.symbol.elixir","b"], - ["punctuation.separator.object.elixir",","], - ["text"," "], - ["punctuation.definition.constant.elixir",":"], - ["constant.other.symbol.elixir","c"], - ["text"," "], - ["punctuation.section.scope.elixir","}"], - ["punctuation.separator.object.elixir",","], - ["text"," "], - ["constant.numeric.elixir","0"], - ["punctuation.section.function.elixir",")"], - ["text"," "], - ["punctuation.definition.comment.elixir","#"], - ["comment.line.number-sign.elixir","=> :a"] -],[ - "start", - ["text"," "], - ["keyword.control.elixir","end"] -],[ - "start", - ["keyword.control.elixir","end"] -],[ - "start" -],[ - "start", - ["text","test_fun "], - ["keyword.operator.assignment.elixir","="], - ["text"," "], - ["keyword.control.elixir","fn"], - ["punctuation.section.function.elixir","("], - ["text","x"], - ["punctuation.section.function.elixir",")"], - ["text"," "], - ["keyword.operator.arithmetic.elixir","-"], - ["keyword.operator.comparison.elixir",">"] -],[ - "start", - ["text"," "], - ["keyword.control.elixir","cond"], - ["text"," "], - ["keyword.control.elixir","do"] -],[ - "start", - ["text"," x "], - ["keyword.operator.comparison.elixir",">"], - ["text"," "], - ["constant.numeric.elixir","10"], - ["text"," "], - ["keyword.operator.arithmetic.elixir","-"], - ["keyword.operator.comparison.elixir",">"] -],[ - "start", - ["text"," "], - ["punctuation.definition.constant.elixir",":"], - ["constant.other.symbol.elixir","greater_than_ten"] -],[ - "start", - ["text"," "], - ["constant.language.elixir","true"], - ["text"," "], - ["keyword.operator.arithmetic.elixir","-"], - ["keyword.operator.comparison.elixir",">"] -],[ - "start", - ["text"," "], - ["punctuation.definition.constant.elixir",":"], - ["constant.other.symbol.elixir","maybe_ten"] -],[ - "start", - ["text"," "], - ["keyword.control.elixir","end"] -],[ - "start", - ["keyword.control.elixir","end"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_elm.json b/lib/ace/mode/_test/tokens_elm.json deleted file mode 100644 index b39de92f..00000000 --- a/lib/ace/mode/_test/tokens_elm.json +++ /dev/null @@ -1,198 +0,0 @@ -[[ - "start", - ["comment.start","{-"], - ["comment"," Ace "], - ["comment.start","{-"], - ["comment"," 4 "], - ["comment.end","-}"], - ["comment"," Elm "], - ["comment.end","-}"] -],[ - "start", - ["constant.language","main"], - ["text"," "], - ["keyword","="], - ["text"," "], - ["identifier","lift"], - ["text"," "], - ["identifier","clock"], - ["text"," "], - ["paren.lparen","("], - ["identifier","every"], - ["text"," "], - ["identifier","second"], - ["paren.rparen",")"] -],[ - "start" -],[ - "start", - ["constant.language","clock"], - ["text"," "], - ["identifier","t"], - ["text"," "], - ["keyword","="], - ["text"," "], - ["identifier","collage"], - ["text"," "], - ["constant.numeric","400"], - ["text"," "], - ["constant.numeric","400"], - ["text"," "], - ["paren.lparen","["], - ["text"," "], - ["identifier","filled"], - ["text"," "], - ["identifier","lightGrey"], - ["text"," "], - ["paren.lparen","("], - ["identifier","ngon"], - ["text"," "], - ["constant.numeric","12"], - ["text"," "], - ["constant.numeric","110"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["operator.punctuation",","], - ["text"," "], - ["identifier","outlined"], - ["text"," "], - ["paren.lparen","("], - ["identifier","solid"], - ["text"," "], - ["identifier","grey"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","("], - ["identifier","ngon"], - ["text"," "], - ["constant.numeric","12"], - ["text"," "], - ["constant.numeric","110"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["operator.punctuation",","], - ["text"," "], - ["identifier","hand"], - ["text"," "], - ["identifier","orange"], - ["text"," "], - ["constant.numeric","100"], - ["text"," "], - ["identifier","t"] -],[ - "start", - ["text"," "], - ["operator.punctuation",","], - ["text"," "], - ["identifier","hand"], - ["text"," "], - ["identifier","charcoal"], - ["text"," "], - ["constant.numeric","100"], - ["text"," "], - ["paren.lparen","("], - ["identifier","t"], - ["keyword.operator","/"], - ["constant.numeric","60"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["operator.punctuation",","], - ["text"," "], - ["identifier","hand"], - ["text"," "], - ["identifier","charcoal"], - ["text"," "], - ["constant.numeric","60"], - ["text"," "], - ["paren.lparen","("], - ["identifier","t"], - ["keyword.operator","/"], - ["constant.numeric","720"], - ["paren.rparen",")"], - ["text"," "], - ["paren.rparen","]"] -],[ - "start" -],[ - "start", - ["constant.language","hand"], - ["text"," "], - ["identifier","clr"], - ["text"," "], - ["identifier","len"], - ["text"," "], - ["identifier","time"], - ["text"," "], - ["keyword","="] -],[ - "start", - ["text"," "], - ["keyword","let"], - ["text"," "], - ["identifier","angle"], - ["text"," "], - ["keyword","="], - ["text"," "], - ["identifier","degrees"], - ["text"," "], - ["paren.lparen","("], - ["constant.numeric","90"], - ["text"," "], - ["keyword.operator","-"], - ["text"," "], - ["constant.numeric","6"], - ["text"," "], - ["keyword.operator","*"], - ["text"," "], - ["identifier","inSeconds"], - ["text"," "], - ["identifier","time"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["keyword","in"], - ["text"," "], - ["identifier","traced"], - ["text"," "], - ["paren.lparen","("], - ["identifier","solid"], - ["text"," "], - ["identifier","clr"], - ["paren.rparen",")"], - ["text"," "], - ["keyword.operator","<|"], - ["text"," "], - ["identifier","segment"], - ["text"," "], - ["paren.lparen","("], - ["constant.numeric","0"], - ["operator.punctuation",","], - ["constant.numeric","0"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","("], - ["identifier","len"], - ["text"," "], - ["keyword.operator","*"], - ["text"," "], - ["identifier","cos"], - ["text"," "], - ["identifier","angle"], - ["operator.punctuation",","], - ["text"," "], - ["identifier","len"], - ["text"," "], - ["keyword.operator","*"], - ["text"," "], - ["identifier","sin"], - ["text"," "], - ["identifier","angle"], - ["paren.rparen",")"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_erlang.json b/lib/ace/mode/_test/tokens_erlang.json deleted file mode 100644 index 8a828976..00000000 --- a/lib/ace/mode/_test/tokens_erlang.json +++ /dev/null @@ -1,166 +0,0 @@ -[[ - "start", - ["text"," "], - ["punctuation.definition.comment.erlang","%% A process whose only job is to keep a counter."] -],[ - "start", - ["text"," "], - ["punctuation.definition.comment.erlang","%% First version"] -],[ - "start", - ["meta.directive.module.erlang"," "], - ["punctuation.section.directive.begin.erlang","-"], - ["keyword.control.directive.module.erlang","module"], - ["punctuation.definition.parameters.begin.erlang","("], - ["entity.name.type.class.module.definition.erlang","counter"], - ["punctuation.definition.parameters.end.erlang",")"], - ["punctuation.section.directive.end.erlang","."] -],[ - "start", - ["meta.directive.export.erlang"," "], - ["punctuation.section.directive.begin.erlang","-"], - ["keyword.control.directive.export.erlang","export"], - ["punctuation.definition.parameters.begin.erlang","("], - ["punctuation.definition.list.begin.erlang","["], - ["entity.name.function.erlang","start"], - ["punctuation.separator.function-arity.erlang","/"], - ["constant.numeric.integer.decimal.erlang","0"], - ["punctuation.separator.list.erlang",","], - ["meta.structure.list.function.erlang"," "], - ["entity.name.function.erlang","codeswitch"], - ["punctuation.separator.function-arity.erlang","/"], - ["constant.numeric.integer.decimal.erlang","1"], - ["punctuation.definition.list.end.erlang","]"], - ["punctuation.definition.parameters.end.erlang",")"], - ["punctuation.section.directive.end.erlang","."] -],[ - "start", - ["text"," "] -],[ - "start", - ["meta.function.erlang"," "], - ["entity.name.function.definition.erlang","start"], - ["punctuation.section.expression.begin.erlang","("], - ["punctuation.section.expression.end.erlang",")"], - ["text"," "], - ["keyword.operator.symbolic.erlang","->"], - ["text"," "], - ["entity.name.function.erlang","loop"], - ["punctuation.definition.parameters.begin.erlang","("], - ["constant.numeric.integer.decimal.erlang","0"], - ["punctuation.definition.parameters.end.erlang",")"], - ["punctuation.terminator.function.erlang","."] -],[ - "start", - ["text"," "] -],[ - ["text6","meta.function.erlang"], - ["meta.function.erlang"," "], - ["entity.name.function.definition.erlang","loop"], - ["punctuation.section.expression.begin.erlang","("], - ["variable.other.erlang","Sum"], - ["punctuation.section.expression.end.erlang",")"], - ["text"," "], - ["keyword.operator.symbolic.erlang","->"] -],[ - ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], - ["text"," "], - ["keyword.control.receive.erlang","receive"] -],[ - ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], - ["meta.expression.receive.erlang"," "], - ["punctuation.definition.tuple.begin.erlang","{"], - ["constant.other.symbol.unquoted.erlang","increment"], - ["punctuation.separator.tuple.erlang",","], - ["meta.structure.tuple.erlang"," "], - ["variable.other.erlang","Count"], - ["punctuation.definition.tuple.end.erlang","}"], - ["meta.expression.receive.erlang"," "], - ["punctuation.separator.clause-head-body.erlang","->"] -],[ - ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], - ["meta.expression.receive.erlang"," "], - ["entity.name.function.erlang","loop"], - ["punctuation.definition.parameters.begin.erlang","("], - ["variable.other.erlang","Sum"], - ["keyword.operator.symbolic.erlang","+"], - ["variable.other.erlang","Count"], - ["punctuation.definition.parameters.end.erlang",")"], - ["punctuation.separator.clauses.erlang",";"] -],[ - ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], - ["meta.expression.receive.erlang"," "], - ["punctuation.definition.tuple.begin.erlang","{"], - ["constant.other.symbol.unquoted.erlang","counter"], - ["punctuation.separator.tuple.erlang",","], - ["meta.structure.tuple.erlang"," "], - ["variable.other.erlang","Pid"], - ["punctuation.definition.tuple.end.erlang","}"], - ["meta.expression.receive.erlang"," "], - ["punctuation.separator.clause-head-body.erlang","->"] -],[ - ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], - ["meta.expression.receive.erlang"," "], - ["variable.other.erlang","Pid"], - ["meta.expression.receive.erlang"," "], - ["keyword.operator.symbolic.erlang","!"], - ["meta.expression.receive.erlang"," "], - ["punctuation.definition.tuple.begin.erlang","{"], - ["constant.other.symbol.unquoted.erlang","counter"], - ["punctuation.separator.tuple.erlang",","], - ["meta.structure.tuple.erlang"," "], - ["variable.other.erlang","Sum"], - ["punctuation.definition.tuple.end.erlang","}"], - ["punctuation.separator.expressions.erlang",","] -],[ - ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], - ["meta.expression.receive.erlang"," "], - ["entity.name.function.erlang","loop"], - ["punctuation.definition.parameters.begin.erlang","("], - ["variable.other.erlang","Sum"], - ["punctuation.definition.parameters.end.erlang",")"], - ["punctuation.separator.clauses.erlang",";"] -],[ - ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], - ["meta.expression.receive.erlang"," "], - ["constant.other.symbol.unquoted.erlang","code_switch"], - ["meta.expression.receive.erlang"," "], - ["punctuation.separator.clause-head-body.erlang","->"] -],[ - ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], - ["meta.expression.receive.erlang"," "], - ["keyword.operator.macro.erlang","?"], - ["entity.name.function.macro.erlang","MODULE"], - ["meta.expression.receive.erlang",":"], - ["entity.name.function.erlang","codeswitch"], - ["punctuation.definition.parameters.begin.erlang","("], - ["variable.other.erlang","Sum"], - ["punctuation.definition.parameters.end.erlang",")"] -],[ - ["keyword.control.receive.erlang","text6","text6","meta.function.erlang"], - ["meta.expression.receive.erlang"," "], - ["punctuation.definition.comment.erlang","% Force the use of 'codeswitch/1' from the latest MODULE version"] -],[ - "start", - ["meta.expression.receive.erlang"," "], - ["keyword.control.end.erlang","end"], - ["punctuation.terminator.function.erlang","."] -],[ - "start", - ["text"," "] -],[ - "start", - ["meta.function.erlang"," "], - ["entity.name.function.definition.erlang","codeswitch"], - ["punctuation.section.expression.begin.erlang","("], - ["variable.other.erlang","Sum"], - ["punctuation.section.expression.end.erlang",")"], - ["text"," "], - ["keyword.operator.symbolic.erlang","->"], - ["text"," "], - ["entity.name.function.erlang","loop"], - ["punctuation.definition.parameters.begin.erlang","("], - ["variable.other.erlang","Sum"], - ["punctuation.definition.parameters.end.erlang",")"], - ["punctuation.terminator.function.erlang","."] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_forth.json b/lib/ace/mode/_test/tokens_forth.json deleted file mode 100644 index 8c8a007e..00000000 --- a/lib/ace/mode/_test/tokens_forth.json +++ /dev/null @@ -1,219 +0,0 @@ -[[ - "start", - ["keyword.other.compile-only.forth",":"], - ["meta.block.forth"," "], - ["entity.name.function.forth","HELLO"], - ["meta.block.forth"," "], - ["comment.line.parentheses.forth"," ( -- )"], - ["meta.block.forth"," CR "], - ["string.quoted.double.forth",".\" Hello, world!\""], - ["meta.block.forth"," "], - ["keyword.other.compile-only.forth",";"], - ["text"," "] -],[ - "start" -],[ - "start", - ["text","HELLO "] -],[ - "start", - ["text","Hello, world!"] -],[ - "start" -],[ - "start", - ["keyword.other.compile-only.forth",":"], - ["meta.block.forth"," "], - ["entity.name.function.forth","[CHAR]"], - ["meta.block.forth"," "], - ["keyword.other.non-immediate.forth"," CHAR"], - ["meta.block.forth"," "], - ["keyword.other.compile-only.forth"," POSTPONE"], - ["meta.block.forth"," LITERAL "], - ["keyword.other.compile-only.forth",";"], - ["keyword.other.immediate.forth"," IMMEDIATE"] -],[ - "start" -],[ - "start", - ["constant.numeric.forth","0"], - ["storage.type.forth"," value"], - ["text"," ii "], - ["constant.numeric.forth"," 0"], - ["storage.type.forth"," value"], - ["text"," jj"] -],[ - "start", - ["constant.numeric.forth","0"], - ["storage.type.forth"," value"], - ["text"," KeyAddr "], - ["constant.numeric.forth"," 0"], - ["storage.type.forth"," value"], - ["text"," KeyLen"] -],[ - "start", - ["storage.type.forth","create"], - ["text"," SArray "], - ["constant.numeric.forth"," 256"], - ["text"," allot "], - ["comment.line.backslash.forth"," \\ state array of 256 bytes"] -],[ - "start", - ["keyword.other.compile-only.forth",":"], - ["meta.block.forth"," "], - ["entity.name.function.forth","KeyArray"], - ["meta.block.forth"," KeyLen mod KeyAddr "], - ["keyword.other.compile-only.forth",";"] -],[ - "start" -],[ - "start", - ["keyword.other.compile-only.forth",":"], - ["meta.block.forth"," "], - ["entity.name.function.forth","get_byte"], - ["meta.block.forth"," + c@ "], - ["keyword.other.compile-only.forth",";"] -],[ - "start", - ["keyword.other.compile-only.forth",":"], - ["meta.block.forth"," "], - ["entity.name.function.forth","set_byte"], - ["meta.block.forth"," + c! "], - ["keyword.other.compile-only.forth",";"] -],[ - "start", - ["keyword.other.compile-only.forth",":"], - ["meta.block.forth"," "], - ["entity.name.function.forth","as_byte"], - ["meta.block.forth"," "], - ["constant.numeric.forth"," 255"], - ["meta.block.forth"," and "], - ["keyword.other.compile-only.forth",";"] -],[ - "start", - ["keyword.other.compile-only.forth",":"], - ["meta.block.forth"," "], - ["entity.name.function.forth","reset_ij"], - ["meta.block.forth"," "], - ["constant.numeric.forth"," 0"], - ["keyword.other.immediate.forth"," TO"], - ["meta.block.forth"," ii "], - ["constant.numeric.forth"," 0"], - ["keyword.other.immediate.forth"," TO"], - ["meta.block.forth"," jj "], - ["keyword.other.compile-only.forth",";"] -],[ - "start", - ["keyword.other.compile-only.forth",":"], - ["meta.block.forth"," "], - ["entity.name.function.forth","i_update"], - ["meta.block.forth"," "], - ["constant.numeric.forth"," 1"], - ["meta.block.forth"," + as_byte"], - ["keyword.other.immediate.forth"," TO"], - ["meta.block.forth"," ii "], - ["keyword.other.compile-only.forth",";"] -],[ - "start", - ["keyword.other.compile-only.forth",":"], - ["meta.block.forth"," "], - ["entity.name.function.forth","j_update"], - ["meta.block.forth"," ii SArray get_byte + as_byte"], - ["keyword.other.immediate.forth"," TO"], - ["meta.block.forth"," jj "], - ["keyword.other.compile-only.forth",";"] -],[ - "keyword.other.compile-only.forth", - ["keyword.other.compile-only.forth",":"], - ["meta.block.forth"," "], - ["entity.name.function.forth","swap_s_ij"] -],[ - "keyword.other.compile-only.forth", - ["meta.block.forth"," jj SArray get_byte"] -],[ - "keyword.other.compile-only.forth", - ["meta.block.forth"," ii SArray get_byte jj SArray set_byte"] -],[ - "keyword.other.compile-only.forth", - ["meta.block.forth"," ii SArray set_byte"] -],[ - "start", - ["keyword.other.compile-only.forth",";"] -],[ - "start" -],[ - "keyword.other.compile-only.forth", - ["keyword.other.compile-only.forth",":"], - ["meta.block.forth"," "], - ["entity.name.function.forth","rc4_init"], - ["comment.line.parentheses.forth"," ( KeyAddr KeyLen -- )"] -],[ - "keyword.other.compile-only.forth", - ["meta.block.forth"," "], - ["constant.numeric.forth"," 256"], - ["meta.block.forth"," min"], - ["keyword.other.immediate.forth"," TO"], - ["meta.block.forth"," KeyLen "], - ["keyword.other.immediate.forth"," TO"], - ["meta.block.forth"," KeyAddr"] -],[ - "keyword.other.compile-only.forth", - ["meta.block.forth"," "], - ["constant.numeric.forth"," 256 0"], - ["keyword.control.compile-only.forth"," DO"], - ["meta.block.forth"," "], - ["variable.language.forth","i"], - ["meta.block.forth"," "], - ["variable.language.forth","i"], - ["meta.block.forth"," SArray set_byte "], - ["keyword.control.compile-only.forth"," LOOP"] -],[ - "keyword.other.compile-only.forth", - ["meta.block.forth"," reset_ij"] -],[ - "keyword.other.compile-only.forth", - ["meta.block.forth"," "], - ["keyword.control.compile-only.forth"," BEGIN"] -],[ - "keyword.other.compile-only.forth", - ["meta.block.forth"," ii KeyArray get_byte jj + j_update"] -],[ - "keyword.other.compile-only.forth", - ["meta.block.forth"," swap_s_ij"] -],[ - "keyword.other.compile-only.forth", - ["meta.block.forth"," ii"], - ["constant.numeric.forth"," 255"], - ["meta.block.forth"," <"], - ["keyword.control.compile-only.forth"," WHILE"] -],[ - "keyword.other.compile-only.forth", - ["meta.block.forth"," ii i_update"] -],[ - "keyword.other.compile-only.forth", - ["meta.block.forth"," "], - ["keyword.control.compile-only.forth"," REPEAT"] -],[ - "keyword.other.compile-only.forth", - ["meta.block.forth"," reset_ij"] -],[ - "start", - ["keyword.other.compile-only.forth",";"] -],[ - "keyword.other.compile-only.forth", - ["keyword.other.compile-only.forth",":"], - ["meta.block.forth"," "], - ["entity.name.function.forth","rc4_byte"] -],[ - "keyword.other.compile-only.forth", - ["meta.block.forth"," ii i_update jj j_update"] -],[ - "keyword.other.compile-only.forth", - ["meta.block.forth"," swap_s_ij"] -],[ - "keyword.other.compile-only.forth", - ["meta.block.forth"," ii SArray get_byte jj SArray get_byte + as_byte SArray get_byte xor"] -],[ - "start", - ["keyword.other.compile-only.forth",";"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_ftl.json b/lib/ace/mode/_test/tokens_ftl.json deleted file mode 100644 index 75e7a6f1..00000000 --- a/lib/ace/mode/_test/tokens_ftl.json +++ /dev/null @@ -1,341 +0,0 @@ -[[ - "start", - ["keyword.function","<#ftl"], - ["text"," "], - ["entity.other.attribute-name","encoding"], - ["keyword.operator","="], - ["string","\"utf-8\""], - ["text"," "], - ["keyword","/>"] -],[ - "start", - ["keyword.function","<#setting"], - ["text"," "], - ["entity.other.attribute-name","locale"], - ["keyword.operator","="], - ["string","\"en_US\""], - ["text"," "], - ["keyword","/>"] -],[ - "start", - ["keyword.function","<#import"], - ["text"," "], - ["string","\"library\""], - ["text"," "], - ["keyword.operator","as"], - ["text"," "], - ["variable","lib"], - ["text"," "], - ["keyword","/>"] -],[ - "ftl-dcomment", - ["comment","<#--"] -],[ - "ftl-dcomment", - ["comment"," FreeMarker comment"] -],[ - "ftl-dcomment", - ["comment"," ${abc} <#assign a=12 />"] -],[ - "start", - ["comment","-->"] -],[ - "start" -],[ - "start", - ["xml-pe.doctype.xml",""] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","html"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","lang"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"en-us\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","head"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","meta"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","charset"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"utf-8\""], - ["text.tag-whitespace.xml"," "], - ["meta.tag.punctuation.tag-close.xml","/>"] -],[ - "start", - ["text.xml"," "] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","title"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["string.interpolated","${"], - ["variable","title"], - ["keyword.operator","!"], - ["string","\"FreeMarker\""], - ["string.interpolated","}"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","title"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","body"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","h1"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Hello "], - ["string.interpolated","${"], - ["variable","name"], - ["keyword.operator","!"], - ["string","\"\""], - ["string.interpolated","}"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","p"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Today is: "], - ["string.interpolated","${"], - ["language.variable",".now"], - ["support.function","?date"], - ["string.interpolated","}"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "] -],[ - "start", - ["text.xml"," "], - ["keyword.function","<#assign"], - ["text"," "], - ["variable","x"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","13"], - ["keyword",">"] -],[ - "start", - ["text.xml"," "], - ["keyword.function","<#if"], - ["text"," "], - ["variable","x"], - ["text"," "], - ["constant.character.entity",">"], - ["text"," "], - ["constant.numeric","12"], - ["text"," "], - ["keyword.operator","&&"], - ["text"," "], - ["variable","x"], - ["text"," "], - ["keyword.operator","lt"], - ["text"," "], - ["constant.numeric","14"], - ["keyword",">"], - ["text.xml","x equals 13: "], - ["string.interpolated","${"], - ["variable","x"], - ["string.interpolated","}"], - ["keyword.function",""] -],[ - "start", - ["text.xml"," "] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","ul"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["keyword.function","<#list"], - ["text"," "], - ["variable","items"], - ["text"," "], - ["keyword.operator","as"], - ["text"," "], - ["variable","item"], - ["keyword",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","li"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["string.interpolated","${"], - ["variable","item_index"], - ["string.interpolated","}"], - ["text.xml",": "], - ["string.interpolated","${"], - ["variable","item.name"], - ["keyword.operator","!"], - ["support.function","?split"], - ["paren.lparen","("], - ["string","\""], - ["constant.character.escape","\\n"], - ["string","\""], - ["paren.rparen",")"], - ["paren.lparen","["], - ["constant.numeric","0"], - ["paren.rparen","]"], - ["string.interpolated","}"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["keyword.function",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "] -],[ - "start", - ["text.xml"," User directive: "], - ["keyword.other","<@lib.function"], - ["text"," "], - ["variable","attr1"], - ["keyword.operator","="], - ["constant.language","true"], - ["text"," "], - ["variable","attr2"], - ["keyword.operator","="], - ["string","'value'"], - ["text"," "], - ["variable","attr3"], - ["keyword.operator","="], - ["constant.numeric","-42.12"], - ["keyword",">"], - ["text.xml","Test"], - ["keyword.other",""] -],[ - "start", - ["text.xml"," "], - ["keyword.other","<@anotherOne"], - ["text"," "], - ["keyword","/>"] -],[ - "start", - ["text.xml"," "] -],[ - "start", - ["text.xml"," "], - ["keyword.function","<#if"], - ["text"," "], - ["variable","variable"], - ["support.function.deprecated","?exists"], - ["keyword",">"] -],[ - "start", - ["text.xml"," Deprecated"] -],[ - "start", - ["text.xml"," "], - ["keyword.function","<#elseif"], - ["text"," "], - ["variable","variable"], - ["support.function","??"], - ["keyword",">"] -],[ - "start", - ["text.xml"," Better"] -],[ - "start", - ["text.xml"," "], - ["keyword.function","<#else"], - ["keyword",">"] -],[ - "start", - ["text.xml"," Default"] -],[ - "start", - ["text.xml"," "], - ["keyword.function",""] -],[ - "start", - ["text.xml"," "] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.image.tag-name.xml","img"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","src"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"images/"], - ["string.interpolated","${"], - ["variable","user.id"], - ["string.interpolated","}"], - ["string.attribute-value.xml",".png\""], - ["text.tag-whitespace.xml"," "], - ["meta.tag.punctuation.tag-close.xml","/>"] -],[ - "start", - ["text.xml"," "] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_gcode.json b/lib/ace/mode/_test/tokens_gcode.json deleted file mode 100644 index d6227473..00000000 --- a/lib/ace/mode/_test/tokens_gcode.json +++ /dev/null @@ -1,296 +0,0 @@ -[[ - "start", - ["identifier","O"], - ["constant.numeric","003"], - ["text"," "], - ["comment","(DIAMOND SQUARE)"] -],[ - "start", - ["comment","N2"], - ["text"," "], - ["string","G54"], - ["text"," "], - ["string","G90"], - ["text"," "], - ["string","G49"], - ["text"," "], - ["string","G80"] -],[ - "start", - ["comment","N3"], - ["text"," "], - ["string","M6"], - ["text"," "], - ["identifier","T"], - ["constant.numeric","1"], - ["text"," "], - ["comment","(1.ENDMILL)"] -],[ - "start", - ["comment","N4"], - ["text"," "], - ["string","M3"], - ["text"," "], - ["identifier","S"], - ["constant.numeric","1800"] -],[ - "start", - ["comment","N5"], - ["text"," "], - ["string","G0"], - ["text"," "], - ["identifier","X"], - ["constant.numeric","-.6"], - ["text"," "], - ["identifier","Y"], - ["constant.numeric","2.050"] -],[ - "start", - ["comment","N6"], - ["text"," "], - ["string","G43"], - ["text"," "], - ["identifier","H"], - ["constant.numeric","1"], - ["text"," "], - ["identifier","Z"], - ["constant.numeric",".1"] -],[ - "start", - ["comment","N7"], - ["text"," "], - ["string","G1"], - ["text"," "], - ["identifier","Z"], - ["constant.numeric","-.3"], - ["text"," "], - ["identifier","F"], - ["constant.numeric","50."] -],[ - "start", - ["comment","N8"], - ["text"," "], - ["string","G41"], - ["text"," "], - ["identifier","D"], - ["constant.numeric","1"], - ["text"," "], - ["identifier","Y"], - ["constant.numeric","1.45"] -],[ - "start", - ["comment","N9"], - ["text"," "], - ["string","G1"], - ["text"," "], - ["identifier","X"], - ["constant.numeric","0"], - ["text"," "], - ["identifier","F"], - ["constant.numeric","20."] -],[ - "start", - ["comment","N10"], - ["text"," "], - ["string","G2"], - ["text"," "], - ["identifier","J"], - ["constant.numeric","-1.45"] -],[ - "start", - ["comment","(CUTTER COMP CANCEL)"] -],[ - "start", - ["comment","N11"], - ["text"," "], - ["string","G1"], - ["text"," "], - ["identifier","Z"], - ["constant.numeric","-.2"], - ["text"," "], - ["identifier","F"], - ["constant.numeric","50."] -],[ - "start", - ["comment","N12"], - ["text"," "], - ["identifier","Y"], - ["constant.numeric","-.990"] -],[ - "start", - ["comment","N13"], - ["text"," "], - ["string","G40"] -],[ - "start", - ["comment","N14"], - ["text"," "], - ["string","G0"], - ["text"," "], - ["identifier","X"], - ["constant.numeric","-.6"], - ["text"," "], - ["identifier","Y"], - ["constant.numeric","1.590"] -],[ - "start", - ["comment","N15"], - ["text"," "], - ["string","G0"], - ["text"," "], - ["identifier","Z"], - ["constant.numeric",".1"] -],[ - "start", - ["comment","N16"], - ["text"," "], - ["string","M5"], - ["text"," "], - ["string","G49"], - ["text"," "], - ["string","G28"], - ["text"," "], - ["string","G91"], - ["text"," "], - ["identifier","Z"], - ["constant.numeric","0"] -],[ - "start", - ["comment","N17"], - ["text"," "], - ["identifier","CALL"], - ["text"," "], - ["identifier","O"], - ["constant.numeric","9456"] -],[ - "start", - ["comment","N18"], - ["text"," #"], - ["constant.numeric","500"], - ["text","="], - ["constant.numeric","0.004"] -],[ - "start", - ["comment","N19"], - ["text"," #"], - ["constant.numeric","503"], - ["text","="], - ["paren.lparen","["], - ["text","#"], - ["constant.numeric","500"], - ["text","+#"], - ["constant.numeric","501"], - ["paren.rparen","]"] -],[ - "start", - ["comment","N20"], - ["text"," "], - ["identifier","VC"], - ["constant.numeric","45"], - ["text","="], - ["constant.numeric","0.0006"] -],[ - "start", - ["identifier","VS"], - ["constant.numeric","4"], - ["text","="], - ["constant.numeric","0.0007"] -],[ - "start", - ["comment","N21"], - ["text"," "], - ["string","G90"], - ["text"," "], - ["string","G10"], - ["text"," "], - ["identifier","L"], - ["constant.numeric","20"], - ["text"," "], - ["identifier","P"], - ["constant.numeric","3"], - ["text"," "], - ["identifier","X"], - ["constant.numeric","5."], - ["identifier","Y"], - ["constant.numeric","4."], - ["text"," "], - ["identifier","Z"], - ["constant.numeric","6.567"] -],[ - "start", - ["comment","N22"], - ["text"," "], - ["string","G0"], - ["text"," "], - ["identifier","X"], - ["constant.numeric","5000"] -],[ - "start", - ["comment","N23"], - ["text"," "], - ["identifier","IF"], - ["text"," "], - ["paren.lparen","["], - ["text","#"], - ["constant.numeric","1"], - ["text"," "], - ["identifier","LT"], - ["text"," "], - ["constant.numeric","0.370"], - ["paren.rparen","]"], - ["text"," "], - ["identifier","GOTO"], - ["text"," "], - ["constant.numeric","49"] -],[ - "start", - ["comment","N24"], - ["text"," "], - ["identifier","X"], - ["constant.numeric","-0.678"], - ["text"," "], - ["identifier","Y"], - ["constant.numeric","+.990"] -],[ - "start", - ["comment","N25"], - ["text"," "], - ["string","G84.3"], - ["text"," "], - ["identifier","X"], - ["constant.numeric","-0.1"] -],[ - "start", - ["comment","N26"], - ["text"," #"], - ["constant.numeric","4"], - ["text","=#"], - ["constant.numeric","5"], - ["text","*"], - ["identifier","COS"], - ["paren.lparen","["], - ["constant.numeric","45"], - ["paren.rparen","]"] -],[ - "start", - ["comment","N27"], - ["text"," #"], - ["constant.numeric","4"], - ["text","=#"], - ["constant.numeric","5"], - ["text","*"], - ["identifier","SIN"], - ["paren.lparen","["], - ["constant.numeric","45"], - ["paren.rparen","]"] -],[ - "start", - ["comment","N28"], - ["text"," "], - ["identifier","VZOFZ"], - ["text","="], - ["constant.numeric","652.9658"] -],[ - "start", - ["text","%"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_gherkin.json b/lib/ace/mode/_test/tokens_gherkin.json deleted file mode 100644 index 173d9798..00000000 --- a/lib/ace/mode/_test/tokens_gherkin.json +++ /dev/null @@ -1,142 +0,0 @@ -[[ - "start", - ["comment","@these"], - ["text"," "], - ["comment","@are"], - ["text"," "], - ["comment","@tags"] -],[ - "start", - ["keyword","Feature:"], - ["text"," Serve coffee"] -],[ - "start", - ["text"," Coffee should not be served until paid for"] -],[ - "start", - ["text"," Coffee should not be served until the button has been pressed"] -],[ - "start", - ["text"," If there is no coffee left then money should be refunded"] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," "], - ["keyword","Scenario Outline:"], - ["text"," Eating"] -],[ - "start", - ["text"," "], - ["keyword","Given"], - ["text"," there are "], - ["comment",""], - ["text"," cucumbers"] -],[ - "start", - ["text"," "], - ["keyword","When"], - ["text"," I eat "], - ["comment",""], - ["text"," cucumbers"] -],[ - "start", - ["text"," "], - ["keyword","Then"], - ["text"," I should have "], - ["comment",""], - ["text"," cucumbers"] -],[ - "start" -],[ - "start", - ["text"," "], - ["keyword","Examples:"] -],[ - "start", - ["text"," "], - ["comment","|"], - ["string"," start "], - ["comment","|"], - ["string"," eat "], - ["comment","|"], - ["string"," left "], - ["comment","|"] -],[ - "start", - ["text"," "], - ["comment","|"], - ["string"," 12 "], - ["comment","|"], - ["string"," 5 "], - ["comment","|"], - ["string"," 7 "], - ["comment","|"] -],[ - "start", - ["text"," "], - ["comment","|"], - ["string"," 20 "], - ["comment","|"], - ["string"," 5 "], - ["comment","|"], - ["string"," 15 "], - ["comment","|"], - ["string"," "] -],[ - "start" -],[ - "start", - ["text"," "], - ["keyword","Scenario:"], - ["text"," Buy last coffee"] -],[ - "start", - ["text"," "], - ["keyword","Given"], - ["text"," there are "], - ["constant.numeric","1"], - ["text"," coffees left in the machine"] -],[ - "start", - ["text"," "], - ["keyword","And"], - ["text"," I have deposited "], - ["constant.numeric","1"], - ["text","$ "] -],[ - "start", - ["text"," "], - ["keyword","When"], - ["text"," I press the coffee button"] -],[ - "start", - ["text"," "], - ["keyword","Then"], - ["text"," I should be served a "], - ["string","\"coffee\""] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," "], - ["comment","# this a comment"] -],[ - "start", - ["text"," "] -],[ - "qqstring3", - ["text"," "], - ["string","\"\"\""] -],[ - "qqstring3", - ["string"," this is a "] -],[ - "qqstring3", - ["string"," pystring"] -],[ - "start", - ["string"," \"\"\""] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_gitignore.json b/lib/ace/mode/_test/tokens_gitignore.json deleted file mode 100644 index 8689a724..00000000 --- a/lib/ace/mode/_test/tokens_gitignore.json +++ /dev/null @@ -1,33 +0,0 @@ -[[ - "start", - ["comment","# A sample .gitignore file."] -],[ - "start" -],[ - "start", - ["text",".buildlog"] -],[ - "start", - ["text",".DS_Store"] -],[ - "start", - ["text",".svn"] -],[ - "start" -],[ - "start", - ["comment","# Negated patterns:"] -],[ - "start", - ["keyword","!foo.bar"] -],[ - "start" -],[ - "start", - ["comment","# Also ignore user settings..."] -],[ - "start", - ["text","/.settings"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_glsl.json b/lib/ace/mode/_test/tokens_glsl.json deleted file mode 100644 index ce8a4d16..00000000 --- a/lib/ace/mode/_test/tokens_glsl.json +++ /dev/null @@ -1,127 +0,0 @@ -[[ - "start", - ["keyword","uniform"], - ["text"," "], - ["keyword","float"], - ["text"," "], - ["identifier","amplitude"], - ["punctuation.operator",";"] -],[ - "start", - ["keyword","attribute"], - ["text"," "], - ["keyword","float"], - ["text"," "], - ["identifier","displacement"], - ["punctuation.operator",";"] -],[ - "start", - ["keyword","varying"], - ["text"," "], - ["keyword","vec3"], - ["text"," "], - ["identifier","vNormal"], - ["punctuation.operator",";"] -],[ - "start" -],[ - "start", - ["keyword","void"], - ["text"," "], - ["identifier","main"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start" -],[ - "start", - ["text"," "], - ["identifier","vNormal"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","normal"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," "], - ["comment","// multiply our displacement by the"] -],[ - "start", - ["text"," "], - ["comment","// amplitude. The amp will get animated"] -],[ - "start", - ["text"," "], - ["comment","// so we'll have animated displacement"] -],[ - "start", - ["text"," "], - ["keyword","vec3"], - ["text"," "], - ["identifier","newPosition"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","position"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "] -],[ - "start", - ["text"," "], - ["identifier","normal"], - ["text"," "], - ["keyword.operator","*"], - ["text"," "] -],[ - "start", - ["text"," "], - ["keyword","vec3"], - ["paren.lparen","("], - ["identifier","displacement"], - ["text"," "], - ["keyword.operator","*"] -],[ - "start", - ["text"," "], - ["identifier","amplitude"], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["constant.language","gl_Position"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","projectionMatrix"], - ["text"," "], - ["keyword.operator","*"] -],[ - "start", - ["text"," "], - ["identifier","modelViewMatrix"], - ["text"," "], - ["keyword.operator","*"] -],[ - "start", - ["text"," "], - ["keyword","vec4"], - ["paren.lparen","("], - ["identifier","newPosition"], - ["punctuation.operator",","], - ["constant.numeric","1.0"], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["paren.rparen","}"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_golang.json b/lib/ace/mode/_test/tokens_golang.json deleted file mode 100644 index 070c0a17..00000000 --- a/lib/ace/mode/_test/tokens_golang.json +++ /dev/null @@ -1,256 +0,0 @@ -[[ - "start", - ["comment","// Concurrent computation of pi."] -],[ - "start", - ["comment","// See http://goo.gl/ZuTZM."] -],[ - "start", - ["comment","//"] -],[ - "start", - ["comment","// This demonstrates Go's ability to handle"] -],[ - "start", - ["comment","// large numbers of concurrent processes."] -],[ - "start", - ["comment","// It is an unreasonable way to calculate pi."] -],[ - "start", - ["keyword","package"], - ["text"," "], - ["identifier","main"] -],[ - "start" -],[ - "start", - ["keyword","import"], - ["text"," "], - ["paren.lparen","("] -],[ - "start", - ["text"," "], - ["string","\"fmt\""] -],[ - "start", - ["text"," "], - ["string","\"math\""] -],[ - "start", - ["paren.rparen",")"] -],[ - "start" -],[ - "start", - ["keyword","func"], - ["text"," "], - ["identifier","main"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["identifier","fmt"], - ["punctuation.operator","."], - ["identifier","Println"], - ["paren.lparen","("], - ["identifier","pi"], - ["paren.lparen","("], - ["constant.numeric","5000"], - ["paren.rparen","))"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["comment","// pi launches n goroutines to compute an"] -],[ - "start", - ["comment","// approximation of pi."] -],[ - "start", - ["keyword","func"], - ["text"," "], - ["identifier","pi"], - ["paren.lparen","("], - ["identifier","n"], - ["text"," "], - ["support.type","int"], - ["paren.rparen",")"], - ["text"," "], - ["support.type","float64"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["identifier","ch"], - ["text"," "], - ["punctuation.operator",":"], - ["keyword.operator","="], - ["text"," "], - ["support.function","make"], - ["paren.lparen","("], - ["keyword","chan"], - ["text"," "], - ["support.type","float64"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["keyword","for"], - ["text"," "], - ["identifier","k"], - ["text"," "], - ["punctuation.operator",":"], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","0"], - ["punctuation.operator",";"], - ["text"," "], - ["identifier","k"], - ["text"," "], - ["keyword.operator","<="], - ["text"," "], - ["identifier","n"], - ["punctuation.operator",";"], - ["text"," "], - ["identifier","k"], - ["keyword.operator","++"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","go"], - ["text"," "], - ["identifier","term"], - ["paren.lparen","("], - ["identifier","ch"], - ["punctuation.operator",","], - ["text"," "], - ["support.type","float64"], - ["paren.lparen","("], - ["identifier","k"], - ["paren.rparen","))"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["identifier","f"], - ["text"," "], - ["punctuation.operator",":"], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","0.0"] -],[ - "start", - ["text"," "], - ["keyword","for"], - ["text"," "], - ["identifier","k"], - ["text"," "], - ["punctuation.operator",":"], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","0"], - ["punctuation.operator",";"], - ["text"," "], - ["identifier","k"], - ["text"," "], - ["keyword.operator","<="], - ["text"," "], - ["identifier","n"], - ["punctuation.operator",";"], - ["text"," "], - ["identifier","k"], - ["keyword.operator","++"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["identifier","f"], - ["text"," "], - ["keyword.operator","+="], - ["text"," "], - ["keyword.operator","<-"], - ["identifier","ch"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["keyword","return"], - ["text"," "], - ["identifier","f"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["keyword","func"], - ["text"," "], - ["identifier","term"], - ["paren.lparen","("], - ["identifier","ch"], - ["text"," "], - ["keyword","chan"], - ["text"," "], - ["support.type","float64"], - ["punctuation.operator",","], - ["text"," "], - ["identifier","k"], - ["text"," "], - ["support.type","float64"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["identifier","ch"], - ["text"," "], - ["keyword.operator","<-"], - ["text"," "], - ["constant.numeric","4"], - ["text"," "], - ["keyword.operator","*"], - ["text"," "], - ["identifier","math"], - ["punctuation.operator","."], - ["identifier","Pow"], - ["paren.lparen","("], - ["constant.numeric","-1"], - ["punctuation.operator",","], - ["text"," "], - ["identifier","k"], - ["paren.rparen",")"], - ["text"," / "], - ["paren.lparen","("], - ["constant.numeric","2"], - ["keyword.operator","*"], - ["identifier","k"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric","1"], - ["paren.rparen",")"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_groovy.json b/lib/ace/mode/_test/tokens_groovy.json deleted file mode 100644 index c7dae6b1..00000000 --- a/lib/ace/mode/_test/tokens_groovy.json +++ /dev/null @@ -1,410 +0,0 @@ -[[ - "start", - ["comment","//http://groovy.codehaus.org/Martin+Fowler%27s+closure+examples+in+Groovy"] -],[ - "start" -],[ - "start", - ["keyword","class"], - ["text"," "], - ["identifier","Employee"], - ["text"," "], - ["lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","def"], - ["text"," "], - ["identifier","name"], - ["text",", "], - ["identifier","salary"] -],[ - "start", - ["text"," "], - ["keyword","boolean"], - ["text"," "], - ["identifier","manager"] -],[ - "start", - ["text"," "], - ["support.function","String"], - ["text"," "], - ["identifier","toString"], - ["lparen","("], - ["rparen",")"], - ["text"," "], - ["lparen","{"], - ["text"," "], - ["keyword","return"], - ["text"," "], - ["identifier","name"], - ["text"," "], - ["rparen","}"] -],[ - "start", - ["rparen","}"] -],[ - "start" -],[ - "start", - ["keyword","def"], - ["text"," "], - ["identifier","emps"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["lparen","["], - ["keyword","new"], - ["text"," "], - ["identifier","Employee"], - ["lparen","("], - ["identifier","name"], - ["text",":"], - ["string","'Guillaume'"], - ["text",", "], - ["identifier","manager"], - ["text",":"], - ["constant.language.boolean","true"], - ["text",", "], - ["identifier","salary"], - ["text",":"], - ["constant.numeric","200"], - ["rparen",")"], - ["text",","] -],[ - "start", - ["text"," "], - ["keyword","new"], - ["text"," "], - ["identifier","Employee"], - ["lparen","("], - ["identifier","name"], - ["text",":"], - ["string","'Graeme'"], - ["text",", "], - ["identifier","manager"], - ["text",":"], - ["constant.language.boolean","true"], - ["text",", "], - ["identifier","salary"], - ["text",":"], - ["constant.numeric","200"], - ["rparen",")"], - ["text",","] -],[ - "start", - ["text"," "], - ["keyword","new"], - ["text"," "], - ["identifier","Employee"], - ["lparen","("], - ["identifier","name"], - ["text",":"], - ["string","'Dierk'"], - ["text",", "], - ["identifier","manager"], - ["text",":"], - ["constant.language.boolean","false"], - ["text",", "], - ["identifier","salary"], - ["text",":"], - ["constant.numeric","151"], - ["rparen",")"], - ["text",","] -],[ - "start", - ["text"," "], - ["keyword","new"], - ["text"," "], - ["identifier","Employee"], - ["lparen","("], - ["identifier","name"], - ["text",":"], - ["string","'Bernd'"], - ["text",", "], - ["identifier","manager"], - ["text",":"], - ["constant.language.boolean","false"], - ["text",", "], - ["identifier","salary"], - ["text",":"], - ["constant.numeric","50"], - ["rparen",")]"] -],[ - "start" -],[ - "start", - ["keyword","def"], - ["text"," "], - ["identifier","managers"], - ["lparen","("], - ["identifier","emps"], - ["rparen",")"], - ["text"," "], - ["lparen","{"] -],[ - "start", - ["text"," "], - ["identifier","emps"], - ["text","."], - ["identifier","findAll"], - ["text"," "], - ["lparen","{"], - ["text"," "], - ["identifier","e"], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["identifier","e"], - ["text","."], - ["identifier","isManager"], - ["lparen","("], - ["rparen",")"], - ["text"," "], - ["rparen","}"] -],[ - "start", - ["rparen","}"] -],[ - "start" -],[ - "start", - ["keyword","assert"], - ["text"," "], - ["identifier","emps"], - ["lparen","["], - ["constant.numeric","0"], - ["text",".."], - ["constant.numeric","1"], - ["rparen","]"], - ["text"," "], - ["keyword.operator","=="], - ["text"," "], - ["identifier","managers"], - ["lparen","("], - ["identifier","emps"], - ["rparen",")"], - ["text"," "], - ["comment","// [Guillaume, Graeme]"] -],[ - "start" -],[ - "start", - ["keyword","def"], - ["text"," "], - ["identifier","highPaid"], - ["lparen","("], - ["identifier","emps"], - ["rparen",")"], - ["text"," "], - ["lparen","{"] -],[ - "start", - ["text"," "], - ["identifier","threshold"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","150"] -],[ - "start", - ["text"," "], - ["identifier","emps"], - ["text","."], - ["identifier","findAll"], - ["text"," "], - ["lparen","{"], - ["text"," "], - ["identifier","e"], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["identifier","e"], - ["text","."], - ["identifier","salary"], - ["text"," "], - ["keyword.operator",">"], - ["text"," "], - ["identifier","threshold"], - ["text"," "], - ["rparen","}"] -],[ - "start", - ["rparen","}"] -],[ - "start" -],[ - "start", - ["keyword","assert"], - ["text"," "], - ["identifier","emps"], - ["lparen","["], - ["constant.numeric","0"], - ["text",".."], - ["constant.numeric","2"], - ["rparen","]"], - ["text"," "], - ["keyword.operator","=="], - ["text"," "], - ["identifier","highPaid"], - ["lparen","("], - ["identifier","emps"], - ["rparen",")"], - ["text"," "], - ["comment","// [Guillaume, Graeme, Dierk]"] -],[ - "start" -],[ - "start", - ["keyword","def"], - ["text"," "], - ["identifier","paidMore"], - ["lparen","("], - ["identifier","amount"], - ["rparen",")"], - ["text"," "], - ["lparen","{"] -],[ - "start", - ["text"," "], - ["lparen","{"], - ["text"," "], - ["identifier","e"], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["identifier","e"], - ["text","."], - ["identifier","salary"], - ["text"," "], - ["keyword.operator",">"], - ["text"," "], - ["identifier","amount"], - ["rparen","}"] -],[ - "start", - ["rparen","}"] -],[ - "start", - ["keyword","def"], - ["text"," "], - ["identifier","highPaid"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","paidMore"], - ["lparen","("], - ["constant.numeric","150"], - ["rparen",")"] -],[ - "start" -],[ - "start", - ["keyword","assert"], - ["text"," "], - ["identifier","highPaid"], - ["lparen","("], - ["identifier","emps"], - ["lparen","["], - ["constant.numeric","0"], - ["rparen","])"], - ["text"," "], - ["comment","// true"] -],[ - "start", - ["keyword","assert"], - ["text"," "], - ["identifier","emps"], - ["lparen","["], - ["constant.numeric","0"], - ["text",".."], - ["constant.numeric","2"], - ["rparen","]"], - ["text"," "], - ["keyword.operator","=="], - ["text"," "], - ["identifier","emps"], - ["text","."], - ["identifier","findAll"], - ["lparen","("], - ["identifier","highPaid"], - ["rparen",")"] -],[ - "start" -],[ - "start", - ["keyword","def"], - ["text"," "], - ["identifier","filename"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string","'test.txt'"] -],[ - "start", - ["keyword","new"], - ["text"," "], - ["identifier","File"], - ["lparen","("], - ["identifier","filename"], - ["rparen",")"], - ["text","."], - ["identifier","withReader"], - ["lparen","{"], - ["text"," "], - ["identifier","reader"], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["identifier","doSomethingWith"], - ["lparen","("], - ["identifier","reader"], - ["rparen",")"], - ["text"," "], - ["rparen","}"] -],[ - "start" -],[ - "start", - ["keyword","def"], - ["text"," "], - ["identifier","readersText"] -],[ - "start", - ["keyword","def"], - ["text"," "], - ["identifier","doSomethingWith"], - ["lparen","("], - ["identifier","reader"], - ["rparen",")"], - ["text"," "], - ["lparen","{"], - ["text"," "], - ["identifier","readersText"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","reader"], - ["text","."], - ["identifier","text"], - ["text"," "], - ["rparen","}"] -],[ - "start" -],[ - "start", - ["keyword","assert"], - ["text"," "], - ["keyword","new"], - ["text"," "], - ["identifier","File"], - ["lparen","("], - ["identifier","filename"], - ["rparen",")"], - ["text","."], - ["identifier","text"], - ["text"," "], - ["keyword.operator","=="], - ["text"," "], - ["identifier","readersText"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_haml.json b/lib/ace/mode/_test/tokens_haml.json deleted file mode 100644 index 423c3bd5..00000000 --- a/lib/ace/mode/_test/tokens_haml.json +++ /dev/null @@ -1,174 +0,0 @@ -[[ - "start", - ["keyword.other.doctype","!!!5"] -],[ - "start" -],[ - "start", - ["punctuation.section.comment","# "] -],[ - "start", - ["punctuation.section.comment","# "] -],[ - "start", - ["punctuation.section.comment","# "] -],[ - "start", - ["punctuation.section.comment","# "] -],[ - "start" -],[ - "start" -],[ - "start", - ["punctuation.section.comment","/adasdasdad"] -],[ - "start", - ["entity.name.tag.haml","%div"], - ["punctuation.section","{"], - ["constant.other.symbol.ruby",":id"], - ["text"," => "], - ["string","\"#{@item.type}_#{@item.number}\""], - ["text",", "], - ["constant.other.symbol.ruby",":class"], - ["text"," => "], - ["string","'#{@item.type} #{@item.urgency}'"], - ["text",", "], - ["constant.other.symbol.ruby",":phoney"], - ["text"," => "], - ["string","`asdasdasd`"], - ["punctuation.section","}"] -],[ - "start", - ["punctuation.section.comment","/ file: app/views/movies/index.html.haml"] -],[ - "start", - ["meta.escape.haml","\\d"] -],[ - "start", - ["entity.name.tag.haml","%ads:"], - ["punctuation.section","{"], - ["constant.other.symbol.ruby",":bleh"], - ["text"," => "], - ["constant.numeric","33"], - ["punctuation.section","}"] -],[ - "embedded_ruby", - ["entity.name.tag.haml","%p"], - ["text","==ddd=="] -],[ - "start", - ["text"," Date/Time:"] -],[ - "embedded_ruby", - ["text"," - "], - ["identifier","now"], - ["text"," = "], - ["support.class","DateTime"], - ["text","."], - ["identifier","now"], - ["text"," "] -],[ - "start", - ["entity.name.tag.haml"," %strong"], - ["text","= now"] -],[ - "embedded_ruby", - ["text"," = "], - ["keyword","if"], - ["text"," "], - ["identifier","now"], - ["text"," "], - ["support.class","DateTime"], - ["text","."], - ["identifier","parse"], - ["text","(\""], - ["support.class","December"], - ["text"," "], - ["constant.numeric","31"], - ["text",", "], - ["constant.numeric","2006"], - ["text","\")"] -],[ - "embedded_ruby", - ["text"," = \""], - ["support.class","Happy"], - ["text"," "], - ["identifier","new"], - ["text"," \" + \""], - ["identifier","year"], - ["text","!\""] -],[ - "start", - ["entity.name.tag.haml","%sfd"], - ["entity.other.attribute-name.class.haml",".dfdfg"] -],[ - "start", - ["punctuation.section.comment","#content"] -],[ - "start", - ["text"," .title"] -],[ - "start", - ["entity.name.tag.haml"," %h1"], - ["text","= @title"] -],[ - "embedded_ruby", - ["text"," = "], - ["support.function","link_to"], - ["text"," '"], - ["support.class","Home"], - ["text","', "], - ["identifier","home_url"] -],[ - "start" -],[ - "start", - ["punctuation.section.comment"," #contents"] -],[ - "start", - ["entity.name.tag.haml","%div"], - ["entity.other.attribute-name.id.haml","#content"] -],[ - "start", - ["entity.name.tag.haml"," %div"], - ["entity.other.attribute-name.class.haml",".articles"] -],[ - "start", - ["entity.name.tag.haml"," %div"], - ["entity.other.attribute-name.class.haml",".article.title"], - ["text"," Blah"] -],[ - "start", - ["entity.name.tag.haml"," %div"], - ["entity.other.attribute-name.class.haml",".article.date"], - ["text"," "], - ["constant.numeric","2006-11-05"] -],[ - "start", - ["entity.name.tag.haml"," %div"], - ["entity.other.attribute-name.class.haml",".article.entry"] -],[ - "start", - ["text"," Neil Patrick Harris "] -],[ - "start" -],[ - "start", - ["entity.name.tag.haml","%div"], - ["text","[@user, "], - ["constant.other.symbol.ruby",":greeting"], - ["text","]"] -],[ - "start", - ["entity.name.tag.haml"," %bar"], - ["text","["], - ["constant.numeric","290"], - ["text","]/"] -],[ - "start", - ["text"," "], - ["string.quoted.double","==Hello!=="] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_handlebars.json b/lib/ace/mode/_test/tokens_handlebars.json deleted file mode 100644 index 1ec79139..00000000 --- a/lib/ace/mode/_test/tokens_handlebars.json +++ /dev/null @@ -1,81 +0,0 @@ -[[ - "start", - ["comment.start","{{!--"], - ["comment"," Ace + :-}} "], - ["comment.end","--}}"] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","div"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","id"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"comments\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["storage.type.start","{{#"], - ["variable.parameter","each"], - ["text"," "], - ["variable.parameter","comments"], - ["storage.type.end","}}"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","h2"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.anchor.tag-name.xml","a"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","href"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"/posts/"], - ["storage.type.start","{{"], - ["text","../"], - ["variable.parameter","permalink"], - ["storage.type.end","}}"], - ["string.attribute-value.xml","#"], - ["storage.type.start","{{"], - ["variable.parameter","id"], - ["storage.type.end","}}"], - ["string.attribute-value.xml","\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["storage.type.start","{{"], - ["variable.parameter","title"], - ["storage.type.end","}}"], - ["meta.tag.punctuation.end-tag-open.xml",""], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","div"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["support.function","{{{"], - ["variable.parameter","body"], - ["support.function","}}}"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["storage.type.start","{{/"], - ["variable.parameter","each"], - ["storage.type.end","}}"] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_haskell.json b/lib/ace/mode/_test/tokens_haskell.json deleted file mode 100644 index 8f9a2b38..00000000 --- a/lib/ace/mode/_test/tokens_haskell.json +++ /dev/null @@ -1,156 +0,0 @@ -[[ - "start", - ["punctuation.definition.comment.haskell","-- Type annotation (optional)"] -],[ - "start", - ["entity.name.function.haskell","fib"], - ["meta.function.type-declaration.haskell"," "], - ["keyword.other.double-colon.haskell","::"], - ["meta.function.type-declaration.haskell"," "], - ["support.type.prelude.haskell","Int"], - ["meta.function.type-declaration.haskell"," "], - ["keyword.other.arrow.haskell","->"], - ["meta.function.type-declaration.haskell"," "], - ["support.type.prelude.haskell","Integer"] -],[ - "start", - ["text"," "] -],[ - "start", - ["punctuation.definition.comment.haskell","-- With self-referencing data"] -],[ - "start", - ["text","fib n "], - ["keyword.operator.haskell","="], - ["text"," fibs "], - ["keyword.operator.haskell","!!"], - ["text"," n"] -],[ - "start", - ["text"," "], - ["keyword.other.haskell","where"], - ["text"," fibs "], - ["keyword.operator.haskell","="], - ["text"," "], - ["constant.numeric.haskell","0"], - ["text"," "], - ["keyword.operator.haskell",":"], - ["text"," "], - ["support.function.prelude.haskell","scanl"], - ["text"," "], - ["entity.name.function.infix.haskell","(+)"], - ["text"," "], - ["constant.numeric.haskell","1"], - ["text"," fibs"] -],[ - "start", - ["text"," "], - ["punctuation.definition.comment.haskell","-- 0,1,1,2,3,5,..."] -],[ - "start", - ["text"," "] -],[ - "start", - ["punctuation.definition.comment.haskell","-- Same, coded directly"] -],[ - "start", - ["text","fib n "], - ["keyword.operator.haskell","="], - ["text"," fibs "], - ["keyword.operator.haskell","!!"], - ["text"," n"] -],[ - "start", - ["text"," "], - ["keyword.other.haskell","where"], - ["text"," fibs "], - ["keyword.operator.haskell","="], - ["text"," "], - ["constant.numeric.haskell","0"], - ["text"," "], - ["keyword.operator.haskell",":"], - ["text"," "], - ["constant.numeric.haskell","1"], - ["text"," "], - ["keyword.operator.haskell",":"], - ["text"," next fibs"] -],[ - "start", - ["text"," next (a "], - ["keyword.operator.haskell",":"], - ["text"," t@(b"], - ["keyword.operator.haskell",":"], - ["text","_)) "], - ["keyword.operator.haskell","="], - ["text"," (a"], - ["keyword.operator.haskell","+"], - ["text","b) "], - ["keyword.operator.haskell",":"], - ["text"," next t"] -],[ - "start", - ["text"," "] -],[ - "start", - ["punctuation.definition.comment.haskell","-- Similar idea, using zipWith"] -],[ - "start", - ["text","fib n "], - ["keyword.operator.haskell","="], - ["text"," fibs "], - ["keyword.operator.haskell","!!"], - ["text"," n"] -],[ - "start", - ["text"," "], - ["keyword.other.haskell","where"], - ["text"," fibs "], - ["keyword.operator.haskell","="], - ["text"," "], - ["constant.numeric.haskell","0"], - ["text"," "], - ["keyword.operator.haskell",":"], - ["text"," "], - ["constant.numeric.haskell","1"], - ["text"," "], - ["keyword.operator.haskell",":"], - ["text"," "], - ["support.function.prelude.haskell","zipWith"], - ["text"," "], - ["entity.name.function.infix.haskell","(+)"], - ["text"," fibs ("], - ["support.function.prelude.haskell","tail"], - ["text"," fibs)"] -],[ - "start", - ["text"," "] -],[ - "start", - ["punctuation.definition.comment.haskell","-- Using a generator function"] -],[ - "start", - ["text","fib n "], - ["keyword.operator.haskell","="], - ["text"," fibs ("], - ["constant.numeric.haskell","0"], - ["punctuation.separator.comma.haskell",","], - ["constant.numeric.haskell","1"], - ["text",") "], - ["keyword.operator.haskell","!!"], - ["text"," n"] -],[ - "start", - ["text"," "], - ["keyword.other.haskell","where"], - ["text"," fibs (a"], - ["punctuation.separator.comma.haskell",","], - ["text","b) "], - ["keyword.operator.haskell","="], - ["text"," a "], - ["keyword.operator.haskell",":"], - ["text"," fibs (b"], - ["punctuation.separator.comma.haskell",","], - ["text","a"], - ["keyword.operator.haskell","+"], - ["text","b)"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_haxe.json b/lib/ace/mode/_test/tokens_haxe.json deleted file mode 100644 index f0f79a48..00000000 --- a/lib/ace/mode/_test/tokens_haxe.json +++ /dev/null @@ -1,143 +0,0 @@ -[[ - "start", - ["keyword","class"], - ["text"," "], - ["identifier","Haxe"], - ["text"," "] -],[ - "start", - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","public"], - ["text"," "], - ["keyword","static"], - ["text"," "], - ["keyword","function"], - ["text"," "], - ["identifier","main"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "] -],[ - "start", - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["comment","// Say Hello!"] -],[ - "start", - ["text"," "], - ["keyword","var"], - ["text"," "], - ["identifier","greeting"], - ["punctuation.operator",":"], - ["keyword","String"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string","\"Hello World\""], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword","trace"], - ["paren.lparen","("], - ["identifier","greeting"], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," "], - ["keyword","var"], - ["text"," "], - ["identifier","targets"], - ["punctuation.operator",":"], - ["keyword","Array"], - ["keyword.operator","<"], - ["keyword","String"], - ["keyword.operator",">"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","["], - ["string","\"Flash\""], - ["punctuation.operator",","], - ["string","\"Javascript\""], - ["punctuation.operator",","], - ["string","\"PHP\""], - ["punctuation.operator",","], - ["string","\"Neko\""], - ["punctuation.operator",","], - ["string","\"C++\""], - ["punctuation.operator",","], - ["string","\"iOS\""], - ["punctuation.operator",","], - ["string","\"Android\""], - ["punctuation.operator",","], - ["string","\"webOS\""], - ["paren.rparen","]"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword","trace"], - ["paren.lparen","("], - ["string","\"Haxe is a great language that can target:\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword","for"], - ["text"," "], - ["paren.lparen","("], - ["identifier","target"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["identifier","targets"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","trace"], - ["text"," "], - ["paren.lparen","("], - ["string","\" - \""], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["identifier","target"], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["keyword","trace"], - ["paren.lparen","("], - ["string","\"And many more!\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["paren.rparen","}"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_html.json b/lib/ace/mode/_test/tokens_html.json deleted file mode 100644 index c5f75eff..00000000 --- a/lib/ace/mode/_test/tokens_html.json +++ /dev/null @@ -1,63 +0,0 @@ -[[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","html"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","scripts"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.script.tag-name.xml","script"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","a"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","'a'"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["storage.type","var"], - ["text"," "], - ["string","\""], - ["meta.tag.punctuation.end-tag-open.xml",""], - ["text.xml","'123'"] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - ["string.attribute-value.xml0","tag_stuff"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.anchor.tag-name.xml","a"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","href"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"abc"] -],[ - "start", - ["string.attribute-value.xml"," def\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - ["string.attribute-value.xml","tag_stuff"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.anchor.tag-name.xml","a"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","href"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","'abc"] -],[ - "start", - ["string.attribute-value.xml","def\\'"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_html_ruby.json b/lib/ace/mode/_test/tokens_html_ruby.json deleted file mode 100644 index 8ff5f6ea..00000000 --- a/lib/ace/mode/_test/tokens_html_ruby.json +++ /dev/null @@ -1,257 +0,0 @@ -[[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","h1"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Listing Books"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","table"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","tr"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","th"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Title"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","th"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Summary"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","th"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","th"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","th"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "] -],[ - "start", - ["support.ruby_tag","<%"], - ["text"," "], - ["variable.instance","@books"], - ["text","."], - ["identifier","each"], - ["text"," "], - ["keyword","do"], - ["text"," |"], - ["identifier","book"], - ["text","| "], - ["support.ruby_tag","%>"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","tr"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["comment.start.erb","<%#"], - ["comment"," comment "], - ["comment.end.erb","%>"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","td"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["support.ruby_tag","<%="], - ["text"," "], - ["identifier","book"], - ["text","."], - ["identifier","title"], - ["text"," "], - ["support.ruby_tag","%>"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","td"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["support.ruby_tag","<%="], - ["text"," "], - ["identifier","book"], - ["text","."], - ["identifier","content"], - ["text"," "], - ["support.ruby_tag","%>"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","td"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["support.ruby_tag","<%="], - ["text"," "], - ["support.function","link_to"], - ["text"," "], - ["string.start","'"], - ["string","Show"], - ["string.end","'"], - ["text",", "], - ["identifier","book"], - ["text"," "], - ["support.ruby_tag","%>"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","td"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["support.ruby_tag","<%="], - ["text"," "], - ["support.function","link_to"], - ["text"," "], - ["string.start","'"], - ["string","Edit"], - ["string.end","'"], - ["text",", "], - ["identifier","edit_book_path"], - ["paren.lparen","("], - ["identifier","book"], - ["paren.rparen",")"], - ["text"," "], - ["support.ruby_tag","%>"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","td"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["support.ruby_tag","<%="], - ["text"," "], - ["support.function","link_to"], - ["text"," "], - ["string.start","'"], - ["string","Remove"], - ["string.end","'"], - ["text",", "], - ["identifier","book"], - ["text",", "], - ["constant.other.symbol.ruby",":confirm"], - ["text"," "], - ["punctuation.separator.key-value","=>"], - ["text"," "], - ["string.start","'"], - ["string","Are you sure?"], - ["string.end","'"], - ["text",", "], - ["constant.other.symbol.ruby",":method"], - ["text"," "], - ["punctuation.separator.key-value","=>"], - ["text"," "], - ["constant.other.symbol.ruby",":delete"], - ["text"," "], - ["support.ruby_tag","%>"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["support.ruby_tag","<%"], - ["text"," "], - ["keyword","end"], - ["text"," "], - ["support.ruby_tag","%>"] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","br"], - ["text.tag-whitespace.xml"," "], - ["meta.tag.punctuation.tag-close.xml","/>"] -],[ - "start", - ["text.xml"," "] -],[ - "start", - ["support.ruby_tag","<%="], - ["text"," "], - ["support.function","link_to"], - ["text"," "], - ["string.start","'"], - ["string","New book"], - ["string.end","'"], - ["text",", "], - ["identifier","new_book_path"], - ["text"," "], - ["support.ruby_tag","%>"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_ini.json b/lib/ace/mode/_test/tokens_ini.json deleted file mode 100644 index 11d28017..00000000 --- a/lib/ace/mode/_test/tokens_ini.json +++ /dev/null @@ -1,23 +0,0 @@ -[[ - "start", - ["punctuation.definition.entity.ini","["], - ["constant.section.group-title.ini",".ShellClassInfo"], - ["punctuation.definition.entity.ini","]"] -],[ - "start", - ["keyword.other.definition.ini","IconResource"], - ["punctuation.separator.key-value.ini","="], - ["text","..\\logo.png"] -],[ - "start", - ["punctuation.definition.entity.ini","["], - ["constant.section.group-title.ini","ViewState"], - ["punctuation.definition.entity.ini","]"] -],[ - "start", - ["keyword.other.definition.ini","FolderType"], - ["punctuation.separator.key-value.ini","="], - ["text","Generic"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_io.json b/lib/ace/mode/_test/tokens_io.json deleted file mode 100644 index b83a675a..00000000 --- a/lib/ace/mode/_test/tokens_io.json +++ /dev/null @@ -1,49 +0,0 @@ -[[ - "start", - ["punctuation.definition.comment.io","//"], - ["comment.line.double-slash.io"," computes factorial of a number"] -],[ - "start", - ["text","factorial "], - ["keyword.operator.io",":="], - ["text"," "], - ["support.function.io","method"], - ["text","(n,"] -],[ - "start", - ["text"," "], - ["keyword.control.io","if"], - ["text","(n "], - ["keyword.operator.io","=="], - ["text"," "], - ["constant.numeric.io","0"], - ["text",", "], - ["keyword.control.io","return"], - ["text"," "], - ["constant.numeric.io","1"], - ["text",")"] -],[ - "start", - ["text"," res "], - ["keyword.operator.io",":="], - ["text"," "], - ["constant.numeric.io","1"] -],[ - "start", - ["text"," "], - ["support.class.io","Range"], - ["text"," "], - ["constant.numeric.io","1"], - ["text"," "], - ["support.function.io","to"], - ["text","(n) "], - ["keyword.control.io","foreach"], - ["text","(i, res "], - ["keyword.operator.io","="], - ["text"," res "], - ["keyword.operator.io","*"], - ["text"," i)"] -],[ - "start", - ["text",")"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_jack.json b/lib/ace/mode/_test/tokens_jack.json deleted file mode 100644 index c3d694dd..00000000 --- a/lib/ace/mode/_test/tokens_jack.json +++ /dev/null @@ -1,1786 +0,0 @@ -[[ - "start", - ["keyword","vars"], - ["text"," "], - ["variable","it"], - ["text",", "], - ["variable","p"] -],[ - "start" -],[ - "start", - ["variable","p"], - ["text"," = "], - ["paren.lparen","{"], - ["variable","label"], - ["text",", "], - ["variable","value"], - ["text","|"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["string","\""], - ["constant.language.escape","\\n"], - ["string","\""], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["variable","label"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["language.builtin","inspect"], - ["paren.lparen","("], - ["variable","value"], - ["paren.rparen","))"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start", - ["comment","-- Create an array from 0 to 15"] -],[ - "start", - ["variable","p"], - ["paren.lparen","("], - ["string","\"range\""], - ["text",", "], - ["language.builtin","i-collect"], - ["paren.lparen","("], - ["language.builtin","range"], - ["paren.lparen","("], - ["constant.numeric","5"], - ["paren.rparen",")))"] -],[ - "start" -],[ - "start", - ["comment","-- Create an array from 0 to 15 and break up in chunks of 4"] -],[ - "start", - ["variable","p"], - ["paren.lparen","("], - ["string","\"chunked range\""], - ["text",", "], - ["language.builtin","i-collect"], - ["paren.lparen","("], - ["language.builtin","i-chunk"], - ["paren.lparen","("], - ["constant.numeric","4"], - ["text",", "], - ["language.builtin","range"], - ["paren.lparen","("], - ["constant.numeric","16"], - ["paren.rparen","))))"] -],[ - "start" -],[ - "start", - ["comment","-- Check if all or none items in stream pass test."] -],[ - "start", - ["variable","p"], - ["paren.lparen","("], - ["string","\"all < 60 in range(60)\""], - ["text",", "], - ["variable","i-all?"], - ["paren.lparen","({"], - ["variable","i"], - ["text","|"], - ["variable","i"], - ["keyword.operator","<"], - ["constant.numeric","60"], - ["paren.rparen","}"], - ["text",", "], - ["language.builtin","range"], - ["paren.lparen","("], - ["constant.numeric","60"], - ["paren.rparen",")))"] -],[ - "start", - ["variable","p"], - ["paren.lparen","("], - ["string","\"any < 60 in range(60)\""], - ["text",", "], - ["variable","i-any?"], - ["paren.lparen","({"], - ["variable","i"], - ["text","|"], - ["variable","i"], - ["keyword.operator",">"], - ["constant.numeric","60"], - ["paren.rparen","}"], - ["text",", "], - ["language.builtin","range"], - ["paren.lparen","("], - ["constant.numeric","60"], - ["paren.rparen",")))"] -],[ - "start", - ["variable","p"], - ["paren.lparen","("], - ["string","\"all < 60 in range(70)\""], - ["text",", "], - ["variable","i-all?"], - ["paren.lparen","({"], - ["variable","i"], - ["text","|"], - ["variable","i"], - ["keyword.operator","<"], - ["constant.numeric","60"], - ["paren.rparen","}"], - ["text",", "], - ["language.builtin","range"], - ["paren.lparen","("], - ["constant.numeric","70"], - ["paren.rparen",")))"] -],[ - "start", - ["variable","p"], - ["paren.lparen","("], - ["string","\"any < 60 in range(70)\""], - ["text",", "], - ["variable","i-any?"], - ["paren.lparen","({"], - ["variable","i"], - ["text","|"], - ["variable","i"], - ["keyword.operator",">"], - ["constant.numeric","60"], - ["paren.rparen","}"], - ["text",", "], - ["language.builtin","range"], - ["paren.lparen","("], - ["constant.numeric","70"], - ["paren.rparen",")))"] -],[ - "start" -],[ - "start", - ["comment","-- Zip three different collections together"] -],[ - "start", - ["variable","p"], - ["paren.lparen","("], - ["string","\"zipped\""], - ["text",", "], - ["language.builtin","i-collect"], - ["paren.lparen","("], - ["language.builtin","i-zip"], - ["paren.lparen","("] -],[ - "start", - ["text"," "], - ["language.builtin","range"], - ["paren.lparen","("], - ["constant.numeric","10"], - ["paren.rparen",")"], - ["text",","] -],[ - "start", - ["text"," "], - ["paren.lparen","["], - ["constant.numeric","1"], - ["text",","], - ["constant.numeric","2"], - ["text",","], - ["constant.numeric","3"], - ["text",","], - ["constant.numeric","4"], - ["text",","], - ["constant.numeric","5"], - ["paren.rparen","]"], - ["text",","] -],[ - "start", - ["text"," "], - ["language.builtin","i-map"], - ["paren.lparen","({"], - ["variable","i"], - ["text","|"], - ["variable","i"], - ["keyword.operator","*"], - ["variable","i"], - ["paren.rparen","}"], - ["text",", "], - ["language.builtin","range"], - ["paren.lparen","("], - ["constant.numeric","10"], - ["paren.rparen","))"] -],[ - "start", - ["paren.rparen",")))"] -],[ - "start" -],[ - "start", - ["keyword","vars"], - ["text"," "], - ["variable","names"], - ["text",", "], - ["variable","person"], - ["text",", "], - ["variable","i"], - ["text",", "], - ["variable","doubles"], - ["text",", "], - ["variable","lengths"], - ["text",", "], - ["variable","cubeRange"] -],[ - "start", - ["variable","names"], - ["text"," = "], - ["paren.lparen","["], - ["string","\"Thorin\""], - ["text",", "], - ["string","\"Dwalin\""], - ["text",", "], - ["string","\"Balin\""], - ["text",", "], - ["string","\"Bifur\""], - ["text",", "], - ["string","\"Bofur\""], - ["text",", "], - ["string","\"Bombur\""], - ["text",", "], - ["string","\"Oin\""], - ["text",","] -],[ - "start", - ["text"," "], - ["string","\"Gloin\""], - ["text",", "], - ["string","\"Ori\""], - ["text",", "], - ["string","\"Nori\""], - ["text",", "], - ["string","\"Dori\""], - ["text",", "], - ["string","\"Fili\""], - ["text",", "], - ["string","\"Kili\""], - ["text",", "], - ["string","\"Bilbo\""], - ["text",", "], - ["string","\"Gandalf\""], - ["paren.rparen","]"] -],[ - "start" -],[ - "start", - ["keyword","for"], - ["text"," "], - ["variable","name"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["variable","names"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","name"], - ["text"," "], - ["keyword.operator","!="], - ["text"," "], - ["string","\"Bilbo\""], - ["text"," "], - ["keyword.operator","&&"], - ["text"," "], - ["variable","name"], - ["text"," "], - ["keyword.operator","!="], - ["text"," "], - ["string","\"Gandalf\""], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["variable","name"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["variable","person"], - ["text"," = "], - ["paren.lparen","{"], - ["variable","name"], - ["text",": "], - ["string","\"Tim\""], - ["text",", "], - ["variable","age"], - ["text",": "], - ["constant.numeric","30"], - ["paren.rparen","}"] -],[ - "start", - ["keyword","for"], - ["text"," "], - ["variable","key"], - ["text",", "], - ["variable","value"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["variable","person"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["variable","key"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","\" = \""], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["variable","value"], - ["paren.rparen",")"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["variable","i"], - ["text"," = "], - ["constant.numeric","0"] -],[ - "start", - ["keyword","while"], - ["text"," "], - ["variable","i"], - ["text"," "], - ["keyword.operator","<"], - ["text"," "], - ["constant.numeric","10"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","i"], - ["text"," = "], - ["variable","i"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric","1"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["variable","i"], - ["paren.rparen",")"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["language.builtin","print"], - ["paren.lparen","("], - ["string","\"range\""], - ["paren.rparen",")"] -],[ - "start", - ["keyword","for"], - ["text"," "], - ["variable","i"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["language.builtin","range"], - ["paren.lparen","("], - ["constant.numeric","10"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["variable","i"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric","1"], - ["paren.rparen",")"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start", - ["keyword","for"], - ["text"," "], - ["variable","i"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["language.builtin","range"], - ["paren.lparen","("], - ["constant.numeric","10"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["constant.numeric","10"], - ["text"," "], - ["keyword.operator","-"], - ["text"," "], - ["variable","i"], - ["paren.rparen",")"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["comment","-- Dynamic object that gives the first 10 doubles"] -],[ - "start", - ["variable","doubles"], - ["text"," = "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["storage.form","@len"], - ["text",": "], - ["paren.lparen","{"], - ["text","| "], - ["constant.numeric","10"], - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["storage.form","@get"], - ["text",": "], - ["paren.lparen","{"], - ["variable","key"], - ["text","|"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","key"], - ["text"," "], - ["keyword","is"], - ["text"," "], - ["storage.type","Integer"], - ["text"," "], - ["paren.lparen","{"], - ["text"," "], - ["variable","key"], - ["text"," "], - ["keyword.operator","*"], - ["text"," "], - ["variable","key"], - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start", - ["language.builtin","print"], - ["paren.lparen","("], - ["string","\"#doubles\""], - ["text",", "], - ["keyword.operator","#"], - ["variable","doubles"], - ["paren.rparen",")"] -],[ - "start" -],[ - "start", - ["language.builtin","print"], - ["paren.lparen","("], - ["string","\"Doubles\""], - ["paren.rparen",")"] -],[ - "start", - ["keyword","for"], - ["text"," "], - ["variable","k"], - ["text",", "], - ["variable","v"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["variable","doubles"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","(["], - ["variable","k"], - ["text",", "], - ["variable","v"], - ["paren.rparen","])"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["comment","-- Dynamic object that has names list as keys and string lenth as values"] -],[ - "start", - ["variable","lengths"], - ["text"," = "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["storage.form","@keys"], - ["text",": "], - ["paren.lparen","{"], - ["text","| "], - ["variable","names"], - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["storage.form","@get"], - ["text",": "], - ["paren.lparen","{"], - ["variable","key"], - ["text","|"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","key"], - ["text"," "], - ["keyword","is"], - ["text"," "], - ["storage.type","String"], - ["text"," "], - ["paren.lparen","{"], - ["text"," "], - ["keyword.operator","#"], - ["variable","key"], - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["language.builtin","print"], - ["text"," "], - ["paren.lparen","("], - ["string","\"Lengths\""], - ["paren.rparen",")"] -],[ - "start", - ["keyword","for"], - ["text"," "], - ["variable","k"], - ["text",", "], - ["variable","v"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["variable","lengths"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","(["], - ["variable","k"], - ["text",", "], - ["variable","v"], - ["paren.rparen","])"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start" -],[ - "start", - ["variable","cubeRange"], - ["text"," = "], - ["paren.lparen","{"], - ["variable","n"], - ["text","|"] -],[ - "start", - ["text"," "], - ["keyword","vars"], - ["text"," "], - ["variable","i"], - ["text",", "], - ["variable","v"] -],[ - "start", - ["text"," "], - ["variable","i"], - ["text"," = "], - ["constant.numeric","0"] -],[ - "start", - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["storage.form","@call"], - ["text",": "], - ["paren.lparen","{"], - ["text","|"] -],[ - "start", - ["text"," "], - ["variable","v"], - ["text"," = "], - ["variable","i"] -],[ - "start", - ["text"," "], - ["variable","i"], - ["text"," = "], - ["variable","i"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric","1"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","v"], - ["text"," "], - ["keyword.operator","<"], - ["text"," "], - ["variable","n"], - ["text"," "], - ["paren.lparen","{"], - ["text"," "], - ["variable","v"], - ["text"," "], - ["keyword.operator","*"], - ["text"," "], - ["variable","v"], - ["text"," "], - ["keyword.operator","*"], - ["text"," "], - ["variable","v"], - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["language.builtin","print"], - ["paren.lparen","("], - ["string","\"Cubes\""], - ["paren.rparen",")"] -],[ - "start", - ["keyword","for"], - ["text"," "], - ["variable","k"], - ["text",", "], - ["variable","v"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["variable","cubeRange"], - ["paren.lparen","("], - ["constant.numeric","5"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","(["], - ["variable","k"], - ["text",", "], - ["variable","v"], - ["paren.rparen","])"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start", - ["language.builtin","print"], - ["paren.lparen","("], - ["string","\"String\""], - ["paren.rparen",")"] -],[ - "start", - ["keyword","for"], - ["text"," "], - ["variable","k"], - ["text",", "], - ["variable","v"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["string","\"Hello World\""], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","(["], - ["variable","k"], - ["text",", "], - ["variable","v"], - ["paren.rparen","])"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start" -],[ - "start", - ["language.builtin","print"], - ["paren.lparen","(["], - ["variable","i"], - ["text"," "], - ["keyword","for"], - ["text"," "], - ["variable","i"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["language.builtin","range"], - ["paren.lparen","("], - ["constant.numeric","10"], - ["paren.rparen",")])"] -],[ - "start", - ["language.builtin","print"], - ["paren.lparen","(["], - ["variable","i"], - ["text"," "], - ["keyword","for"], - ["text"," "], - ["variable","i"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["language.builtin","range"], - ["paren.lparen","("], - ["constant.numeric","20"], - ["paren.rparen",")"], - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","i"], - ["text"," "], - ["keyword.operator","%"], - ["text"," "], - ["constant.numeric","3"], - ["paren.rparen","])"] -],[ - "start" -],[ - "start" -],[ - "start" -],[ - "start", - ["comment","-- Example showing how to do parallel work using split..and"] -],[ - "start", - ["variable","base"], - ["text"," = "], - ["paren.lparen","{"], - ["variable","bootstrap"], - ["text",", "], - ["variable","target-dir"], - ["text","|"] -],[ - "start", - ["text"," "], - ["keyword","split"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","copy"], - ["paren.lparen","("], - ["string","\"res\""], - ["text",", "], - ["variable","target-dir"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"], - ["text"," "], - ["keyword","and"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","newer"], - ["paren.lparen","("], - ["string","\"src/*.less\""], - ["text",", "], - ["variable","target-dir"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","\"/style.css\""], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","lessc"], - ["paren.lparen","("], - ["string","\"src/\""], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["variable","bootstrap"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","\".less\""], - ["text",", "], - ["variable","target-dir"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","\"/style.css\""], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"], - ["text"," "], - ["keyword","and"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","build"], - ["paren.lparen","("], - ["string","\"src/\""], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["variable","bootstrap"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","\".js\""], - ["text",", "], - ["variable","target-dir"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","\"/app.js\""], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start" -],[ - "start", - ["keyword","vars"], - ["text"," "], - ["variable","Dragon"], - ["text",", "], - ["variable","pet"] -],[ - "start" -],[ - "start", - ["variable","Dragon"], - ["text"," = "], - ["paren.lparen","{"], - ["variable","name"], - ["text","|"] -],[ - "start", - ["text"," "], - ["keyword","vars"], - ["text"," "], - ["variable","asleep"], - ["text",", "], - ["variable","stuff-in-belly"], - ["text",", "], - ["variable","stuff-in-intestine"], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","feed"], - ["text",", "], - ["variable","walk"], - ["text",", "], - ["variable","put-to-bed"], - ["text",", "], - ["variable","toss"], - ["text",", "], - ["variable","rock"], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","hungry?"], - ["text",", "], - ["variable","poopy?"], - ["text",", "], - ["variable","passage-of-time"] -],[ - "start" -],[ - "start", - ["text"," "], - ["variable","asleep"], - ["text"," = "], - ["constant.language.boolean","false"] -],[ - "start", - ["text"," "], - ["variable","stuff-in-belly"], - ["text"," = "], - ["constant.numeric","10"], - ["text"," "], - ["comment","-- He's full."] -],[ - "start", - ["text"," "], - ["variable","stuff-in-intestine"], - ["text"," = "], - ["constant.numeric","0"], - ["text"," "], - ["comment","-- He doesn't need to go."] -],[ - "start" -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["variable","name"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","' is born.'"], - ["paren.rparen",")"] -],[ - "start" -],[ - "start", - ["text"," "], - ["variable","feed"], - ["text"," = "], - ["paren.lparen","{"], - ["text","|"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["string","'You feed '"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["variable","name"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","'.'"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["variable","stuff-in-belly"], - ["text"," = "], - ["constant.numeric","10"] -],[ - "start", - ["text"," "], - ["variable","passage-of-time"], - ["paren.lparen","("], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["text"," "], - ["variable","walk"], - ["text"," = "], - ["paren.lparen","{"], - ["text","|"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["string","'You walk '"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["variable","name"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","\".\""], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["variable","stuff-in-intestine"], - ["text"," = "], - ["constant.numeric","0"] -],[ - "start", - ["text"," "], - ["variable","passage-of-time"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["text"," "], - ["variable","put-to-bed"], - ["text"," = "], - ["paren.lparen","{"], - ["text","|"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["string","'You put '"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["variable","name"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","' to bed.'"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["variable","asleep"], - ["text"," = "], - ["constant.language.boolean","true"] -],[ - "start", - ["text"," "], - ["keyword","for"], - ["text"," "], - ["variable","i"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["language.builtin","range"], - ["paren.lparen","("], - ["constant.numeric","3"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","asleep"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","passage-of-time"], - ["paren.lparen","("], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","asleep"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["variable","name"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","' snores, filling the room with smoke.'"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","asleep"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","asleep"], - ["text"," = "], - ["constant.language.boolean","false"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["variable","name"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","' wakes up slowly.'"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["text"," "], - ["variable","toss"], - ["text"," = "], - ["paren.lparen","{"], - ["text","|"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["string","'You toss '"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["variable","name"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","' up into the air.'"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["string","'He giggles, which singes your eyebrows.'"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["variable","passage-of-time"], - ["paren.lparen","("], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["text"," "], - ["variable","rock"], - ["text"," = "], - ["paren.lparen","{"], - ["text","|"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["string","'You rock '"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["variable","name"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","' gently.'"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["variable","asleep"], - ["text"," = "], - ["constant.language.boolean","true"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["string","'He briefly dozes off...'"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["variable","passage-of-time"], - ["paren.lparen","("], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","asleep"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","asleep"], - ["text"," = "], - ["constant.language.boolean","false"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["string","'...but wakes when you stop.'"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["text"," "], - ["variable","hungry?"], - ["text"," = "], - ["paren.lparen","{"], - ["text","|"] -],[ - "start", - ["text"," "], - ["variable","stuff-in-belly"], - ["text"," "], - ["keyword.operator","<="], - ["text"," "], - ["constant.numeric","2"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["text"," "], - ["variable","poopy?"], - ["text"," = "], - ["paren.lparen","{"], - ["text","|"] -],[ - "start", - ["text"," "], - ["variable","stuff-in-intestine"], - ["text"," "], - ["keyword.operator",">="], - ["text"," "], - ["constant.numeric","8"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["text"," "], - ["variable","passage-of-time"], - ["text"," = "], - ["paren.lparen","{"], - ["text","|"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","stuff-in-belly"], - ["text"," "], - ["keyword.operator",">"], - ["text"," "], - ["constant.numeric","0"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["comment","-- Move food from belly to intestine"] -],[ - "start", - ["text"," "], - ["variable","stuff-in-belly"], - ["text"," = "], - ["variable","stuff-in-belly"], - ["text"," "], - ["keyword.operator","-"], - ["text"," "], - ["constant.numeric","1"] -],[ - "start", - ["text"," "], - ["variable","stuff-in-intestine"], - ["text"," = "], - ["variable","stuff-in-intestine"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric","1"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"], - ["text"," "], - ["keyword","else"], - ["text"," "], - ["paren.lparen","{"], - ["text"," "], - ["comment","-- Our dragon is starving!"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","asleep"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","asleep"], - ["text"," = "], - ["constant.language.boolean","false"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["string","'He wakes up suddenly!'"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["variable","name"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","' is starving! In desperation, he ate YOU!'"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["keyword","abort"], - ["text"," "], - ["string","\"died\""] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","stuff-in-intestine"], - ["text"," "], - ["keyword.operator",">="], - ["text"," "], - ["constant.numeric","10"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","stuff-in-intestine"], - ["text"," = "], - ["constant.numeric","0"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["string","'Whoops! '"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["variable","name"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","' had an accident...'"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","hungry?"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","asleep"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","asleep"], - ["text"," = "], - ["constant.language.boolean","false"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["string","'He wakes up suddenly!'"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["variable","name"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","\"'s stomach grumbles...\""], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","poopy?"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","asleep"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","asleep"], - ["text"," = "], - ["constant.language.boolean","false"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["string","'He wakes up suddenly!'"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["language.builtin","print"], - ["paren.lparen","("], - ["variable","name"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","' does the potty dance...'"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["text"," "], - ["comment","-- Export the public interface to this closure object."] -],[ - "start", - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","feed"], - ["text",": "], - ["variable","feed"] -],[ - "start", - ["text"," "], - ["variable","walk"], - ["text",": "], - ["variable","walk"] -],[ - "start", - ["text"," "], - ["variable","put-to-bed"], - ["text",": "], - ["variable","put-to-bed"] -],[ - "start", - ["text"," "], - ["variable","toss"], - ["text",": "], - ["variable","toss"] -],[ - "start", - ["text"," "], - ["variable","rock"], - ["text",": "], - ["variable","rock"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["variable","pet"], - ["text"," = "], - ["variable","Dragon"], - ["paren.lparen","("], - ["string","'Norbert'"], - ["paren.rparen",")"] -],[ - "start", - ["variable","pet"], - ["text","."], - ["variable","feed"], - ["paren.lparen","("], - ["paren.rparen",")"] -],[ - "start", - ["variable","pet"], - ["text","."], - ["variable","toss"], - ["paren.lparen","("], - ["paren.rparen",")"] -],[ - "start", - ["variable","pet"], - ["text","."], - ["variable","walk"], - ["paren.lparen","("], - ["paren.rparen",")"] -],[ - "start", - ["variable","pet"], - ["text","."], - ["variable","put-to-bed"], - ["paren.lparen","("], - ["paren.rparen",")"] -],[ - "start", - ["variable","pet"], - ["text","."], - ["variable","rock"], - ["paren.lparen","("], - ["paren.rparen",")"] -],[ - "start", - ["variable","pet"], - ["text","."], - ["variable","put-to-bed"], - ["paren.lparen","("], - ["paren.rparen",")"] -],[ - "start", - ["variable","pet"], - ["text","."], - ["variable","put-to-bed"], - ["paren.lparen","("], - ["paren.rparen",")"] -],[ - "start", - ["variable","pet"], - ["text","."], - ["variable","put-to-bed"], - ["paren.lparen","("], - ["paren.rparen",")"] -],[ - "start", - ["variable","pet"], - ["text","."], - ["variable","put-to-bed"], - ["paren.lparen","("], - ["paren.rparen",")"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_jade.json b/lib/ace/mode/_test/tokens_jade.json deleted file mode 100644 index 5bf45968..00000000 --- a/lib/ace/mode/_test/tokens_jade.json +++ /dev/null @@ -1,188 +0,0 @@ -[[ - "start", - ["keyword.other.doctype.jade","!!!doctype"] -],[ - "start", - ["keyword.other.doctype.jade","!!!5"] -],[ - "start", - ["keyword.other.doctype.jade","!!!"] -],[ - "start" -],[ - "start", - ["keyword.control.import.include.jade","include"], - ["text"," something"] -],[ - "start" -],[ - "start", - ["keyword.control.import.include.jade"," include"], - ["text"," another_thing"] -],[ - "start" -],[ - "start", - ["punctuation.section.comment"," // let's talk about it"] -],[ - "start" -],[ - ["comment_block",0,"start"], - ["comment","// "] -],[ - ["comment_block",0,"start"], - ["comment"," here it is. a block comment!"] -],[ - ["comment_block",0,"start"], - ["comment"," and another row!"] -],[ - "start", - ["meta.tag.any.jade","but"], - ["text"," not here."] -],[ - "start" -],[ - ["comment_block",5,"start"], - ["comment"," // "] -],[ - ["comment_block",5,"start"], - ["comment"," a far spaced"] -],[ - "start", - ["text"," should be lack of block"] -],[ - "start" -],[ - "start", - ["punctuation.section.comment"," // also not a comment"] -],[ - "start", - ["meta.tag.any.jade"," div"], - ["entity.other.attribute-name.class.jade",".attemptAtBlock"] -],[ - "start", - ["text"," "] -],[ - "start", - ["meta.tag.any.jade"," span"], - ["entity.other.attribute-name.id.jade","#myName"] -],[ - "start" -],[ - "start", - ["text"," "], - ["string.interpolated.jade","#{implicit}"] -],[ - "start", - ["text"," "], - ["string.interpolated.jade","!{more_explicit}"] -],[ - "start" -],[ - "start", - ["text"," "], - ["suport.type.attribute.id.jade","#idDiv"] -],[ - "start" -],[ - "start", - ["text"," "], - ["suport.type.attribute.class.jade",".idDiv"] -],[ - "start" -],[ - "start", - ["meta.tag.any.jade"," test"], - ["punctuation","("], - ["entity.other.attribute-name.jade","id"], - ["text","="], - ["string","\"tag\""], - ["punctuation",")"] -],[ - "start", - ["meta.tag.any.jade"," header"], - ["punctuation","("], - ["entity.other.attribute-name.jade","id"], - ["text","="], - ["string","\"tag\""], - ["text",", "], - ["entity.other.attribute-name.jade","blah"], - ["text","="], - ["string","\"foo\""], - ["text",", "], - ["entity.other.attribute-name.jade","meh"], - ["text","="], - ["string","\"aads\""], - ["punctuation",")"] -],[ - "start", - ["storage.type.function.jade","mixin"], - ["entity.name.function.jade"," article"], - ["punctuation.definition.parameters.begin.jade","("], - ["variable.parameter.function.jade","obj, parents"], - ["punctuation.definition.parameters.end.jade",")"] -],[ - "start" -],[ - "start", - ["storage.type.function.jade"," mixin"], - ["entity.name.function.jade"," bleh"], - ["punctuation.definition.parameters.begin.jade","("], - ["punctuation.definition.parameters.end.jade",")"] -],[ - "start" -],[ - "start", - ["storage.type.function.jade"," mixin"], - ["entity.name.function.jade"," clever-name"] -],[ - "start" -],[ - "start", - ["source.js.embedded.jade"," -"], - ["storage.type","var"], - ["text"," "], - ["identifier","x"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string","\"0\""], - ["text",";"] -],[ - "start", - ["source.js.embedded.jade"," -"], - ["text"," "], - ["identifier","y"], - ["text"," "], - ["identifier","each"], - ["text"," z"] -],[ - "start" -],[ - "start", - ["source.js.embedded.jade"," -"], - ["text"," "], - ["storage.type","var"], - ["text"," "], - ["identifier","items"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","["], - ["string","\"one\""], - ["punctuation.operator",","], - ["text"," "], - ["string","\"two\""], - ["punctuation.operator",","], - ["text"," "], - ["string","\"three\""], - ["text","]"] -],[ - "start", - ["meta.tag.any.jade"," each"], - ["text"," item in items"] -],[ - "start", - ["meta.tag.any.jade"," li"], - ["text","= item"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_java.json b/lib/ace/mode/_test/tokens_java.json deleted file mode 100644 index 799ebdb5..00000000 --- a/lib/ace/mode/_test/tokens_java.json +++ /dev/null @@ -1,95 +0,0 @@ -[[ - "start", - ["keyword","public"], - ["text"," "], - ["keyword","class"], - ["text"," "], - ["identifier","InfiniteLoop"], - ["text"," "], - ["lparen","{"] -],[ - "start" -],[ - "comment", - ["text"," "], - ["comment","/*"] -],[ - "comment", - ["comment"," * This will cause the program to hang..."] -],[ - "comment", - ["comment"," *"] -],[ - "comment", - ["comment"," * Taken from:"] -],[ - "comment", - ["comment"," * http://www.exploringbinary.com/java-hangs-when-converting-2-2250738585072012e-308/"] -],[ - "start", - ["comment"," */"] -],[ - "start", - ["text"," "], - ["keyword","public"], - ["text"," "], - ["keyword","static"], - ["text"," "], - ["keyword","void"], - ["text"," "], - ["identifier","main"], - ["lparen","("], - ["support.function","String"], - ["lparen","["], - ["rparen","]"], - ["text"," "], - ["identifier","args"], - ["rparen",")"], - ["text"," "], - ["lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","double"], - ["text"," "], - ["identifier","d"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["support.function","Double"], - ["text","."], - ["identifier","parseDouble"], - ["lparen","("], - ["string","\"2.2250738585072012e-308\""], - ["rparen",")"], - ["text",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["comment","// unreachable code"] -],[ - "start", - ["text"," "], - ["support.function","System"], - ["text","."], - ["identifier","out"], - ["text","."], - ["identifier","println"], - ["lparen","("], - ["string","\"Value: \""], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["identifier","d"], - ["rparen",")"], - ["text",";"] -],[ - "start", - ["text"," "], - ["rparen","}"] -],[ - "start", - ["rparen","}"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_javascript.json b/lib/ace/mode/_test/tokens_javascript.json deleted file mode 100644 index 1be3f605..00000000 --- a/lib/ace/mode/_test/tokens_javascript.json +++ /dev/null @@ -1,593 +0,0 @@ -[[ - "start", - ["comment","//test: tokenize 'standard' functions"] -],[ - "no_regex", - ["identifier","string"], - ["punctuation.operator","."], - ["support.function","charCodeAt"], - ["paren.lparen","("], - ["constant.numeric","23"], - ["paren.rparen",")"], - ["punctuation.operator",";"], - ["text"," "], - ["variable.language","document"], - ["punctuation.operator","."], - ["support.function.dom","getElementById"], - ["paren.lparen","("], - ["string","'test'"], - ["paren.rparen",")"], - ["punctuation.operator",";"], - ["text"," "], - ["storage.type","console"], - ["punctuation.operator","."], - ["support.function.firebug","log"], - ["paren.lparen","("], - ["string","'Here it is'"], - ["paren.rparen",")"], - ["punctuation.operator",";"], - ["string","\";"] -],[ - "no_regex", - ["identifier","test"], - ["punctuation.operator",":"], - ["text"," "], - ["comment.doc","/**tokenize doc*/"], - ["text"," "], - ["identifier","comment"] -],[ - "no_regex", - ["comment.doc","/**tokenize doc comment with "], - ["comment.doc.tag","@tag"], - ["comment.doc"," {}*/"] -],[ - "no_regex", - ["comment","//test: tokenize parens"] -],[ - "start", - ["text"," "], - ["storage.type","var"], - ["text"," "], - ["identifier","line"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string","\"[{( )}]\""], - ["punctuation.operator",";"] -],[ - "start", - ["comment","//test tokenize arithmetic expression which looks like a regexp"] -],[ - "no_regex", - ["identifier","a"], - ["keyword.operator","/"], - ["identifier","b"], - ["keyword.operator","/"], - ["identifier","c"] -],[ - "no_regex", - ["identifier","a"], - ["keyword.operator","/="], - ["identifier","b"], - ["keyword.operator","/"], - ["identifier","c"] -],[ - "no_regex", - ["comment","//test tokenize reg exps"] -],[ - "no_regex", - ["identifier","a"], - ["keyword.operator","="], - ["string.regexp","/b/g"] -],[ - "no_regex", - ["identifier","a"], - ["keyword.operator","+"], - ["string.regexp","/b/g"] -],[ - "no_regex", - ["identifier","a"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","1"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string.regexp","/2 "], - ["constant.language.escape","+"], - ["string.regexp"," 1/gimyx"], - ["identifier","k"] -],[ - "no_regex", - ["identifier","a"], - ["keyword.operator","="], - ["string.regexp","/a/"], - ["text"," "], - ["keyword.operator","/"], - ["text"," "], - ["string.regexp","/a/"] -],[ - "no_regex", - ["keyword","case"], - ["text"," "], - ["string.regexp","/a/"], - ["punctuation.operator","."], - ["support.function","test"], - ["paren.lparen","("], - ["identifier","c"], - ["paren.rparen",")"] -],[ - "no_regex", - ["comment","//test tokenize multi-line comment containing a single line comment"] -],[ - "no_regex", - ["identifier","noRegex"] -],[ - "no_regex", - ["comment","/* foo // bar */"] -],[ - "start", - ["identifier","canBeRegex"], - ["punctuation.operator",";"] -],[ - "start", - ["comment","/* foo // bar */"] -],[ - "start", - ["comment","// test tokenize identifier with umlauts"] -],[ - "no_regex", - ["identifier","fu"], - ["punctuation.operator","?"], - ["identifier","e"] -],[ - "no_regex", - ["comment","// test // is not a regexp"] -],[ - "start", - ["paren.lparen","{"], - ["text"," "], - ["comment","// 123"] -],[ - "start", - ["comment","//test skipping escaped chars"] -],[ - "no_regex", - ["string","'Meh"], - ["constant.language.escape","\\\\"], - ["string","nNeh'"] -],[ - "no_regex", - ["storage.type","console"], - ["punctuation.operator","."], - ["support.function.firebug","log"], - ["paren.lparen","("], - ["string","'"], - ["constant.language.escape","\\\\"], - ["string","u1232Feh'"] -],[ - "qqstring", - ["string","\"test multiline\\"] -],[ - "no_regex", - ["string"," strings\""] -],[ - "no_regex", - ["identifier","a"], - ["keyword.operator","="], - ["text","'"] -],[ - "qqstring", - ["identifier","b"], - ["keyword.operator","="], - ["string","\"\\"] -],[ - "no_regex", - ["string","still a string"] -],[ - "no_regex", - ["text"," "] -],[ - "no_regex", - ["text"," "] -],[ - "start", - ["storage.type","function"], - ["text"," "], - ["entity.name.function","foo"], - ["paren.lparen","("], - ["variable.parameter","items"], - ["punctuation.operator",", "], - ["variable.parameter","nada"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","for"], - ["text"," "], - ["paren.lparen","("], - ["storage.type","var"], - ["text"," "], - ["identifier","i"], - ["keyword.operator","="], - ["constant.numeric","0"], - ["punctuation.operator",";"], - ["text"," "], - ["identifier","i"], - ["keyword.operator","<"], - ["identifier","items"], - ["punctuation.operator","."], - ["support.constant","length"], - ["punctuation.operator",";"], - ["text"," "], - ["identifier","i"], - ["keyword.operator","++"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["support.function","alert"], - ["paren.lparen","("], - ["identifier","items"], - ["paren.lparen","["], - ["identifier","i"], - ["paren.rparen","]"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","\"juhu"], - ["constant.language.escape","\\n"], - ["string","\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "no_regex", - ["text"," "], - ["paren.rparen","}"], - ["text","\t"], - ["comment","// Real Tab."] -],[ - "no_regex", - ["paren.rparen","}"] -],[ - "no_regex" -],[ - "no_regex", - ["identifier","regexp"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string.regexp","/p"], - ["constant.language.delimiter","|"], - ["string.regexp","p/"], - ["text"," "], - ["comment","// ends here"] -],[ - "no_regex" -],[ - "no_regex", - ["identifier","r"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string.regexp","/d"], - ["constant.language.escape","{1,2}?"], - ["string.regexp","f{e}"], - ["invalid","++"], - ["string.regexp","r"], - ["constant.language.escape","*?"], - ["regexp.keyword.operator","\\d"], - ["constant.language.escape","+?[]"], - ["string.regexp","r"], - ["constant.language.escape","[^"], - ["string.regexp.charachterclass","r"], - ["constant.language.escape","-"], - ["string.regexp.charachterclass","o"], - ["regexp.charclass.keyword.operator","\\f\\f"], - ["string.regexp.charachterclass","["], - ["regexp.charclass.keyword.operator","\\f"], - ["constant.language.escape","]?"], - ["string.regexp","r"], - ["invalid","{7}+"], - ["string.regexp","r"], - ["regexp.keyword.operator","\\{"], - ["string.regexp","7}"], - ["constant.language.escape","+"], - ["string.regexp","rr--rr"], - ["constant.language.escape","$^(?:"], - ["string.regexp","d"], - ["constant.language.delimiter","|"], - ["string.regexp","s"], - ["constant.language.escape",")(?="], - ["string.regexp","a"], - ["constant.language.delimiter","|"], - ["constant.language.escape",")(?!"], - ["string.regexp","y"], - ["constant.language.escape",")[]"], - ["constant.language.delimiter","|"], - ["invalid","$?"], - ["constant.language.delimiter","|"], - ["invalid","^*"], - ["string.regexp","/"], - ["text"," "], - ["identifier","o"] -],[ - "no_regex", - ["identifier","a"], - ["keyword.operator","="], - ["string.regexp","/a/"], - ["text"," "], - ["identifier","jk"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string.regexp","/ /"], - ["text"," "], - ["keyword.operator","/"], - ["text"," "], - ["string.regexp","/ /"] -],[ - "no_regex", - ["text"," "], - ["comment.doc","/************************************/"] -],[ - "no_regex", - ["comment.doc","/** total mess, tricky to highlight**/"] -],[ - "no_regex" -],[ - "start", - ["storage.type","function"], - ["text"," "], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "doc-start", - ["text","\t"], - ["comment.doc","/**"] -],[ - "doc-start", - ["comment.doc","\t * docComment"] -],[ - "no_regex", - ["comment.doc","\t **/"] -],[ - "no_regex", - ["text","\t"], - ["identifier","r"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string.regexp","/u"], - ["regexp.keyword.operator","\\t"], - ["constant.language.escape","*"], - ["string.regexp","/"] -],[ - "no_regex", - ["text","\t"], - ["identifier","g"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","1."], - ["text","00"], - ["identifier","E"], - ["keyword.operator","^"], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["text"," "], - ["identifier","y"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","1.2"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["punctuation.operator","."], - ["constant.numeric","2"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric","052"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric","0x25"] -],[ - "no_regex", - ["text","\t"], - ["identifier","t"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","["], - ["string","'d'"], - ["punctuation.operator",","], - ["text"," "], - ["string","''"], - ["paren.rparen","]"] -],[ - "no_regex", - ["paren.rparen","}"] -],[ - "start", - ["storage.type","function"], - ["text"," "], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text","\t"], - ["comment","/* eee */"] -],[ - "no_regex", - ["paren.rparen","}"] -],[ - "no_regex" -],[ - "qqstring", - ["string","\"s\\"] -],[ - "no_regex", - ["string","s"], - ["constant.language.escape","\\u7824"], - ["string","sss"], - ["constant.language.escape","\\u"], - ["string","1\""] -],[ - "no_regex" -],[ - "qstring", - ["string","'\\"] -],[ - "no_regex", - ["string","string'"] -],[ - "no_regex" -],[ - "no_regex", - ["text","'"] -],[ - "no_regex", - ["identifier","string"], - ["text","'"] -],[ - "no_regex" -],[ - "no_regex", - ["string","\"trailing space"], - ["constant.language.escape","\\ "], - ["string"," "] -],[ - "no_regex", - ["string","\" \""], - ["text"," "], - ["keyword.operator","/"], - ["identifier","not"], - ["text"," "], - ["identifier","a"], - ["text"," "], - ["identifier","regexp"], - ["keyword.operator","/"], - ["identifier","g"] -],[ - "no_regex" -],[ - "doc-start", - ["comment.doc","/**"] -],[ - "doc-start", - ["comment.doc"," *doc"] -],[ - "no_regex", - ["comment.doc"," */"] -],[ - "no_regex" -],[ - "start", - ["identifier","a"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text","\t"], - ["string","'a'"], - ["punctuation.operator",":"], - ["text"," "], - ["identifier","b"], - ["punctuation.operator",","] -],[ - "no_regex", - ["text","\t"], - ["string","'g'"], - ["text",":"], - ["text"," "], - ["storage.type","function"], - ["paren.lparen","("], - ["variable.parameter","t"], - ["paren.rparen",")"] -],[ - "no_regex", - ["text","\t"], - ["entity.name.function","gta"], - ["punctuation.operator",":"], - ["storage.type","function"], - ["paren.lparen","("], - ["variable.parameter","a"], - ["punctuation.operator",","], - ["variable.parameter","b"], - ["paren.rparen",")"] -],[ - "no_regex", - ["paren.rparen","}"] -],[ - "no_regex" -],[ - "no_regex" -],[ - "function_arguments", - ["identifier","foo"], - ["punctuation.operator","."], - ["storage.type","protoype"], - ["punctuation.operator","."], - ["entity.name.function","d"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["storage.type","function"], - ["paren.lparen","("], - ["variable.parameter","a"], - ["punctuation.operator",", "], - ["variable.parameter","b"], - ["punctuation.operator",","] -],[ - "no_regex", - ["punctuation.operator"," "], - ["variable.parameter","c"], - ["punctuation.operator",", "], - ["variable.parameter","d"], - ["paren.rparen",")"] -],[ - "no_regex", - ["storage.type","foo"], - ["punctuation.operator","."], - ["entity.name.function","d"], - ["text"," "], - ["keyword.operator","="], - ["storage.type","function"], - ["paren.lparen","("], - ["variable.parameter","a"], - ["punctuation.operator",", "], - ["variable.parameter","b"], - ["paren.rparen",")"] -],[ - "no_regex", - ["storage.type","foo"], - ["punctuation.operator","."], - ["entity.name.function","d"], - ["text"," "], - ["keyword.operator","="], - ["storage.type","function"], - ["paren.lparen","("], - ["variable.parameter","a"], - ["punctuation.operator",", "], - ["comment.doc","/*****/"], - ["text"," "], - ["identifier","d"], - ["string","\"string\""], - ["text"," "] -],[ - "no_regex" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_json.json b/lib/ace/mode/_test/tokens_json.json deleted file mode 100644 index 4420a740..00000000 --- a/lib/ace/mode/_test/tokens_json.json +++ /dev/null @@ -1,412 +0,0 @@ -[[ - "start", - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","\"query\""], - ["text",": "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","\"count\""], - ["text",": "], - ["constant.numeric","10"], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"created\""], - ["text",": "], - ["string","\"2011-06-21T08:10:46Z\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"lang\""], - ["text",": "], - ["string","\"en-US\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"results\""], - ["text",": "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","\"photo\""], - ["text",": "], - ["paren.lparen","["] -],[ - "start", - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","\"farm\""], - ["text",": "], - ["string","\"6\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"id\""], - ["text",": "], - ["string","\"5855620975\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"isfamily\""], - ["text",": "], - ["string","\"0\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"isfriend\""], - ["text",": "], - ["string","\"0\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"ispublic\""], - ["text",": "], - ["string","\"1\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"owner\""], - ["text",": "], - ["string","\"32021554@N04\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"secret\""], - ["text",": "], - ["string","\"f1f5e8515d\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"server\""], - ["text",": "], - ["string","\"5110\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"title\""], - ["text",": "], - ["string","\"7087 bandit cat\""] -],[ - "start", - ["text"," "], - ["paren.rparen","}"], - ["text",","] -],[ - "start", - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","\"farm\""], - ["text",": "], - ["string","\"4\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"id\""], - ["text",": "], - ["string","\"5856170534\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"isfamily\""], - ["text",": "], - ["string","\"0\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"isfriend\""], - ["text",": "], - ["string","\"0\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"ispublic\""], - ["text",": "], - ["string","\"1\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"owner\""], - ["text",": "], - ["string","\"32021554@N04\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"secret\""], - ["text",": "], - ["string","\"ff1efb2a6f\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"server\""], - ["text",": "], - ["string","\"3217\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"title\""], - ["text",": "], - ["string","\"6975 rusty cat\""] -],[ - "start", - ["text"," "], - ["paren.rparen","}"], - ["text",","] -],[ - "start", - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","\"farm\""], - ["text",": "], - ["string","\"6\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"id\""], - ["text",": "], - ["string","\"5856172972\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"isfamily\""], - ["text",": "], - ["string","\"0\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"isfriend\""], - ["text",": "], - ["string","\"0\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"ispublic\""], - ["text",": "], - ["string","\"1\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"owner\""], - ["text",": "], - ["string","\"51249875@N03\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"secret\""], - ["text",": "], - ["string","\"6c6887347c\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"server\""], - ["text",": "], - ["string","\"5192\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"title\""], - ["text",": "], - ["string","\"watermarked-cats\""] -],[ - "start", - ["text"," "], - ["paren.rparen","}"], - ["text",","] -],[ - "start", - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","\"farm\""], - ["text",": "], - ["string","\"6\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"id\""], - ["text",": "], - ["string","\"5856168328\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"isfamily\""], - ["text",": "], - ["string","\"0\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"isfriend\""], - ["text",": "], - ["string","\"0\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"ispublic\""], - ["text",": "], - ["string","\"1\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"owner\""], - ["text",": "], - ["string","\"32021554@N04\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"secret\""], - ["text",": "], - ["string","\"0c1cfdf64c\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"server\""], - ["text",": "], - ["string","\"5078\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"title\""], - ["text",": "], - ["string","\"7020 mandy cat\""] -],[ - "start", - ["text"," "], - ["paren.rparen","}"], - ["text",","] -],[ - "start", - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","\"farm\""], - ["text",": "], - ["string","\"3\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"id\""], - ["text",": "], - ["string","\"5856171774\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"isfamily\""], - ["text",": "], - ["string","\"0\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"isfriend\""], - ["text",": "], - ["string","\"0\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"ispublic\""], - ["text",": "], - ["string","\"1\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"owner\""], - ["text",": "], - ["string","\"32021554@N04\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"secret\""], - ["text",": "], - ["string","\"7f5a3180ab\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"server\""], - ["text",": "], - ["string","\"2696\""], - ["text",","] -],[ - "start", - ["text"," "], - ["variable","\"title\""], - ["text",": "], - ["string","\"7448 bobby cat\""] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","]"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["paren.rparen","}"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_jsoniq.json b/lib/ace/mode/_test/tokens_jsoniq.json deleted file mode 100644 index 0f4ee6e9..00000000 --- a/lib/ace/mode/_test/tokens_jsoniq.json +++ /dev/null @@ -1,4 +0,0 @@ -[[ - "[\"start\"]", - ["support.function","TODO"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_jsp.json b/lib/ace/mode/_test/tokens_jsp.json deleted file mode 100644 index 25d3af4d..00000000 --- a/lib/ace/mode/_test/tokens_jsp.json +++ /dev/null @@ -1,435 +0,0 @@ -[[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","html"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","body"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "js-start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.script.tag-name.xml","script"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "js-start", - ["text"," "], - ["storage.type","var"], - ["text"," "], - ["identifier","x"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string","\"abc\""], - ["punctuation.operator",";"] -],[ - "js-start", - ["text"," "], - ["storage.type","function"], - ["text"," "], - ["identifier","y"], - ["text"," "], - ["paren.lparen","{"] -],[ - "js-no_regex", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "css-start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.style.tag-name.xml","style"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - ["css-ruleset","css-start"], - ["text"," "], - ["variable",".class"], - ["text"," "], - ["paren.lparen","{"] -],[ - ["css-ruleset","css-start"], - ["text"," "], - ["support.type","background"], - ["text",": "], - ["constant.numeric","#124356"], - ["text",";"] -],[ - "css-start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","p"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," Today's date: "], - ["meta.tag","<%"], - ["keyword.operator","="], - ["text"," "], - ["lparen","("], - ["keyword","new"], - ["text"," "], - ["identifier","java"], - ["text","."], - ["identifier","util"], - ["text","."], - ["identifier","Date"], - ["lparen","("], - ["rparen","))"], - ["text","."], - ["identifier","toLocaleString"], - ["lparen","("], - ["rparen",")"], - ["meta.tag","%>"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag","<%"], - ["keyword.operator","!"], - ["text"," "], - ["keyword","int"], - ["text"," "], - ["identifier","i"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","0"], - ["text","; "], - ["meta.tag","%>"] -],[ - "jsp-start", - ["text.xml"," "], - ["meta.tag",""] -],[ - "jsp-start", - ["text"," "], - ["keyword","int"], - ["text"," "], - ["identifier","j"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","10"], - ["text",";"] -],[ - "start", - ["text"," "], - ["meta.tag",""] -],[ - "start" -],[ - "start", - ["text.xml"," "], - ["comment","<%-- This is JSP comment --%>"] -],[ - "start", - ["text.xml"," "], - ["meta.tag","<%@"], - ["text"," "], - ["identifier","directive"], - ["text"," "], - ["identifier","attribute"], - ["keyword.operator","="], - ["string","\"value\""], - ["text"," "], - ["meta.tag","%>"] -],[ - "start" -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","h2"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Select Languages:"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.form.tag-name.xml","form"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","ACTION"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"jspCheckBox.jsp\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.form.tag-name.xml","input"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","type"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"checkbox\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","name"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"id\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","value"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"Java\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml"," Java"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","BR"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.form.tag-name.xml","input"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","type"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"checkbox\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","name"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"id\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","value"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\".NET\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml"," .NET"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","BR"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.form.tag-name.xml","input"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","type"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"checkbox\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","name"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"id\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","value"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"PHP\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml"," PHP"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","BR"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.form.tag-name.xml","input"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","type"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"checkbox\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","name"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"id\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","value"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"C/C++\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml"," C/C++"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","BR"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.form.tag-name.xml","input"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","type"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"checkbox\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","name"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"id\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","value"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"PERL\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml"," PERL "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","BR"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.form.tag-name.xml","input"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","type"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"submit\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","value"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"Submit\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "jsp-start", - ["text.xml"," "], - ["meta.tag","<%"] -],[ - "jsp-start", - ["text"," "], - ["support.function","String"], - ["text"," "], - ["identifier","select"], - ["lparen","["], - ["rparen","]"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["variable.language","request"], - ["text","."], - ["identifier","getParameterValues"], - ["lparen","("], - ["string","\"id\""], - ["rparen",")"], - ["text","; "] -],[ - "jsp-start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["lparen","("], - ["identifier","select"], - ["text"," "], - ["keyword.operator","!="], - ["text"," "], - ["constant.language","null"], - ["text"," "], - ["keyword.operator","&&"], - ["text"," "], - ["identifier","select"], - ["text","."], - ["identifier","length"], - ["text"," "], - ["keyword.operator","!="], - ["text"," "], - ["constant.numeric","0"], - ["rparen",")"], - ["text"," "], - ["lparen","{"] -],[ - "jsp-start", - ["text"," "], - ["variable.language","out"], - ["text","."], - ["identifier","println"], - ["lparen","("], - ["string","\"You have selected: \""], - ["rparen",")"], - ["text",";"] -],[ - "jsp-start", - ["text"," "], - ["keyword","for"], - ["text"," "], - ["lparen","("], - ["keyword","int"], - ["text"," "], - ["identifier","i"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","0"], - ["text","; "], - ["identifier","i"], - ["text"," "], - ["keyword.operator","<"], - ["text"," "], - ["identifier","select"], - ["text","."], - ["identifier","length"], - ["text","; "], - ["identifier","i"], - ["keyword.operator","++"], - ["rparen",")"], - ["text"," "], - ["lparen","{"] -],[ - "jsp-start", - ["text"," "], - ["variable.language","out"], - ["text","."], - ["identifier","println"], - ["lparen","("], - ["identifier","select"], - ["lparen","["], - ["identifier","i"], - ["rparen","])"], - ["text","; "] -],[ - "jsp-start", - ["text"," "], - ["rparen","}"] -],[ - "jsp-start", - ["text"," "], - ["rparen","}"] -],[ - "start", - ["text"," "], - ["meta.tag","%>"] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_jsx.json b/lib/ace/mode/_test/tokens_jsx.json deleted file mode 100644 index d1a740b0..00000000 --- a/lib/ace/mode/_test/tokens_jsx.json +++ /dev/null @@ -1,51 +0,0 @@ -[[ - "comment", - ["comment","/*EXPECTED"] -],[ - "comment", - ["comment","hello world!"] -],[ - "start", - ["comment","*/"] -],[ - "start", - ["keyword","class"], - ["text"," "], - ["language.support.class","Test"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","static"], - ["text"," "], - ["storage.type","function"], - ["text"," "], - ["entity.name.function","run"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["punctuation.operator",":"], - ["text"," "], - ["keyword","void"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["comment","// console.log(\"hello world!\");"] -],[ - "start", - ["text"," "], - ["keyword","log"], - ["text"," "], - ["string","\"hello world!\""], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["paren.rparen","}"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_julia.json b/lib/ace/mode/_test/tokens_julia.json deleted file mode 100644 index 5aaef6f9..00000000 --- a/lib/ace/mode/_test/tokens_julia.json +++ /dev/null @@ -1,111 +0,0 @@ -[[ - "start", - ["keyword.control.julia","for"], - ["text"," op "], - ["keyword.operator.update.julia","="], - ["text"," ("], - ["keyword.operator.ternary.julia",":"], - ["keyword.operator.arithmetic.julia","+"], - ["text",", "], - ["keyword.operator.ternary.julia",":"], - ["keyword.operator.arithmetic.julia","*"], - ["text",", "], - ["keyword.operator.ternary.julia",":"], - ["keyword.operator.bitwise.julia","&"], - ["text",", "], - ["keyword.operator.ternary.julia",":"], - ["keyword.operator.bitwise.julia","|"], - ["text",", "], - ["keyword.operator.ternary.julia",":"], - ["keyword.operator.interpolation.julia","$"], - ["text",")"] -],[ - "start", - ["text"," "], - ["variable.macro.julia","@eval"], - ["text"," ("], - ["keyword.operator.interpolation.julia","$"], - ["text","op)(a,b,c) "], - ["keyword.operator.update.julia","="], - ["text"," ("], - ["keyword.operator.interpolation.julia","$"], - ["text","op)(("], - ["keyword.operator.interpolation.julia","$"], - ["text","op)(a,b),c)"] -],[ - "start", - ["keyword.control.julia","end"] -],[ - "start" -],[ - "start", - ["text","v "], - ["keyword.operator.update.julia","="], - ["text"," "], - ["variable","α"], - ["keyword.operator.transposed-variable.julia","'"], - ["text",";"] -],[ - "start", - ["keyword.other.julia","function"], - ["meta.function.julia"," "], - ["entity.name.function.julia","g"], - ["text","("], - ["text","x,y)"] -],[ - "start", - ["text"," "], - ["keyword.control.julia","return"], - ["text"," x "], - ["keyword.operator.arithmetic.julia","*"], - ["text"," y"] -],[ - "start", - ["text"," x "], - ["keyword.operator.arithmetic.julia","+"], - ["text"," y"] -],[ - "start", - ["keyword.control.julia","end"] -],[ - "start" -],[ - "start", - ["support.function.julia","cd"], - ["text","("], - ["punctuation.definition.string.begin.julia","\""], - ["string.quoted.double.julia","data"], - ["punctuation.definition.string.end.julia","\""], - ["text",") "], - ["keyword.control.julia","do"] -],[ - "start", - ["text"," "], - ["support.function.julia","open"], - ["text","("], - ["punctuation.definition.string.begin.julia","\""], - ["string.quoted.double.julia","outfile"], - ["punctuation.definition.string.end.julia","\""], - ["text",", "], - ["punctuation.definition.string.begin.julia","\""], - ["string.quoted.double.julia","w"], - ["punctuation.definition.string.end.julia","\""], - ["text",") "], - ["keyword.control.julia","do"], - ["text"," f"] -],[ - "start", - ["text"," "], - ["support.function.julia","write"], - ["text","("], - ["text","f, data)"] -],[ - "start", - ["text"," "], - ["keyword.control.julia","end"] -],[ - "start", - ["keyword.control.julia","end"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_latex.json b/lib/ace/mode/_test/tokens_latex.json deleted file mode 100644 index 52508e0d..00000000 --- a/lib/ace/mode/_test/tokens_latex.json +++ /dev/null @@ -1,127 +0,0 @@ -[[ - "start", - ["keyword","\\usepackage"], - ["lparen","{"], - ["storage.type","amsmath"], - ["rparen","}"] -],[ - "start", - ["storage.type","\\title"], - ["lparen","{"], - ["storage.type","\\LaTeX"], - ["rparen","}"] -],[ - "start", - ["storage.type","\\date"], - ["lparen","{"], - ["rparen","}"] -],[ - "start", - ["storage.type","\\begin"], - ["lparen","{"], - ["variable.parameter","document"], - ["rparen","}"] -],[ - "start", - ["text"," "], - ["storage.type","\\maketitle"] -],[ - "start", - ["text"," "], - ["storage.type","\\LaTeX"], - ["lparen","{"], - ["rparen","}"], - ["text"," is a document preparation system for the "], - ["storage.type","\\TeX"], - ["lparen","{"], - ["rparen","}"] -],[ - "start", - ["text"," typesetting program. It offers programmable desktop publishing"] -],[ - "start", - ["text"," features and extensive facilities for automating most aspects of"] -],[ - "start", - ["text"," typesetting and desktop publishing, including numbering and"] -],[ - "start", - ["text"," cross-referencing, tables and figures, page layout, bibliographies,"] -],[ - "start", - ["text"," and much more. "], - ["storage.type","\\LaTeX"], - ["lparen","{"], - ["rparen","}"], - ["text"," was originally written in 1984 by Leslie"] -],[ - "start", - ["text"," Lamport and has become the dominant method for using "], - ["storage.type","\\TeX"], - ["text","; few"] -],[ - "start", - ["text"," people write in plain "], - ["storage.type","\\TeX"], - ["lparen","{"], - ["rparen","}"], - ["text"," anymore. The current version is"] -],[ - "start", - ["text"," "], - ["storage.type","\\LaTeXe"], - ["text","."] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," "], - ["comment","% This is a comment; it will not be shown in the final output."] -],[ - "start", - ["text"," "], - ["comment","% The following shows a little of the typesetting power of LaTeX:"] -],[ - "start", - ["text"," "], - ["storage.type","\\begin"], - ["lparen","{"], - ["variable.parameter","align"], - ["rparen","}"] -],[ - "start", - ["text"," E &= mc^2 "], - ["constant.character.escape","\\\\"] -],[ - "start", - ["text"," m &= "], - ["storage.type","\\frac"], - ["lparen","{"], - ["text","m_0"], - ["rparen","}"], - ["lparen","{"], - ["storage.type","\\sqrt"], - ["lparen","{"], - ["text","1-"], - ["storage.type","\\frac"], - ["lparen","{"], - ["text","v^2"], - ["rparen","}"], - ["lparen","{"], - ["text","c^2"], - ["rparen","}}}"] -],[ - "start", - ["text"," "], - ["storage.type","\\end"], - ["lparen","{"], - ["variable.parameter","align"], - ["rparen","}"] -],[ - "start", - ["storage.type","\\end"], - ["lparen","{"], - ["variable.parameter","document"], - ["rparen","}"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_less.json b/lib/ace/mode/_test/tokens_less.json deleted file mode 100644 index 81fe0c20..00000000 --- a/lib/ace/mode/_test/tokens_less.json +++ /dev/null @@ -1,204 +0,0 @@ -[[ - "start", - ["comment","/* styles.less */"] -],[ - "start" -],[ - "start", - ["variable","@base"], - ["text",": "], - ["constant.numeric","#f938ab"], - ["text",";"] -],[ - "start" -],[ - "start", - ["variable.language",".box-shadow"], - ["paren.lparen","("], - ["variable","@style"], - ["text",", "], - ["variable","@c"], - ["paren.rparen",")"], - ["text"," "], - ["keyword","when"], - ["text"," "], - ["paren.lparen","("], - ["support.function","iscolor"], - ["paren.lparen","("], - ["variable","@c"], - ["paren.rparen","))"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," box-shadow: "], - ["variable","@style"], - ["text"," "], - ["variable","@c"], - ["text",";"] -],[ - "start", - ["text"," -webkit-box-shadow: "], - ["variable","@style"], - ["text"," "], - ["variable","@c"], - ["text",";"] -],[ - "start", - ["text"," -moz-box-shadow: "], - ["variable","@style"], - ["text"," "], - ["variable","@c"], - ["text",";"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start", - ["variable.language",".box-shadow"], - ["paren.lparen","("], - ["variable","@style"], - ["text",", "], - ["variable","@alpha"], - ["text",": "], - ["constant.numeric","50%"], - ["paren.rparen",")"], - ["text"," "], - ["keyword","when"], - ["text"," "], - ["paren.lparen","("], - ["support.function","isnumber"], - ["paren.lparen","("], - ["variable","@alpha"], - ["paren.rparen","))"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable.language",".box-shadow"], - ["paren.lparen","("], - ["variable","@style"], - ["text",", "], - ["support.function","rgba"], - ["paren.lparen","("], - ["constant.numeric","0"], - ["text",", "], - ["constant.numeric","0"], - ["text",", "], - ["constant.numeric","0"], - ["text",", "], - ["variable","@alpha"], - ["paren.rparen","))"], - ["text",";"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["comment","// Box styles"] -],[ - "start", - ["variable.language",".box"], - ["text"," "], - ["paren.lparen","{"], - ["text"," "] -],[ - "start", - ["text"," "], - ["support.type","color"], - ["text",": "], - ["support.function","saturate"], - ["paren.lparen","("], - ["variable","@base"], - ["text",", "], - ["constant.numeric","5%"], - ["paren.rparen",")"], - ["text",";"] -],[ - "start", - ["text"," "], - ["support.type","border-color"], - ["text",": "], - ["support.function","lighten"], - ["paren.lparen","("], - ["variable","@base"], - ["text",", "], - ["constant.numeric","30%"], - ["paren.rparen",")"], - ["text",";"] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," "], - ["variable.language","div"], - ["text"," "], - ["paren.lparen","{"], - ["text"," "], - ["variable.language",".box-shadow"], - ["paren.lparen","("], - ["constant.numeric","0"], - ["text"," "], - ["constant.numeric","0"], - ["text"," "], - ["constant.numeric","5px"], - ["text",", "], - ["constant.numeric","30%"], - ["paren.rparen",")"], - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," "], - ["variable.language","a"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["support.type","color"], - ["text",": "], - ["variable","@base"], - ["text",";"] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," &"], - ["variable.language",":hover"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["support.type","color"], - ["text",": "], - ["support.function","lighten"], - ["paren.lparen","("], - ["variable","@base"], - ["text",", "], - ["constant.numeric","50%"], - ["paren.rparen",")"], - ["text",";"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_liquid.json b/lib/ace/mode/_test/tokens_liquid.json deleted file mode 100644 index 30d003cb..00000000 --- a/lib/ace/mode/_test/tokens_liquid.json +++ /dev/null @@ -1,551 +0,0 @@ -[[ - "start", - ["text.xml","The following examples can be found in full at http://liquidmarkup.org/"] -],[ - "start" -],[ - "start", - ["text.xml","Liquid is an extraction from the e-commerce system Shopify."] -],[ - "start", - ["text.xml","Shopify powers many thousands of e-commerce stores which all call for unique designs."] -],[ - "start", - ["text.xml","For this we developed Liquid which allows our customers complete design freedom while"] -],[ - "start", - ["text.xml","maintaining the integrity of our servers."] -],[ - "start" -],[ - "start", - ["text.xml","Liquid has been in production use since June 2006 and is now used by many other"] -],[ - "start", - ["text.xml","hosted web applications."] -],[ - "start" -],[ - "start", - ["text.xml","It was developed for usage in Ruby on Rails web applications and integrates seamlessly"] -],[ - "start", - ["text.xml","as a plugin but it also works excellently as a stand alone library."] -],[ - "start" -],[ - "start", - ["text.xml","Here's what it looks like:"] -],[ - "start" -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","ul"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","id"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"products\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["variable","{%"], - ["text"," "], - ["keyword","for"], - ["text"," "], - ["identifier","product"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["identifier","products"], - ["text"," "], - ["variable","%}"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","li"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","h2"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["variable","{{"], - ["text"," "], - ["identifier","product"], - ["text","."], - ["identifier","title"], - ["text"," "], - ["variable","}}"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," Only "], - ["variable","{{"], - ["text"," "], - ["identifier","product"], - ["text","."], - ["identifier","price"], - ["text"," | "], - ["identifier","format_as_money"], - ["text"," "], - ["variable","}}"] -],[ - "start" -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","p"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["variable","{{"], - ["text"," "], - ["identifier","product"], - ["text","."], - ["identifier","description"], - ["text"," | "], - ["identifier","prettyprint"], - ["text"," | "], - ["support.function","truncate"], - ["text",": "], - ["constant.numeric","200"], - ["text"," "], - ["variable","}}"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["variable","{%"], - ["text"," "], - ["keyword","endfor"], - ["text"," "], - ["variable","%}"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "start" -],[ - "start", - ["text.xml","Some more features include:"] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","h2"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Filters"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","p"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml"," The word \"tobi\" in uppercase: "], - ["variable","{{"], - ["text"," "], - ["string","'tobi'"], - ["text"," | "], - ["support.function","upcase"], - ["text"," "], - ["variable","}}"], - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","p"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","The word \"tobi\" has "], - ["variable","{{"], - ["text"," "], - ["string","'tobi'"], - ["text"," | "], - ["support.function","size"], - ["text"," "], - ["variable","}}"], - ["text.xml"," letters! "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","p"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Change \"Hello world\" to \"Hi world\": "], - ["variable","{{"], - ["text"," "], - ["string","'Hello world'"], - ["text"," | "], - ["support.function","replace"], - ["text",": "], - ["string","'Hello'"], - ["text",", "], - ["string","'Hi'"], - ["text"," "], - ["variable","}}"], - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","p"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","The date today is "], - ["variable","{{"], - ["text"," "], - ["string","'now'"], - ["text"," | "], - ["support.function","date"], - ["text",": "], - ["string","\"%Y %b %d\""], - ["text"," "], - ["variable","}}"], - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","h2"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","If"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","p"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["variable","{%"], - ["text"," "], - ["keyword","if"], - ["text"," "], - ["identifier","user"], - ["text","."], - ["identifier","name"], - ["text"," "], - ["keyword.operator","=="], - ["text"," "], - ["string","'tobi'"], - ["text"," "], - ["identifier","or"], - ["text"," "], - ["identifier","user"], - ["text","."], - ["identifier","name"], - ["text"," "], - ["keyword.operator","=="], - ["text"," "], - ["string","'marc'"], - ["text"," "], - ["variable","%}"], - ["text.xml"," "] -],[ - "start", - ["text.xml"," hi marc or tobi"] -],[ - "start", - ["text.xml"," "], - ["variable","{%"], - ["text"," "], - ["keyword","endif"], - ["text"," "], - ["variable","%}"] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","h2"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Case"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","p"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["variable","{%"], - ["text"," "], - ["keyword","case"], - ["text"," "], - ["identifier","template"], - ["text"," "], - ["variable","%}"] -],[ - "start", - ["text.xml"," "], - ["variable","{%"], - ["text"," "], - ["keyword","when"], - ["text"," "], - ["string","'index'"], - ["text"," "], - ["variable","%}"] -],[ - "start", - ["text.xml"," Welcome"] -],[ - "start", - ["text.xml"," "], - ["variable","{%"], - ["text"," "], - ["keyword","when"], - ["text"," "], - ["string","'product'"], - ["text"," "], - ["variable","%}"] -],[ - "start", - ["text.xml"," "], - ["variable","{{"], - ["text"," "], - ["identifier","product"], - ["text","."], - ["identifier","vendor"], - ["text"," | "], - ["identifier","link_to_vendor"], - ["text"," "], - ["variable","}}"], - ["text.xml"," / "], - ["variable","{{"], - ["text"," "], - ["identifier","product"], - ["text","."], - ["identifier","title"], - ["text"," "], - ["variable","}}"] -],[ - "start", - ["text.xml"," "], - ["variable","{%"], - ["text"," "], - ["keyword","else"], - ["text"," "], - ["variable","%}"] -],[ - "start", - ["text.xml"," "], - ["variable","{{"], - ["text"," "], - ["identifier","page_title"], - ["text"," "], - ["variable","}}"] -],[ - "start", - ["text.xml"," "], - ["variable","{%"], - ["text"," "], - ["keyword","endcase"], - ["text"," "], - ["variable","%}"] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","h2"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","For Loops"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","p"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["variable","{%"], - ["text"," "], - ["keyword","for"], - ["text"," "], - ["identifier","item"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["identifier","array"], - ["text"," "], - ["variable","%}"], - ["text.xml"," "] -],[ - "start", - ["text.xml"," "], - ["variable","{{"], - ["text"," "], - ["identifier","item"], - ["text"," "], - ["variable","}}"] -],[ - "start", - ["text.xml"," "], - ["variable","{%"], - ["text"," "], - ["keyword","endfor"], - ["text"," "], - ["variable","%}"] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","h2"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Tables"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","p"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["variable","{%"], - ["text"," "], - ["keyword","tablerow"], - ["text"," "], - ["identifier","item"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["identifier","items"], - ["text"," "], - ["identifier","cols"], - ["text",": "], - ["constant.numeric","3"], - ["text"," "], - ["variable","%}"] -],[ - "start", - ["text.xml"," "], - ["variable","{%"], - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable.language","tablerowloop"], - ["text","."], - ["identifier","col_first"], - ["text"," "], - ["variable","%}"] -],[ - "start", - ["text.xml"," First column: "], - ["variable","{{"], - ["text"," "], - ["identifier","item"], - ["text","."], - ["identifier","variable"], - ["text"," "], - ["variable","}}"] -],[ - "start", - ["text.xml"," "], - ["variable","{%"], - ["text"," "], - ["keyword","else"], - ["text"," "], - ["variable","%}"] -],[ - "start", - ["text.xml"," Different column: "], - ["variable","{{"], - ["text"," "], - ["identifier","item"], - ["text","."], - ["identifier","variable"], - ["text"," "], - ["variable","}}"] -],[ - "start", - ["text.xml"," "], - ["variable","{%"], - ["text"," "], - ["keyword","endif"], - ["text"," "], - ["variable","%}"] -],[ - "start", - ["text.xml"," "], - ["variable","{%"], - ["text"," "], - ["keyword","endtablerow"], - ["text"," "], - ["variable","%}"] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_lisp.json b/lib/ace/mode/_test/tokens_lisp.json deleted file mode 100644 index 2e70a555..00000000 --- a/lib/ace/mode/_test/tokens_lisp.json +++ /dev/null @@ -1,248 +0,0 @@ -[[ - "start", - ["text","("], - ["storage.type.function-type.lisp","defun"], - ["text"," "], - ["entity.name.function.lisp","prompt-for-cd"], - ["text"," ()"] -],[ - "start", - ["text"," "], - ["string","\"Prompts"] -],[ - "start", - ["text"," "], - ["identifier","for"], - ["text"," "], - ["identifier","CD"], - ["text","\""] -],[ - "start", - ["text"," ("], - ["identifier","prompt"], - ["text","-"], - ["identifier","read"], - ["text"," "], - ["string","\"Title\""], - ["text"," "], - ["constant.numeric","1.53"], - ["text"," "], - ["constant.numeric","1"], - ["text"," "], - ["constant.numeric","2"], - ["text","/"], - ["constant.numeric","4"], - ["text"," "], - ["constant.numeric","1.7"], - ["text"," "], - ["constant.numeric","1.7e0"], - ["text"," "], - ["constant.numeric","2.9E-4"], - ["text"," "], - ["constant.numeric","+42"], - ["text"," "], - ["constant.numeric","-7"], - ["text"," "], - ["punctuation.definition.constant.character.lisp","#"], - ["constant.character.lisp","b001"], - ["text"," "], - ["punctuation.definition.constant.character.lisp","#"], - ["constant.character.lisp","b001/100"], - ["text"," "], - ["punctuation.definition.constant.character.lisp","#"], - ["constant.character.lisp","o777"], - ["text"," "], - ["punctuation.definition.constant.character.lisp","#"], - ["constant.character.lisp","O777"], - ["text"," "], - ["punctuation.definition.constant.character.lisp","#"], - ["constant.character.lisp","xabc55"], - ["text"," "], - ["punctuation.definition.constant.character.lisp","#"], - ["constant.character.lisp","c"], - ["text","("], - ["constant.numeric","0"], - ["text"," "], - ["constant.numeric","-5.6"], - ["text","))"] -],[ - "start", - ["text"," ("], - ["identifier","prompt"], - ["text","-"], - ["identifier","read"], - ["text"," "], - ["string","\"Artist\""], - ["text"," &"], - ["identifier","rest"], - ["text",")"] -],[ - "start", - ["text"," ("], - ["keyword.operator","or"], - ["text"," ("], - ["identifier","parse"], - ["text","-"], - ["identifier","integer"], - ["text"," ("], - ["identifier","prompt"], - ["text","-"], - ["identifier","read"], - ["text"," "], - ["string","\"Rating\""], - ["text",") :"], - ["identifier","junk"], - ["text","-"], - ["identifier","allowed"], - ["text"," "], - ["support.function","t"], - ["text",") "], - ["constant.numeric","0"], - ["text",")"] -],[ - "start", - ["text"," ("], - ["keyword.control","if"], - ["text"," "], - ["identifier","x"], - ["text"," ("], - ["support.function","format"], - ["text"," "], - ["support.function","t"], - ["text"," "], - ["string","\"yes\""], - ["text",") ("], - ["support.function","format"], - ["text"," "], - ["support.function","t"], - ["text"," "], - ["string","\"no\""], - ["text"," "], - ["constant.language","nil"], - ["text",") "], - ["comment",";and here comment"] -],[ - "start", - ["text"," ) "], - ["constant.numeric","0xFFLL"], - ["text"," "], - ["constant.numeric","-23ull"] -],[ - "start", - ["text"," "], - ["comment",";; second line comment"] -],[ - "start", - ["text"," '(+ "], - ["constant.numeric","1"], - ["text"," "], - ["constant.numeric","2"], - ["text",")"] -],[ - "start", - ["text"," ("], - ["identifier","defvar"], - ["text"," "], - ["punctuation.definition.variable.lisp","*"], - ["variable.other.global.lisp","lines"], - ["punctuation.definition.variable.lisp","*"], - ["text",") "], - ["comment","; list of all lines"] -],[ - "start", - ["text"," ("], - ["identifier","position"], - ["text","-"], - ["keyword.control","if"], - ["text","-"], - ["identifier","not"], - ["text"," "], - ["punctuation.definition.constant.character.lisp","#"], - ["constant.character.lisp","'sys::whitespacep"], - ["text"," "], - ["identifier","line"], - ["text"," :"], - ["identifier","start"], - ["text"," "], - ["identifier","beg"], - ["text","))"] -],[ - "start", - ["text"," ("], - ["support.function","quote"], - ["text"," ("], - ["identifier","privet"], - ["text"," "], - ["constant.numeric","1"], - ["text"," "], - ["constant.numeric","2"], - ["text"," "], - ["constant.numeric","3"], - ["text","))"] -],[ - "start", - ["text"," '("], - ["identifier","hello"], - ["text"," "], - ["identifier","world"], - ["text",")"] -],[ - "start", - ["text"," (* "], - ["constant.numeric","5"], - ["text"," "], - ["constant.numeric","7"], - ["text",")"] -],[ - "start", - ["text"," ("], - ["constant.numeric","1"], - ["text"," "], - ["constant.numeric","2"], - ["text"," "], - ["constant.numeric","34"], - ["text"," "], - ["constant.numeric","5"], - ["text",")"] -],[ - "start", - ["text"," (:"], - ["identifier","use"], - ["text"," "], - ["string","\"aaaa\""], - ["text",")"] -],[ - "start", - ["text"," ("], - ["keyword.control","let"], - ["text"," (("], - ["identifier","x"], - ["text"," "], - ["constant.numeric","10"], - ["text",") ("], - ["identifier","y"], - ["text"," "], - ["constant.numeric","20"], - ["text","))"] -],[ - "start", - ["text"," ("], - ["identifier","print"], - ["text"," (+ "], - ["identifier","x"], - ["text"," "], - ["identifier","y"], - ["text","))"] -],[ - "start", - ["text"," ) "], - ["support.function","LAmbDa"] -],[ - "start" -],[ - "start", - ["text"," "], - ["string","\"asdad"], - ["constant.character.escape.lisp","\\0"], - ["string","eqweqe\""] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_livescript.json b/lib/ace/mode/_test/tokens_livescript.json deleted file mode 100644 index c2bd83df..00000000 --- a/lib/ace/mode/_test/tokens_livescript.json +++ /dev/null @@ -1,6 +0,0 @@ -[[ - "start", - ["comment","# comment"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_logiql.json b/lib/ace/mode/_test/tokens_logiql.json deleted file mode 100644 index 5f7eda49..00000000 --- a/lib/ace/mode/_test/tokens_logiql.json +++ /dev/null @@ -1,190 +0,0 @@ -[[ - "start", - ["comment.single","// ancestors"] -],[ - "start", - ["entity.name","parentof"], - ["text","("], - ["string","\"douglas\""], - ["keyword.other",","], - ["text"," "], - ["string","\"john\""], - ["text",")"], - ["keyword.end","."] -],[ - "start", - ["entity.name","parentof"], - ["text","("], - ["string","\"john\""], - ["keyword.other",","], - ["text"," "], - ["string","\"bob\""], - ["text",")"], - ["keyword.end","."] -],[ - "start", - ["entity.name","parentof"], - ["text","("], - ["string","\"bob\""], - ["keyword.other",","], - ["text"," "], - ["string","\"ebbon\""], - ["text",")"], - ["keyword.end","."] -],[ - "start" -],[ - "start", - ["entity.name","parentof"], - ["text","("], - ["string","\"douglas\""], - ["keyword.other",","], - ["text"," "], - ["string","\"jane\""], - ["text",")"], - ["keyword.end","."] -],[ - "start", - ["entity.name","parentof"], - ["text","("], - ["string","\"jane\""], - ["keyword.other",","], - ["text"," "], - ["string","\"jan\""], - ["text",")"], - ["keyword.end","."] -],[ - "start" -],[ - "start", - ["entity.name","ancestorof"], - ["text","("], - ["variable.parameter","A"], - ["keyword.other",","], - ["text"," "], - ["variable.parameter","B"], - ["text",") "], - ["keyword.start","<-"], - ["text"," "], - ["entity.name","parentof"], - ["text","("], - ["variable.parameter","A"], - ["keyword.other",","], - ["text"," "], - ["variable.parameter","B"], - ["text",")"], - ["keyword.end","."] -],[ - "start", - ["entity.name","ancestorof"], - ["text","("], - ["variable.parameter","A"], - ["keyword.other",","], - ["text"," "], - ["variable.parameter","C"], - ["text",") "], - ["keyword.start","<-"], - ["text"," "], - ["entity.name","ancestorof"], - ["text","("], - ["variable.parameter","A"], - ["keyword.other",","], - ["text"," "], - ["variable.parameter","B"], - ["text",")"], - ["keyword.other",","], - ["text"," "], - ["entity.name","parentof"], - ["text","("], - ["variable.parameter","B"], - ["keyword.other",","], - ["variable.parameter","C"], - ["text",")"], - ["keyword.end","."] -],[ - "start" -],[ - "start", - ["entity.name","grandparentof"], - ["text","("], - ["variable.parameter","A"], - ["keyword.other",","], - ["text"," "], - ["variable.parameter","B"], - ["text",") "], - ["keyword.start","<-"], - ["text"," "], - ["entity.name","parentof"], - ["text","("], - ["variable.parameter","A"], - ["keyword.other",","], - ["text"," "], - ["variable.parameter","C"], - ["text",")"], - ["keyword.other",","], - ["text"," "], - ["entity.name","parentof"], - ["text","("], - ["variable.parameter","C"], - ["keyword.other",","], - ["text"," "], - ["variable.parameter","B"], - ["text",")"], - ["keyword.end","."] -],[ - "start" -],[ - "start", - ["entity.name","cousins"], - ["text","("], - ["variable.parameter","A"], - ["keyword.other",","], - ["variable.parameter","B"], - ["text",") "], - ["keyword.start","<-"], - ["text"," "], - ["entity.name","grandparentof"], - ["text","("], - ["variable.parameter","C"], - ["keyword.other",","], - ["variable.parameter","A"], - ["text",")"], - ["keyword.other",","], - ["text"," "], - ["entity.name","grandparentof"], - ["text","("], - ["variable.parameter","C"], - ["keyword.other",","], - ["variable.parameter","B"], - ["text",")"], - ["keyword.end","."] -],[ - "start" -],[ - "start", - ["entity.name","parentof"], - ["text","["], - ["entity.name.type.logicblox","`arg"], - ["text","]("], - ["variable.parameter","A"], - ["keyword.other",","], - ["text"," "], - ["variable.parameter","B"], - ["text",") "], - ["keyword.start","->"], - ["text"," "], - ["entity.name","int"], - ["text","["], - ["constant.numeric","32"], - ["text","]("], - ["variable.parameter","A"], - ["text",")"], - ["keyword.other",","], - ["text"," "], - ["keyword.other","!"], - ["entity.name","string"], - ["text","("], - ["variable.parameter","B"], - ["text",")"], - ["keyword.end","."] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_lsl.json b/lib/ace/mode/_test/tokens_lsl.json deleted file mode 100644 index 2248a607..00000000 --- a/lib/ace/mode/_test/tokens_lsl.json +++ /dev/null @@ -1,503 +0,0 @@ -[[ - "comment", - ["comment.block.begin.lsl","/*"] -],[ - "comment", - ["comment.block.lsl"," Testing syntax highlighting"] -],[ - "comment", - ["comment.block.lsl"," of Ace Editor"] -],[ - "comment", - ["comment.block.lsl"," for the Linden Scripting Language"] -],[ - "start", - ["comment.block.end.lsl","*/"] -],[ - "start" -],[ - "start", - ["storage.type.lsl","integer"], - ["text.lsl"," "], - ["identifier","someIntNormal"], - ["text.lsl"," "], - ["keyword.operator.lsl","="], - ["text.lsl"," "], - ["constant.numeric.lsl","3672"], - ["punctuation.operator.lsl",";"] -],[ - "start", - ["storage.type.lsl","integer"], - ["text.lsl"," "], - ["identifier","someIntHex"], - ["text.lsl"," "], - ["keyword.operator.lsl","="], - ["text.lsl"," "], - ["constant.numeric.lsl","0x00000000"], - ["punctuation.operator.lsl",";"] -],[ - "start", - ["storage.type.lsl","integer"], - ["text.lsl"," "], - ["identifier","someIntMath"], - ["text.lsl"," "], - ["keyword.operator.lsl","="], - ["text.lsl"," "], - ["constant.language.float.lsl","PI_BY_TWO"], - ["punctuation.operator.lsl",";"] -],[ - "start" -],[ - "start", - ["storage.type.lsl","integer"], - ["text.lsl"," "], - ["invalid.illegal.lsl","event"], - ["text.lsl"," "], - ["keyword.operator.lsl","="], - ["text.lsl"," "], - ["constant.numeric.lsl","5673"], - ["punctuation.operator.lsl",";"], - ["text.lsl"," "], - ["comment.line.double-slash.lsl","// invalid.illegal"] -],[ - "start" -],[ - "start", - ["storage.type.lsl","key"], - ["text.lsl"," "], - ["identifier","someKeyTexture"], - ["text.lsl"," "], - ["keyword.operator.lsl","="], - ["text.lsl"," "], - ["constant.language.string.lsl","TEXTURE_DEFAULT"], - ["punctuation.operator.lsl",";"] -],[ - "start", - ["storage.type.lsl","string"], - ["text.lsl"," "], - ["identifier","someStringSpecial"], - ["text.lsl"," "], - ["keyword.operator.lsl","="], - ["text.lsl"," "], - ["constant.language.string.lsl","EOF"], - ["punctuation.operator.lsl",";"] -],[ - "start" -],[ - "start", - ["identifier","some_user_defined_function_without_return_type"], - ["paren.lparen.lsl","("], - ["storage.type.lsl","string"], - ["text.lsl"," "], - ["identifier","inputAsString"], - ["paren.rparen.lsl",")"] -],[ - "start", - ["paren.lparen.lsl","{"] -],[ - "start", - ["text.lsl"," "], - ["support.function.lsl","llSay"], - ["paren.lparen.lsl","("], - ["constant.language.integer.lsl","PUBLIC_CHANNEL"], - ["punctuation.operator.lsl",","], - ["text.lsl"," "], - ["identifier","inputAsString"], - ["paren.rparen.lsl",")"], - ["punctuation.operator.lsl",";"] -],[ - "start", - ["paren.rparen.lsl","}"] -],[ - "start" -],[ - "start", - ["storage.type.lsl","string"], - ["text.lsl"," "], - ["identifier","user_defined_function_returning_a_string"], - ["paren.lparen.lsl","("], - ["storage.type.lsl","key"], - ["text.lsl"," "], - ["identifier","inputAsKey"], - ["paren.rparen.lsl",")"] -],[ - "start", - ["paren.lparen.lsl","{"] -],[ - "start", - ["text.lsl"," "], - ["keyword.control.lsl","return"], - ["text.lsl"," "], - ["paren.lparen.lsl","("], - ["storage.type.lsl","string"], - ["paren.rparen.lsl",")"], - ["identifier","inputAsKey"], - ["punctuation.operator.lsl",";"] -],[ - "start", - ["paren.rparen.lsl","}"] -],[ - "start" -],[ - "start", - ["entity.name.state.lsl","default"] -],[ - "start", - ["paren.lparen.lsl","{"] -],[ - "start", - ["text.lsl"," "], - ["support.function.event.lsl","state_entry"], - ["paren.lparen.lsl","("], - ["paren.rparen.lsl",")"] -],[ - "start", - ["text.lsl"," "], - ["paren.lparen.lsl","{"] -],[ - "start", - ["text.lsl"," "], - ["storage.type.lsl","key"], - ["text.lsl"," "], - ["identifier","someKey"], - ["text.lsl"," "], - ["keyword.operator.lsl","="], - ["text.lsl"," "], - ["constant.language.string.lsl","NULL_KEY"], - ["punctuation.operator.lsl",";"] -],[ - "start", - ["text.lsl"," "], - ["identifier","someKey"], - ["text.lsl"," "], - ["keyword.operator.lsl","="], - ["text.lsl"," "], - ["support.function.lsl","llGetOwner"], - ["paren.lparen.lsl","("], - ["paren.rparen.lsl",")"], - ["punctuation.operator.lsl",";"] -],[ - "start" -],[ - "start", - ["text.lsl"," "], - ["storage.type.lsl","string"], - ["text.lsl"," "], - ["identifier","someString"], - ["text.lsl"," "], - ["keyword.operator.lsl","="], - ["text.lsl"," "], - ["identifier","user_defined_function_returning_a_string"], - ["paren.lparen.lsl","("], - ["identifier","someKey"], - ["paren.rparen.lsl",")"], - ["punctuation.operator.lsl",";"] -],[ - "start" -],[ - "start", - ["text.lsl"," "], - ["identifier","some_user_defined_function_without_return_type"], - ["paren.lparen.lsl","("], - ["identifier","someString"], - ["paren.rparen.lsl",")"], - ["punctuation.operator.lsl",";"] -],[ - "start", - ["text.lsl"," "], - ["paren.rparen.lsl","}"] -],[ - "start" -],[ - "start", - ["text.lsl"," "], - ["support.function.event.lsl","touch_start"], - ["paren.lparen.lsl","("], - ["storage.type.lsl","integer"], - ["text.lsl"," "], - ["identifier","num_detected"], - ["paren.rparen.lsl",")"] -],[ - "start", - ["text.lsl"," "], - ["paren.lparen.lsl","{"] -],[ - "start", - ["text.lsl"," "], - ["storage.type.lsl","list"], - ["text.lsl"," "], - ["identifier","agentsInRegion"], - ["text.lsl"," "], - ["keyword.operator.lsl","="], - ["text.lsl"," "], - ["support.function.lsl","llGetAgentList"], - ["paren.lparen.lsl","("], - ["constant.language.integer.lsl","AGENT_LIST_REGION"], - ["punctuation.operator.lsl",","], - ["text.lsl"," "], - ["paren.lparen.lsl","["], - ["paren.rparen.lsl","])"], - ["punctuation.operator.lsl",";"] -],[ - "start", - ["text.lsl"," "], - ["storage.type.lsl","integer"], - ["text.lsl"," "], - ["identifier","numOfAgents"], - ["text.lsl"," "], - ["keyword.operator.lsl","="], - ["text.lsl"," "], - ["support.function.lsl","llGetListLength"], - ["paren.lparen.lsl","("], - ["identifier","agentsInRegion"], - ["paren.rparen.lsl",")"], - ["punctuation.operator.lsl",";"] -],[ - "start" -],[ - "start", - ["text.lsl"," "], - ["storage.type.lsl","integer"], - ["text.lsl"," "], - ["identifier","index"], - ["punctuation.operator.lsl",";"], - ["text.lsl"," "], - ["comment.line.double-slash.lsl","// defaults to 0"] -],[ - "start", - ["text.lsl"," "], - ["keyword.control.lsl","for"], - ["text.lsl"," "], - ["paren.lparen.lsl","("], - ["punctuation.operator.lsl",";"], - ["text.lsl"," "], - ["identifier","index"], - ["text.lsl"," "], - ["keyword.operator.lsl","<="], - ["text.lsl"," "], - ["identifier","numOfAgents"], - ["text.lsl"," "], - ["keyword.operator.lsl","-"], - ["text.lsl"," "], - ["constant.numeric.lsl","1"], - ["punctuation.operator.lsl",";"], - ["text.lsl"," "], - ["identifier","index"], - ["keyword.operator.lsl","++"], - ["paren.rparen.lsl",")"], - ["text.lsl"," "], - ["comment.line.double-slash.lsl","// for each agent in region"] -],[ - "start", - ["text.lsl"," "], - ["paren.lparen.lsl","{"] -],[ - "start", - ["text.lsl"," "], - ["support.function.lsl","llRegionSayTo"], - ["paren.lparen.lsl","("], - ["support.function.lsl","llList2Key"], - ["paren.lparen.lsl","("], - ["identifier","agentsInRegion"], - ["punctuation.operator.lsl",","], - ["text.lsl"," "], - ["identifier","index"], - ["paren.rparen.lsl",")"], - ["punctuation.operator.lsl",","], - ["text.lsl"," "], - ["constant.language.integer.lsl","PUBLIC_CHANNEL"], - ["punctuation.operator.lsl",","], - ["text.lsl"," "], - ["string.quoted.double.lsl.start","\""], - ["string.quoted.double.lsl","Hello, Avatar!"], - ["string.quoted.double.lsl.end","\""], - ["paren.rparen.lsl",")"], - ["punctuation.operator.lsl",";"] -],[ - "start", - ["text.lsl"," "], - ["paren.rparen.lsl","}"] -],[ - "start", - ["text.lsl"," "], - ["paren.rparen.lsl","}"] -],[ - "start" -],[ - "start", - ["text.lsl"," "], - ["support.function.event.lsl","touch_end"], - ["paren.lparen.lsl","("], - ["storage.type.lsl","integer"], - ["text.lsl"," "], - ["identifier","num_detected"], - ["paren.rparen.lsl",")"] -],[ - "start", - ["text.lsl"," "], - ["paren.lparen.lsl","{"] -],[ - "start", - ["text.lsl"," "], - ["identifier","someIntNormal"], - ["text.lsl"," "], - ["keyword.operator.lsl","="], - ["text.lsl"," "], - ["constant.numeric.lsl","3672"], - ["punctuation.operator.lsl",";"] -],[ - "start", - ["text.lsl"," "], - ["identifier","someIntHex"], - ["text.lsl"," "], - ["keyword.operator.lsl","="], - ["text.lsl"," "], - ["constant.numeric.lsl","0x00000000"], - ["punctuation.operator.lsl",";"] -],[ - "start", - ["text.lsl"," "], - ["identifier","someIntMath"], - ["text.lsl"," "], - ["keyword.operator.lsl","="], - ["text.lsl"," "], - ["constant.language.float.lsl","PI_BY_TWO"], - ["punctuation.operator.lsl",";"] -],[ - "start" -],[ - "start", - ["text.lsl"," "], - ["invalid.illegal.lsl","event"], - ["text.lsl"," "], - ["keyword.operator.lsl","="], - ["text.lsl"," "], - ["constant.numeric.lsl","5673"], - ["punctuation.operator.lsl",";"], - ["text.lsl"," "], - ["comment.line.double-slash.lsl","// invalid.illegal"] -],[ - "start" -],[ - "start", - ["text.lsl"," "], - ["identifier","someKeyTexture"], - ["text.lsl"," "], - ["keyword.operator.lsl","="], - ["text.lsl"," "], - ["constant.language.string.lsl","TEXTURE_DEFAULT"], - ["punctuation.operator.lsl",";"] -],[ - "start", - ["text.lsl"," "], - ["identifier","someStringSpecial"], - ["text.lsl"," "], - ["keyword.operator.lsl","="], - ["text.lsl"," "], - ["constant.language.string.lsl","EOF"], - ["punctuation.operator.lsl",";"] -],[ - "start" -],[ - "start", - ["text.lsl"," "], - ["reserved.godmode.lsl","llSetInventoryPermMask"], - ["paren.lparen.lsl","("], - ["string.quoted.double.lsl.start","\""], - ["string.quoted.double.lsl","some item"], - ["string.quoted.double.lsl.end","\""], - ["punctuation.operator.lsl",","], - ["text.lsl"," "], - ["constant.language.integer.lsl","MASK_NEXT"], - ["punctuation.operator.lsl",","], - ["text.lsl"," "], - ["constant.language.integer.lsl","PERM_ALL"], - ["paren.rparen.lsl",")"], - ["punctuation.operator.lsl",";"], - ["text.lsl"," "], - ["comment.line.double-slash.lsl","// reserved.godmode"] -],[ - "start" -],[ - "start", - ["text.lsl"," "], - ["support.function.lsl","llWhisper"], - ["paren.lparen.lsl","("], - ["constant.language.integer.lsl","PUBLIC_CHANNEL"], - ["punctuation.operator.lsl",","], - ["text.lsl"," "], - ["string.quoted.double.lsl.start","\""], - ["string.quoted.double.lsl","Leaving "], - ["constant.character.escape.lsl","\\\""], - ["string.quoted.double.lsl","default"], - ["constant.character.escape.lsl","\\\""], - ["string.quoted.double.lsl"," now..."], - ["string.quoted.double.lsl.end","\""], - ["paren.rparen.lsl",")"], - ["punctuation.operator.lsl",";"] -],[ - "start", - ["text.lsl"," "], - ["entity.name.state.lsl","state other"], - ["punctuation.operator.lsl",";"] -],[ - "start", - ["text.lsl"," "], - ["paren.rparen.lsl","}"] -],[ - "start", - ["paren.rparen.lsl","}"] -],[ - "start" -],[ - "start", - ["entity.name.state.lsl","state other"] -],[ - "start", - ["paren.lparen.lsl","{"] -],[ - "start", - ["text.lsl"," "], - ["support.function.event.lsl","state_entry"], - ["paren.lparen.lsl","("], - ["paren.rparen.lsl",")"] -],[ - "start", - ["text.lsl"," "], - ["paren.lparen.lsl","{"] -],[ - "start", - ["text.lsl"," "], - ["support.function.lsl","llWhisper"], - ["paren.lparen.lsl","("], - ["constant.language.integer.lsl","PUBLIC_CHANNEL"], - ["punctuation.operator.lsl",","], - ["text.lsl"," "], - ["string.quoted.double.lsl.start","\""], - ["string.quoted.double.lsl","Entered "], - ["constant.character.escape.lsl","\\\""], - ["string.quoted.double.lsl","state other"], - ["constant.character.escape.lsl","\\\""], - ["string.quoted.double.lsl",", returning to "], - ["constant.character.escape.lsl","\\\""], - ["string.quoted.double.lsl","default"], - ["constant.character.escape.lsl","\\\""], - ["string.quoted.double.lsl"," again..."], - ["string.quoted.double.lsl.end","\""], - ["paren.rparen.lsl",")"], - ["punctuation.operator.lsl",";"] -],[ - "start", - ["text.lsl"," "], - ["entity.name.state.lsl","state default"], - ["punctuation.operator.lsl",";"] -],[ - "start", - ["text.lsl"," "], - ["paren.rparen.lsl","}"] -],[ - "start", - ["paren.rparen.lsl","}"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_lua.json b/lib/ace/mode/_test/tokens_lua.json deleted file mode 100644 index b60c7cb1..00000000 --- a/lib/ace/mode/_test/tokens_lua.json +++ /dev/null @@ -1,348 +0,0 @@ -[[ - ["bracketedComment",2,"start"], - ["comment","--[[--"] -],[ - ["bracketedComment",2,"start"], - ["comment","num_args takes in 5.1 byte code and extracts the number of arguments"] -],[ - ["bracketedComment",2,"start"], - ["comment","from its function header."] -],[ - "start", - ["comment","--]]--"] -],[ - "start" -],[ - "start", - ["keyword","function"], - ["text"," "], - ["identifier","int"], - ["paren.lparen","("], - ["identifier","t"], - ["paren.rparen",")"] -],[ - "start", - ["text","\t"], - ["keyword","return"], - ["text"," "], - ["identifier","t"], - ["keyword.operator",":"], - ["support.function","byte"], - ["paren.lparen","("], - ["constant.numeric","1"], - ["paren.rparen",")"], - ["keyword.operator","+"], - ["identifier","t"], - ["keyword.operator",":"], - ["support.function","byte"], - ["paren.lparen","("], - ["constant.numeric","2"], - ["paren.rparen",")"], - ["keyword.operator","*"], - ["constant.numeric","0x100"], - ["keyword.operator","+"], - ["identifier","t"], - ["keyword.operator",":"], - ["support.function","byte"], - ["paren.lparen","("], - ["constant.numeric","3"], - ["paren.rparen",")"], - ["keyword.operator","*"], - ["constant.numeric","0x10000"], - ["keyword.operator","+"], - ["identifier","t"], - ["keyword.operator",":"], - ["support.function","byte"], - ["paren.lparen","("], - ["constant.numeric","4"], - ["paren.rparen",")"], - ["keyword.operator","*"], - ["constant.numeric","0x1000000"] -],[ - "start", - ["keyword","end"] -],[ - "start" -],[ - "start", - ["keyword","function"], - ["text"," "], - ["identifier","num_args"], - ["paren.lparen","("], - ["identifier","func"], - ["paren.rparen",")"] -],[ - "start", - ["text","\t"], - ["keyword","local"], - ["text"," "], - ["support.function","dump"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.library","string"], - ["text","."], - ["support.function","dump"], - ["paren.lparen","("], - ["identifier","func"], - ["paren.rparen",")"] -],[ - "start", - ["text","\t"], - ["keyword","local"], - ["text"," "], - ["identifier","offset"], - ["text",", "], - ["identifier","cursor"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","int"], - ["paren.lparen","("], - ["support.function","dump"], - ["keyword.operator",":"], - ["support.function","sub"], - ["paren.lparen","("], - ["constant.numeric","13"], - ["paren.rparen","))"], - ["text",", "], - ["identifier","offset"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric","26"] -],[ - "start", - ["text","\t"], - ["comment","--Get the params and var flag (whether there's a ... in the param)"] -],[ - "start", - ["text","\t"], - ["keyword","return"], - ["text"," "], - ["support.function","dump"], - ["keyword.operator",":"], - ["support.function","sub"], - ["paren.lparen","("], - ["identifier","cursor"], - ["paren.rparen",")"], - ["keyword.operator",":"], - ["support.function","byte"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text",", "], - ["support.function","dump"], - ["keyword.operator",":"], - ["support.function","sub"], - ["paren.lparen","("], - ["identifier","cursor"], - ["keyword.operator","+"], - ["constant.numeric","1"], - ["paren.rparen",")"], - ["keyword.operator",":"], - ["support.function","byte"], - ["paren.lparen","("], - ["paren.rparen",")"] -],[ - "start", - ["keyword","end"] -],[ - "start" -],[ - "start", - ["comment","-- Usage:"] -],[ - "start", - ["identifier","num_args"], - ["paren.lparen","("], - ["keyword","function"], - ["paren.lparen","("], - ["identifier","a"], - ["text",","], - ["identifier","b"], - ["text",","], - ["identifier","c"], - ["text",","], - ["identifier","d"], - ["text",", "], - ["keyword.operator","..."], - ["paren.rparen",")"], - ["text"," "], - ["keyword","end"], - ["paren.rparen",")"], - ["text"," "], - ["comment","-- return 4, 7"] -],[ - "start" -],[ - "start", - ["comment","-- Python styled string format operator"] -],[ - "start", - ["keyword","local"], - ["text"," "], - ["identifier","gm"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.library","debug"], - ["text","."], - ["support.function","getmetatable"], - ["paren.lparen","("], - ["string","\"\""], - ["paren.rparen",")"] -],[ - "start" -],[ - "start", - ["identifier","gm"], - ["text","."], - ["support.function","__mod"], - ["keyword.operator","="], - ["keyword","function"], - ["paren.lparen","("], - ["variable.language","self"], - ["text",", "], - ["identifier","other"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["support.function","type"], - ["paren.lparen","("], - ["identifier","other"], - ["paren.rparen",")"], - ["text"," "], - ["keyword.operator","~="], - ["text"," "], - ["string","\"table\""], - ["text"," "], - ["keyword","then"], - ["text"," "], - ["identifier","other"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","{"], - ["identifier","other"], - ["paren.rparen","}"], - ["text"," "], - ["keyword","end"] -],[ - "start", - ["text"," "], - ["keyword","for"], - ["text"," "], - ["identifier","i"], - ["text",","], - ["identifier","v"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["support.function","ipairs"], - ["paren.lparen","("], - ["identifier","other"], - ["paren.rparen",")"], - ["text"," "], - ["keyword","do"], - ["text"," "], - ["identifier","other"], - ["paren.lparen","["], - ["identifier","i"], - ["paren.rparen","]"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["support.function","tostring"], - ["paren.lparen","("], - ["identifier","v"], - ["paren.rparen",")"], - ["text"," "], - ["keyword","end"] -],[ - "start", - ["text"," "], - ["keyword","return"], - ["text"," "], - ["variable.language","self"], - ["keyword.operator",":"], - ["support.function","format"], - ["paren.lparen","("], - ["support.function","unpack"], - ["paren.lparen","("], - ["identifier","other"], - ["paren.rparen","))"] -],[ - "start", - ["keyword","end"] -],[ - "start" -],[ - ["bracketedString",5,"start"], - ["support.function","print"], - ["paren.lparen","("], - ["comment","[===["] -],[ - ["bracketedString",5,"start"], - ["comment"," blah blah %s, (%d %d)"] -],[ - "start", - ["comment","]===]"], - ["keyword.operator","%"], - ["paren.lparen","{"], - ["string","\"blah\""], - ["text",", "], - ["identifier","num_args"], - ["paren.lparen","("], - ["identifier","int"], - ["paren.rparen",")})"] -],[ - "start" -],[ - ["bracketedComment",3,"start"], - ["comment","--[=[--"] -],[ - ["bracketedComment",3,"start"], - ["comment","table.maxn is deprecated, use # instead."] -],[ - "start", - ["comment","--]=]--"] -],[ - "start", - ["support.function","print"], - ["paren.lparen","("], - ["constant.library","table"], - ["text","."], - ["invalid.deprecated","maxn"], - ["paren.lparen","{"], - ["constant.numeric","1"], - ["text",","], - ["constant.numeric","2"], - ["text",","], - ["paren.lparen","["], - ["constant.numeric","4"], - ["paren.rparen","]"], - ["keyword.operator","="], - ["constant.numeric","4"], - ["text",","], - ["paren.lparen","["], - ["constant.numeric","8"], - ["paren.rparen","]"], - ["keyword.operator","="], - ["constant.numeric","8"], - ["paren.rparen",")"], - ["text"," "], - ["comment","-- outputs 8 instead of 2"] -],[ - "start" -],[ - "start", - ["support.function","print"], - ["paren.lparen","("], - ["constant.numeric","5"], - ["text"," "], - ["comment","--[[ blah ]]"], - ["paren.rparen",")"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_luapage.json b/lib/ace/mode/_test/tokens_luapage.json deleted file mode 100644 index 1fa765dd..00000000 --- a/lib/ace/mode/_test/tokens_luapage.json +++ /dev/null @@ -1,633 +0,0 @@ -[[ - "doctype", - ["text.xml",""], - ["xml-pe.doctype.xml",""] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","html"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - ["lua-bracketedComment",2,"lua-start"], - ["keyword","<%"], - ["text"," "], - ["comment","--[[--"] -],[ - ["lua-bracketedComment",2,"lua-start"], - ["comment"," index.lp from the Kepler Project's LuaDoc HTML doclet."] -],[ - ["lua-bracketedComment",2,"lua-start"], - ["comment"," http://keplerproject.github.com/luadoc/"] -],[ - "start", - ["comment","--]]"], - ["text"," "], - ["keyword","%>"] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","head"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","title"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Reference"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","link"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","rel"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"stylesheet\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","href"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\""], - ["keyword","<%="], - ["identifier","luadoc"], - ["text","."], - ["identifier","doclet"], - ["text","."], - ["identifier","html"], - ["text","."], - ["identifier","link"], - ["paren.lparen","("], - ["string","\"luadoc.css\""], - ["paren.rparen",")"], - ["keyword","%>"], - ["string.attribute-value.xml","\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","type"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"text/css\""], - ["text.tag-whitespace.xml"," "], - ["meta.tag.punctuation.tag-close.xml","/>"] -],[ - "start", - ["text.xml","\t"], - ["comment.xml",""] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","body"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","div"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","id"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"container\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","div"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","id"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"product\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml","\t"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","div"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","id"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"product_logo\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml","\t"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","div"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","id"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"product_name\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","big"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","b"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.end-tag-open.xml",""], - ["meta.tag.punctuation.end-tag-open.xml",""], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml","\t"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","div"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","id"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"product_description\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""], - ["text.xml"," "], - ["comment.xml",""] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","div"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","id"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"main\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","div"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","id"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"navigation\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["keyword","<%="], - ["identifier","luadoc"], - ["text","."], - ["identifier","doclet"], - ["text","."], - ["identifier","html"], - ["text","."], - ["identifier","include"], - ["paren.lparen","("], - ["string","\"menu.lp\""], - ["text",", "], - ["paren.lparen","{"], - ["text"," "], - ["identifier","doc"], - ["keyword.operator","="], - ["identifier","doc"], - ["text"," "], - ["paren.rparen","})"], - ["keyword","%>"] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""], - ["text.xml"," "], - ["comment.xml",""] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","div"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","id"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"content\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start" -],[ - "start" -],[ - "start", - ["keyword","<%if"], - ["text"," "], - ["keyword","not"], - ["text"," "], - ["identifier","options"], - ["text","."], - ["identifier","nomodules"], - ["text"," "], - ["keyword","and"], - ["text"," "], - ["keyword.operator","#"], - ["identifier","doc"], - ["text","."], - ["identifier","modules"], - ["text"," "], - ["keyword.operator",">"], - ["text"," "], - ["constant.numeric","0"], - ["text"," "], - ["keyword","then%>"] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","h2"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Modules"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","table"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","class"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"module_list\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["comment.xml",""] -],[ - "start", - ["keyword","<%for"], - ["text"," "], - ["identifier","_"], - ["text",", "], - ["identifier","modulename"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["support.function","ipairs"], - ["paren.lparen","("], - ["identifier","doc"], - ["text","."], - ["identifier","modules"], - ["paren.rparen",")"], - ["text"," "], - ["keyword","do%>"] -],[ - "start", - ["text.xml","\t"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","tr"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml","\t\t"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","td"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","class"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"name\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.anchor.tag-name.xml","a"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","href"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\""], - ["keyword","<%="], - ["identifier","luadoc"], - ["text","."], - ["identifier","doclet"], - ["text","."], - ["identifier","html"], - ["text","."], - ["identifier","module_link"], - ["paren.lparen","("], - ["identifier","modulename"], - ["text",", "], - ["identifier","doc"], - ["paren.rparen",")"], - ["keyword","%>"], - ["string.attribute-value.xml","\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["keyword","<%="], - ["identifier","modulename"], - ["keyword","%>"], - ["meta.tag.punctuation.end-tag-open.xml",""], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml","\t\t"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","td"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","class"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"summary\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["keyword","<%="], - ["identifier","doc"], - ["text","."], - ["identifier","modules"], - ["paren.lparen","["], - ["identifier","modulename"], - ["paren.rparen","]"], - ["text","."], - ["identifier","summary"], - ["keyword","%>"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml","\t"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["keyword","<%end%>"] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["keyword","<%end%>"] -],[ - "start" -],[ - "start" -],[ - "start" -],[ - "start", - ["keyword","<%if"], - ["text"," "], - ["keyword","not"], - ["text"," "], - ["identifier","options"], - ["text","."], - ["identifier","nofiles"], - ["text"," "], - ["keyword","and"], - ["text"," "], - ["keyword.operator","#"], - ["identifier","doc"], - ["text","."], - ["identifier","files"], - ["text"," "], - ["keyword.operator",">"], - ["text"," "], - ["constant.numeric","0"], - ["text"," "], - ["keyword","then%>"] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","h2"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Files"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","table"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","class"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"file_list\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["comment.xml",""] -],[ - "start", - ["keyword","<%for"], - ["text"," "], - ["identifier","_"], - ["text",", "], - ["identifier","filepath"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["support.function","ipairs"], - ["paren.lparen","("], - ["identifier","doc"], - ["text","."], - ["identifier","files"], - ["paren.rparen",")"], - ["text"," "], - ["keyword","do%>"] -],[ - "start", - ["text.xml","\t"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","tr"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml","\t\t"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","td"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","class"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"name\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.anchor.tag-name.xml","a"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","href"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\""], - ["keyword","<%="], - ["identifier","luadoc"], - ["text","."], - ["identifier","doclet"], - ["text","."], - ["identifier","html"], - ["text","."], - ["identifier","file_link"], - ["paren.lparen","("], - ["identifier","filepath"], - ["paren.rparen",")"], - ["keyword","%>"], - ["string.attribute-value.xml","\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["keyword","<%="], - ["identifier","filepath"], - ["keyword","%>"], - ["meta.tag.punctuation.end-tag-open.xml",""], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml","\t\t"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.table.tag-name.xml","td"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","class"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"summary\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml","\t"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["keyword","<%end%>"] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["keyword","<%end%>"] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""], - ["text.xml"," "], - ["comment.xml",""] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""], - ["text.xml"," "], - ["comment.xml",""] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","div"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","id"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"about\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml","\t"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","p"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.anchor.tag-name.xml","a"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","href"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"http://validator.w3.org/check?uri=referer\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.image.tag-name.xml","img"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","src"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"http://www.w3.org/Icons/valid-xhtml10\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","alt"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"Valid XHTML 1.0!\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","height"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"31\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","width"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"88\""], - ["text.tag-whitespace.xml"," "], - ["meta.tag.punctuation.tag-close.xml","/>"], - ["meta.tag.punctuation.end-tag-open.xml",""], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""], - ["text.xml"," "], - ["comment.xml",""] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""], - ["text.xml"," "], - ["comment.xml",""], - ["text.xml","\t"] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_lucene.json b/lib/ace/mode/_test/tokens_lucene.json deleted file mode 100644 index 1f6d2985..00000000 --- a/lib/ace/mode/_test/tokens_lucene.json +++ /dev/null @@ -1,92 +0,0 @@ -[[ - "start", - ["keyword","test:"], - ["text"," recognises "], - ["keyword.operator","AND"], - ["text"," as keyword"] -],[ - "start", - ["keyword","test:"], - ["text"," recognises "], - ["keyword.operator","OR"], - ["text"," as keyword"] -],[ - "start", - ["keyword","test:"], - ["text"," recognises "], - ["keyword.operator","NOT"], - ["text"," as keyword"] -],[ - "start", - ["keyword","test:"], - ["text"," recognises "], - ["string","\"hello this is dog\""], - ["text"," as string"] -],[ - "start", - ["keyword","test:"], - ["text"," recognises "], - ["constant.character.negation","-"], - ["string","\"hello this is dog\""], - ["text"," as negation with string"] -],[ - "start", - ["keyword","test:"], - ["text"," recognises "], - ["constant.character.proximity","~100"], - ["text"," as text with proximity"] -],[ - "start", - ["keyword","test:"], - ["text"," recognises "], - ["string","\"hello this is dog\""], - ["constant.character.proximity","~100"], - ["text"," as string with proximity"] -],[ - "start", - ["keyword","test:"], - ["text"," recognises "], - ["keyword","raw:"], - ["string","\"hello this is dog\""], - ["text"," as keyword"] -],[ - "start", - ["keyword","test:"], - ["text"," recognises "], - ["keyword","raw:"], - ["text","foo as\"keyword'"] -],[ - "start", - ["keyword","test:"], - ["text"," recognises "], - ["string","\"(\""], - ["text"," as opening parenthesis"] -],[ - "start", - ["keyword","test:"], - ["text"," recognises "], - ["string","\")\""], - ["text"," as closing parenthesis"] -],[ - "start", - ["keyword","test:"], - ["text"," recognises foo"], - ["constant.character.asterisk","*"], - ["text"," as text with asterisk"] -],[ - "start", - ["keyword","test:"], - ["text"," recognises foo"], - ["constant.character.interro","?"], - ["text"," as text with interro"] -],[ - "start", - ["keyword","test:"], - ["text"," recognises single word as text"] -],[ - "start", - ["text"," foo"] -],[ - "start", - ["text"," "] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_markdown.json b/lib/ace/mode/_test/tokens_markdown.json deleted file mode 100644 index 29e878b2..00000000 --- a/lib/ace/mode/_test/tokens_markdown.json +++ /dev/null @@ -1,114 +0,0 @@ -[[ - "start", - ["text.xml","test: header 1 "] -],[ - "start", - ["markup.heading.1","#"], - ["heading","f"] -],[ - "start", - ["text.xml","test: header 2"] -],[ - "start", - ["markup.heading.2","##"], - ["heading"," foo"] -],[ - "start", - ["text.xml","test: header ends with ' #'"] -],[ - "start", - ["markup.heading.1","#"], - ["heading"," # # "] -],[ - "start", - ["text.xml","test: header ends with '#'"] -],[ - "start", - ["markup.heading.1","#"], - ["heading","foo# "] -],[ - "start", - ["text.xml","test: 6+ #s is not a valid header"] -],[ - "start", - ["text.xml","####### foo"] -],[ - "start", - ["text.xml","test: # followed be only space is not a valid header"] -],[ - "start", - ["text.xml","# "] -],[ - "start", - ["text.xml","test: only space between #s is not a valid header"] -],[ - "start", - ["text.xml","# #"] -],[ - "allowBlock" -],[ - "start", - ["markup.heading.1","#"], - ["heading"," test links "], - ["text","["], - ["string","Cloud9 IDE"], - ["text","]("], - ["markup.underline","http://www.c9.io/"], - ["text",")"], - ["heading"," #"] -],[ - "listblock", - ["markup.list","* "], - ["text","["], - ["string","demo"], - ["text","]("], - ["markup.underline","http://ajaxorg.github.com/ace/"], - ["text",")"], - ["list"," "], - ["text","["], - ["string","+"], - ["text","]("], - ["markup.underline","escape(\\) "], - ["text",")"], - ["list"," "], - ["text","["], - ["string","+"], - ["text","]("], - ["markup.underline","a"], - ["string"," \"title\""], - ["text",")"], - ["list"," "], - ["text","["], - ["string","+"], - ["text","]("], - ["markup.underline","a"], - ["string"," \"space\" "], - ["text",")"] -],[ - "listblock", - ["markup.list","* "], - ["list","usually "], - ["string.emphasis","*work*"], - ["list"," fine ("], - ["string.emphasis","_em_"], - ["list",")"] -],[ - "listblock", - ["list","in lists"] -],[ - "start" -],[ - "start", - ["text.xml","in plain text "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","b"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","http://ace.ajaxorg.com"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","b"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "allowBlock" -],[ - "start" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_mask.json b/lib/ace/mode/_test/tokens_mask.json deleted file mode 100644 index 5f2b9762..00000000 --- a/lib/ace/mode/_test/tokens_mask.json +++ /dev/null @@ -1,302 +0,0 @@ -[[ - "start", - ["comment","/* Mask Syntax Demo */"] -],[ - "start" -],[ - "start", - ["keyword.support.constant.language","div"], - ["text"," "], - ["paren.lparen",">"], - ["text"," "], - ["string.start","'"], - ["string"," Test "], - ["paren.lparen.markup.italic","~["], - ["identifier","name"], - ["paren.rparen.markup.italic","]"], - ["string.end","'"], - ["paren.rparen",";"] -],[ - "start" -],[ - "start", - ["keyword","define"], - ["text"," :"], - ["support.variable.class","userProfile"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text","\t"], - ["keyword.support.constant.language","header"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text","\t\t"], - ["keyword.support.constant.language","h4"], - ["text"," "], - ["paren.lparen",">"], - ["text"," "], - ["support.function.markup.bold","@title"], - ["paren.lparen",";"] -],[ - "start", - ["text","\t\t"], - ["keyword.support.constant.language","button"], - ["support.variable.class",".close"], - ["paren.lparen",";"] -],[ - "start", - ["text","\t"], - ["paren.rparen","}"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["support.function.markup.bold",":userProfile"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text","\t"], - ["support.function.markup.bold","@title"], - ["text"," "], - ["paren.lparen",">"], - ["text"," "], - ["string.start","'"], - ["string"," Hello "], - ["paren.lparen.markup.italic","~["], - ["keyword.control.markup.italic",":"], - ["text"," "], - ["identifier","username"], - ["punctuation.operator","."], - ["support.function","toUpperCase"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["paren.rparen.markup.italic","]"], - ["string.end","'"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - ["paren.lparen52","constant.language40"], - ["constant.language","style"], - ["text"," "], - ["paren.lparen","{"] -],[ - ["css-block-ruleset","paren.lparen52","paren.lparen52","constant.language40"], - ["text"," "], - ["constant","html"], - ["text",", "], - ["constant","body"], - ["text"," "], - ["paren.lparen","{"] -],[ - ["css-block-ruleset","paren.lparen52","paren.lparen52","constant.language40"], - ["text"," "], - ["support.type","background"], - ["text",": "], - ["support.function","url("], - ["string","'name.png'"], - ["support.function",")"], - ["text"," "], - ["constant.numeric","0"], - ["text"," "], - ["constant.numeric","0"], - ["text"," "], - ["support.constant","no-repeat"], - ["text",";"] -],[ - ["paren.lparen52","constant.language40"], - ["text"," "], - ["paren.rparen","}"] -],[ - ["#tmp","css-block-end","paren.lparen52","constant.language40"], - ["paren.rparen","}"] -],[ - ["#tmp","start","paren.lparen52","constant.language40"] -],[ - ["#tmp","start","paren.lparen52","constant.language40"], - ["keyword.support.constant.language","button"], - ["text"," "], - ["paren.lparen","{"] -],[ - ["paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["text","\t"], - ["constant.language","event"], - ["text"," "], - ["support.variable.class","click"], - ["text"," "], - ["paren.lparen","("], - ["identifier","e"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - ["#tmp","js-block-start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["text","\t "], - ["variable.language","this"], - ["punctuation.operator","."], - ["identifier","textContent"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string.quasi.start","`"], - ["string.quasi","name "], - ["paren.quasi.start","${"], - ["identifier","e"], - ["punctuation.operator","."], - ["identifier","clientX"], - ["paren.quasi.end","}"], - ["string.quasi"," !"], - ["string.quasi.end","`"], - ["punctuation.operator",";"] -],[ - ["#tmp","js-block-end","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["text","\t"], - ["paren.rparen","}"] -],[ - ["#tmp","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["paren.rparen","}"] -],[ - ["#tmp","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"] -],[ - ["paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["constant.language","md"], - ["text"," "], - ["paren.lparen",">"], - ["text"," "], - ["paren.lparen","\"\"\""] -],[ - ["#tmp","md-multiline-allowBlock","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"] -],[ - ["#tmp","md-multiline-listblock","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["markup.list","- "], - ["list","div"] -],[ - ["#tmp","md-multiline-listblock","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["markup.list","- "], - ["list","span"] -],[ - ["#tmp","md-multiline-listblock","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["list"," "] -],[ - ["#tmp","md-multiline-listblock","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["list","Hello"] -],[ - ["#tmp","md-multiline-start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"] -],[ - ["#tmp","md-multiline-start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["text","["], - ["string","one"], - ["text","]("], - ["markup.underline","http://google.com"], - ["text",")"] -],[ - ["#tmp","md-multiline-allowBlock","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"] -],[ - ["#tmp","start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["paren.rparen","\"\"\";"] -],[ - ["#tmp","start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"] -],[ - ["#tmp","start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"] -],[ - ["#tmp","start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["keyword.support.constant.language","header"], - ["text"," "], - ["support.variable.class",".foo"], - ["text"," "], - ["paren.lparen",">"], - ["text"," "], - ["string.start","'"], - ["string","Heading"], - ["string.end","'"] -],[ - ["#tmp","start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"] -],[ - ["string.start2","start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["keyword.support.constant.language","button"], - ["text"," "], - ["support.variable.class",".baz"], - ["text"," "], - ["support.variable.class.markup.bold","x-signal"], - ["keyword.operator","="], - ["string.start","'"], - ["string","click: test"], - ["string.end","'"], - ["text"," "], - ["support.variable.class","disabled"], - ["text"," "], - ["paren.lparen",">"], - ["text"," "], - ["string.start","\""] -],[ - ["string.start2","start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["string","\tHello,"] -],[ - ["string.start2","start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["string","\tworld "] -],[ - ["string.start2","start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["string","\t"], - ["string.escape","\\\""], - ["string","Buddy"], - ["string.escape","\\\""] -],[ - ["#tmp","start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["string.end","\""] -],[ - ["#tmp","start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"] -],[ - ["#tmp","js-statement-start","start","js-statement-no_regex","constant.language53","start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["constant.language","var"], - ["text"," "], - ["identifier","a"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren","{"] -],[ - ["#tmp","js-statement-no_regex","start","js-statement-no_regex","constant.language53","start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["text"," "], - ["identifier","name"], - ["punctuation.operator",":"], - ["text"," "], - ["string.quasi.start","`"], - ["string.quasi","name "], - ["paren.quasi.start","${"], - ["variable.language","window"], - ["punctuation.operator","."], - ["support.constant","innerWidth"], - ["paren.rparen","}"], - ["string.quasi.end","`"] -],[ - ["#tmp","start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["paren.rparen","};"] -],[ - ["#tmp","start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"] -],[ - ["#tmp","start","paren.lparen13","constant.language","constant.language","start","paren.lparen39","constant.language27","constant.language27","start","paren.lparen52","constant.language40"], - ["keyword.support.constant.language","span"], - ["text"," "], - ["support.variable.class",".foo"], - ["text"," "], - ["paren.lparen",">"], - ["text"," "], - ["string.start","\""], - ["paren.lparen.markup.italic","~["], - ["keyword.control.markup.italic","bind:"], - ["text"," "], - ["identifier","a"], - ["punctuation.operator","."], - ["identifier","name"], - ["paren.rparen.markup.italic","]"], - ["string.end","\""] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_matlab.json b/lib/ace/mode/_test/tokens_matlab.json deleted file mode 100644 index 6b4a8567..00000000 --- a/lib/ace/mode/_test/tokens_matlab.json +++ /dev/null @@ -1,90 +0,0 @@ -[[ - ["blockComment","noQstring"], - ["comment.start","%{"] -],[ - ["blockComment","blockComment","blockComment","noQstring"], - ["comment.start"," %{"] -],[ - ["blockComment","blockComment","blockComment","noQstring"], - ["comment"," Ace Matlab demo"] -],[ - ["blockComment","noQstring"], - ["comment.end"," %}"] -],[ - "noQstring", - ["comment.end","%}"] -],[ - "start" -],[ - "start", - ["keyword","classdef"], - ["text"," "], - ["identifier","hello"] -],[ - "start", - ["text"," "], - ["support.function","methods"] -],[ - "start", - ["text"," "], - ["keyword","function"], - ["text"," "], - ["identifier","greet"], - ["paren.lparen","("], - ["identifier","this"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["support.function","disp"], - ["paren.lparen","("], - ["string","'Hello!'"], - ["paren.rparen",")"], - ["text"," "], - ["comment","% say hi"] -],[ - "start", - ["text"," "], - ["keyword","end"] -],[ - "start", - ["text"," "], - ["keyword","end"] -],[ - "start", - ["keyword","end"] -],[ - "noQstring" -],[ - "start", - ["comment","% transpose "] -],[ - "qqstring", - ["identifier","a"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","["], - ["text"," "], - ["string","'x"], - ["constant.language.escape","''"], - ["string","y'"], - ["punctuation.operator",","], - ["text"," "], - ["string","\"x"], - ["constant.language.escape","\\n"], - ["string","\\"] -],[ - "start", - ["string"," y\""], - ["punctuation.operator",","], - ["text"," "], - ["constant.numeric","1"], - ["text","' "], - ["paren.rparen","]"], - ["text","' "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric","2"], - ["text","'"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_mel.json b/lib/ace/mode/_test/tokens_mel.json deleted file mode 100644 index a2d618a9..00000000 --- a/lib/ace/mode/_test/tokens_mel.json +++ /dev/null @@ -1,257 +0,0 @@ -[[ - "start", - ["comment.line.double-slash.mel","//"], - ["punctuation.definition.comment.mel"," animated duplicates, instances script"] -],[ - "start", - ["meta.function.mel","proc"], - ["keyword.other.mel"," "], - ["storage.type.mel","animatedDuplication"], - ["entity.name.function.mel"," ("], - ["punctuation.section.function.mel","("], - ["meta.function.mel","int $rangeStart, int $rangeEnd, int $numOfDuplicates, int $duplicateOrInstance"], - ["punctuation.section.function.mel",")"], - "proc animatedDuplication (int $rangeStart, int $rangeEnd, int $numOfDuplicates, int $duplicateOrInstance)" -],[ - "start", - ["text","{"] -],[ - "start", - ["text"," "], - ["storage.type.mel","int"], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","range_start"], - ["text"," "], - ["keyword.operator.symbolic.mel","="], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","rangeStart"], - ["text",";"] -],[ - "start", - ["text"," "], - ["storage.type.mel","int"], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","range_end"], - ["text"," "], - ["keyword.operator.symbolic.mel","="], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","rangeEnd"], - ["text",";"] -],[ - "start", - ["text"," "], - ["storage.type.mel","int"], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","num_of_duplicates"], - ["text"," "], - ["keyword.operator.symbolic.mel","="], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","numOfDuplicates"], - ["text",";"] -],[ - "start", - ["text"," "], - ["storage.type.mel","int"], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","step_size"], - ["text"," "], - ["keyword.operator.symbolic.mel","="], - ["text"," ("], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","range_end"], - ["text"," "], - ["keyword.operator.symbolic.mel","-"], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","range_start"], - ["text",") "], - ["keyword.operator.symbolic.mel","/"], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","num_of_duplicates"], - ["text",";"] -],[ - "start", - ["text"," "], - ["storage.type.mel","int"], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","i"], - ["text"," "], - ["keyword.operator.symbolic.mel","="], - ["text"," "], - ["constant.numeric.mel","0"], - ["text",";"] -],[ - "start", - ["text"," "], - ["storage.type.mel","int"], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","temp"], - ["text",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["support.function.mel","currentTime"], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","range_start"], - ["text","; "], - ["comment.line.double-slash.mel","//"], - ["punctuation.definition.comment.mel"," set to range start"] -],[ - "start" -],[ - "start", - ["text"," "], - ["storage.type.mel","string"], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","selectedObjects"], - ["text","[]; "], - ["comment.line.double-slash.mel","//"], - ["punctuation.definition.comment.mel"," to store selected objects"] -],[ - "start", - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","selectedObjects"], - ["text"," "], - ["keyword.operator.symbolic.mel","="], - ["text"," `"], - ["support.function.mel","ls"], - ["text"," "], - ["keyword.operator.symbolic.mel","-"], - ["text","sl`; "], - ["comment.line.double-slash.mel","//"], - ["punctuation.definition.comment.mel"," store selected objects"] -],[ - "start", - ["text"," "], - ["support.function.mel","select"], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","selectedObjects"], - ["text",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["keyword.control.mel","while"], - ["text"," ("], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","i"], - ["text"," <"], - ["keyword.operator.symbolic.mel","="], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","num_of_duplicates"], - ["text",")"] -],[ - "start", - ["text"," {"] -],[ - "start", - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","temp"], - ["text"," "], - ["keyword.operator.symbolic.mel","="], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","range_start"], - ["text"," "], - ["keyword.operator.symbolic.mel","+"], - ["text"," ("], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","step_size"], - ["text"," "], - ["keyword.operator.symbolic.mel","*"], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","i"], - ["text",");"] -],[ - "start", - ["text"," "], - ["support.function.mel","currentTime"], - ["text"," ("], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","temp"], - ["text",");"] -],[ - "start", - ["text"," "], - ["comment.line.double-slash.mel","//"], - ["punctuation.definition.comment.mel"," seleced the objects to duplicate or instance"] -],[ - "start", - ["text"," "], - ["support.function.mel","select"], - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","selectedObjects"], - ["text",";"] -],[ - "start", - ["text"," "], - ["keyword.control.mel","if"], - ["text","("], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","duplicateOrInstance"], - ["text"," "], - ["keyword.operator.symbolic.mel","=="], - ["text"," "], - ["constant.numeric.mel","0"], - ["text",")"] -],[ - "start", - ["text"," {"] -],[ - "start", - ["text"," "], - ["support.function.mel","duplicate"], - ["text",";"] -],[ - "start", - ["text"," }"] -],[ - "start", - ["text"," "], - ["keyword.control.mel","else"] -],[ - "start", - ["text"," {"] -],[ - "start", - ["text"," "], - ["support.function.mel","instance"], - ["text",";"] -],[ - "start", - ["text"," }"] -],[ - "start", - ["text"," "], - ["variable.other.mel","$"], - ["punctuation.definition.variable.mel","i"], - ["keyword.operator.symbolic.mel","++"], - ["text",";"] -],[ - "start", - ["text"," }"] -],[ - "start", - ["text","}"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_mushcode.json b/lib/ace/mode/_test/tokens_mushcode.json deleted file mode 100644 index 9f8e7cc2..00000000 --- a/lib/ace/mode/_test/tokens_mushcode.json +++ /dev/null @@ -1,790 +0,0 @@ -[[ - "start", - ["text","@"], - ["support.function","create"], - ["text"," "], - ["identifier","phone"] -],[ - "start", - ["text","&"], - ["identifier","pickup"], - ["text"," "], - ["identifier","phone"], - ["keyword.operator","="], - ["identifier","$pick"], - ["text"," "], - ["identifier","up"], - ["text",":@"], - ["support.function","ifelse"], - ["text"," "], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["identifier","is"], - ["text",","], - ["support.function","u"], - ["paren.lparen","("], - ["identifier","mode"], - ["paren.rparen",")"], - ["text",","], - ["identifier","ICC"], - ["paren.rparen",")]"], - ["keyword.operator","="], - ["paren.lparen","{"], - ["text","@"], - ["support.function","pemit"], - ["text"," "], - ["keyword.operator","%#="], - ["identifier","You"], - ["text"," "], - ["support.function","pick"], - ["text"," "], - ["identifier","up"], - ["text"," "], - ["identifier","the"], - ["text"," "], - ["paren.lparen","["], - ["support.function","fullname"], - ["paren.lparen","("], - ["identifier","me"], - ["paren.rparen",")]"], - ["text","."], - ["paren.lparen","["], - ["support.function","set"], - ["paren.lparen","("], - ["identifier","me"], - ["text",","], - ["identifier","PHONER"], - ["text",":"], - ["keyword.operator","%#"], - ["paren.rparen",")]"], - ["paren.lparen","["], - ["support.function","set"], - ["paren.lparen","("], - ["identifier","me"], - ["text",","], - ["identifier","MODE"], - ["text",":"], - ["identifier","CIP"], - ["paren.rparen",")]"], - ["paren.lparen","["], - ["support.function","set"], - ["paren.lparen","(["], - ["support.function","u"], - ["paren.lparen","("], - ["identifier","INCOMING"], - ["paren.rparen",")]"], - ["text",","], - ["identifier","CONNECTED"], - ["text",":"], - ["paren.lparen","["], - ["support.function","num"], - ["paren.lparen","("], - ["identifier","me"], - ["paren.rparen",")])]"], - ["paren.lparen","["], - ["support.function","set"], - ["paren.lparen","("], - ["identifier","me"], - ["text",","], - ["identifier","CONNECTED"], - ["text",":"], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["identifier","INCOMING"], - ["paren.rparen",")])]"], - ["variable","%r"], - ["paren.lparen","["], - ["support.function","showpicture"], - ["paren.lparen","("], - ["identifier","PICPICKUP"], - ["paren.rparen",")]"], - ["variable","%r"], - ["identifier","Use"], - ["text"," '"], - ["paren.lparen","["], - ["identifier","color"], - ["paren.lparen","("], - ["identifier","green"], - ["text",","], - ["identifier","black"], - ["text",","], - ["identifier","psay"], - ["text"," "], - ["keyword.operator","<"], - ["identifier","message"], - ["keyword.operator",">"], - ["paren.rparen",")]"], - ["text","' "], - ["paren.lparen","("], - ["support.function","or"], - ["text"," '"], - ["paren.lparen","["], - ["identifier","color"], - ["paren.lparen","("], - ["identifier","green"], - ["text",","], - ["identifier","black"], - ["text",","], - ["identifier","p"], - ["text"," "], - ["keyword.operator","<"], - ["identifier","message"], - ["keyword.operator",">"], - ["paren.rparen",")]"], - ["text","'"], - ["paren.rparen",")"], - ["text"," "], - ["identifier","to"], - ["text"," "], - ["identifier","talk"], - ["text"," "], - ["identifier","into"], - ["text"," "], - ["identifier","the"], - ["text"," "], - ["identifier","phone"], - ["text",".;@"], - ["support.function","oemit"], - ["text"," "], - ["keyword.operator","%#="], - ["variable","%N"], - ["text"," "], - ["identifier","picks"], - ["text"," "], - ["identifier","up"], - ["text"," "], - ["identifier","the"], - ["text"," "], - ["paren.lparen","["], - ["support.function","fullname"], - ["paren.lparen","("], - ["identifier","me"], - ["paren.rparen",")]"], - ["text","."], - ["paren.rparen","}"], - ["text",","], - ["paren.lparen","{"], - ["text","@"], - ["support.function","pemit"], - ["text"," "], - ["keyword.operator","%#="], - ["identifier","You"], - ["text"," "], - ["support.function","pick"], - ["text"," "], - ["identifier","up"], - ["text"," "], - ["identifier","the"], - ["text"," "], - ["identifier","phone"], - ["text"," "], - ["identifier","but"], - ["text"," "], - ["identifier","no"], - ["text"," "], - ["identifier","one"], - ["text"," "], - ["identifier","is"], - ["text"," "], - ["identifier","there"], - ["text",". "], - ["identifier","You"], - ["text"," "], - ["identifier","hear"], - ["text"," "], - ["identifier","a"], - ["text"," "], - ["identifier","dialtone"], - ["text"," "], - ["support.function","and"], - ["text"," "], - ["identifier","then"], - ["text"," "], - ["identifier","hang"], - ["text"," "], - ["identifier","up"], - ["text",". "], - ["paren.lparen","["], - ["support.function","play"], - ["paren.lparen","("], - ["support.function","u"], - ["paren.lparen","("], - ["identifier","DIALTONE"], - ["paren.rparen","))]"], - ["text",";@"], - ["support.function","oemit"], - ["text"," "], - ["keyword.operator","%#="], - ["variable","%N"], - ["text"," "], - ["identifier","picks"], - ["text"," "], - ["identifier","up"], - ["text"," "], - ["identifier","the"], - ["text"," "], - ["identifier","phone"], - ["text",", "], - ["identifier","but"], - ["text"," "], - ["identifier","no"], - ["text"," "], - ["identifier","one"], - ["text"," "], - ["identifier","is"], - ["text"," "], - ["identifier","on"], - ["text"," "], - ["identifier","the"], - ["text"," "], - ["identifier","other"], - ["text"," "], - ["identifier","end"], - ["text","."], - ["paren.rparen","}"] -],[ - "start", - ["text","&"], - ["identifier","ringfun"], - ["text"," "], - ["identifier","phone"], - ["keyword.operator","="], - ["paren.lparen","["], - ["support.function","ifelse"], - ["paren.lparen","("], - ["support.function","eq"], - ["paren.lparen","("], - ["support.function","comp"], - ["paren.lparen","(["], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%0"], - ["keyword.operator","/"], - ["identifier","ringtone"], - ["paren.rparen",")]"], - ["text",","], - ["identifier","off"], - ["paren.rparen",")"], - ["text",","], - ["constant.numeric","0"], - ["paren.rparen",")"], - ["text",","], - ["paren.lparen","["], - ["identifier","color"], - ["paren.lparen","("], - ["identifier","black"], - ["text",","], - ["identifier","cyan"], - ["text",","], - ["identifier","INCOMING"], - ["text"," "], - ["identifier","CALL"], - ["text"," "], - ["identifier","FROM"], - ["text"," "], - ["variable","%1"], - ["paren.rparen",")]"], - ["text",","], - ["paren.lparen","["], - ["support.function","play"], - ["paren.lparen","(["], - ["support.function","switch"], - ["paren.lparen","(["], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%0"], - ["keyword.operator","/"], - ["identifier","ringtone"], - ["paren.rparen",")]"], - ["text",","], - ["constant.numeric","1"], - ["text",","], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%0"], - ["keyword.operator","/"], - ["identifier","ringtone1"], - ["paren.rparen",")]"], - ["text",","], - ["constant.numeric","2"], - ["text",","], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%0"], - ["keyword.operator","/"], - ["identifier","ringtone2"], - ["paren.rparen",")]"], - ["text",","], - ["constant.numeric","3"], - ["text",","], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%0"], - ["keyword.operator","/"], - ["identifier","ringtone3"], - ["paren.rparen",")]"], - ["text",","], - ["constant.numeric","4"], - ["text",","], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%0"], - ["keyword.operator","/"], - ["identifier","ringtone4"], - ["paren.rparen",")]"], - ["text",","], - ["constant.numeric","5"], - ["text",","], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%0"], - ["keyword.operator","/"], - ["identifier","ringtone5"], - ["paren.rparen",")]"], - ["text",","], - ["constant.numeric","6"], - ["text",","], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%0"], - ["keyword.operator","/"], - ["identifier","ringtone6"], - ["paren.rparen",")]"], - ["text",","], - ["constant.numeric","7"], - ["text",","], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%0"], - ["keyword.operator","/"], - ["identifier","ringtone7"], - ["paren.rparen",")]"], - ["text",","], - ["constant.numeric","8"], - ["text",","], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%0"], - ["keyword.operator","/"], - ["identifier","ringtone8"], - ["paren.rparen",")]"], - ["text",","], - ["constant.numeric","9"], - ["text",","], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%0"], - ["keyword.operator","/"], - ["identifier","ringtone9"], - ["paren.rparen",")]"], - ["text",","], - ["identifier","custom"], - ["text",","], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%0"], - ["keyword.operator","/"], - ["identifier","customtone"], - ["paren.rparen",")]"], - ["text",","], - ["identifier","vibrate"], - ["text",","], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%0"], - ["keyword.operator","/"], - ["identifier","vibrate"], - ["paren.rparen",")])])]"] -],[ - "start", - ["text","&"], - ["identifier","ringloop"], - ["text"," "], - ["identifier","phone"], - ["keyword.operator","="], - ["text","@"], - ["support.function","switch"], - ["text"," "], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["identifier","ringstate"], - ["paren.rparen",")]"], - ["keyword.operator","="], - ["constant.numeric","1"], - ["text",","], - ["paren.lparen","{"], - ["text","@"], - ["support.function","emit"], - ["text"," "], - ["paren.lparen","["], - ["support.function","setq"], - ["paren.lparen","("], - ["identifier","q"], - ["text",","], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["identifier","connecting"], - ["paren.rparen",")])]"], - ["paren.lparen","["], - ["support.function","set"], - ["paren.lparen","("], - ["variable","%qq"], - ["text",","], - ["identifier","rangs"], - ["text",":"], - ["constant.numeric","0"], - ["paren.rparen",")]"], - ["paren.lparen","["], - ["support.function","set"], - ["paren.lparen","("], - ["variable","%qq"], - ["text",","], - ["identifier","mode"], - ["text",":"], - ["identifier","WFC"], - ["paren.rparen",")]"], - ["paren.lparen","["], - ["support.function","set"], - ["paren.lparen","("], - ["variable","%qq"], - ["text",","], - ["identifier","INCOMING"], - ["text",":"], - ["paren.rparen",")]"], - ["text",";@"], - ["support.function","ifelse"], - ["text"," "], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%qq"], - ["keyword.operator","/"], - ["identifier","HASVMB"], - ["paren.rparen",")]"], - ["keyword.operator","="], - ["paren.lparen","{"], - ["text","@"], - ["support.function","tr"], - ["text"," "], - ["identifier","me"], - ["keyword.operator","/"], - ["identifier","ROUTEVMB"], - ["keyword.operator","="], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["identifier","connecting"], - ["paren.rparen",")]"], - ["text",";"], - ["paren.rparen","}"], - ["text",","], - ["paren.lparen","{"], - ["text","@"], - ["support.function","pemit"], - ["text"," "], - ["keyword.operator","%#="], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["identifier","MSGCNC"], - ["paren.rparen",")]"], - ["text",";"], - ["paren.rparen","}}"], - ["text",","], - ["constant.numeric","2"], - ["text",","], - ["paren.lparen","{"], - ["text","@"], - ["support.function","pemit"], - ["text"," "], - ["keyword.operator","%#="], - ["identifier","The"], - ["text"," "], - ["identifier","call"], - ["text"," "], - ["identifier","is"], - ["text"," "], - ["identifier","connected"], - ["text","."], - ["paren.lparen","["], - ["support.function","setq"], - ["paren.lparen","("], - ["identifier","q"], - ["text",","], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["identifier","CONNECTING"], - ["paren.rparen",")])]"], - ["paren.lparen","["], - ["support.function","set"], - ["paren.lparen","("], - ["identifier","me"], - ["text",","], - ["identifier","CONNECTED"], - ["text",":"], - ["variable","%qq"], - ["paren.rparen",")]"], - ["paren.lparen","["], - ["support.function","set"], - ["paren.lparen","("], - ["variable","%qq"], - ["text",","], - ["identifier","CONNECTED"], - ["text",":"], - ["paren.lparen","["], - ["support.function","num"], - ["paren.lparen","("], - ["identifier","me"], - ["paren.rparen",")])]"], - ["paren.lparen","["], - ["support.function","set"], - ["paren.lparen","("], - ["variable","%qq"], - ["text",","], - ["identifier","MODE"], - ["text",":"], - ["identifier","CIP"], - ["paren.rparen",")]"], - ["text",";@"], - ["support.function","tr"], - ["text"," "], - ["identifier","me"], - ["keyword.operator","/"], - ["identifier","ciploop"], - ["text",";@"], - ["support.function","tr"], - ["text"," "], - ["variable","%qq"], - ["keyword.operator","/"], - ["identifier","ciploop"], - ["text",";"], - ["paren.rparen","}"], - ["text",","], - ["constant.numeric","3"], - ["text",","], - ["paren.lparen","{"], - ["text","@"], - ["support.function","emit"], - ["text"," "], - ["identifier","On"], - ["text"," "], - ["paren.lparen","["], - ["support.function","fullname"], - ["paren.lparen","("], - ["identifier","me"], - ["paren.rparen",")]"], - ["text","'"], - ["support.function","s"], - ["text"," "], - ["identifier","earpiece"], - ["text"," "], - ["identifier","you"], - ["text"," "], - ["identifier","hear"], - ["text"," "], - ["identifier","a"], - ["text"," "], - ["identifier","ringing"], - ["text"," "], - ["identifier","sound"], - ["text","."], - ["paren.lparen","["], - ["support.function","play"], - ["paren.lparen","("], - ["support.function","u"], - ["paren.lparen","("], - ["identifier","LINETONE"], - ["paren.rparen","))]"], - ["text",";@"], - ["support.function","tr"], - ["text"," "], - ["identifier","me"], - ["keyword.operator","/"], - ["identifier","ringhere"], - ["text",";@"], - ["identifier","increment"], - ["text"," "], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["identifier","connecting"], - ["paren.rparen",")]"], - ["keyword.operator","/"], - ["identifier","RANGS"], - ["text",";@"], - ["identifier","wait"], - ["text"," "], - ["constant.numeric","5"], - ["keyword.operator","="], - ["paren.lparen","{"], - ["text","@"], - ["support.function","tr"], - ["text"," "], - ["identifier","me"], - ["keyword.operator","/"], - ["identifier","ringloop"], - ["paren.rparen","}"], - ["text",";"], - ["paren.rparen","}"], - ["text",","], - ["constant.numeric","4"], - ["text",","], - ["paren.lparen","{"], - ["paren.rparen","}"] -],[ - "start", - ["text","&"], - ["identifier","ringstate"], - ["text"," "], - ["identifier","phone"], - ["keyword.operator","="], - ["paren.lparen","["], - ["support.function","setq"], - ["paren.lparen","("], - ["identifier","q"], - ["text",","], - ["support.function","u"], - ["paren.lparen","("], - ["identifier","connecting"], - ["paren.rparen","))]"], - ["paren.lparen","["], - ["support.function","setq"], - ["paren.lparen","("], - ["constant.numeric","1"], - ["text",","], - ["paren.lparen","["], - ["support.function","gt"], - ["paren.lparen","("], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%qq"], - ["keyword.operator","/"], - ["identifier","rangs"], - ["paren.rparen",")"], - ["text",","], - ["support.function","sub"], - ["paren.lparen","("], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%qq"], - ["keyword.operator","/"], - ["identifier","rings"], - ["paren.rparen",")"], - ["text",","], - ["constant.numeric","1"], - ["paren.rparen","))])]"], - ["paren.lparen","["], - ["support.function","setq"], - ["paren.lparen","("], - ["constant.numeric","2"], - ["text",","], - ["paren.lparen","["], - ["support.function","and"], - ["paren.lparen","("], - ["support.function","u"], - ["paren.lparen","("], - ["identifier","is"], - ["text",","], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%qq"], - ["keyword.operator","/"], - ["identifier","MODE"], - ["paren.rparen",")"], - ["text",","], - ["identifier","CIP"], - ["paren.rparen",")"], - ["text",","], - ["support.function","u"], - ["paren.lparen","("], - ["identifier","is"], - ["text",","], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%qq"], - ["keyword.operator","/"], - ["identifier","INCOMING"], - ["paren.rparen",")"], - ["text",","], - ["paren.lparen","["], - ["support.function","num"], - ["paren.lparen","("], - ["identifier","me"], - ["paren.rparen",")]))]"], - ["paren.lparen","["], - ["support.function","setq"], - ["paren.lparen","("], - ["constant.numeric","3"], - ["text",","], - ["paren.lparen","["], - ["support.function","u"], - ["paren.lparen","("], - ["identifier","is"], - ["text",","], - ["support.function","u"], - ["paren.lparen","("], - ["variable","%qq"], - ["keyword.operator","/"], - ["identifier","MODE"], - ["paren.rparen",")"], - ["text",","], - ["identifier","ICC"], - ["paren.rparen",")])]"], - ["paren.lparen","["], - ["support.function","ifelse"], - ["paren.lparen","("], - ["variable","%q1"], - ["text",","], - ["constant.numeric","1"], - ["text",","], - ["support.function","ifelse"], - ["paren.lparen","("], - ["variable","%q2"], - ["text",","], - ["constant.numeric","2"], - ["text",","], - ["support.function","ifelse"], - ["paren.lparen","("], - ["variable","%q3"], - ["text",","], - ["constant.numeric","3"], - ["text",","], - ["constant.numeric","4"], - ["paren.rparen",")))]"] -],[ - "start", - ["text",";"], - ["identifier","comment"] -],[ - "start", - ["text","@@"], - ["paren.lparen","("], - ["identifier","comment"], - ["paren.rparen",")"] -],[ - "start", - ["keyword","say"], - ["text"," "], - ["paren.lparen","["], - ["support.function","time"], - ["paren.lparen","("], - ["paren.rparen",")]"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_mysql.json b/lib/ace/mode/_test/tokens_mysql.json deleted file mode 100644 index 9909eadd..00000000 --- a/lib/ace/mode/_test/tokens_mysql.json +++ /dev/null @@ -1,4 +0,0 @@ -[[ - "start", - ["identifier","TODO"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_nix.json b/lib/ace/mode/_test/tokens_nix.json deleted file mode 100644 index b9424456..00000000 --- a/lib/ace/mode/_test/tokens_nix.json +++ /dev/null @@ -1,360 +0,0 @@ -[[ - "start", - ["text","{"] -],[ - "start", - ["text"," "], - ["comment","# Name of our deployment"] -],[ - "start", - ["text"," "], - ["identifier","network"], - ["text","."], - ["identifier","description"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," "], - ["string","\"HelloWorld\""], - ["text",";"] -],[ - "start", - ["text"," "], - ["comment","# Enable rolling back to previous versions of our infrastructure"] -],[ - "start", - ["text"," "], - ["identifier","network"], - ["text","."], - ["identifier","enableRollback"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," "], - ["constant.language.nix","true"], - ["text",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["comment","# It consists of a single server named 'helloserver'"] -],[ - "start", - ["text"," "], - ["identifier","helloserver"], - ["text"," "], - ["keyword.operator.assignment.nix","="] -],[ - "start", - ["text"," "], - ["comment","# Every server gets passed a few arguments, including a reference"] -],[ - "start", - ["text"," "], - ["comment","# to nixpkgs (pkgs)"] -],[ - "start", - ["text"," { "], - ["identifier","config"], - ["text",", "], - ["identifier","pkgs"], - ["text",", ... }:"] -],[ - "start", - ["text"," "], - ["keyword.declaration.nix","let"] -],[ - "start", - ["text"," "], - ["comment","# We import our custom packages from ./default passing pkgs as argument"] -],[ - "start", - ["text"," "], - ["identifier","packages"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," "], - ["keyword.control.nix","import"], - ["text"," ./"], - ["identifier","default"], - ["text","."], - ["identifier","nix"], - ["text"," { "], - ["identifier","pkgs"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," "], - ["identifier","pkgs"], - ["text","; };"] -],[ - "start", - ["text"," "], - ["comment","# This is the nodejs version specified in default.nix"] -],[ - "start", - ["text"," "], - ["identifier","nodejs"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," "], - ["identifier","packages"], - ["text","."], - ["identifier","nodejs"], - ["text",";"] -],[ - "start", - ["text"," "], - ["comment","# And this is the application we'd like to deploy"] -],[ - "start", - ["text"," "], - ["identifier","app"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," "], - ["identifier","packages"], - ["text","."], - ["identifier","app"], - ["text",";"] -],[ - "start", - ["text"," "], - ["keyword.declaration.nix","in"] -],[ - "start", - ["text"," {"] -],[ - "start", - ["text"," "], - ["comment","# We'll be running our application on port 8080, because a regular"] -],[ - "start", - ["text"," "], - ["comment","# user cannot bind to port 80"] -],[ - "start", - ["text"," "], - ["comment","# Then, using some iptables magic we'll forward traffic designated to port 80 to 8080"] -],[ - "start", - ["text"," "], - ["identifier","networking"], - ["text","."], - ["identifier","firewall"], - ["text","."], - ["identifier","enable"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," "], - ["constant.language.nix","true"], - ["text",";"] -],[ - "start", - ["text"," "], - ["comment","# We will open up port 22 (SSH) as well otherwise we're locking ourselves out"] -],[ - "start", - ["text"," "], - ["identifier","networking"], - ["text","."], - ["identifier","firewall"], - ["text","."], - ["identifier","allowedTCPPorts"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," [ "], - ["constant.numeric","80"], - ["text"," "], - ["constant.numeric","8080"], - ["text"," "], - ["constant.numeric","22"], - ["text"," ];"] -],[ - "start", - ["text"," "], - ["identifier","networking"], - ["text","."], - ["identifier","firewall"], - ["text","."], - ["identifier","allowPing"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," "], - ["constant.language.nix","true"], - ["text",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["comment","# Port forwarding using iptables"] -],[ - "qqdoc", - ["text"," "], - ["identifier","networking"], - ["text","."], - ["identifier","firewall"], - ["text","."], - ["identifier","extraCommands"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," "], - ["string","''"] -],[ - "qqdoc", - ["string"," iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080"] -],[ - "start", - ["string"," ''"], - ["text",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["comment","# To run our node.js program we're going to use a systemd service"] -],[ - "start", - ["text"," "], - ["comment","# We can configure the service to automatically start on boot and to restart"] -],[ - "start", - ["text"," "], - ["comment","# the process in case it crashes"] -],[ - "start", - ["text"," "], - ["identifier","systemd"], - ["text","."], - ["identifier","services"], - ["text","."], - ["identifier","helloserver"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," {"] -],[ - "start", - ["text"," "], - ["identifier","description"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," "], - ["string","\"Hello world application\""], - ["text",";"] -],[ - "start", - ["text"," "], - ["comment","# Start the service after the network is available"] -],[ - "start", - ["text"," "], - ["identifier","after"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," [ "], - ["string","\"network.target\""], - ["text"," ];"] -],[ - "start", - ["text"," "], - ["comment","# We're going to run it on port 8080 in production"] -],[ - "start", - ["text"," "], - ["identifier","environment"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," { "], - ["identifier","PORT"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," "], - ["string","\"8080\""], - ["text","; };"] -],[ - "start", - ["text"," "], - ["identifier","serviceConfig"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," {"] -],[ - "start", - ["text"," "], - ["comment","# The actual command to run"] -],[ - "start", - ["text"," "], - ["identifier","ExecStart"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," "], - ["string","\""], - ["constant.language.escape","${"], - ["identifier","nodejs"], - ["constant.language.escape","}"], - ["string","/bin/node "], - ["constant.language.escape","${"], - ["identifier","app"], - ["constant.language.escape","}"], - ["string","/server.js\""], - ["text",";"] -],[ - "start", - ["text"," "], - ["comment","# For security reasons we'll run this process as a special 'nodejs' user"] -],[ - "start", - ["text"," "], - ["identifier","User"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," "], - ["string","\"nodejs\""], - ["text",";"] -],[ - "start", - ["text"," "], - ["identifier","Restart"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," "], - ["string","\"always\""], - ["text",";"] -],[ - "start", - ["text"," };"] -],[ - "start", - ["text"," };"] -],[ - "start" -],[ - "start", - ["text"," "], - ["comment","# And lastly we ensure the user we run our application as is created"] -],[ - "start", - ["text"," "], - ["identifier","users"], - ["text","."], - ["identifier","extraUsers"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," {"] -],[ - "start", - ["text"," "], - ["identifier","nodejs"], - ["text"," "], - ["keyword.operator.assignment.nix","="], - ["text"," { };"] -],[ - "start", - ["text"," };"] -],[ - "start", - ["text"," };"] -],[ - "start", - ["text","}"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_objectivec.json b/lib/ace/mode/_test/tokens_objectivec.json deleted file mode 100644 index cdfd1196..00000000 --- a/lib/ace/mode/_test/tokens_objectivec.json +++ /dev/null @@ -1,793 +0,0 @@ -[[ - "start", - ["storage.type.objc","@"], - ["punctuation.definition.storage.type.objc","protocol"], - ["entity.name.type.objc"," Printing"], - ["text",": "], - ["entity.other.inherited-class.objc","someParent"] -],[ - "start", - ["meta.function.objc","-"], - ["paren.lparen","("], - ["storage.type","void"], - ["paren.rparen",")"], - ["text"," "], - ["identifier","print"], - ["punctuation.operator",";"] -],[ - "start", - ["storage.type.objc","@end"] -],[ - "start" -],[ - "start", - ["storage.type.objc","@"], - ["punctuation.definition.storage.type.objc","interface"], - ["entity.name.type.objc"," Fraction"], - ["text",": "], - ["entity.other.inherited-class.objc","NSObject"], - ["text"," "], - ["keyword.operator","<"], - ["identifier","Printing"], - ["punctuation.operator",","], - ["text"," "], - ["support.class.cocoa","NSCopying"], - ["keyword.operator",">"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["storage.type","int"], - ["text"," "], - ["identifier","numerator"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["storage.type","int"], - ["text"," "], - ["identifier","denominator"], - ["punctuation.operator",";"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start", - ["storage.type.objc","@end"] -],[ - "start" -],[ - "start", - ["string.begin.objc","@\""], - ["string","blah"], - ["invalid.illegal.unknown-escape.objc","\\8"], - ["punctuation.definition.string.end","\""], - ["text"," "], - ["string.begin.objc","@\""], - ["string","a"], - ["constant.character.escape.objc","\\222"], - ["string","sd"], - ["invalid.illegal.unknown-escape.objc","\\d"], - ["punctuation.definition.string.end","\""], - ["text"," "], - ["string.begin.objc","@\""], - ["constant.character.escape.objc","\\f"], - ["string","aw"], - ["constant.character.escape.objc","\\\"\\?"], - ["string"," "], - ["constant.character.escape.objc","\\'"], - ["string"," "], - ["constant.character.escape.objc","\\4"], - ["string"," n"], - ["constant.character.escape.objc","\\\\"], - ["punctuation.definition.string.end","\""], - ["text"," "], - ["string.begin.objc","@\""], - ["constant.character.escape.objc","\\56"], - ["punctuation.definition.string.end","\""] -],[ - "start", - ["string.begin.objc","@\""], - ["constant.character.escape.objc","\\xSF42"], - ["punctuation.definition.string.end","\""] -],[ - "start" -],[ - "start", - ["meta.function.objc","-"], - ["paren.lparen","("], - ["support.class.cocoa","NSDecimalNumber"], - ["keyword.operator","*"], - ["paren.rparen",")"], - ["identifier","addCount"], - ["punctuation.operator",":"], - ["paren.lparen","("], - ["storage.type.id.objc","id"], - ["paren.rparen",")"], - ["identifier","addObject"], - ["paren.lparen","{"] -],[ - "start" -],[ - "start", - ["keyword.control","return"], - ["text"," "], - ["punctuation.section.scope.begin.objc","["], - ["identifier","count"], - ["text"," "], - ["support.function.any-method.objc","decimalNumberByAdding:"], - ["identifier","addObject"], - ["punctuation.operator","."], - ["identifier","count"], - ["paren.rparen","]"], - ["punctuation.operator",";"] -],[ - "start" -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["text"," "], - ["keyword.control.macro.objc","NS_DURING"], - ["text"," "], - ["keyword.control.macro.objc","NS_HANDLER"], - ["text"," "], - ["keyword.control.macro.objc","NS_ENDHANDLER"] -],[ - "start" -],[ - "start", - ["punctuation.definition.keyword.objc","@"], - ["keyword.control.exception.objc","try"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword.control","if"], - ["text"," "], - ["paren.lparen","("], - ["identifier","argc"], - ["text"," "], - ["keyword.operator",">"], - ["text"," "], - ["constant.numeric","1"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["punctuation.definition.keyword.objc","@"], - ["keyword.control.exception.objc","throw"], - ["text"," "], - ["punctuation.section.scope.begin.objc","["], - ["support.class.cocoa","NSException"], - ["text"," "], - ["support.function.any-method.objc","exceptionWithName:"], - ["string.begin.objc","@\""], - ["string","Throwing a test exception"], - ["punctuation.definition.string.end","\""], - ["text"," "], - ["identifier","reason"], - ["punctuation.operator",":"], - ["string.begin.objc","@\""], - ["string","Testing the @throw directive."], - ["punctuation.definition.string.end","\""], - ["text"," "], - ["identifier","userInfo"], - ["punctuation.operator",":"], - ["constant.language.objc","nil"], - ["paren.rparen","]"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["paren.rparen","}"], - ["text"," "] -],[ - "start", - ["punctuation.definition.keyword.objc","@"], - ["keyword.control.exception.objc","catch"], - ["text"," "], - ["paren.lparen","("], - ["storage.type.id.objc","id"], - ["text"," "], - ["identifier","theException"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["support.function.cocoa","NSLog"], - ["paren.lparen","("], - ["string.begin.objc","@\""], - ["string","%@"], - ["punctuation.definition.string.end","\""], - ["punctuation.operator",","], - ["text"," "], - ["identifier","theException"], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["identifier","result"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","1"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["paren.rparen","}"], - ["text"," "] -],[ - "start", - ["punctuation.definition.keyword.objc","@"], - ["keyword.control.exception.objc","finally"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["support.function.cocoa","NSLog"], - ["paren.lparen","("], - ["string.begin.objc","@\""], - ["string","This always happens."], - ["punctuation.definition.string.end","\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["identifier","result"], - ["text"," "], - ["keyword.operator","+="], - ["text"," "], - ["constant.numeric","2"], - ["text"," "], - ["punctuation.operator",";"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["text"," "], - ["punctuation.definition.storage.modifier.objc","@"], - ["storage.modifier.objc","synchronized"], - ["paren.lparen","("], - ["identifier","lock"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["support.function.cocoa","NSLog"], - ["paren.lparen","("], - ["string.begin.objc","@\""], - ["string","Hello World"], - ["punctuation.definition.string.end","\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["storage.type","struct"], - ["text"," "], - ["paren.lparen","{"], - ["text"," "], - ["punctuation.definition.keyword.objc","@"], - ["keyword.other.objc","defs"], - ["paren.lparen","("], - ["text"," "], - ["support.class.cocoa","NSObject"], - ["paren.rparen",")"], - ["text"," "], - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["storage.type","char"], - ["text"," "], - ["keyword.operator","*"], - ["identifier","enc1"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["punctuation.definition.keyword.objc","@"], - ["keyword.other.objc","encode"], - ["paren.lparen","("], - ["storage.type","int"], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["storage.type.objc","IBOutlet"], - ["text","|"], - ["storage.type.objc","IBAction"], - ["text","|"], - ["storage.type.objc","BOOL"], - ["text","|"], - ["storage.type.objc","SEL"], - ["text","|"], - ["storage.type.id.objc","id"], - ["text","|"], - ["storage.type.objc","unichar"], - ["text","|"], - ["storage.type.objc","IMP"], - ["text","|"], - ["storage.type.objc","Class"], - ["text"," "] -],[ - "start" -],[ - "start" -],[ - "start", - ["text"," "], - ["punctuation.definition.storage.type.objc","@"], - ["storage.type.objc","class"], - ["text"," "], - ["punctuation.definition.storage.type.objc","@"], - ["storage.type.objc","protocol"] -],[ - "start" -],[ - "start", - ["punctuation.definition.storage.modifier.objc","@"], - ["storage.modifier.objc","public"] -],[ - "start", - ["text"," "], - ["comment","// instance variables"] -],[ - "start", - ["punctuation.definition.storage.modifier.objc","@"], - ["storage.modifier.objc","package"] -],[ - "start", - ["text"," "], - ["comment","// instance variables"] -],[ - "start", - ["punctuation.definition.storage.modifier.objc","@"], - ["storage.modifier.objc","protected"] -],[ - "start", - ["text"," "], - ["comment","// instance variables"] -],[ - "start", - ["punctuation.definition.storage.modifier.objc","@"], - ["storage.modifier.objc","private"] -],[ - "start", - ["text"," "], - ["comment","// instance variables"] -],[ - "start" -],[ - "start", - ["text"," "], - ["constant.language.objc","YES"], - ["text"," "], - ["constant.language.objc","NO"], - ["text"," "], - ["constant.language.objc","Nil"], - ["text"," "], - ["constant.language.objc","nil"] -],[ - "start", - ["support.variable.foundation","NSApp"], - ["paren.lparen","("], - ["paren.rparen",")"] -],[ - "start", - ["support.function.cocoa.leopard","NSRectToCGRect"], - ["text"," "], - ["paren.lparen","("], - ["identifier","Protocol"], - ["text"," "], - ["identifier","ProtocolFromString"], - ["punctuation.operator",":"], - ["string","\"NSTableViewDelegate\""], - ["paren.rparen","))"] -],[ - "start" -],[ - "start", - ["punctuation.section.scope.begin.objc","["], - ["identifier","SPPoint"], - ["text"," "], - ["support.function.any-method.objc","pointFromCGPoint:"], - ["identifier","self"], - ["punctuation.operator","."], - ["identifier","position"], - ["paren.rparen","]"] -],[ - "start" -],[ - "start", - ["support.function.cocoa","NSRoundDownToMultipleOfPageSize"] -],[ - "start" -],[ - "start", - ["keyword","#import"], - ["constant.other"," "] -],[ - "start" -],[ - "start", - ["storage.type","int"], - ["text"," "], - ["identifier","main"], - ["paren.lparen","("], - ["text"," "], - ["storage.type","int"], - ["text"," "], - ["identifier","argc"], - ["punctuation.operator",","], - ["text"," "], - ["storage.modifier","const"], - ["text"," "], - ["storage.type","char"], - ["text"," "], - ["keyword.operator","*"], - ["identifier","argv"], - ["punctuation.section.scope.begin.objc","["], - ["punctuation.section.scope.end.objc","]"], - ["text"," "], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["support.function.C99.c","printf"], - ["paren.lparen","("], - ["text"," "], - ["string","\"hello world\\n\""], - ["text"," "], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword.control","return"], - ["text"," "], - ["constant.numeric","0"], - ["punctuation.operator",";"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["support.class.cocoa","NSChangeSpelling"] -],[ - "start" -],[ - "start", - ["string.begin.objc","@\""], - ["string","0 != SUBQUERY(image, $x, 0 != SUBQUERY($x.bookmarkItems, $y, $y.@count == 0).@count).@count"], - ["punctuation.definition.string.end","\""] -],[ - "start" -],[ - "start", - ["punctuation.definition.storage.type.objc","@selector"], - ["punctuation","("], - ["support.function.any-method.name-of-parameter.objc","lowercaseString"], - ["punctuation",")"], - ["text"," "], - ["punctuation.definition.storage.type.objc","@selector"], - ["punctuation","("], - ["support.function.any-method.name-of-parameter.objc","uppercaseString:"], - ["punctuation",")"] -],[ - "start" -],[ - "start", - ["identifier","NSFetchRequest"], - ["text"," "], - ["keyword.operator","*"], - ["identifier","localRequest"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["punctuation.section.scope.begin.objc","[["], - ["identifier","NSFetchRequest"], - ["text"," "], - ["support.function.any-method.objc","alloc"], - ["paren.rparen","]"], - ["text"," "], - ["identifier","init"], - ["paren.rparen","]"], - ["punctuation.operator",";"], - ["text"," "] -],[ - "start", - ["identifier","localRequest"], - ["punctuation.operator","."], - ["identifier","entity"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["punctuation.section.scope.begin.objc","["], - ["identifier","NSEntityDescription"], - ["text"," "], - ["support.function.any-method.objc","entityForName:"], - ["string.begin.objc","@\""], - ["string","VNSource"], - ["punctuation.definition.string.end","\""], - ["text"," "], - ["identifier","inManagedObjectContext"], - ["punctuation.operator",":"], - ["identifier","context"], - ["paren.rparen","]"], - ["punctuation.operator",";"], - ["text"," "] -],[ - "start", - ["identifier","localRequest"], - ["punctuation.operator","."], - ["identifier","sortDescriptors"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["punctuation.section.scope.begin.objc","["], - ["support.class.cocoa","NSArray"], - ["text"," "], - ["support.function.any-method.objc","arrayWithObject:"], - ["punctuation.section.scope.begin.objc","["], - ["support.class.cocoa","NSSortDescriptor"], - ["text"," "], - ["support.function.any-method.objc","sortDescriptorWithKey:"], - ["string.begin.objc","@\""], - ["string","resolution"], - ["punctuation.definition.string.end","\""], - ["text"," "], - ["identifier","ascending"], - ["punctuation.operator",":"], - ["constant.language.objc","YES"], - ["paren.rparen","]]"], - ["punctuation.operator",";"], - ["text"," "] -],[ - "start", - ["support.class.cocoa","NSPredicate"], - ["text"," "], - ["keyword.operator","*"], - ["identifier","predicate"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["punctuation.section.scope.begin.objc","["], - ["support.class.cocoa","NSPredicate"], - ["text"," "], - ["support.function.any-method.objc","predicateWithFormat:"], - ["string.begin.objc","@\""], - ["string","0 != SUBQUERY(image, $x, 0 != SUBQUERY($x.bookmarkItems, $y, $y.@count == 0).@count).@count"], - ["punctuation.definition.string.end","\""], - ["paren.rparen","]"], - ["punctuation.operator",";"] -],[ - "start", - ["punctuation.section.scope.begin.objc","["], - ["support.class.cocoa","NSPredicate"], - ["text"," "], - ["support.function.any-method.objc","predicateWithFormat:"], - ["paren.rparen","]"] -],[ - "start", - ["support.class.cocoa","NSString"], - ["text"," "], - ["keyword.operator","*"], - ["identifier","predicateString"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["punctuation.section.scope.begin.objc","["], - ["support.class.cocoa","NSString"], - ["text"," "], - ["support.function.any-method.objc","stringWithFormat:"], - ["string.begin.objc","@\""], - ["string","SELF beginsWith[cd] %@"], - ["punctuation.definition.string.end","\""], - ["punctuation.operator",","], - ["text"," "], - ["identifier","searchString"], - ["paren.rparen","]"], - ["punctuation.operator",";"] -],[ - "start", - ["support.class.cocoa","NSPredicate"], - ["text"," "], - ["keyword.operator","*"], - ["identifier","pred"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["punctuation.section.scope.begin.objc","["], - ["support.class.cocoa","NSPredicate"], - ["text"," "], - ["support.function.any-method.objc","predicateWithFormat:"], - ["identifier","predicateString"], - ["paren.rparen","]"], - ["punctuation.operator",";"] -],[ - "start", - ["support.class.cocoa","NSArray"], - ["text"," "], - ["keyword.operator","*"], - ["identifier","filteredKeys"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["punctuation.section.scope.begin.objc","[["], - ["identifier","myMutableDictionary"], - ["text"," "], - ["support.function.any-method.objc","allKeys"], - ["paren.rparen","]"], - ["text"," "], - ["identifier","filteredArrayUsingPredicate"], - ["punctuation.operator",":"], - ["identifier","pred"], - ["paren.rparen","]"], - ["punctuation.operator",";"], - ["text"," "] -],[ - "start" -],[ - "start", - ["identifier","localRequest"], - ["punctuation.operator","."], - ["identifier","predicate"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["punctuation.section.scope.begin.objc","["], - ["support.class.cocoa","NSPredicate"], - ["text"," "], - ["support.function.any-method.objc","predicateWithFormat:"], - ["string.begin.objc","@\""], - ["string","whichChart = %@"], - ["punctuation.definition.string.end","\""], - ["text"," "], - ["identifier","argumentArray"], - ["punctuation.operator",":"], - ["text"," "], - ["identifier","listChartToDownload"], - ["paren.rparen","]"], - ["punctuation.operator",";"] -],[ - "start", - ["identifier","localRequest"], - ["punctuation.operator","."], - ["identifier","fetchBatchSize"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","100"], - ["punctuation.operator",";"] -],[ - "start", - ["identifier","arrayRequest"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["punctuation.section.scope.begin.objc","["], - ["identifier","context"], - ["text"," "], - ["support.function.any-method.objc","executeFetchRequest:"], - ["identifier","localRequest"], - ["text"," "], - ["identifier","error"], - ["punctuation.operator",":"], - ["keyword.operator","&"], - ["identifier","error1"], - ["paren.rparen","]"], - ["punctuation.operator",";"] -],[ - "start" -],[ - "start", - ["punctuation.section.scope.begin.objc","["], - ["identifier","localRequest"], - ["text"," "], - ["support.function.any-method.objc","release"], - ["paren.rparen","]"], - ["punctuation.operator",";"] -],[ - "start" -],[ - "start", - ["keyword","#ifndef"], - ["text"," "], - ["constant.language.objc","Nil"] -],[ - "start", - ["keyword","#define"], - ["constant.other"," Nil __DARWIN_NULL "], - ["comment","/* id of Nil class */"] -],[ - "start", - ["keyword","#endif"] -],[ - "start" -],[ - "start", - ["storage.type.objc","@implementation"], - ["entity.name.type.objc"," MyObject"] -],[ - "start", - ["meta.function.objc","- "], - ["paren.lparen","("], - ["storage.type","unsigned"], - ["text"," "], - ["storage.type","int"], - ["paren.rparen",")"], - ["identifier","areaOfWidth"], - ["punctuation.operator",":"], - ["paren.lparen","("], - ["storage.type","unsigned"], - ["text"," "], - ["storage.type","int"], - ["paren.rparen",")"], - ["identifier","width"] -],[ - "start", - ["text"," "], - ["identifier","height"], - ["punctuation.operator",":"], - ["paren.lparen","("], - ["storage.type","unsigned"], - ["text"," "], - ["storage.type","int"], - ["paren.rparen",")"], - ["identifier","height"] -],[ - "start", - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword.control","return"], - ["text"," "], - ["identifier","width"], - ["keyword.operator","*"], - ["identifier","height"], - ["punctuation.operator",";"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start", - ["storage.type.objc","@end"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_ocaml.json b/lib/ace/mode/_test/tokens_ocaml.json deleted file mode 100644 index 73e3cfcd..00000000 --- a/lib/ace/mode/_test/tokens_ocaml.json +++ /dev/null @@ -1,200 +0,0 @@ -[[ - "comment", - ["comment","(*"] -],[ - "comment", - ["comment"," * Example of early return implementation taken from"] -],[ - "comment", - ["comment"," * http://ocaml.janestreet.com/?q=node/91"] -],[ - "start", - ["comment"," *)"] -],[ - "start" -],[ - "start", - ["keyword","let"], - ["text"," "], - ["identifier","with_return"], - ["text"," "], - ["paren.lparen","("], - ["keyword","type"], - ["text"," "], - ["identifier","t"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","("], - ["identifier","f"], - ["text"," : "], - ["identifier","_"], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["identifier","t"], - ["paren.rparen",")"], - ["text"," "], - ["keyword.operator","="] -],[ - "start", - ["text"," "], - ["keyword","let"], - ["text"," "], - ["keyword","module"], - ["text"," "], - ["identifier","M"], - ["text"," "], - ["keyword.operator","="] -],[ - "start", - ["text"," "], - ["keyword","struct"], - ["text"," "], - ["keyword","exception"], - ["text"," "], - ["identifier","Return"], - ["text"," "], - ["keyword","of"], - ["text"," "], - ["identifier","t"], - ["text"," "], - ["keyword","end"] -],[ - "start", - ["text"," "], - ["keyword","in"] -],[ - "start", - ["text"," "], - ["keyword","let"], - ["text"," "], - ["identifier","return"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","{"], - ["text"," "], - ["identifier","return"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["keyword","fun"], - ["text"," "], - ["identifier","x"], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["support.function","raise"], - ["text"," "], - ["paren.lparen","("], - ["identifier","M"], - ["text","."], - ["identifier","Return"], - ["text"," "], - ["identifier","x"], - ["paren.rparen","))"], - ["text","; "], - ["paren.rparen","}"], - ["text"," "], - ["keyword","in"] -],[ - "start", - ["text"," "], - ["keyword","try"], - ["text"," "], - ["identifier","f"], - ["text"," "], - ["identifier","return"], - ["text"," "], - ["keyword","with"], - ["text"," "], - ["identifier","M"], - ["text","."], - ["identifier","Return"], - ["text"," "], - ["identifier","x"], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["identifier","x"] -],[ - "start" -],[ - "start" -],[ - "start", - ["comment","(* Function that uses the 'early return' functionality provided by `with_return` *)"] -],[ - "start", - ["keyword","let"], - ["text"," "], - ["identifier","sum_until_first_negative"], - ["text"," "], - ["support.function","list"], - ["text"," "], - ["keyword.operator","="] -],[ - "start", - ["text"," "], - ["identifier","with_return"], - ["text"," "], - ["paren.lparen","("], - ["keyword","fun"], - ["text"," "], - ["identifier","r"], - ["text"," "], - ["keyword.operator","->"] -],[ - "start", - ["text"," "], - ["support.function","List"], - ["text","."], - ["support.function","fold"], - ["text"," "], - ["support.function","list"], - ["text"," "], - ["keyword.operator","~"], - ["support.function","init"], - ["text",":"], - ["constant.numeric","0"], - ["text"," "], - ["keyword.operator","~"], - ["identifier","f"], - ["text",":"], - ["paren.lparen","("], - ["keyword","fun"], - ["text"," "], - ["identifier","acc"], - ["text"," "], - ["identifier","x"], - ["text"," "], - ["keyword.operator","->"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["identifier","x"], - ["text"," "], - ["keyword.operator",">="], - ["text"," "], - ["constant.numeric","0"], - ["text"," "], - ["keyword","then"], - ["text"," "], - ["identifier","acc"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["identifier","x"], - ["text"," "], - ["keyword","else"], - ["text"," "], - ["identifier","r"], - ["text","."], - ["identifier","return"], - ["text"," "], - ["identifier","acc"], - ["paren.rparen","))"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_pascal.json b/lib/ace/mode/_test/tokens_pascal.json deleted file mode 100644 index 22c1f0c4..00000000 --- a/lib/ace/mode/_test/tokens_pascal.json +++ /dev/null @@ -1,297 +0,0 @@ -[[ - "punctuation.definition.comment.pascal", - ["punctuation.definition.comment.pascal","(*"], - ["comment.block.pascal.one","****************************************************************************"] -],[ - "punctuation.definition.comment.pascal", - ["comment.block.pascal.one"," * A simple bubble sort program. Reads integers, one per line, and prints *"] -],[ - "punctuation.definition.comment.pascal", - ["comment.block.pascal.one"," * them out in sorted order. Blows up if there are more than 49. *"] -],[ - "start", - ["comment.block.pascal.one"," ****************************************************************************"], - ["punctuation.definition.comment.pascal","*)"] -],[ - "start", - ["keyword.control.pascal","PROGRAM"], - ["text"," Sort(input"], - ["keyword.operator",","], - ["text"," output)"], - ["keyword.operator",";"] -],[ - "start", - ["text"," "], - ["keyword.control.pascal","CONST"] -],[ - "start", - ["text"," "], - ["punctuation.definition.comment.pascal","(*"], - ["comment.block.pascal.one"," Max array size. "], - ["punctuation.definition.comment.pascal","*)"] -],[ - "start", - ["text"," MaxElts "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric.pascal","50"], - ["keyword.operator",";"] -],[ - "start", - ["text"," "], - ["keyword.control.pascal","TYPE"], - ["text"," "] -],[ - "start", - ["text"," "], - ["punctuation.definition.comment.pascal","(*"], - ["comment.block.pascal.one"," Type of the element array. "], - ["punctuation.definition.comment.pascal","*)"] -],[ - "start", - ["text"," IntArrType "], - ["keyword.operator","="], - ["text"," "], - ["keyword.control.pascal","ARRAY"], - ["text"," ["], - ["constant.numeric.pascal","1"], - ["text","..MaxElts] "], - ["keyword.control.pascal","OF"], - ["text"," Integer"], - ["keyword.operator",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["keyword.control.pascal","VAR"] -],[ - "start", - ["text"," "], - ["punctuation.definition.comment.pascal","(*"], - ["comment.block.pascal.one"," Indexes, exchange temp, array size. "], - ["punctuation.definition.comment.pascal","*)"] -],[ - "start", - ["text"," i"], - ["keyword.operator",","], - ["text"," j"], - ["keyword.operator",","], - ["text"," tmp"], - ["keyword.operator",","], - ["text"," size: integer"], - ["keyword.operator",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["punctuation.definition.comment.pascal","(*"], - ["comment.block.pascal.one"," Array of ints "], - ["punctuation.definition.comment.pascal","*)"] -],[ - "start", - ["text"," arr: IntArrType"], - ["keyword.operator",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["punctuation.definition.comment.pascal","(*"], - ["comment.block.pascal.one"," Read in the integers. "], - ["punctuation.definition.comment.pascal","*)"] -],[ - "start", - ["text"," "], - ["variable.pascal","PROCEDURE"], - ["text"," "], - ["storage.type.function.pascal","ReadArr"], - ["text","("], - ["keyword.control.pascal","VAR"], - ["text"," size: Integer"], - ["keyword.operator",";"], - ["text"," "], - ["keyword.control.pascal","VAR"], - ["text"," a: IntArrType)"], - ["keyword.operator",";"], - ["text"," "] -],[ - "start", - ["text"," "], - ["keyword.control.pascal","BEGIN"] -],[ - "start", - ["text"," size "], - ["keyword.operator",":="], - ["text"," "], - ["constant.numeric.pascal","1"], - ["keyword.operator",";"] -],[ - "start", - ["text"," "], - ["keyword.control.pascal","WHILE"], - ["text"," "], - ["keyword.control.pascal","NOT"], - ["text"," eof "], - ["keyword.control.pascal","DO"], - ["text"," "], - ["keyword.control.pascal","BEGIN"] -],[ - "start", - ["text"," readln(a[size])"], - ["keyword.operator",";"] -],[ - "start", - ["text"," "], - ["keyword.control.pascal","IF"], - ["text"," "], - ["keyword.control.pascal","NOT"], - ["text"," eof "], - ["keyword.control.pascal","THEN"], - ["text"," "] -],[ - "start", - ["text"," size "], - ["keyword.operator",":="], - ["text"," size "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric.pascal","1"] -],[ - "start", - ["text"," "], - ["keyword.control.pascal","END"] -],[ - "start", - ["text"," "], - ["keyword.control.pascal","END"], - ["keyword.operator",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["keyword.control.pascal","BEGIN"] -],[ - "start", - ["text"," "], - ["punctuation.definition.comment.pascal","(*"], - ["comment.block.pascal.one"," Read "], - ["punctuation.definition.comment.pascal","*)"] -],[ - "start", - ["text"," ReadArr(size"], - ["keyword.operator",","], - ["text"," arr)"], - ["keyword.operator",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["punctuation.definition.comment.pascal","(*"], - ["comment.block.pascal.one"," Sort using bubble sort. "], - ["punctuation.definition.comment.pascal","*)"] -],[ - "start", - ["text"," "], - ["keyword.control.pascal","FOR"], - ["text"," i "], - ["keyword.operator",":="], - ["text"," size "], - ["keyword.operator","-"], - ["text"," "], - ["constant.numeric.pascal","1"], - ["text"," DOWNTO "], - ["constant.numeric.pascal","1"], - ["text"," "], - ["keyword.control.pascal","DO"] -],[ - "start", - ["text"," "], - ["keyword.control.pascal","FOR"], - ["text"," j "], - ["keyword.operator",":="], - ["text"," "], - ["constant.numeric.pascal","1"], - ["text"," "], - ["keyword.control.pascal","TO"], - ["text"," i "], - ["keyword.control.pascal","DO"], - ["text"," "] -],[ - "start", - ["text"," "], - ["keyword.control.pascal","IF"], - ["text"," arr[j] > arr[j "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric.pascal","1"], - ["text","] "], - ["keyword.control.pascal","THEN"], - ["text"," "], - ["keyword.control.pascal","BEGIN"] -],[ - "start", - ["text"," tmp "], - ["keyword.operator",":="], - ["text"," arr[j]"], - ["keyword.operator",";"] -],[ - "start", - ["text"," arr[j] "], - ["keyword.operator",":="], - ["text"," arr[j "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric.pascal","1"], - ["text","]"], - ["keyword.operator",";"] -],[ - "start", - ["text"," arr[j "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric.pascal","1"], - ["text","] "], - ["keyword.operator",":="], - ["text"," tmp"], - ["keyword.operator",";"] -],[ - "start", - ["text"," "], - ["keyword.control.pascal","END"], - ["keyword.operator",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["punctuation.definition.comment.pascal","(*"], - ["comment.block.pascal.one"," Print. "], - ["punctuation.definition.comment.pascal","*)"] -],[ - "start", - ["text"," "], - ["keyword.control.pascal","FOR"], - ["text"," i "], - ["keyword.operator",":="], - ["text"," "], - ["constant.numeric.pascal","1"], - ["text"," "], - ["keyword.control.pascal","TO"], - ["text"," size "], - ["keyword.control.pascal","DO"] -],[ - "start", - ["text"," writeln(arr[i])"] -],[ - "start", - ["text"," "], - ["keyword.control.pascal","END"], - ["text","."] -],[ - "start", - ["text"," "] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_perl.json b/lib/ace/mode/_test/tokens_perl.json deleted file mode 100644 index 30bb39c6..00000000 --- a/lib/ace/mode/_test/tokens_perl.json +++ /dev/null @@ -1,227 +0,0 @@ -[[ - "start", - ["comment","#!/usr/bin/perl"] -],[ - "block_comment", - ["comment.doc","=begin"] -],[ - "block_comment", - ["comment.doc"," perl example code for Ace"] -],[ - "start", - ["comment.doc","=cut"] -],[ - "start" -],[ - "start", - ["keyword","use"], - ["text"," "], - ["identifier","strict"], - ["text",";"] -],[ - "start", - ["keyword","use"], - ["text"," "], - ["identifier","warnings"], - ["text",";"] -],[ - "start", - ["keyword","my"], - ["text"," "], - ["identifier","$num_primes"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","0"], - ["text",";"] -],[ - "start", - ["keyword","my"], - ["text"," @"], - ["identifier","primes"], - ["text",";"] -],[ - "start" -],[ - "start", - ["comment","# Put 2 as the first prime so we won't have an empty array"] -],[ - "start", - ["identifier","$primes"], - ["lparen","["], - ["identifier","$num_primes"], - ["rparen","]"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","2"], - ["text",";"] -],[ - "start", - ["identifier","$num_primes"], - ["keyword.operator","++"], - ["text",";"] -],[ - "start" -],[ - "start", - ["identifier","MAIN_LOOP"], - ["text",":"] -],[ - "start", - ["keyword","for"], - ["text"," "], - ["keyword","my"], - ["text"," "], - ["identifier","$number_to_check"], - ["text"," "], - ["lparen","("], - ["constant.numeric","3"], - ["text"," "], - ["keyword.operator",".."], - ["text"," "], - ["constant.numeric","200"], - ["rparen",")"] -],[ - "start", - ["lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","for"], - ["text"," "], - ["keyword","my"], - ["text"," "], - ["identifier","$p"], - ["text"," "], - ["lparen","("], - ["constant.numeric","0"], - ["text"," "], - ["keyword.operator",".."], - ["text"," "], - ["lparen","("], - ["identifier","$num_primes"], - ["constant.numeric","-1"], - ["rparen","))"] -],[ - "start", - ["text"," "], - ["lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["lparen","("], - ["identifier","$number_to_check"], - ["text"," "], - ["keyword.operator","%"], - ["text"," "], - ["identifier","$primes"], - ["lparen","["], - ["identifier","$p"], - ["rparen","]"], - ["text"," "], - ["keyword.operator","=="], - ["text"," "], - ["constant.numeric","0"], - ["rparen",")"] -],[ - "start", - ["text"," "], - ["lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","next"], - ["text"," "], - ["identifier","MAIN_LOOP"], - ["text",";"] -],[ - "start", - ["text"," "], - ["rparen","}"] -],[ - "start", - ["text"," "], - ["rparen","}"] -],[ - "start" -],[ - "start", - ["text"," "], - ["comment","# If we reached this point it means $number_to_check is not"] -],[ - "start", - ["text"," "], - ["comment","# divisable by any prime number that came before it."] -],[ - "start", - ["text"," "], - ["identifier","$primes"], - ["lparen","["], - ["identifier","$num_primes"], - ["rparen","]"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","$number_to_check"], - ["text",";"] -],[ - "start", - ["text"," "], - ["identifier","$num_primes"], - ["keyword.operator","++"], - ["text",";"] -],[ - "start", - ["rparen","}"] -],[ - "start" -],[ - "start", - ["keyword","for"], - ["text"," "], - ["keyword","my"], - ["text"," "], - ["identifier","$p"], - ["text"," "], - ["lparen","("], - ["constant.numeric","0"], - ["text"," "], - ["keyword.operator",".."], - ["text"," "], - ["lparen","("], - ["identifier","$num_primes"], - ["constant.numeric","-1"], - ["rparen","))"] -],[ - "start", - ["lparen","{"] -],[ - "start", - ["text"," "], - ["support.function","print"], - ["text"," "], - ["identifier","$primes"], - ["lparen","["], - ["identifier","$p"], - ["rparen","]"], - ["keyword.operator",","], - ["text"," "], - ["string","\", \""], - ["text",";"] -],[ - "start", - ["rparen","}"] -],[ - "start", - ["support.function","print"], - ["text"," "], - ["string","\"\\n\""], - ["text",";"] -],[ - "start" -],[ - "start" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_pgsql.json b/lib/ace/mode/_test/tokens_pgsql.json deleted file mode 100644 index fef23fd2..00000000 --- a/lib/ace/mode/_test/tokens_pgsql.json +++ /dev/null @@ -1,889 +0,0 @@ -[[ - "start" -],[ - "start", - ["keyword.statementBegin","BEGIN"], - ["statementEnd",";"] -],[ - "start" -],[ - "doc-start", - ["comment.doc","/**"] -],[ - "doc-start", - ["comment.doc","* Samples from PostgreSQL src/tutorial/basics.source"] -],[ - "start", - ["comment.doc","*/"] -],[ - "statement", - ["keyword.statementBegin","CREATE"], - ["text"," "], - ["keyword","TABLE"], - ["text"," "], - ["identifier","weather"], - ["text"," "], - ["paren.lparen","("] -],[ - "statement", - ["text","\t"], - ["identifier","city"], - ["text","\t\t"], - ["keyword","varchar"], - ["paren.lparen","("], - ["constant.numeric","80"], - ["paren.rparen",")"], - ["text",","] -],[ - "statement", - ["text","\t"], - ["identifier","temp_lo"], - ["text","\t\t"], - ["keyword","int"], - ["text",",\t\t"], - ["comment","-- low temperature"] -],[ - "statement", - ["text","\t"], - ["identifier","temp_hi"], - ["text","\t\t"], - ["keyword","int"], - ["text",",\t\t"], - ["comment","-- high temperature"] -],[ - "statement", - ["text","\t"], - ["identifier","prcp"], - ["text","\t\t"], - ["keyword","real"], - ["text",",\t\t"], - ["comment","-- precipitation"] -],[ - "statement", - ["text","\t"], - ["variable.language","\"date\""], - ["text","\t\t"], - ["keyword","date"] -],[ - "start", - ["paren.rparen",")"], - ["statementEnd",";"] -],[ - "start" -],[ - "statement", - ["keyword.statementBegin","CREATE"], - ["text"," "], - ["keyword","TABLE"], - ["text"," "], - ["identifier","cities"], - ["text"," "], - ["paren.lparen","("] -],[ - "statement", - ["text","\t"], - ["keyword","name"], - ["text","\t\t"], - ["keyword","varchar"], - ["paren.lparen","("], - ["constant.numeric","80"], - ["paren.rparen",")"], - ["text",","] -],[ - "statement", - ["text","\t"], - ["keyword","location"], - ["text","\t"], - ["keyword","point"] -],[ - "start", - ["paren.rparen",")"], - ["statementEnd",";"] -],[ - "start" -],[ - "start" -],[ - "statement", - ["keyword.statementBegin","INSERT"], - ["text"," "], - ["keyword","INTO"], - ["text"," "], - ["identifier","weather"] -],[ - "start", - ["text"," "], - ["keyword","VALUES"], - ["text"," "], - ["paren.lparen","("], - ["string","'San Francisco'"], - ["text",", "], - ["constant.numeric","46"], - ["text",", "], - ["constant.numeric","50"], - ["text",", "], - ["constant.numeric","0.25"], - ["text",", "], - ["string","'1994-11-27'"], - ["paren.rparen",")"], - ["statementEnd",";"] -],[ - "start" -],[ - "statement", - ["keyword.statementBegin","INSERT"], - ["text"," "], - ["keyword","INTO"], - ["text"," "], - ["identifier","cities"] -],[ - "start", - ["text"," "], - ["keyword","VALUES"], - ["text"," "], - ["paren.lparen","("], - ["string","'San Francisco'"], - ["text",", "], - ["string","'(-194.0, 53.0)'"], - ["paren.rparen",")"], - ["statementEnd",";"] -],[ - "start" -],[ - "statement", - ["keyword.statementBegin","INSERT"], - ["text"," "], - ["keyword","INTO"], - ["text"," "], - ["identifier","weather"], - ["text"," "], - ["paren.lparen","("], - ["identifier","city"], - ["text",", "], - ["identifier","temp_lo"], - ["text",", "], - ["identifier","temp_hi"], - ["text",", "], - ["identifier","prcp"], - ["text",", "], - ["variable.language","\"date\""], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["keyword","VALUES"], - ["text"," "], - ["paren.lparen","("], - ["string","'San Francisco'"], - ["text",", "], - ["constant.numeric","43"], - ["text",", "], - ["constant.numeric","57"], - ["text",", "], - ["constant.numeric","0.0"], - ["text",", "], - ["string","'1994-11-29'"], - ["paren.rparen",")"], - ["statementEnd",";"] -],[ - "start" -],[ - "statement", - ["keyword.statementBegin","INSERT"], - ["text"," "], - ["keyword","INTO"], - ["text"," "], - ["identifier","weather"], - ["text"," "], - ["paren.lparen","("], - ["keyword","date"], - ["text",", "], - ["identifier","city"], - ["text",", "], - ["identifier","temp_hi"], - ["text",", "], - ["identifier","temp_lo"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["keyword","VALUES"], - ["text"," "], - ["paren.lparen","("], - ["string","'1994-11-29'"], - ["text",", "], - ["string","'Hayward'"], - ["text",", "], - ["constant.numeric","54"], - ["text",", "], - ["constant.numeric","37"], - ["paren.rparen",")"], - ["statementEnd",";"] -],[ - "start" -],[ - "start" -],[ - "start", - ["keyword.statementBegin","SELECT"], - ["text"," "], - ["identifier","city"], - ["text",", "], - ["paren.lparen","("], - ["identifier","temp_hi"], - ["keyword.operator","+"], - ["identifier","temp_lo"], - ["paren.rparen",")"], - ["keyword.operator","/"], - ["constant.numeric","2"], - ["text"," "], - ["keyword","AS"], - ["text"," "], - ["identifier","temp_avg"], - ["text",", "], - ["variable.language","\"date\""], - ["text"," "], - ["keyword","FROM"], - ["text"," "], - ["identifier","weather"], - ["statementEnd",";"] -],[ - "start" -],[ - "statement", - ["keyword.statementBegin","SELECT"], - ["text"," "], - ["identifier","city"], - ["text",", "], - ["identifier","temp_lo"], - ["text",", "], - ["identifier","temp_hi"], - ["text",", "], - ["identifier","prcp"], - ["text",", "], - ["variable.language","\"date\""], - ["text",", "], - ["keyword","location"] -],[ - "statement", - ["text"," "], - ["keyword","FROM"], - ["text"," "], - ["identifier","weather"], - ["text",", "], - ["identifier","cities"] -],[ - "start", - ["text"," "], - ["keyword","WHERE"], - ["text"," "], - ["identifier","city"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["keyword","name"], - ["statementEnd",";"] -],[ - "start" -],[ - "start" -],[ - "start" -],[ - "doc-start", - ["comment.doc","/**"] -],[ - "doc-start", - ["comment.doc","* Dollar quotes starting at the end of the line are colored as SQL unless"] -],[ - "doc-start", - ["comment.doc","* a special language tag is used. Dollar quote syntax coloring is implemented"] -],[ - "doc-start", - ["comment.doc","* for Perl, Python, JavaScript, and Json."] -],[ - "start", - ["comment.doc","*/"] -],[ - "statement", - ["keyword.statementBegin","create"], - ["text"," "], - ["keyword","or"], - ["text"," "], - ["keyword","replace"], - ["text"," "], - ["keyword","function"], - ["text"," "], - ["identifier","blob_content_chunked"], - ["paren.lparen","("] -],[ - "statement", - ["text"," "], - ["keyword","in"], - ["text"," "], - ["identifier","p_data"], - ["text"," "], - ["keyword","bytea"], - ["text",", "] -],[ - "statement", - ["text"," "], - ["keyword","in"], - ["text"," "], - ["identifier","p_chunk"], - ["text"," "], - ["keyword","integer"], - ["paren.rparen",")"] -],[ - "dollarSql", - ["keyword","returns"], - ["text"," "], - ["keyword","setof"], - ["text"," "], - ["keyword","bytea"], - ["text"," "], - ["keyword","as"], - ["text"," "], - ["string","$$"] -],[ - "dollarSql", - ["comment","-- Still SQL comments"] -],[ - "dollarSql", - ["keyword","declare"] -],[ - "dollarSql", - ["text","\t"], - ["identifier","v_size"], - ["text"," "], - ["keyword","integer"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["support.function","octet_length"], - ["paren.lparen","("], - ["identifier","p_data"], - ["paren.rparen",")"], - ["text",";"] -],[ - "dollarSql", - ["keyword","begin"] -],[ - "dollarSql", - ["text","\t"], - ["keyword","for"], - ["text"," "], - ["identifier","i"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["constant.numeric","1"], - ["text",".."], - ["identifier","v_size"], - ["text"," "], - ["keyword","by"], - ["text"," "], - ["identifier","p_chunk"], - ["text"," "], - ["identifier","loop"] -],[ - "dollarSql", - ["text","\t\t"], - ["identifier","return"], - ["text"," "], - ["keyword","next"], - ["text"," "], - ["keyword","substring"], - ["paren.lparen","("], - ["identifier","p_data"], - ["text"," "], - ["keyword","from"], - ["text"," "], - ["identifier","i"], - ["text"," "], - ["keyword","for"], - ["text"," "], - ["identifier","p_chunk"], - ["paren.rparen",")"], - ["text",";"] -],[ - "dollarSql", - ["text","\t"], - ["keyword","end"], - ["text"," "], - ["identifier","loop"], - ["text",";"] -],[ - "dollarSql", - ["keyword","end"], - ["text",";"] -],[ - "start", - ["string","$$"], - ["text"," "], - ["keyword","language"], - ["text"," "], - ["identifier","plpgsql"], - ["text"," "], - ["keyword","stable"], - ["statementEnd",";"] -],[ - "start" -],[ - "start" -],[ - "start", - ["comment","-- pl/perl"] -],[ - "perl-start", - ["keyword.statementBegin","CREATE"], - ["text"," "], - ["keyword","FUNCTION"], - ["text"," "], - ["identifier","perl_max"], - ["text"," "], - ["paren.lparen","("], - ["keyword","integer"], - ["text",", "], - ["keyword","integer"], - ["paren.rparen",")"], - ["text"," "], - ["keyword","RETURNS"], - ["text"," "], - ["keyword","integer"], - ["text"," "], - ["keyword","AS"], - ["text"," "], - ["string","$perl$"] -],[ - "perl-start", - ["text"," "], - ["comment","# perl comment..."] -],[ - "perl-start", - ["text"," "], - ["keyword","my"], - ["text"," "], - ["lparen","("], - ["identifier","$x"], - ["keyword.operator",","], - ["identifier","$y"], - ["rparen",")"], - ["text"," "], - ["keyword.operator","="], - ["text"," @"], - ["identifier","_"], - ["text",";"] -],[ - "perl-start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["lparen","("], - ["keyword.operator","!"], - ["text"," "], - ["support.function","defined"], - ["text"," "], - ["identifier","$x"], - ["rparen",")"], - ["text"," "], - ["lparen","{"] -],[ - "perl-start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["lparen","("], - ["keyword.operator","!"], - ["text"," "], - ["support.function","defined"], - ["text"," "], - ["identifier","$y"], - ["rparen",")"], - ["text"," "], - ["lparen","{"], - ["text"," "], - ["support.function","return"], - ["text"," "], - ["support.function","undef"], - ["text","; "], - ["rparen","}"] -],[ - "perl-start", - ["text"," "], - ["support.function","return"], - ["text"," "], - ["identifier","$y"], - ["text",";"] -],[ - "perl-start", - ["text"," "], - ["rparen","}"] -],[ - "perl-start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["lparen","("], - ["keyword.operator","!"], - ["text"," "], - ["support.function","defined"], - ["text"," "], - ["identifier","$y"], - ["rparen",")"], - ["text"," "], - ["lparen","{"], - ["text"," "], - ["support.function","return"], - ["text"," "], - ["identifier","$x"], - ["text","; "], - ["rparen","}"] -],[ - "perl-start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["lparen","("], - ["identifier","$x"], - ["text"," "], - ["keyword.operator",">"], - ["text"," "], - ["identifier","$y"], - ["rparen",")"], - ["text"," "], - ["lparen","{"], - ["text"," "], - ["support.function","return"], - ["text"," "], - ["identifier","$x"], - ["text","; "], - ["rparen","}"] -],[ - "perl-start", - ["text"," "], - ["support.function","return"], - ["text"," "], - ["identifier","$y"], - ["text",";"] -],[ - "start", - ["string","$perl$"], - ["text"," "], - ["keyword","LANGUAGE"], - ["text"," "], - ["identifier","plperl"], - ["statementEnd",";"] -],[ - "start" -],[ - "start", - ["comment","-- pl/python"] -],[ - "python-start", - ["keyword.statementBegin","CREATE"], - ["text"," "], - ["keyword","FUNCTION"], - ["text"," "], - ["identifier","usesavedplan"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["keyword","RETURNS"], - ["text"," "], - ["keyword","trigger"], - ["text"," "], - ["keyword","AS"], - ["text"," "], - ["string","$python$"] -],[ - "python-start", - ["text"," "], - ["comment","# python comment..."] -],[ - "python-start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["identifier","SD"], - ["text","."], - ["identifier","has_key"], - ["paren.lparen","("], - ["string","\"plan\""], - ["paren.rparen",")"], - ["text",":"] -],[ - "python-start", - ["text"," "], - ["identifier","plan"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","SD"], - ["paren.lparen","["], - ["string","\"plan\""], - ["paren.rparen","]"] -],[ - "python-start", - ["text"," "], - ["keyword","else"], - ["text",":"] -],[ - "python-start", - ["text"," "], - ["identifier","plan"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","plpy"], - ["text","."], - ["identifier","prepare"], - ["paren.lparen","("], - ["string","\"SELECT 1\""], - ["paren.rparen",")"] -],[ - "python-start", - ["text"," "], - ["identifier","SD"], - ["paren.lparen","["], - ["string","\"plan\""], - ["paren.rparen","]"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","plan"] -],[ - "start", - ["string","$python$"], - ["text"," "], - ["keyword","LANGUAGE"], - ["text"," "], - ["identifier","plpythonu"], - ["statementEnd",";"] -],[ - "start" -],[ - "start", - ["comment","-- pl/v8 (javascript)"] -],[ - "javascript-start", - ["keyword.statementBegin","CREATE"], - ["text"," "], - ["keyword","FUNCTION"], - ["text"," "], - ["identifier","plv8_test"], - ["paren.lparen","("], - ["identifier","keys"], - ["text"," "], - ["keyword","text"], - ["text","[], "], - ["identifier","vals"], - ["text"," "], - ["keyword","text"], - ["text","[]"], - ["paren.rparen",")"], - ["text"," "], - ["keyword","RETURNS"], - ["text"," "], - ["keyword","text"], - ["text"," "], - ["keyword","AS"], - ["text"," "], - ["string","$javascript$"] -],[ - "javascript-start", - ["storage.type","var"], - ["text"," "], - ["identifier","o"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","{"], - ["paren.rparen","}"], - ["punctuation.operator",";"] -],[ - "javascript-start", - ["keyword","for"], - ["paren.lparen","("], - ["storage.type","var"], - ["text"," "], - ["identifier","i"], - ["keyword.operator","="], - ["constant.numeric","0"], - ["punctuation.operator",";"], - ["text"," "], - ["identifier","i"], - ["keyword.operator","<"], - ["identifier","keys"], - ["punctuation.operator","."], - ["support.constant","length"], - ["punctuation.operator",";"], - ["text"," "], - ["identifier","i"], - ["keyword.operator","++"], - ["paren.rparen",")"], - ["paren.lparen","{"] -],[ - "javascript-start", - ["text"," "], - ["identifier","o"], - ["paren.lparen","["], - ["identifier","keys"], - ["paren.lparen","["], - ["identifier","i"], - ["paren.rparen","]]"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","vals"], - ["paren.lparen","["], - ["identifier","i"], - ["paren.rparen","]"], - ["punctuation.operator",";"] -],[ - "javascript-no_regex", - ["paren.rparen","}"] -],[ - "javascript-start", - ["keyword","return"], - ["text"," "], - ["variable.language","JSON"], - ["punctuation.operator","."], - ["identifier","stringify"], - ["paren.lparen","("], - ["identifier","o"], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["string","$javascript$"], - ["text"," "], - ["keyword","LANGUAGE"], - ["text"," "], - ["identifier","plv8"], - ["text"," "], - ["keyword","IMMUTABLE"], - ["text"," "], - ["keyword","STRICT"], - ["statementEnd",";"] -],[ - "start" -],[ - "start", - ["comment","-- json"] -],[ - "json-start", - ["keyword.statementBegin","select"], - ["text"," "], - ["keyword.operator","*"], - ["text"," "], - ["keyword","from"], - ["text"," "], - ["support.function","json_object_keys"], - ["paren.lparen","("], - ["string","$json$"] -],[ - "json-start", - ["paren.lparen","{"] -],[ - "json-start", - ["text"," "], - ["variable","\"f1\""], - ["text",": "], - ["constant.numeric","5"], - ["text",","] -],[ - "json-start", - ["text"," "], - ["variable","\"f2\""], - ["text",": "], - ["string","\"test\""], - ["text",","] -],[ - "json-start", - ["text"," "], - ["variable","\"f3\""], - ["text",": "], - ["paren.lparen","{"], - ["paren.rparen","}"] -],[ - "json-start", - ["paren.rparen","}"] -],[ - "start", - ["string","$json$"], - ["paren.rparen",")"], - ["statementEnd",";"] -],[ - "start" -],[ - "start" -],[ - "start", - ["comment","-- psql commands"] -],[ - "start", - ["support.buildin","\\df cash*"] -],[ - "start" -],[ - "start" -],[ - "start", - ["comment","-- Some string samples."] -],[ - "start", - ["keyword.statementBegin","select"], - ["text"," "], - ["string","'don''t do it now;'"], - ["text"," "], - ["keyword.operator","||"], - ["text"," "], - ["string","'maybe later'"], - ["statementEnd",";"] -],[ - "start", - ["keyword.statementBegin","select"], - ["text"," "], - ["identifier","E"], - ["string","'dont\\'t do it'"], - ["statementEnd",";"] -],[ - "start", - ["keyword.statementBegin","select"], - ["text"," "], - ["support.function","length"], - ["paren.lparen","("], - ["string","'some other''s stuff'"], - ["text"," "], - ["keyword.operator","||"], - ["text"," "], - ["string","$$cat in hat's stuff $$"], - ["paren.rparen",")"], - ["statementEnd",";"] -],[ - "start" -],[ - "dollarStatementString", - ["keyword.statementBegin","select"], - ["text"," "], - ["string","$$ strings"] -],[ - "dollarStatementString", - ["string","over multiple "] -],[ - "dollarStatementString", - ["string","lines - use dollar quotes"] -],[ - "start", - ["string","$$"], - ["statementEnd",";"] -],[ - "start" -],[ - "start", - ["keyword.statementBegin","END"], - ["statementEnd",";"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_php.json b/lib/ace/mode/_test/tokens_php.json deleted file mode 100644 index 2134dccb..00000000 --- a/lib/ace/mode/_test/tokens_php.json +++ /dev/null @@ -1,171 +0,0 @@ -[[ - "php-start", - ["support.php_tag",""], - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.script.tag-name.xml","script"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text"," "], - ["support.php_tag",""] -],[ - "js-comment_regex_allowed", - ["comment","/*this is js "], - ["support.php_tag",""] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""], - ["text.xml"," not "], - ["constant.language.escape.reference.xml","&js;"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_powershell.json b/lib/ace/mode/_test/tokens_powershell.json deleted file mode 100644 index 43b77db4..00000000 --- a/lib/ace/mode/_test/tokens_powershell.json +++ /dev/null @@ -1,184 +0,0 @@ -[[ - "start", - ["comment","# This is a simple comment"] -],[ - "start", - ["keyword","function"], - ["text"," "], - ["identifier","Hello"], - ["lparen","("], - ["variable.instance","$name"], - ["rparen",")"], - ["text"," "], - ["lparen","{"] -],[ - "start", - ["text"," "], - ["identifier","Write-host"], - ["text"," "], - ["string","\"Hello $name\""] -],[ - "start", - ["rparen","}"] -],[ - "start" -],[ - "start", - ["keyword","function"], - ["text"," "], - ["identifier","add"], - ["lparen","("], - ["variable.instance","$left"], - ["text",", "], - ["variable.instance","$right"], - ["keyword.operator","="], - ["constant.numeric","4"], - ["rparen",")"], - ["text"," "], - ["lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["lparen","("], - ["variable.instance","$right"], - ["text"," "], - ["keyword.operator","-ne"], - ["text"," "], - ["constant.numeric","4"], - ["rparen",")"], - ["text"," "], - ["lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","return"], - ["text"," "], - ["variable.instance","$left"] -],[ - "start", - ["text"," "], - ["rparen","}"], - ["text"," "], - ["keyword","elseif"], - ["text"," "], - ["lparen","("], - ["variable.instance","$left"], - ["text"," "], - ["keyword.operator","-eq"], - ["text"," "], - ["constant.language","$null"], - ["text"," "], - ["keyword.operator","-and"], - ["text"," "], - ["variable.instance","$right"], - ["text"," "], - ["keyword.operator","-eq"], - ["text"," "], - ["constant.numeric","2"], - ["rparen",")"], - ["text"," "], - ["lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","return"], - ["text"," "], - ["constant.numeric","3"] -],[ - "start", - ["text"," "], - ["rparen","}"], - ["text"," "], - ["keyword","else"], - ["text"," "], - ["lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","return"], - ["text"," "], - ["constant.numeric","2"] -],[ - "start", - ["text"," "], - ["rparen","}"] -],[ - "start", - ["rparen","}"] -],[ - "start" -],[ - "start", - ["variable.instance","$number"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","1"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric","2"], - ["text",";"] -],[ - "start", - ["variable.instance","$number"], - ["text"," "], - ["keyword.operator","+="], - ["text"," "], - ["constant.numeric","3"] -],[ - "start" -],[ - "start", - ["support.function","Write-Host"], - ["text"," "], - ["identifier","Hello"], - ["text"," "], - ["keyword.operator","-"], - ["identifier","name"], - ["text"," "], - ["string","\"World\""] -],[ - "start" -],[ - "start", - ["variable.instance","$an_array"], - ["text"," "], - ["keyword.operator","="], - ["text"," @"], - ["lparen","("], - ["constant.numeric","1"], - ["text",", "], - ["constant.numeric","2"], - ["text",", "], - ["constant.numeric","3"], - ["rparen",")"] -],[ - "start", - ["variable.instance","$a_hash"], - ["text"," "], - ["keyword.operator","="], - ["text"," @"], - ["lparen","{"], - ["string","\"something\""], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string","\"something else\""], - ["rparen","}"] -],[ - "start" -],[ - "start", - ["keyword.operator","&"], - ["text"," "], - ["identifier","notepad"], - ["text"," .\\"], - ["identifier","readme"], - ["text","."], - ["identifier","md"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_prolog.json b/lib/ace/mode/_test/tokens_prolog.json deleted file mode 100644 index 4c0f5c5c..00000000 --- a/lib/ace/mode/_test/tokens_prolog.json +++ /dev/null @@ -1,245 +0,0 @@ -[[ - "start", - ["entity.name.function.fact.prolog","partition"], - ["punctuation.begin.fact.parameters.prolog","("], - ["punctuation.begin.list.prolog","["], - ["punctuation.end.list.prolog","]"], - ["punctuation.separator.parameters.prolog",","], - ["meta.fact.prolog"," "], - ["variable.language.anonymous.prolog","_"], - ["punctuation.separator.parameters.prolog",","], - ["meta.fact.prolog"," "], - ["punctuation.begin.list.prolog","["], - ["punctuation.end.list.prolog","]"], - ["punctuation.separator.parameters.prolog",","], - ["meta.fact.prolog"," "], - ["punctuation.begin.list.prolog","["], - ["punctuation.end.list.prolog","]"], - ["punctuation.end.fact.parameters.prolog",")"], - ["punctuation.end.fact.prolog","."] -],[ - ["keyword.operator.definition.prolog","meta.rule.prolog"], - ["entity.name.function.rule.prolog","partition"], - ["punctuation.rule.parameters.begin.prolog","("], - ["punctuation.begin.list.prolog","["], - ["variable.other.prolog","X"], - ["punctuation.concat.list.prolog","|"], - ["variable.other.prolog","Xs"], - ["punctuation.end.list.prolog","]"], - ["punctuation.separator.parameters.prolog",","], - ["meta.rule.parameters.prolog"," "], - ["variable.parameter.prolog","Pivot"], - ["punctuation.separator.parameters.prolog",","], - ["meta.rule.parameters.prolog"," "], - ["variable.parameter.prolog","Smalls"], - ["punctuation.separator.parameters.prolog",","], - ["meta.rule.parameters.prolog"," "], - ["variable.parameter.prolog","Bigs"], - ["punctuation.rule.parameters.end.prolog",")"], - ["meta.rule.signature.prolog"," "], - ["keyword.operator.definition.prolog",":-"] -],[ - ["meta.expression.prolog","keyword.operator.definition.prolog","keyword.operator.definition.prolog","meta.rule.prolog"], - ["meta.rule.definition.prolog"," "], - ["meta.expression.prolog","( "], - ["variable.other.prolog","X"], - ["meta.expression.prolog"," @"], - ["keyword.operator.prolog","<"], - ["meta.expression.prolog"," "], - ["variable.other.prolog","Pivot"], - ["meta.expression.prolog"," "], - ["keyword.operator.prolog","->"] -],[ - ["meta.expression.prolog","keyword.operator.definition.prolog","keyword.operator.definition.prolog","meta.rule.prolog"], - ["meta.expression.prolog"," "], - ["variable.other.prolog","Smalls"], - ["meta.expression.prolog"," "], - ["keyword.operator.prolog","="], - ["meta.expression.prolog"," "], - ["punctuation.begin.list.prolog","["], - ["variable.other.prolog","X"], - ["punctuation.concat.list.prolog","|"], - ["variable.other.prolog","Rest"], - ["punctuation.end.list.prolog","]"], - ["punctuation.control.and.prolog",","] -],[ - ["meta.expression.prolog","keyword.operator.definition.prolog","keyword.operator.definition.prolog","meta.rule.prolog"], - ["meta.expression.prolog"," "], - ["constant.other.atom.prolog","partition"], - ["punctuation.begin.statement.parameters.prolog","("], - ["variable.other.prolog","Xs"], - ["punctuation.separator.statement.prolog",","], - ["meta.statement.parameters.prolog"," "], - ["variable.other.prolog","Pivot"], - ["punctuation.separator.statement.prolog",","], - ["meta.statement.parameters.prolog"," "], - ["variable.other.prolog","Rest"], - ["punctuation.separator.statement.prolog",","], - ["meta.statement.parameters.prolog"," "], - ["variable.other.prolog","Bigs"], - ["punctuation.end.statement.parameters.prolog",")"] -],[ - ["meta.expression.prolog","keyword.operator.definition.prolog","keyword.operator.definition.prolog","meta.rule.prolog"], - ["meta.expression.prolog"," "], - ["punctuation.control.or.prolog",";"], - ["meta.expression.prolog"," "], - ["variable.other.prolog","Bigs"], - ["meta.expression.prolog"," "], - ["keyword.operator.prolog","="], - ["meta.expression.prolog"," "], - ["punctuation.begin.list.prolog","["], - ["variable.other.prolog","X"], - ["punctuation.concat.list.prolog","|"], - ["variable.other.prolog","Rest"], - ["punctuation.end.list.prolog","]"], - ["punctuation.control.and.prolog",","] -],[ - ["meta.expression.prolog","keyword.operator.definition.prolog","keyword.operator.definition.prolog","meta.rule.prolog"], - ["meta.expression.prolog"," "], - ["constant.other.atom.prolog","partition"], - ["punctuation.begin.statement.parameters.prolog","("], - ["variable.other.prolog","Xs"], - ["punctuation.separator.statement.prolog",","], - ["meta.statement.parameters.prolog"," "], - ["variable.other.prolog","Pivot"], - ["punctuation.separator.statement.prolog",","], - ["meta.statement.parameters.prolog"," "], - ["variable.other.prolog","Smalls"], - ["punctuation.separator.statement.prolog",","], - ["meta.statement.parameters.prolog"," "], - ["variable.other.prolog","Rest"], - ["punctuation.end.statement.parameters.prolog",")"] -],[ - "start", - ["meta.expression.prolog"," )"], - ["punctuation.rule.end.prolog","."] -],[ - "start", - ["text"," "] -],[ - "start", - ["entity.name.function.fact.prolog","quicksort"], - ["punctuation.begin.fact.parameters.prolog","("], - ["punctuation.begin.list.prolog","["], - ["punctuation.end.list.prolog","]"], - ["punctuation.end.fact.parameters.prolog",")"], - ["text"," --> []."] -],[ - "start", - ["entity.name.function.fact.prolog","quicksort"], - ["punctuation.begin.fact.parameters.prolog","("], - ["punctuation.begin.list.prolog","["], - ["variable.other.prolog","X"], - ["punctuation.concat.list.prolog","|"], - ["variable.other.prolog","Xs"], - ["punctuation.end.list.prolog","]"], - ["punctuation.end.fact.parameters.prolog",")"], - ["text"," -->"] -],[ - "start", - ["text"," { "], - ["entity.name.function.fact.prolog","partition"], - ["punctuation.begin.fact.parameters.prolog","("], - ["variable.parameter.prolog","Xs"], - ["punctuation.separator.parameters.prolog",","], - ["meta.fact.prolog"," "], - ["variable.parameter.prolog","X"], - ["punctuation.separator.parameters.prolog",","], - ["meta.fact.prolog"," "], - ["variable.parameter.prolog","Smaller"], - ["punctuation.separator.parameters.prolog",","], - ["meta.fact.prolog"," "], - ["variable.parameter.prolog","Bigger"], - ["punctuation.end.fact.parameters.prolog",")"], - ["text"," },"] -],[ - "start", - ["text"," "], - ["entity.name.function.fact.prolog","quicksort"], - ["punctuation.begin.fact.parameters.prolog","("], - ["variable.parameter.prolog","Smaller"], - ["punctuation.end.fact.parameters.prolog",")"], - ["text",", [X], "], - ["entity.name.function.fact.prolog","quicksort"], - ["punctuation.begin.fact.parameters.prolog","("], - ["variable.parameter.prolog","Bigger"], - ["punctuation.end.fact.parameters.prolog",")"], - ["punctuation.end.fact.prolog","."] -],[ - "start" -],[ - ["keyword.operator.definition.prolog","meta.rule.prolog"], - ["entity.name.function.rule.prolog","perfect"], - ["punctuation.rule.parameters.begin.prolog","("], - ["variable.parameter.prolog","N"], - ["punctuation.rule.parameters.end.prolog",")"], - ["meta.rule.signature.prolog"," "], - ["keyword.operator.definition.prolog",":-"] -],[ - ["keyword.operator.definition.prolog","meta.rule.prolog"], - ["meta.rule.definition.prolog"," "], - ["constant.other.atom.prolog","between"], - ["punctuation.begin.statement.parameters.prolog","("], - ["constant.numeric.prolog","1"], - ["punctuation.separator.statement.prolog",","], - ["meta.statement.parameters.prolog"," "], - ["constant.other.atom.prolog","inf"], - ["punctuation.separator.statement.prolog",","], - ["meta.statement.parameters.prolog"," "], - ["variable.other.prolog","N"], - ["punctuation.end.statement.parameters.prolog",")"], - ["punctuation.control.and.prolog",","], - ["meta.rule.definition.prolog"," "], - ["variable.other.prolog","U"], - ["meta.rule.definition.prolog"," "], - ["keyword.operator.prolog","is"], - ["meta.rule.definition.prolog"," "], - ["variable.other.prolog","N"], - ["meta.rule.definition.prolog"," // "], - ["constant.numeric.prolog","2"], - ["punctuation.control.and.prolog",","] -],[ - ["keyword.operator.definition.prolog","meta.rule.prolog"], - ["meta.rule.definition.prolog"," "], - ["constant.other.atom.prolog","findall"], - ["punctuation.begin.statement.parameters.prolog","("], - ["variable.other.prolog","D"], - ["punctuation.separator.statement.prolog",","], - ["meta.statement.parameters.prolog"," ("], - ["constant.other.atom.prolog","between"], - ["punctuation.begin.statement.parameters.prolog","("], - ["constant.numeric.prolog","1"], - ["punctuation.separator.statement.prolog",","], - ["variable.other.prolog","U"], - ["punctuation.separator.statement.prolog",","], - ["variable.other.prolog","D"], - ["punctuation.end.statement.parameters.prolog",")"], - ["punctuation.separator.statement.prolog",","], - ["meta.statement.parameters.prolog"," "], - ["variable.other.prolog","N"], - ["meta.statement.parameters.prolog"," "], - ["constant.other.atom.prolog","mod"], - ["meta.statement.parameters.prolog"," "], - ["variable.other.prolog","D"], - ["meta.statement.parameters.prolog"," "], - ["keyword.operator.prolog","=:="], - ["meta.statement.parameters.prolog"," "], - ["constant.numeric.prolog","0"], - ["punctuation.end.statement.parameters.prolog",")"], - ["punctuation.control.and.prolog",","], - ["meta.rule.definition.prolog"," "], - ["variable.other.prolog","Ds"], - ["meta.rule.definition.prolog",")"], - ["punctuation.control.and.prolog",","] -],[ - "start", - ["meta.rule.definition.prolog"," "], - ["constant.other.atom.prolog","sumlist"], - ["punctuation.begin.statement.parameters.prolog","("], - ["variable.other.prolog","Ds"], - ["punctuation.separator.statement.prolog",","], - ["meta.statement.parameters.prolog"," "], - ["variable.other.prolog","N"], - ["punctuation.end.statement.parameters.prolog",")"], - ["punctuation.rule.end.prolog","."] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_properties.json b/lib/ace/mode/_test/tokens_properties.json deleted file mode 100644 index 8831045e..00000000 --- a/lib/ace/mode/_test/tokens_properties.json +++ /dev/null @@ -1,68 +0,0 @@ -[[ - "start", - ["comment","# You are reading the \".properties\" entry."] -],[ - "start", - ["comment","! The exclamation mark can also mark text as comments."] -],[ - "start", - ["comment","# The key and element characters #, !, =, and : are written with a preceding backslash to ensure that they are properly loaded."] -],[ - "start", - ["variable","website "], - ["keyword","="], - ["string"," http"], - ["constant.language.escape","\\"], - ["string","://en.wikipedia.org/"] -],[ - "start", - ["variable","language "], - ["keyword","="], - ["string"," English"] -],[ - "start", - ["comment","# The backslash below tells the application to continue reading"] -],[ - "start", - ["comment","# the value onto the next line."] -],[ - "value", - ["variable","message "], - ["keyword","="], - ["string"," Welcome to \\"] -],[ - "start", - ["string"," Wikipedia!"] -],[ - "start", - ["comment","# Add spaces to the key"] -],[ - "start", - ["variable","key"], - ["constant.language.escape","\\"], - ["variable"," with"], - ["constant.language.escape","\\"], - ["variable"," spaces "], - ["keyword","="], - ["string"," This is the value that could be looked up with the key \"key with spaces\"."] -],[ - "start", - ["comment","# Unicode"] -],[ - "start", - ["variable","tab "], - ["keyword",":"], - ["string"," "], - ["constant.language.escape","\\u0009"] -],[ - "start", - ["variable","empty-key"], - ["keyword","="] -],[ - "start", - ["variable","last.line"], - ["keyword","="], - ["string","value"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_protobuf.json b/lib/ace/mode/_test/tokens_protobuf.json deleted file mode 100644 index 469dba06..00000000 --- a/lib/ace/mode/_test/tokens_protobuf.json +++ /dev/null @@ -1,136 +0,0 @@ -[[ - "start", - ["keyword.declaration.protobuf","message"], - ["text"," "], - ["identifier","Point"], - ["text"," {"] -],[ - "start", - ["text"," "], - ["keyword.declaration.protobuf","required"], - ["text"," "], - ["support.type","int32"], - ["text"," "], - ["identifier","x"], - ["text"," "], - ["keyword.operator.assignment.protobuf","="], - ["text"," "], - ["constant.numeric","1"], - ["text",";"] -],[ - "start", - ["text"," "], - ["keyword.declaration.protobuf","required"], - ["text"," "], - ["support.type","int32"], - ["text"," "], - ["identifier","y"], - ["text"," "], - ["keyword.operator.assignment.protobuf","="], - ["text"," "], - ["constant.numeric","2"], - ["text",";"] -],[ - "start", - ["text"," "], - ["keyword.declaration.protobuf","optional"], - ["text"," "], - ["support.type","string"], - ["text"," "], - ["identifier","label"], - ["text"," "], - ["keyword.operator.assignment.protobuf","="], - ["text"," "], - ["constant.numeric","3"], - ["text",";"] -],[ - "start", - ["text","}"] -],[ - "start" -],[ - "start", - ["keyword.declaration.protobuf","message"], - ["text"," "], - ["identifier","Line"], - ["text"," {"] -],[ - "start", - ["text"," "], - ["keyword.declaration.protobuf","required"], - ["text"," "], - ["identifier","Point"], - ["text"," "], - ["identifier","start"], - ["text"," "], - ["keyword.operator.assignment.protobuf","="], - ["text"," "], - ["constant.numeric","1"], - ["text",";"] -],[ - "start", - ["text"," "], - ["keyword.declaration.protobuf","required"], - ["text"," "], - ["identifier","Point"], - ["text"," "], - ["identifier","end"], - ["text"," "], - ["keyword.operator.assignment.protobuf","="], - ["text"," "], - ["constant.numeric","2"], - ["text",";"] -],[ - "start", - ["text"," "], - ["keyword.declaration.protobuf","optional"], - ["text"," "], - ["support.type","string"], - ["text"," "], - ["identifier","label"], - ["text"," "], - ["keyword.operator.assignment.protobuf","="], - ["text"," "], - ["constant.numeric","3"], - ["text",";"] -],[ - "start", - ["text","}"] -],[ - "start" -],[ - "start", - ["keyword.declaration.protobuf","message"], - ["text"," "], - ["identifier","Polyline"], - ["text"," {"] -],[ - "start", - ["text"," "], - ["keyword.declaration.protobuf","repeated"], - ["text"," "], - ["identifier","Point"], - ["text"," "], - ["identifier","point"], - ["text"," "], - ["keyword.operator.assignment.protobuf","="], - ["text"," "], - ["constant.numeric","1"], - ["text",";"] -],[ - "start", - ["text"," "], - ["keyword.declaration.protobuf","optional"], - ["text"," "], - ["support.type","string"], - ["text"," "], - ["identifier","label"], - ["text"," "], - ["keyword.operator.assignment.protobuf","="], - ["text"," "], - ["constant.numeric","2"], - ["text",";"] -],[ - "start", - ["text","}"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_python.json b/lib/ace/mode/_test/tokens_python.json deleted file mode 100644 index 293c8ff2..00000000 --- a/lib/ace/mode/_test/tokens_python.json +++ /dev/null @@ -1,152 +0,0 @@ -[[ - "start", - ["comment","#!/usr/local/bin/python"] -],[ - "start" -],[ - "start", - ["keyword","import"], - ["text"," "], - ["identifier","string"], - ["text",", "], - ["identifier","sys"] -],[ - "start" -],[ - "start", - ["comment","# If no arguments were given, print a helpful message"] -],[ - "start", - ["keyword","if"], - ["text"," "], - ["support.function","len"], - ["paren.lparen","("], - ["identifier","sys"], - ["text","."], - ["identifier","argv"], - ["paren.rparen",")"], - ["keyword.operator","=="], - ["constant.numeric","1"], - ["text",":"] -],[ - "qstring3", - ["text"," "], - ["keyword","print"], - ["text"," "], - ["string","'''Usage:"] -],[ - "start", - ["string","celsius temp1 temp2 ...'''"] -],[ - "start", - ["text"," "], - ["identifier","sys"], - ["text","."], - ["identifier","exit"], - ["paren.lparen","("], - ["constant.numeric","0"], - ["paren.rparen",")"] -],[ - "start" -],[ - "start", - ["comment","# Loop over the arguments"] -],[ - "start", - ["keyword","for"], - ["text"," "], - ["identifier","i"], - ["text"," "], - ["keyword","in"], - ["text"," "], - ["identifier","sys"], - ["text","."], - ["identifier","argv"], - ["paren.lparen","["], - ["constant.numeric","1"], - ["text",":"], - ["paren.rparen","]"], - ["text",":"] -],[ - "start", - ["text"," "], - ["keyword","try"], - ["text",":"] -],[ - "start", - ["text"," "], - ["identifier","fahrenheit"], - ["keyword.operator","="], - ["support.function","float"], - ["paren.lparen","("], - ["identifier","string"], - ["text","."], - ["identifier","atoi"], - ["paren.lparen","("], - ["identifier","i"], - ["paren.rparen","))"] -],[ - "start", - ["text"," "], - ["keyword","except"], - ["text"," "], - ["identifier","string"], - ["text","."], - ["identifier","atoi_error"], - ["text",":"] -],[ - "start", - ["text"," "], - ["keyword","print"], - ["text"," "], - ["support.function","repr"], - ["paren.lparen","("], - ["identifier","i"], - ["paren.rparen",")"], - ["text",", "], - ["string","\"not a numeric value\""] -],[ - "start", - ["text"," "], - ["keyword","else"], - ["text",":"] -],[ - "start", - ["text"," "], - ["identifier","celsius"], - ["keyword.operator","="], - ["paren.lparen","("], - ["identifier","fahrenheit"], - ["keyword.operator","-"], - ["constant.numeric","32"], - ["paren.rparen",")"], - ["keyword.operator","*"], - ["constant.numeric","5.0"], - ["keyword.operator","/"], - ["constant.numeric","9.0"] -],[ - "start", - ["text"," "], - ["keyword","print"], - ["text"," "], - ["string","'%i"], - ["constant.language.escape","\\260"], - ["string","F = %i"], - ["constant.language.escape","\\260"], - ["string","C'"], - ["text"," "], - ["keyword.operator","%"], - ["text"," "], - ["paren.lparen","("], - ["support.function","int"], - ["paren.lparen","("], - ["identifier","fahrenheit"], - ["paren.rparen",")"], - ["text",", "], - ["support.function","int"], - ["paren.lparen","("], - ["identifier","celsius"], - ["keyword.operator","+"], - ["constant.numeric",".5"], - ["paren.rparen","))"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_r.json b/lib/ace/mode/_test/tokens_r.json deleted file mode 100644 index 2d446bce..00000000 --- a/lib/ace/mode/_test/tokens_r.json +++ /dev/null @@ -1,235 +0,0 @@ -[[ - "start", - ["identifier","Call"], - ["keyword.operator",":"] -],[ - "start", - ["identifier","lm"], - ["paren.keyword.operator","("], - ["identifier","formula"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","y"], - ["text"," "], - ["keyword.operator","~"], - ["text"," "], - ["identifier","x"], - ["paren.keyword.operator",")"] -],[ - "start", - ["text"," "] -],[ - "start", - ["identifier","Residuals"], - ["keyword.operator",":"] -],[ - "start", - ["constant.numeric","1"], - ["text"," "], - ["constant.numeric","2"], - ["text"," "], - ["constant.numeric","3"], - ["text"," "], - ["constant.numeric","4"], - ["text"," "], - ["constant.numeric","5"], - ["text"," "], - ["constant.numeric","6"] -],[ - "start", - ["constant.numeric","3.3333"], - ["text"," "], - ["keyword.operator","-"], - ["constant.numeric","0.6667"], - ["text"," "], - ["keyword.operator","-"], - ["constant.numeric","2.6667"], - ["text"," "], - ["keyword.operator","-"], - ["constant.numeric","2.6667"], - ["text"," "], - ["keyword.operator","-"], - ["constant.numeric","0.6667"], - ["text"," "], - ["constant.numeric","3.3333"] -],[ - "start", - ["text"," "] -],[ - "start", - ["identifier","Coefficients"], - ["keyword.operator",":"] -],[ - "start", - ["text"," "], - ["identifier","Estimate"], - ["text"," "], - ["identifier","Std"], - ["text",". "], - ["identifier","Error"], - ["text"," "], - ["identifier","t"], - ["text"," "], - ["identifier","value"], - ["text"," "], - ["identifier","Pr"], - ["paren.keyword.operator","("], - ["keyword.operator",">|"], - ["identifier","t"], - ["keyword.operator","|"], - ["paren.keyword.operator",")"] -],[ - "start", - ["paren.keyword.operator","("], - ["identifier","Intercept"], - ["paren.keyword.operator",")"], - ["text"," "], - ["keyword.operator","-"], - ["constant.numeric","9.3333"], - ["text"," "], - ["constant.numeric","2.8441"], - ["text"," "], - ["keyword.operator","-"], - ["constant.numeric","3.282"], - ["text"," "], - ["constant.numeric","0.030453"], - ["text"," "], - ["keyword.operator","*"] -],[ - "start", - ["identifier","x"], - ["text"," "], - ["constant.numeric","7.0000"], - ["text"," "], - ["constant.numeric","0.7303"], - ["text"," "], - ["constant.numeric","9.585"], - ["text"," "], - ["constant.numeric","0.000662"], - ["text"," "], - ["keyword.operator","***"] -],[ - "start", - ["keyword.operator","---"] -],[ - "start", - ["identifier","Signif"], - ["text",". "], - ["identifier","codes"], - ["keyword.operator",":"], - ["text"," "], - ["constant.numeric","0"], - ["text"," ‘"], - ["keyword.operator","***"], - ["text","’ "], - ["constant.numeric","0.001"], - ["text"," ‘"], - ["keyword.operator","**"], - ["text","’ "], - ["constant.numeric","0.01"], - ["text"," ‘"], - ["keyword.operator","*"], - ["text","’ "], - ["constant.numeric","0.05"], - ["text"," ‘.’ "], - ["constant.numeric","0.1"], - ["text"," ‘ ’ "], - ["constant.numeric","1"] -],[ - "start", - ["text"," "] -],[ - "start", - ["identifier","Residual"], - ["text"," "], - ["identifier","standard"], - ["text"," "], - ["identifier","error"], - ["keyword.operator",":"], - ["text"," "], - ["constant.numeric","3.055"], - ["text"," "], - ["identifier","on"], - ["text"," "], - ["constant.numeric","4"], - ["text"," "], - ["identifier","degrees"], - ["text"," "], - ["identifier","of"], - ["text"," "], - ["identifier","freedom"] -],[ - "start", - ["identifier","Multiple"], - ["text"," "], - ["identifier","R"], - ["keyword.operator","-"], - ["identifier","squared"], - ["keyword.operator",":"], - ["text"," "], - ["constant.numeric","0.9583"], - ["text",", "], - ["identifier","Adjusted"], - ["text"," "], - ["identifier","R"], - ["keyword.operator","-"], - ["identifier","squared"], - ["keyword.operator",":"], - ["text"," "], - ["constant.numeric","0.9478"] -],[ - "start", - ["constant.language.boolean","F"], - ["keyword.operator","-"], - ["identifier","statistic"], - ["keyword.operator",":"], - ["text"," "], - ["constant.numeric","91.88"], - ["text"," "], - ["identifier","on"], - ["text"," "], - ["constant.numeric","1"], - ["text"," "], - ["identifier","and"], - ["text"," "], - ["constant.numeric","4"], - ["text"," "], - ["identifier","DF"], - ["text",", "], - ["identifier","p"], - ["keyword.operator","-"], - ["identifier","value"], - ["keyword.operator",":"], - ["text"," "], - ["constant.numeric","0.000662"] -],[ - "start", - ["text"," "] -],[ - "start", - ["keyword.operator",">"], - ["text"," "], - ["identifier","par"], - ["paren.keyword.operator","("], - ["identifier","mfrow"], - ["keyword.operator","="], - ["identifier","c"], - ["paren.keyword.operator","("], - ["constant.numeric","2"], - ["text",", "], - ["constant.numeric","2"], - ["paren.keyword.operator","))"], - ["text"," "], - ["comment","# Request 2x2 plot layout"] -],[ - "start", - ["keyword.operator",">"], - ["text"," "], - ["identifier","plot"], - ["paren.keyword.operator","("], - ["identifier","lm_1"], - ["paren.keyword.operator",")"], - ["text"," "], - ["comment","# Diagnostic plot of regression model"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_rdoc.json b/lib/ace/mode/_test/tokens_rdoc.json deleted file mode 100644 index 0c757438..00000000 --- a/lib/ace/mode/_test/tokens_rdoc.json +++ /dev/null @@ -1,441 +0,0 @@ -[[ - "start", - ["keyword","\\name"], - ["paren.keyword.operator","{"], - ["nospell.text","picker"], - ["paren.keyword.operator","}"] -],[ - "start", - ["keyword","\\alias"], - ["paren.keyword.operator","{"], - ["nospell.text","picker"], - ["paren.keyword.operator","}"] -],[ - "start", - ["keyword","\\title"], - ["paren.keyword.operator","{"], - ["text","Create a picker control"], - ["paren.keyword.operator","}"] -],[ - "start", - ["keyword","\\description"], - ["paren.keyword.operator","{"] -],[ - "start", - ["text"," Create a picker control to enable manipulation of plot variables based on a set of fixed choices."] -],[ - "start", - ["paren.keyword.operator","}"] -],[ - "start" -],[ - "nospell", - ["keyword","\\usage"], - ["paren.keyword.operator","{"] -],[ - "nospell", - ["nospell.text","picker"], - ["paren.keyword.operator","("], - ["text","...,"], - ["nospell.text"," initial "], - ["text","="], - ["nospell.text"," NULL"], - ["text",","], - ["nospell.text"," label "], - ["text","="], - ["nospell.text"," NULL"], - ["paren.keyword.operator",")"] -],[ - "start", - ["paren.keyword.operator","}"] -],[ - "start" -],[ - "start" -],[ - "start", - ["keyword","\\arguments"], - ["paren.keyword.operator","{"] -],[ - "start", - ["text"," "], - ["keyword","\\item"], - ["paren.keyword.operator","{"], - ["keyword","\\dots"], - ["paren.keyword.operator","}{"] -],[ - "start", - ["text"," Arguments containing objects to be presented as choices for the picker "], - ["paren.keyword.operator","("], - ["text","or a list containing the choices"], - ["paren.keyword.operator",")"], - ["text",". If an element is named then the name is used to display it within the picker. If an element is not named then it is displayed within the picker using "], - ["keyword","\\code"], - ["paren.keyword.operator","{"], - ["keyword","\\link"], - ["paren.keyword.operator","{"], - ["nospell.text","as"], - ["text","."], - ["nospell.text","character"], - ["paren.keyword.operator","}}"], - ["text",". "] -],[ - "start", - ["paren.keyword.operator","}"] -],[ - "start", - ["text"," "], - ["keyword","\\item"], - ["paren.keyword.operator","{"], - ["nospell.text","initial"], - ["paren.keyword.operator","}{"] -],[ - "start", - ["text"," Initial value for picker. Value must be present in the list of choices specified. If not specified defaults to the first choice."] -],[ - "start", - ["paren.keyword.operator","}"] -],[ - "start", - ["text"," "], - ["keyword","\\item"], - ["paren.keyword.operator","{"], - ["nospell.text","label"], - ["paren.keyword.operator","}{"] -],[ - "start", - ["text"," Display label for picker. Defaults to the variable name if not specified."] -],[ - "start", - ["paren.keyword.operator","}"] -],[ - "start", - ["paren.keyword.operator","}"] -],[ - "start" -],[ - "start", - ["keyword","\\value"], - ["paren.keyword.operator","{"] -],[ - "start", - ["text"," An object of class \"manipulator.picker\" which can be passed to the "], - ["keyword","\\code"], - ["paren.keyword.operator","{"], - ["keyword","\\link"], - ["paren.keyword.operator","{"], - ["nospell.text","manipulate"], - ["paren.keyword.operator","}}"], - ["text"," function."] -],[ - "start", - ["paren.keyword.operator","}"] -],[ - "start" -],[ - "start", - ["keyword","\\seealso"], - ["paren.keyword.operator","{"] -],[ - "start", - ["keyword","\\code"], - ["paren.keyword.operator","{"], - ["keyword","\\link"], - ["paren.keyword.operator","{"], - ["nospell.text","manipulate"], - ["paren.keyword.operator","}}"], - ["text",", "], - ["keyword","\\code"], - ["paren.keyword.operator","{"], - ["keyword","\\link"], - ["paren.keyword.operator","{"], - ["nospell.text","slider"], - ["paren.keyword.operator","}}"], - ["text",", "], - ["keyword","\\code"], - ["paren.keyword.operator","{"], - ["keyword","\\link"], - ["paren.keyword.operator","{"], - ["nospell.text","checkbox"], - ["paren.keyword.operator","}}"], - ["text",", "], - ["keyword","\\code"], - ["paren.keyword.operator","{"], - ["keyword","\\link"], - ["paren.keyword.operator","{"], - ["nospell.text","button"], - ["paren.keyword.operator","}}"] -],[ - "start", - ["paren.keyword.operator","}"] -],[ - "start" -],[ - "start" -],[ - "nospell", - ["keyword","\\examples"], - ["paren.keyword.operator","{"] -],[ - "nospell", - ["keyword","\\dontrun"], - ["paren.keyword.operator","{"] -],[ - "nospell" -],[ - "nospell", - ["text","##"], - ["nospell.text"," Filtering data with a picker"] -],[ - "nospell", - ["nospell.text","manipulate"], - ["paren.keyword.operator","("] -],[ - "nospell", - ["nospell.text"," barplot"], - ["paren.keyword.operator","("], - ["nospell.text","as"], - ["text","."], - ["nospell.text","matrix"], - ["paren.keyword.operator","("], - ["nospell.text","longley"], - ["paren.keyword.operator","["], - ["text",","], - ["nospell.text","factor"], - ["paren.keyword.operator","])"], - ["text",","], - ["nospell.text"," "] -],[ - "nospell", - ["nospell.text"," beside "], - ["text","="], - ["nospell.text"," TRUE"], - ["text",","], - ["nospell.text"," main "], - ["text","="], - ["nospell.text"," factor"], - ["paren.keyword.operator",")"], - ["text",","] -],[ - "nospell", - ["nospell.text"," factor "], - ["text","="], - ["nospell.text"," picker"], - ["paren.keyword.operator","("], - ["text","\""], - ["nospell.text","GNP"], - ["text","\","], - ["nospell.text"," "], - ["text","\""], - ["nospell.text","Unemployed"], - ["text","\","], - ["nospell.text"," "], - ["text","\""], - ["nospell.text","Employed"], - ["text","\""], - ["paren.keyword.operator","))"] -],[ - "nospell" -],[ - "nospell", - ["text","##"], - ["nospell.text"," Create a picker with labels"] -],[ - "nospell", - ["nospell.text","manipulate"], - ["paren.keyword.operator","("] -],[ - "nospell", - ["nospell.text"," plot"], - ["paren.keyword.operator","("], - ["nospell.text","pressure"], - ["text",","], - ["nospell.text"," type "], - ["text","="], - ["nospell.text"," type"], - ["paren.keyword.operator",")"], - ["text",","], - ["nospell.text"," "] -],[ - "nospell", - ["nospell.text"," type "], - ["text","="], - ["nospell.text"," picker"], - ["paren.keyword.operator","("], - ["text","\""], - ["nospell.text","points"], - ["text","\""], - ["nospell.text"," "], - ["text","="], - ["nospell.text"," "], - ["text","\""], - ["nospell.text","p"], - ["text","\","], - ["nospell.text"," "], - ["text","\""], - ["nospell.text","line"], - ["text","\""], - ["nospell.text"," "], - ["text","="], - ["nospell.text"," "], - ["text","\""], - ["nospell.text","l"], - ["text","\","], - ["nospell.text"," "], - ["text","\""], - ["nospell.text","step"], - ["text","\""], - ["nospell.text"," "], - ["text","="], - ["nospell.text"," "], - ["text","\""], - ["nospell.text","s"], - ["text","\""], - ["paren.keyword.operator","))"] -],[ - "nospell", - ["nospell.text"," "] -],[ - "nospell", - ["text","##"], - ["nospell.text"," Picker with groups"] -],[ - "nospell", - ["nospell.text","manipulate"], - ["paren.keyword.operator","("] -],[ - "nospell", - ["nospell.text"," barplot"], - ["paren.keyword.operator","("], - ["nospell.text","as"], - ["text","."], - ["nospell.text","matrix"], - ["paren.keyword.operator","("], - ["nospell.text","mtcars"], - ["paren.keyword.operator","["], - ["nospell.text","group"], - ["text",",\""], - ["nospell.text","mpg"], - ["text","\""], - ["paren.keyword.operator","])"], - ["text",","], - ["nospell.text"," beside"], - ["text","="], - ["nospell.text","TRUE"], - ["paren.keyword.operator",")"], - ["text",","] -],[ - "nospell", - ["nospell.text"," group "], - ["text","="], - ["nospell.text"," picker"], - ["paren.keyword.operator","("], - ["text","\""], - ["nospell.text","Group 1"], - ["text","\""], - ["nospell.text"," "], - ["text","="], - ["nospell.text"," 1"], - ["text",":"], - ["nospell.text","11"], - ["text",","], - ["nospell.text"," "] -],[ - "nospell", - ["nospell.text"," "], - ["text","\""], - ["nospell.text","Group 2"], - ["text","\""], - ["nospell.text"," "], - ["text","="], - ["nospell.text"," 12"], - ["text",":"], - ["nospell.text","22"], - ["text",","], - ["nospell.text"," "] -],[ - "nospell", - ["nospell.text"," "], - ["text","\""], - ["nospell.text","Group 3"], - ["text","\""], - ["nospell.text"," "], - ["text","="], - ["nospell.text"," 23"], - ["text",":"], - ["nospell.text","32"], - ["paren.keyword.operator","))"] -],[ - "nospell" -],[ - "nospell", - ["text","##"], - ["nospell.text"," Histogram w"], - ["text","/"], - ["nospell.text"," picker to select type"] -],[ - "nospell", - ["nospell.text","require"], - ["paren.keyword.operator","("], - ["nospell.text","lattice"], - ["paren.keyword.operator",")"] -],[ - "nospell", - ["nospell.text","require"], - ["paren.keyword.operator","("], - ["nospell.text","stats"], - ["paren.keyword.operator",")"] -],[ - "nospell", - ["nospell.text","manipulate"], - ["paren.keyword.operator","("] -],[ - "nospell", - ["nospell.text"," histogram"], - ["paren.keyword.operator","("], - ["text","~"], - ["nospell.text"," height "], - ["text","|"], - ["nospell.text"," voice"], - ["text","."], - ["nospell.text","part"], - ["text",","], - ["nospell.text"," "] -],[ - "nospell", - ["nospell.text"," data "], - ["text","="], - ["nospell.text"," singer"], - ["text",","], - ["nospell.text"," type "], - ["text","="], - ["nospell.text"," type"], - ["paren.keyword.operator",")"], - ["text",","] -],[ - "nospell", - ["nospell.text"," type "], - ["text","="], - ["nospell.text"," picker"], - ["paren.keyword.operator","("], - ["text","\""], - ["nospell.text","percent"], - ["text","\","], - ["nospell.text"," "], - ["text","\""], - ["nospell.text","count"], - ["text","\","], - ["nospell.text"," "], - ["text","\""], - ["nospell.text","density"], - ["text","\""], - ["paren.keyword.operator","))"] -],[ - "nospell" -],[ - "start", - ["paren.keyword.operator","}"] -],[ - "start", - ["paren.keyword.operator","}"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_rhtml.json b/lib/ace/mode/_test/tokens_rhtml.json deleted file mode 100644 index a536f851..00000000 --- a/lib/ace/mode/_test/tokens_rhtml.json +++ /dev/null @@ -1,106 +0,0 @@ -[[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","html"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","head"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","title"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Title"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","body"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","p"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","This is an R HTML document. When you click the "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","b"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Knit HTML"], - ["meta.tag.punctuation.end-tag-open.xml",""], - ["text.xml"," button a web page will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "r-start", - ["support.function.codebegin",""] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","p"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","You can also embed plots, for example:"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "r-start", - ["support.function.codebegin",""] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_ruby.json b/lib/ace/mode/_test/tokens_ruby.json deleted file mode 100644 index f9991e9c..00000000 --- a/lib/ace/mode/_test/tokens_ruby.json +++ /dev/null @@ -1,242 +0,0 @@ -[[ - "start", - ["text"," "], - ["comment","#test: symbol tokenizer"] -],[ - "start", - ["text"," "], - ["paren.lparen","["], - ["constant.other.symbol.ruby",":@thing"], - ["text",", "], - ["constant.other.symbol.ruby",":$thing"], - ["text",", "], - ["constant.other.symbol.ruby",":_thing"], - ["text",", "], - ["constant.other.symbol.ruby",":thing"], - ["text",", "], - ["constant.other.symbol.ruby",":Thing"], - ["text",", "], - ["constant.other.symbol.ruby",":thing1"], - ["text",", "], - ["constant.other.symbol.ruby",":thing_a"], - ["text",","] -],[ - "start", - ["text"," "], - ["constant.other.symbol.ruby",":THING"], - ["text",", "], - ["constant.other.symbol.ruby",":thing!"], - ["text",", "], - ["constant.other.symbol.ruby",":thing="], - ["text",", "], - ["constant.other.symbol.ruby",":thing?"], - ["text",", "], - ["constant.other.symbol.ruby",":t?"], - ["text",","] -],[ - "start", - ["text"," :, :@, :"], - ["keyword.operator","$"], - ["text",", :"], - ["constant.numeric","1"], - ["text",", :1"], - ["identifier","thing"], - ["text",", "], - ["constant.other.symbol.ruby",":th?"], - ["identifier","ing"], - ["text",", "], - ["constant.other.symbol.ruby",":thi="], - ["identifier","ng"], - ["text",", :1"], - ["identifier","thing"], - ["text",","] -],[ - "start", - ["text"," "], - ["constant.other.symbol.ruby",":th!"], - ["identifier","ing"], - ["text",", "], - ["constant.other.symbol.ruby",":thing"], - ["comment","#"] -],[ - "start", - ["text"," "], - ["paren.rparen","]"] -],[ - "start" -],[ - "start", - ["text"," "], - ["comment","#test: namespaces aren't symbols\" : function() {"] -],[ - "start", - ["text"," "], - ["support.class","Namespaced"], - ["text","::"], - ["support.class","Class"] -],[ - "start", - ["text"," "], - ["comment","#test: hex tokenizer "] -],[ - "start", - ["text"," "], - ["constant.numeric","0x9a"], - ["text",", "], - ["constant.numeric","0XA1"], - ["text",", "], - ["constant.numeric","0x9_a"], - ["text",", 0"], - ["identifier","x"], - ["text",", 0"], - ["identifier","x_9a"], - ["text",", 0"], - ["identifier","x9a_"], - ["text",","] -],[ - "start", - ["text"," "], - ["comment","#test: float tokenizer"] -],[ - "start", - ["text"," "], - ["paren.lparen","["], - ["constant.numeric","1"], - ["text",", "], - ["constant.numeric","+1"], - ["text",", "], - ["constant.numeric","-1"], - ["text",", "], - ["constant.numeric","12_345"], - ["text",", "], - ["constant.numeric","0.000_1"], - ["text",","] -],[ - "start", - ["text"," "], - ["identifier","_"], - ["text",", "], - ["constant.numeric","3_1"], - ["text",", "], - ["constant.numeric","1_2"], - ["text",", 1"], - ["identifier","_"], - ["text","."], - ["constant.numeric","0"], - ["text",", "], - ["constant.numeric","0"], - ["text","."], - ["identifier","_1"], - ["paren.rparen","]"], - ["text",";"] -],[ - "start", - ["text"," "] -],[ - "start", - ["paren.lparen","{"], - ["constant.other.symbol.ruby",":id"], - ["text"," "], - ["punctuation.separator.key-value","=>"], - ["text"," "], - ["string.character","?\""], - ["text",", "], - ["constant.other.symbol.ruby",":key"], - ["text"," "], - ["punctuation.separator.key-value","=>"], - ["text"," "], - ["string.start","\""], - ["string","value"], - ["string.end","\""], - ["text",", "], - ["identifier","anotherKey"], - ["text",": "], - ["paren.lparen","["], - ["identifier","x"], - ["text",", "], - ["identifier","y"], - ["text","?"], - ["paren.rparen","]}"] -],[ - "start" -],[ - "comment", - ["comment","=begin"] -],[ - "start", - ["comment","=end"] -],[ - "start" -],[ - "comment", - ["comment","=begin x"] -],[ - "comment", - ["comment","=end-"] -],[ - "start", - ["comment","=end x"] -],[ - "start" -],[ - ["heredoc","FOO","heredoc","BAR","indentedHeredoc","BAZ","indentedHeredoc","EXEC"], - ["text"," "], - ["identifier","herDocs"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","["], - ["constant","<<"], - ["string","'"], - ["support.class","FOO"], - ["string","'"], - ["text",", "], - ["constant","<<"], - ["string",""], - ["support.class","BAR"], - ["string",""], - ["text",", "], - ["constant","<<-"], - ["string",""], - ["support.class","BAZ"], - ["string",""], - ["text",", "], - ["constant","<<-"], - ["string","`"], - ["support.class","EXEC"], - ["string","`"], - ["paren.rparen","]"], - ["text"," "], - ["comment","#comment"] -],[ - ["heredoc","FOO","heredoc","BAR","indentedHeredoc","BAZ","indentedHeredoc","EXEC"], - ["string"," FOO #{literal}"] -],[ - ["heredoc","BAR","indentedHeredoc","BAZ","indentedHeredoc","EXEC"], - ["support.class","FOO"] -],[ - ["heredoc","BAR","indentedHeredoc","BAZ","indentedHeredoc","EXEC"], - ["string"," BAR #{fact(10)}"] -],[ - ["indentedHeredoc","BAZ","indentedHeredoc","EXEC"], - ["support.class","BAR"] -],[ - ["indentedHeredoc","BAZ","indentedHeredoc","EXEC"], - ["string"," BAZ indented"] -],[ - ["indentedHeredoc","EXEC"], - ["string"," "], - ["support.class","BAZ"] -],[ - ["indentedHeredoc","EXEC"], - ["string"," echo hi"] -],[ - "start", - ["string"," "], - ["support.class","EXEC"] -],[ - "start", - ["support.function","puts"], - ["text"," "], - ["identifier","herDocs"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_rust.json b/lib/ace/mode/_test/tokens_rust.json deleted file mode 100644 index 8c59a3aa..00000000 --- a/lib/ace/mode/_test/tokens_rust.json +++ /dev/null @@ -1,139 +0,0 @@ -[[ - "start", - ["keyword.source.rust","use"], - ["text"," "], - ["support.constant","core::rand::"], - ["text","RngUtil"], - ["keyword.operator",";"] -],[ - "start" -],[ - "start", - ["keyword.source.rust","fn"], - ["text"," "], - ["entity.name.function.source.rust","main"], - ["text","() {"] -],[ - "start", - ["text"," "], - ["keyword.source.rust","for"], - ["text"," ["], - ["string.quoted.double.source.rust","\"Alice\""], - ["keyword.operator",","], - ["text"," "], - ["string.quoted.double.source.rust","\"Bob\""], - ["keyword.operator",","], - ["text"," "], - ["string.quoted.double.source.rust","\"Carol\""], - ["text","].each |&name| {"] -],[ - "start", - ["text"," "], - ["keyword.source.rust","do"], - ["text"," spawn {"] -],[ - "start", - ["text"," "], - ["keyword.source.rust","let"], - ["text"," v "], - ["keyword.operator","="], - ["text"," "], - ["support.constant","rand::"], - ["text","Rng().shuffle(["], - ["constant.numeric.integer.source.rust","1"], - ["keyword.operator",","], - ["text"," "], - ["constant.numeric.integer.source.rust","2"], - ["keyword.operator",","], - ["text"," "], - ["constant.numeric.integer.source.rust","3"], - ["text","])"], - ["keyword.operator",";"] -],[ - "start", - ["text"," "], - ["keyword.source.rust","for"], - ["text"," v.each |&num| {"] -],[ - "start", - ["text"," print(fmt"], - ["keyword.operator","!"], - ["text","("], - ["string.quoted.double.source.rust","\"%s says: '%d'"], - ["constant.character.escape.source.rust","\\n"], - ["string.quoted.double.source.rust","\""], - ["keyword.operator",","], - ["text"," name"], - ["keyword.operator",","], - ["text"," num "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric.integer.source.rust","1"], - ["text","))"] -],[ - "start", - ["text"," }"] -],[ - "start", - ["text"," }"] -],[ - "start", - ["text"," }"] -],[ - "start", - ["text","}"] -],[ - "start" -],[ - "start", - ["keyword.source.rust","fn"], - ["text"," "], - ["entity.name.function.source.rust","map"], - ["keyword.operator","<"], - ["text","T"], - ["keyword.operator",","], - ["text"," U"], - ["keyword.operator",">"], - ["text","(vector: &[T]"], - ["keyword.operator",","], - ["text"," function: &fn(v: &T) "], - ["keyword.operator","->"], - ["text"," U) "], - ["keyword.operator","->"], - ["text"," ~[U] {"] -],[ - "start", - ["text"," "], - ["keyword.source.rust","let"], - ["text"," "], - ["keyword.source.rust","mut"], - ["text"," accumulator "], - ["keyword.operator","="], - ["text"," ~[]"], - ["keyword.operator",";"] -],[ - "start", - ["text"," "], - ["keyword.source.rust","for"], - ["text"," "], - ["support.constant","vec::"], - ["text","each(vector) |element| {"] -],[ - "start", - ["text"," accumulator.push(function(element))"], - ["keyword.operator",";"] -],[ - "start", - ["text"," }"] -],[ - "start", - ["text"," "], - ["keyword.source.rust","return"], - ["text"," accumulator"], - ["keyword.operator",";"] -],[ - "start", - ["text","}"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_sass.json b/lib/ace/mode/_test/tokens_sass.json deleted file mode 100644 index c0b85682..00000000 --- a/lib/ace/mode/_test/tokens_sass.json +++ /dev/null @@ -1,229 +0,0 @@ -[[ - "start", - ["comment","// sass ace mode;"] -],[ - "start" -],[ - "start", - ["keyword","@import"], - ["text"," "], - ["support.function","url("], - ["string","http://fonts.googleapis.com/css?family=Ace:700"], - ["support.function",")"] -],[ - "start" -],[ - "start", - ["variable.language","html"], - ["text",", "], - ["variable.language","body"] -],[ - "start", - ["support.type"," :background-color "], - ["constant.numeric","#ace"] -],[ - "start", - ["text"," "], - ["support.type","text-align"], - ["text",": "], - ["constant.language","center"] -],[ - "start", - ["text"," "], - ["support.type","height"], - ["text",": "], - ["constant.numeric","100%"] -],[ - ["comment",-1,2,"start"], - ["comment"," /*;*********;"] -],[ - ["comment",3,2,"start"], - ["comment"," ;comment ;"] -],[ - ["comment",3,2,"start"], - ["comment"," ;*********;"] -],[ - "start" -],[ - "start", - ["variable.language",".toggle"] -],[ - "start", - ["text"," "], - ["variable","$size"], - ["text",": "], - ["constant.numeric","14px"] -],[ - "start" -],[ - "start", - ["support.type"," :background "], - ["support.function","url("], - ["string","http://subtlepatterns.com/patterns/dark_stripes.png"], - ["support.function",")"] -],[ - "start", - ["text"," "], - ["support.type","border-radius"], - ["text",": "], - ["constant.numeric","8px"] -],[ - "start", - ["text"," "], - ["support.type","height"], - ["text",": "], - ["variable","$size"] -],[ - "start" -],[ - "start", - ["text"," &"], - ["variable.language",":before"] -],[ - "start", - ["text"," "], - ["variable","$radius"], - ["text",": "], - ["variable","$size"], - ["text"," "], - ["keyword.operator","*"], - ["text"," "], - ["constant.numeric","0.845"] -],[ - "start", - ["text"," "], - ["variable","$glow"], - ["text",": "], - ["variable","$size"], - ["text"," "], - ["keyword.operator","*"], - ["text"," "], - ["constant.numeric","0.125"] -],[ - "start" -],[ - "start", - ["text"," "], - ["support.type","box-shadow"], - ["text",": "], - ["constant.numeric","0"], - ["text"," "], - ["constant.numeric","0"], - ["text"," "], - ["variable","$glow"], - ["text"," "], - ["variable","$glow"], - ["text"," / "], - ["constant.numeric","2"], - ["text"," "], - ["constant.numeric","#fff"] -],[ - "start", - ["text"," "], - ["support.type","border-radius"], - ["text",": "], - ["variable","$radius"] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," &"], - ["variable.language",":active"] -],[ - "start", - ["text"," ~ "], - ["variable.language",".button"] -],[ - "start", - ["text"," "], - ["support.type","box-shadow"], - ["text",": "], - ["constant.numeric","0"], - ["text"," "], - ["constant.numeric","15px"], - ["text"," "], - ["constant.numeric","25px"], - ["text"," "], - ["constant.numeric","-4px"], - ["text"," "], - ["support.function","rgba"], - ["paren.lparen","("], - ["constant.numeric","0"], - ["text",","], - ["constant.numeric","0"], - ["text",","], - ["constant.numeric","0"], - ["text",","], - ["constant.numeric","0.4"], - ["paren.rparen",")"], - ["text"," "] -],[ - "start", - ["text"," ~ "], - ["variable.language",".label"] -],[ - "start", - ["text"," "], - ["support.type","font-size"], - ["text",": "], - ["constant.numeric","40px"] -],[ - "start", - ["text"," "], - ["support.type","color"], - ["text",": "], - ["support.function","rgba"], - ["paren.lparen","("], - ["constant.numeric","0"], - ["text",","], - ["constant.numeric","0"], - ["text",","], - ["constant.numeric","0"], - ["text",","], - ["constant.numeric","0.45"], - ["paren.rparen",")"] -],[ - "start" -],[ - "start", - ["text"," &"], - ["variable.language",":checked"], - ["text"," "] -],[ - "start", - ["text"," ~ "], - ["variable.language",".button"] -],[ - "start", - ["text"," "], - ["support.type","box-shadow"], - ["text",": "], - ["constant.numeric","0"], - ["text"," "], - ["constant.numeric","15px"], - ["text"," "], - ["constant.numeric","25px"], - ["text"," "], - ["constant.numeric","-4px"], - ["text"," "], - ["constant.numeric","#ace"] -],[ - "start", - ["text"," ~ "], - ["variable.language",".label"] -],[ - "start", - ["text"," "], - ["support.type","font-size"], - ["text",": "], - ["constant.numeric","40px"] -],[ - "start", - ["text"," "], - ["support.type","color"], - ["text",": "], - ["constant.numeric","#c9c9c9"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_scad.json b/lib/ace/mode/_test/tokens_scad.json deleted file mode 100644 index 8f0ff637..00000000 --- a/lib/ace/mode/_test/tokens_scad.json +++ /dev/null @@ -1,194 +0,0 @@ -[[ - "start", - ["comment","// ace can highlight scad!"] -],[ - "start", - ["keyword","module"], - ["text"," "], - ["identifier","Element"], - ["paren.lparen","("], - ["identifier","xpos"], - ["text",", "], - ["identifier","ypos"], - ["text",", "], - ["identifier","zpos"], - ["paren.rparen",")"], - ["paren.lparen","{"] -],[ - "start", - ["text","\t"], - ["identifier","translate"], - ["paren.lparen","(["], - ["identifier","xpos"], - ["text",","], - ["identifier","ypos"], - ["text",","], - ["identifier","zpos"], - ["paren.rparen","])"], - ["paren.lparen","{"] -],[ - "start", - ["text","\t\t"], - ["identifier","union"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["paren.lparen","{"] -],[ - "start", - ["text","\t\t\t"], - ["identifier","cube"], - ["paren.lparen","(["], - ["constant.numeric","10"], - ["text",","], - ["constant.numeric","10"], - ["text",","], - ["constant.numeric","4"], - ["paren.rparen","]"], - ["text",","], - ["identifier","true"], - ["paren.rparen",")"], - ["text",";"] -],[ - "start", - ["text","\t\t\t"], - ["identifier","cylinder"], - ["paren.lparen","("], - ["constant.numeric","10"], - ["text",","], - ["constant.numeric","15"], - ["text",","], - ["constant.numeric","5"], - ["paren.rparen",")"], - ["text",";"] -],[ - "start", - ["text","\t\t\t"], - ["identifier","translate"], - ["paren.lparen","(["], - ["constant.numeric","0"], - ["text",","], - ["constant.numeric","0"], - ["text",","], - ["constant.numeric","10"], - ["paren.rparen","])"], - ["identifier","sphere"], - ["paren.lparen","("], - ["constant.numeric","5"], - ["paren.rparen",")"], - ["text",";"] -],[ - "start", - ["text","\t\t"], - ["paren.rparen","}"] -],[ - "start", - ["text","\t"], - ["paren.rparen","}"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["identifier","union"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["paren.lparen","{"] -],[ - "start", - ["text","\t"], - ["keyword","for"], - ["paren.lparen","("], - ["identifier","i"], - ["keyword.operator","="], - ["paren.lparen","["], - ["constant.numeric","0"], - ["text",":"], - ["constant.numeric","30"], - ["paren.rparen","])"], - ["paren.lparen","{"] -],[ - "start", - ["text","\t\t# "], - ["identifier","Element"], - ["paren.lparen","("], - ["constant.numeric","0"], - ["text",","], - ["constant.numeric","0"], - ["text",","], - ["constant.numeric","0"], - ["paren.rparen",")"], - ["text",";"] -],[ - "start", - ["text","\t\t"], - ["identifier","Element"], - ["paren.lparen","("], - ["constant.numeric","15"], - ["keyword.operator","*"], - ["identifier","i"], - ["text",","], - ["constant.numeric","0"], - ["text",","], - ["constant.numeric","0"], - ["paren.rparen",")"], - ["text",";"] -],[ - "start", - ["text","\t"], - ["paren.rparen","}"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["keyword","for"], - ["text"," "], - ["paren.lparen","("], - ["identifier","i"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","["], - ["constant.numeric","3"], - ["text",", "], - ["constant.numeric","5"], - ["text",", "], - ["constant.numeric","7"], - ["text",", "], - ["constant.numeric","11"], - ["paren.rparen","])"], - ["paren.lparen","{"] -],[ - "start", - ["text","\t"], - ["identifier","rotate"], - ["paren.lparen","(["], - ["identifier","i"], - ["keyword.operator","*"], - ["constant.numeric","10"], - ["text",","], - ["constant.numeric","0"], - ["text",","], - ["constant.numeric","0"], - ["paren.rparen","])"], - ["identifier","scale"], - ["paren.lparen","(["], - ["constant.numeric","1"], - ["text",","], - ["constant.numeric","1"], - ["text",","], - ["identifier","i"], - ["paren.rparen","])"], - ["identifier","cube"], - ["paren.lparen","("], - ["constant.numeric","10"], - ["paren.rparen",")"], - ["text",";"] -],[ - "start", - ["paren.rparen","}"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_scala.json b/lib/ace/mode/_test/tokens_scala.json deleted file mode 100644 index 01dd3ce3..00000000 --- a/lib/ace/mode/_test/tokens_scala.json +++ /dev/null @@ -1,542 +0,0 @@ -[[ - "start", - ["comment","// http://www.scala-lang.org/node/54"] -],[ - "start" -],[ - "start", - ["keyword","package"], - ["text"," "], - ["identifier","examples"], - ["text","."], - ["identifier","actors"] -],[ - "start" -],[ - "start", - ["keyword","import"], - ["text"," "], - ["identifier","scala"], - ["text","."], - ["identifier","actors"], - ["text","."], - ["identifier","Actor"] -],[ - "start", - ["keyword","import"], - ["text"," "], - ["identifier","scala"], - ["text","."], - ["identifier","actors"], - ["text","."], - ["identifier","Actor"], - ["text","."], - ["identifier","_"] -],[ - "start" -],[ - "start", - ["keyword","abstract"], - ["text"," "], - ["keyword","class"], - ["text"," "], - ["identifier","PingMessage"] -],[ - "start", - ["keyword","case"], - ["text"," "], - ["keyword","object"], - ["text"," "], - ["identifier","Start"], - ["text"," "], - ["keyword","extends"], - ["text"," "], - ["identifier","PingMessage"] -],[ - "start", - ["keyword","case"], - ["text"," "], - ["keyword","object"], - ["text"," "], - ["identifier","SendPing"], - ["text"," "], - ["keyword","extends"], - ["text"," "], - ["identifier","PingMessage"] -],[ - "start", - ["keyword","case"], - ["text"," "], - ["keyword","object"], - ["text"," "], - ["identifier","Pong"], - ["text"," "], - ["keyword","extends"], - ["text"," "], - ["identifier","PingMessage"] -],[ - "start" -],[ - "start", - ["keyword","abstract"], - ["text"," "], - ["keyword","class"], - ["text"," "], - ["identifier","PongMessage"] -],[ - "start", - ["keyword","case"], - ["text"," "], - ["keyword","object"], - ["text"," "], - ["identifier","Ping"], - ["text"," "], - ["keyword","extends"], - ["text"," "], - ["identifier","PongMessage"] -],[ - "start", - ["keyword","case"], - ["text"," "], - ["keyword","object"], - ["text"," "], - ["identifier","Stop"], - ["text"," "], - ["keyword","extends"], - ["text"," "], - ["identifier","PongMessage"] -],[ - "start" -],[ - "start", - ["keyword","object"], - ["text"," "], - ["identifier","pingpong"], - ["text"," "], - ["keyword","extends"], - ["text"," "], - ["identifier","Application"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","val"], - ["text"," "], - ["identifier","pong"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["keyword","new"], - ["text"," "], - ["identifier","Pong"] -],[ - "start", - ["text"," "], - ["keyword","val"], - ["text"," "], - ["identifier","ping"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["keyword","new"], - ["text"," "], - ["identifier","Ping"], - ["paren.lparen","("], - ["constant.numeric","100000"], - ["text",", "], - ["identifier","pong"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["identifier","ping"], - ["text","."], - ["identifier","start"] -],[ - "start", - ["text"," "], - ["identifier","pong"], - ["text","."], - ["identifier","start"] -],[ - "start", - ["text"," "], - ["identifier","ping"], - ["text"," "], - ["keyword.operator","!"], - ["text"," "], - ["identifier","Start"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["keyword","class"], - ["text"," "], - ["identifier","Ping"], - ["paren.lparen","("], - ["identifier","count"], - ["text",": "], - ["support.function","Int"], - ["text",", "], - ["identifier","pong"], - ["text",": "], - ["identifier","Actor"], - ["paren.rparen",")"], - ["text"," "], - ["keyword","extends"], - ["text"," "], - ["identifier","Actor"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","def"], - ["text"," "], - ["identifier","act"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["identifier","println"], - ["paren.lparen","("], - ["string","\"Ping: Initializing with count \""], - ["keyword.operator","+"], - ["identifier","count"], - ["keyword.operator","+"], - ["string","\": \""], - ["keyword.operator","+"], - ["identifier","pong"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["keyword","var"], - ["text"," "], - ["identifier","pingsLeft"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","count"] -],[ - "start", - ["text"," "], - ["identifier","loop"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["identifier","react"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","case"], - ["text"," "], - ["identifier","Start"], - ["text"," "], - ["keyword.operator","=>"] -],[ - "start", - ["text"," "], - ["identifier","println"], - ["paren.lparen","("], - ["string","\"Ping: starting.\""], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["identifier","pong"], - ["text"," "], - ["keyword.operator","!"], - ["text"," "], - ["identifier","Ping"] -],[ - "start", - ["text"," "], - ["identifier","pingsLeft"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","pingsLeft"], - ["text"," "], - ["keyword.operator","-"], - ["text"," "], - ["constant.numeric","1"] -],[ - "start", - ["text"," "], - ["keyword","case"], - ["text"," "], - ["identifier","SendPing"], - ["text"," "], - ["keyword.operator","=>"] -],[ - "start", - ["text"," "], - ["identifier","pong"], - ["text"," "], - ["keyword.operator","!"], - ["text"," "], - ["identifier","Ping"] -],[ - "start", - ["text"," "], - ["identifier","pingsLeft"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","pingsLeft"], - ["text"," "], - ["keyword.operator","-"], - ["text"," "], - ["constant.numeric","1"] -],[ - "start", - ["text"," "], - ["keyword","case"], - ["text"," "], - ["identifier","Pong"], - ["text"," "], - ["keyword.operator","=>"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["paren.lparen","("], - ["identifier","pingsLeft"], - ["text"," "], - ["keyword.operator","%"], - ["text"," "], - ["constant.numeric","1000"], - ["text"," "], - ["keyword.operator","=="], - ["text"," "], - ["constant.numeric","0"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["identifier","println"], - ["paren.lparen","("], - ["string","\"Ping: pong from: \""], - ["keyword.operator","+"], - ["identifier","sender"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["paren.lparen","("], - ["identifier","pingsLeft"], - ["text"," "], - ["keyword.operator",">"], - ["text"," "], - ["constant.numeric","0"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["identifier","self"], - ["text"," "], - ["keyword.operator","!"], - ["text"," "], - ["identifier","SendPing"] -],[ - "start", - ["text"," "], - ["keyword","else"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["identifier","println"], - ["paren.lparen","("], - ["string","\"Ping: Stop.\""], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["identifier","pong"], - ["text"," "], - ["keyword.operator","!"], - ["text"," "], - ["identifier","Stop"] -],[ - "start", - ["text"," "], - ["identifier","exit"], - ["paren.lparen","("], - ["symbol.constant","'stop"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["keyword","class"], - ["text"," "], - ["identifier","Pong"], - ["text"," "], - ["keyword","extends"], - ["text"," "], - ["identifier","Actor"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","def"], - ["text"," "], - ["identifier","act"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","var"], - ["text"," "], - ["identifier","pongCount"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","0"] -],[ - "start", - ["text"," "], - ["identifier","loop"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["identifier","react"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","case"], - ["text"," "], - ["identifier","Ping"], - ["text"," "], - ["keyword.operator","=>"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["paren.lparen","("], - ["identifier","pongCount"], - ["text"," "], - ["keyword.operator","%"], - ["text"," "], - ["constant.numeric","1000"], - ["text"," "], - ["keyword.operator","=="], - ["text"," "], - ["constant.numeric","0"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["identifier","println"], - ["paren.lparen","("], - ["string","\"Pong: ping \""], - ["keyword.operator","+"], - ["identifier","pongCount"], - ["keyword.operator","+"], - ["string","\" from \""], - ["keyword.operator","+"], - ["identifier","sender"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["identifier","sender"], - ["text"," "], - ["keyword.operator","!"], - ["text"," "], - ["identifier","Pong"] -],[ - "start", - ["text"," "], - ["identifier","pongCount"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","pongCount"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric","1"] -],[ - "start", - ["text"," "], - ["keyword","case"], - ["text"," "], - ["identifier","Stop"], - ["text"," "], - ["keyword.operator","=>"] -],[ - "start", - ["text"," "], - ["identifier","println"], - ["paren.lparen","("], - ["string","\"Pong: Stop.\""], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["identifier","exit"], - ["paren.lparen","("], - ["symbol.constant","'stop"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["paren.rparen","}"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_scheme.json b/lib/ace/mode/_test/tokens_scheme.json deleted file mode 100644 index 42f4aa65..00000000 --- a/lib/ace/mode/_test/tokens_scheme.json +++ /dev/null @@ -1,216 +0,0 @@ -[[ - "start", - ["text","("], - ["storage.type.function-type.scheme","define"], - ["text"," "], - ["text","("], - ["identifier","prompt-for-cd"], - ["text",")"] -],[ - "start", - ["text"," "], - ["string","\"Prompts"] -],[ - "start", - ["text"," "], - ["identifier","for"], - ["text"," "], - ["identifier","CD"], - ["text","\""] -],[ - "start", - ["text"," ("], - ["identifier","prompt-read"], - ["text"," "], - ["string","\"Title\""], - ["text"," "], - ["constant.numeric","1.53"], - ["text"," "], - ["constant.numeric","1"], - ["text"," "], - ["constant.numeric","2"], - ["text","/"], - ["constant.numeric","4"], - ["text"," "], - ["constant.numeric","1.7"], - ["text"," "], - ["constant.numeric","1.7e0"], - ["text"," "], - ["constant.numeric","2.9E-4"], - ["text"," "], - ["constant.numeric","+42"], - ["text"," "], - ["constant.numeric","-7"], - ["text"," "], - ["constant.numeric","#b001"], - ["text"," "], - ["constant.numeric","#b001"], - ["text","/"], - ["constant.numeric","100"], - ["text"," "], - ["constant.numeric","#o777"], - ["text"," "], - ["constant.numeric","#O777"], - ["text"," "], - ["constant.numeric","#xabc55"], - ["text"," "], - ["identifier","#c"], - ["text","("], - ["constant.numeric","0"], - ["text"," "], - ["constant.numeric","-5.6"], - ["text","))"] -],[ - "start", - ["text"," ("], - ["identifier","prompt-read"], - ["text"," "], - ["string","\"Artist\""], - ["text",")"] -],[ - "start", - ["text"," ("], - ["keyword.operator","or"], - ["text"," ("], - ["identifier","parse-integer"], - ["text"," ("], - ["identifier","prompt-read"], - ["text"," "], - ["string","\"Rating\""], - ["text",") "], - ["punctuation.definition.constant.character.scheme","#:junk-allowed"], - ["text"," "], - ["constant.language","#t"], - ["text",") "], - ["constant.numeric","0"], - ["text",")"] -],[ - "start", - ["text"," ("], - ["keyword.control","if"], - ["text"," "], - ["identifier","x"], - ["text"," ("], - ["support.function","format"], - ["text"," "], - ["constant.language","#t"], - ["text"," "], - ["string","\"yes\""], - ["text",") ("], - ["support.function","format"], - ["text"," "], - ["constant.language","#f"], - ["text"," "], - ["string","\"no\""], - ["text",") "], - ["comment",";and here comment"] -],[ - "start", - ["text"," ) "] -],[ - "start", - ["text"," "], - ["comment",";; second line comment"] -],[ - "start", - ["text"," '(+ "], - ["constant.numeric","1"], - ["text"," "], - ["constant.numeric","2"], - ["text",")"] -],[ - "start", - ["text"," ("], - ["identifier","position-if-not"], - ["text"," "], - ["identifier","char-set"], - ["text",":"], - ["identifier","whitespace"], - ["text"," "], - ["identifier","line"], - ["text"," "], - ["punctuation.definition.constant.character.scheme","#:start"], - ["text"," "], - ["identifier","beg"], - ["text","))"] -],[ - "start", - ["text"," ("], - ["support.function","quote"], - ["text"," ("], - ["identifier","privet"], - ["text"," "], - ["constant.numeric","1"], - ["text"," "], - ["constant.numeric","2"], - ["text"," "], - ["constant.numeric","3"], - ["text","))"] -],[ - "start", - ["text"," '("], - ["identifier","hello"], - ["text"," "], - ["identifier","world"], - ["text",")"] -],[ - "start", - ["text"," (* "], - ["constant.numeric","5"], - ["text"," "], - ["constant.numeric","7"], - ["text",")"] -],[ - "start", - ["text"," ("], - ["constant.numeric","1"], - ["text"," "], - ["constant.numeric","2"], - ["text"," "], - ["constant.numeric","34"], - ["text"," "], - ["constant.numeric","5"], - ["text",")"] -],[ - "start", - ["text"," ("], - ["punctuation.definition.constant.character.scheme","#:use"], - ["text"," "], - ["string","\"aaaa\""], - ["text",")"] -],[ - "start", - ["text"," ("], - ["keyword.control","let"], - ["text"," (("], - ["identifier","x"], - ["text"," "], - ["constant.numeric","10"], - ["text",") ("], - ["identifier","y"], - ["text"," "], - ["constant.numeric","20"], - ["text","))"] -],[ - "start", - ["text"," ("], - ["identifier","display"], - ["text"," (+ "], - ["identifier","x"], - ["text"," "], - ["identifier","y"], - ["text","))"] -],[ - "start", - ["text"," ) "] -],[ - "start" -],[ - "start", - ["text"," "], - ["string","\"asdad"], - ["constant.character.escape.scheme","\\0"], - ["string","eqweqe\""] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_scss.json b/lib/ace/mode/_test/tokens_scss.json deleted file mode 100644 index 7e92f153..00000000 --- a/lib/ace/mode/_test/tokens_scss.json +++ /dev/null @@ -1,123 +0,0 @@ -[[ - "start", - ["comment","/* style.scss */"] -],[ - "start" -],[ - "start", - ["variable.language","#navbar"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable","$navbar-width"], - ["text",": "], - ["constant.numeric","800px"], - ["text",";"] -],[ - "start", - ["text"," "], - ["variable","$items"], - ["text",": "], - ["constant.numeric","5"], - ["text",";"] -],[ - "start", - ["text"," "], - ["variable","$navbar-color"], - ["text",": "], - ["constant.numeric","#ce4dd6"], - ["text",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["support.type","width"], - ["text",": "], - ["variable","$navbar-width"], - ["text",";"] -],[ - "start", - ["text"," "], - ["support.type","border-bottom"], - ["text",": "], - ["constant.numeric","2px"], - ["text"," "], - ["constant.language","solid"], - ["text"," "], - ["variable","$navbar-color"], - ["text",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["variable.language","li"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["support.type","float"], - ["text",": "], - ["support.type","left"], - ["text",";"] -],[ - "start", - ["text"," "], - ["support.type","width"], - ["text",": "], - ["variable","$navbar-width"], - ["text","/"], - ["variable","$items"], - ["text"," "], - ["constant","-"], - ["text"," "], - ["constant.numeric","10px"], - ["text",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["support.type","background-color"], - ["text",": "], - ["support.function","lighten"], - ["paren.lparen","("], - ["variable","$navbar-color"], - ["text",", "], - ["constant.numeric","20%"], - ["paren.rparen",")"], - ["text",";"] -],[ - "start", - ["text"," &"], - ["variable.language",":hover"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["support.type","background-color"], - ["text",": "], - ["support.function","lighten"], - ["paren.lparen","("], - ["variable","$navbar-color"], - ["text",", "], - ["constant.numeric","10%"], - ["paren.rparen",")"], - ["text",";"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["paren.rparen","}"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_sh.json b/lib/ace/mode/_test/tokens_sh.json deleted file mode 100644 index f2c6b276..00000000 --- a/lib/ace/mode/_test/tokens_sh.json +++ /dev/null @@ -1,334 +0,0 @@ -[[ - "start", - ["comment","#!/bin/sh"] -],[ - "start" -],[ - "start", - ["comment","# Script to open a browser to current branch"] -],[ - "start", - ["comment","# Repo formats:"] -],[ - "start", - ["comment","# ssh git@github.com:richo/gh_pr.git"] -],[ - "start", - ["comment","# http https://richoH@github.com/richo/gh_pr.git"] -],[ - "start", - ["comment","# git git://github.com/richo/gh_pr.git"] -],[ - "start" -],[ - "start", - ["variable","username="], - ["text","`"], - ["identifier","git"], - ["text"," "], - ["identifier","config"], - ["text"," "], - ["keyword.operator","--"], - ["identifier","get"], - ["text"," "], - ["identifier","github"], - ["text","."], - ["identifier","user"], - ["text","`"] -],[ - "start" -],[ - "start", - ["support.function","get_repo()"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["identifier","git"], - ["text"," "], - ["identifier","remote"], - ["text"," "], - ["keyword.operator","-"], - ["identifier","v"], - ["text"," | "], - ["identifier","grep"], - ["text"," $"], - ["paren.lparen","{"], - ["text","@:"], - ["keyword.operator","-"], - ["variable","$username"], - ["paren.rparen","}"], - ["text"," | "], - ["keyword","while"], - ["text"," "], - ["keyword","read"], - ["text"," "], - ["identifier","remote"], - ["text","; "], - ["keyword","do"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","repo="], - ["text","`"], - ["support.function.builtin","echo"], - ["text"," "], - ["variable","$remote"], - ["text"," | "], - ["identifier","grep"], - ["text"," "], - ["keyword.operator","-"], - ["identifier","E"], - ["text"," "], - ["keyword.operator","-"], - ["identifier","o"], - ["text"," "], - ["string","\"git@github.com:[^ ]*\""], - ["text","`; "], - ["keyword","then"] -],[ - "start", - ["text"," "], - ["support.function.builtin","echo"], - ["text"," "], - ["variable","$repo"], - ["text"," | "], - ["identifier","sed"], - ["text"," "], - ["keyword.operator","-"], - ["identifier","e"], - ["text"," "], - ["string","\"s/^git@github\\.com://\""], - ["text"," "], - ["keyword.operator","-"], - ["identifier","e"], - ["text"," "], - ["string","\"s/\\.git$//\""] -],[ - "start", - ["text"," "], - ["support.function.builtin","exit"], - ["text"," "], - ["constant.numeric","1"] -],[ - "start", - ["text"," "], - ["keyword","fi"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","repo="], - ["text","`"], - ["support.function.builtin","echo"], - ["text"," "], - ["variable","$remote"], - ["text"," | "], - ["identifier","grep"], - ["text"," "], - ["keyword.operator","-"], - ["identifier","E"], - ["text"," "], - ["keyword.operator","-"], - ["identifier","o"], - ["text"," "], - ["string","\"https?://([^@]*@)?github.com/[^ ]*\\.git\""], - ["text","`; "], - ["keyword","then"] -],[ - "start", - ["text"," "], - ["support.function.builtin","echo"], - ["text"," "], - ["variable","$repo"], - ["text"," | "], - ["identifier","sed"], - ["text"," "], - ["keyword.operator","-"], - ["identifier","e"], - ["text"," "], - ["string","\"s|^https?://||\""], - ["text"," "], - ["keyword.operator","-"], - ["identifier","e"], - ["text"," "], - ["string","\"s/^.*github\\.com\\///\""], - ["text"," "], - ["keyword.operator","-"], - ["identifier","e"], - ["text"," "], - ["string","\"s/\\.git$//\""] -],[ - "start", - ["text"," "], - ["support.function.builtin","exit"], - ["text"," "], - ["constant.numeric","1"] -],[ - "start", - ["text"," "], - ["keyword","fi"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["variable","repo="], - ["text","`"], - ["support.function.builtin","echo"], - ["text"," "], - ["variable","$remote"], - ["text"," | "], - ["identifier","grep"], - ["text"," "], - ["keyword.operator","-"], - ["identifier","E"], - ["text"," "], - ["keyword.operator","-"], - ["identifier","o"], - ["text"," "], - ["string","\"git://github.com/[^ ]*\\.git\""], - ["text","`; "], - ["keyword","then"] -],[ - "start", - ["text"," "], - ["support.function.builtin","echo"], - ["text"," "], - ["variable","$repo"], - ["text"," | "], - ["identifier","sed"], - ["text"," "], - ["keyword.operator","-"], - ["identifier","e"], - ["text"," "], - ["string","\"s|^git://github.com/||\""], - ["text"," "], - ["keyword.operator","-"], - ["identifier","e"], - ["text"," "], - ["string","\"s/\\.git$//\""] -],[ - "start", - ["text"," "], - ["support.function.builtin","exit"], - ["text"," "], - ["constant.numeric","1"] -],[ - "start", - ["text"," "], - ["keyword","fi"] -],[ - "start", - ["text"," "], - ["keyword","done"] -],[ - "start" -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["paren.lparen","["], - ["text"," "], - ["variable.language","$?"], - ["text"," "], - ["keyword.operator","-"], - ["identifier","eq"], - ["text"," "], - ["constant.numeric","0"], - ["text"," "], - ["paren.rparen","]"], - ["text","; "], - ["keyword","then"] -],[ - "start", - ["text"," "], - ["support.function.builtin","echo"], - ["text"," "], - ["string","\"Couldn't find a valid remote\""], - ["text"," "], - ["keyword.operator",">"], - ["support.function","&2"] -],[ - "start", - ["text"," "], - ["support.function.builtin","exit"], - ["text"," "], - ["constant.numeric","1"] -],[ - "start", - ["text"," "], - ["keyword","fi"] -],[ - "start", - ["paren.rparen","}"] -],[ - "start" -],[ - "start", - ["support.function.builtin","echo"], - ["text"," $"], - ["paren.lparen","{"], - ["text","#"], - ["identifier","x"], - ["paren.lparen","["], - ["text","@"], - ["paren.rparen","]}"] -],[ - "start" -],[ - "start", - ["keyword","if"], - ["text"," "], - ["variable","repo="], - ["text","`"], - ["identifier","get_repo"], - ["text"," $@`; "], - ["keyword","then"] -],[ - "start", - ["text"," "], - ["variable","branch="], - ["text","`"], - ["identifier","git"], - ["text"," "], - ["identifier","symbolic"], - ["keyword.operator","-"], - ["identifier","ref"], - ["text"," "], - ["identifier","HEAD"], - ["text"," "], - ["constant.numeric","2"], - ["keyword.operator",">/"], - ["identifier","dev"], - ["keyword.operator","/"], - ["identifier","null"], - ["text","`"] -],[ - "start", - ["text"," "], - ["support.function.builtin","echo"], - ["text"," "], - ["string","\"http://github.com/"], - ["constant","$repo"], - ["string","/pull/new/${branch##refs/heads/}\""] -],[ - "start", - ["keyword","else"] -],[ - "start", - ["text"," "], - ["support.function.builtin","exit"], - ["text"," "], - ["constant.numeric","1"] -],[ - "start", - ["keyword","fi"] -],[ - "start" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_sjs.json b/lib/ace/mode/_test/tokens_sjs.json deleted file mode 100644 index 5cd96451..00000000 --- a/lib/ace/mode/_test/tokens_sjs.json +++ /dev/null @@ -1,276 +0,0 @@ -[[ - "start", - ["storage.type","var"], - ["text"," "], - ["paren.lparen","{"], - ["text"," "], - ["identifier","each"], - ["punctuation.operator",","], - ["text"," "], - ["identifier","map"], - ["text"," "], - ["paren.rparen","}"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","require"], - ["paren.lparen","("], - ["string","'sjs:sequence'"], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["storage.type","var"], - ["text"," "], - ["paren.lparen","{"], - ["text"," "], - ["keyword","get"], - ["text"," "], - ["paren.rparen","}"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","require"], - ["paren.lparen","("], - ["string","'sjs:http'"], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start" -],[ - "start", - ["storage.type","function"], - ["text"," "], - ["entity.name.function","foo"], - ["paren.lparen","("], - ["variable.parameter","items"], - ["punctuation.operator",", "], - ["variable.parameter","nada"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - ["no_regex"], - ["text"," "], - ["storage.type","var"], - ["text"," "], - ["identifier","component"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","{"], - ["text"," "], - ["identifier","name"], - ["punctuation.operator",":"], - ["text"," "], - ["string","\"Ace\""], - ["punctuation.operator",","], - ["text"," "], - ["identifier","role"], - ["punctuation.operator",":"], - ["text"," "], - ["string","\"Editor\""], - ["text"," "], - ["paren.rparen","}"], - ["punctuation.operator",";"] -],[ - ["qqstring","no_regex"], - ["text"," "], - ["storage.type","console"], - ["punctuation.operator","."], - ["support.function.firebug","log"], - ["paren.lparen","("], - ["string","\""] -],[ - ["qqstring","no_regex"], - ["string"," Welcome, "], - ["paren.lparen","#{"], - ["identifier","component"], - ["text","."], - ["identifier","name"], - ["paren.rparen","}"] -],[ - ["no_regex"], - ["string"," \""], - ["punctuation.operator","."], - ["identifier","trim"], - ["paren.lparen","("], - ["paren.rparen","))"], - ["punctuation.operator",";"] -],[ - ["no_regex"] -],[ - ["no_regex"], - ["text"," "], - ["identifier","logging"], - ["punctuation.operator","."], - ["identifier","debug"], - ["paren.lparen","("], - ["string","`Component added: "], - ["paren.lparen","$"], - ["identifier","String"], - ["paren.lparen","("], - ["identifier","component"], - ["paren.rparen",")"], - ["string"," ("], - ["paren.lparen","${"], - ["identifier","component"], - ["paren.rparen","}"], - ["string",")`"], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - ["no_regex"] -],[ - ["bstring","no_regex"], - ["text"," "], - ["storage.type","console"], - ["punctuation.operator","."], - ["support.function.firebug","log"], - ["paren.lparen","("], - ["string","`"] -],[ - ["string_interp","string_interp","bstring","no_regex"], - ["string"," Welcome, {"], - ["paren.lparen","${"], - ["storage.type","function"], - ["text","() "], - ["paren.lparen","{"] -],[ - ["string_interp","string_interp","bstring","no_regex"], - ["text"," "], - ["keyword","return"], - ["text"," "], - ["paren.lparen","{"], - ["text"," "], - ["identifier","x"], - ["text",": "], - ["constant.numeric","1"], - ["text",", "], - ["identifier","y"], - ["text",": "], - ["string","\"why?}\""], - ["paren.rparen","}"], - ["text",";"] -],[ - ["bstring","no_regex"], - ["text"," "], - ["paren.rparen","}"], - ["text","()"], - ["paren.rparen","}"] -],[ - ["no_regex"], - ["string"," `"], - ["punctuation.operator","."], - ["identifier","trim"], - ["paren.lparen","("], - ["paren.rparen","))"], - ["punctuation.operator",";"] -],[ - ["no_regex"] -],[ - ["no_regex"], - ["text"," "], - ["keyword","waitfor"], - ["text"," "], - ["paren.lparen","{"] -],[ - ["no_regex"], - ["text"," "], - ["identifier","items"], - ["text"," "], - ["keyword.operator",".."], - ["text"," "], - ["identifier","each"], - ["punctuation.operator","."], - ["identifier","par"], - ["text"," "], - ["paren.lparen","{"], - ["text"," "], - ["paren.rparen","|"], - ["variable.parameter","item"], - ["paren.rparen","|"] -],[ - ["no_regex"], - ["text"," "], - ["keyword","get"], - ["paren.lparen","("], - ["identifier","item"], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - ["no_regex"], - ["text"," "], - ["paren.rparen","}"] -],[ - ["no_regex"], - ["text"," "], - ["paren.rparen","}"], - ["text"," "], - ["keyword","and"], - ["text"," "], - ["paren.lparen","{"] -],[ - ["no_regex"], - ["text"," "], - ["storage.type","var"], - ["text"," "], - ["identifier","lengths"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","items"], - ["text"," "], - ["keyword.operator",".."], - ["text"," "], - ["identifier","map"], - ["paren.lparen","("], - ["identifier","i"], - ["text"," "], - ["keyword.operator","->"], - ["text"," "], - ["identifier","i"], - ["punctuation.operator","."], - ["support.constant","length"], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - ["no_regex"], - ["text"," "], - ["paren.rparen","}"], - ["text"," "], - ["keyword","or"], - ["text"," "], - ["paren.lparen","{"] -],[ - ["no_regex"], - ["text"," "], - ["variable.language","hold"], - ["paren.lparen","("], - ["constant.numeric","1500"], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - ["no_regex"], - ["text"," "], - ["keyword","throw"], - ["text"," "], - ["keyword","new"], - ["text"," "], - ["variable.language","Error"], - ["paren.lparen","("], - ["string","\"timed out\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - ["no_regex"], - ["text"," "], - ["paren.rparen","}"] -],[ - ["no_regex"], - ["paren.rparen","}"], - ["text","\t"], - ["comment","// Real Tab."] -],[ - ["no_regex"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_smarty.json b/lib/ace/mode/_test/tokens_smarty.json deleted file mode 100644 index 0f56985d..00000000 --- a/lib/ace/mode/_test/tokens_smarty.json +++ /dev/null @@ -1,98 +0,0 @@ -[[ - "start", - ["punctuation.section.embedded.begin.smarty","{"], - ["keyword.control.smarty","foreach"], - ["source.smarty"," "], - ["punctuation.definition.variable.smarty","$"], - ["variable.other.smarty","foo"], - ["source.smarty"," as "], - ["punctuation.definition.variable.smarty","$"], - ["variable.other.smarty","bar"], - ["punctuation.section.embedded.end.smarty","}"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.anchor.tag-name.xml","a"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","href"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\""], - ["punctuation.section.embedded.begin.smarty","{"], - ["punctuation.definition.variable.smarty","$"], - ["variable.other.smarty","bar"], - ["source.smarty",".zig"], - ["punctuation.section.embedded.end.smarty","}"], - ["string.attribute-value.xml","\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["punctuation.section.embedded.begin.smarty","{"], - ["punctuation.definition.variable.smarty","$"], - ["variable.other.smarty","bar"], - ["source.smarty",".zag"], - ["punctuation.section.embedded.end.smarty","}"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.anchor.tag-name.xml","a"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","href"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\""], - ["punctuation.section.embedded.begin.smarty","{"], - ["punctuation.definition.variable.smarty","$"], - ["variable.other.smarty","bar"], - ["source.smarty",".zig2"], - ["punctuation.section.embedded.end.smarty","}"], - ["string.attribute-value.xml","\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["punctuation.section.embedded.begin.smarty","{"], - ["punctuation.definition.variable.smarty","$"], - ["variable.other.smarty","bar"], - ["source.smarty",".zag2"], - ["punctuation.section.embedded.end.smarty","}"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.anchor.tag-name.xml","a"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","href"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\""], - ["punctuation.section.embedded.begin.smarty","{"], - ["punctuation.definition.variable.smarty","$"], - ["variable.other.smarty","bar"], - ["source.smarty",".zig3"], - ["punctuation.section.embedded.end.smarty","}"], - ["string.attribute-value.xml","\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["punctuation.section.embedded.begin.smarty","{"], - ["punctuation.definition.variable.smarty","$"], - ["variable.other.smarty","bar"], - ["source.smarty",".zag3"], - ["punctuation.section.embedded.end.smarty","}"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["punctuation.section.embedded.begin.smarty","{"], - ["keyword.control.smarty","foreachelse"], - ["punctuation.section.embedded.end.smarty","}"] -],[ - "start", - ["text.xml"," There were no rows found."] -],[ - "start", - ["punctuation.section.embedded.begin.smarty","{"], - ["source.smarty","/"], - ["keyword.control.smarty","foreach"], - ["punctuation.section.embedded.end.smarty","}"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_snippets.json b/lib/ace/mode/_test/tokens_snippets.json deleted file mode 100644 index 308683b7..00000000 --- a/lib/ace/mode/_test/tokens_snippets.json +++ /dev/null @@ -1,159 +0,0 @@ -[[ - "start", - ["comment","# Function"] -],[ - "start", - ["constant.language.escape","snippet"], - ["text"," fun"] -],[ - "sn-start", - ["text","\tfunction "], - ["markup.list","${"], - ["constant.numeric","1"], - ["text","?:function_name"], - ["markup.list","}"], - ["text","("], - ["markup.list","${"], - ["constant.numeric","2"], - ["punctuation.operator",":"], - ["text","argument"], - ["markup.list","}"], - ["text",") {"] -],[ - "sn-start", - ["text","\t\t"], - ["markup.list","${"], - ["constant.numeric","3"], - ["punctuation.operator",":"], - ["text","// body..."], - ["markup.list","}"] -],[ - "sn-start", - ["text","\t}"] -],[ - "start", - ["comment","# Anonymous Function"] -],[ - "start", - ["constant.language.escape","regex "], - ["keyword","/"], - ["text","((=)\\s*|(:)\\s*|(\\()|\\b)"], - ["keyword","/"], - ["text","f"], - ["keyword","/"], - ["text","(\\))?"], - ["keyword","/"] -],[ - "start", - ["constant.language.escape","name"], - ["text"," f"] -],[ - "sn-start", - ["text","\tfunction"], - ["markup.list","${"], - ["variable","M1"], - ["text","?: "], - ["markup.list","${"], - ["constant.numeric","1"], - ["punctuation.operator",":"], - ["text","functionName"], - ["markup.list","}}"], - ["text","("], - ["variable","$2"], - ["text",") {"] -],[ - "sn-start", - ["text","\t\t"], - ["markup.list","${"], - ["constant.numeric","0"], - ["punctuation.operator",":"], - ["keyword","$TM_SELECTED_TEXT"], - ["markup.list","}"] -],[ - "sn-start", - ["text","\t}"], - ["markup.list","${"], - ["variable","M2"], - ["text","?;"], - ["markup.list","}${"], - ["variable","M3"], - ["text","?,"], - ["markup.list","}${"], - ["variable","M4"], - ["text","?)"], - ["markup.list","}"] -],[ - "start", - ["comment","# Immediate function"] -],[ - "start", - ["constant.language.escape","trigger"], - ["text"," \\(?f\\("] -],[ - "start", - ["constant.language.escape","endTrigger"], - ["text"," \\)?"] -],[ - "start", - ["constant.language.escape","snippet"], - ["text"," f("] -],[ - "sn-start", - ["text","\t(function("], - ["markup.list","${"], - ["constant.numeric","1"], - ["markup.list","}"], - ["text",") {"] -],[ - "sn-start", - ["text","\t\t"], - ["markup.list","${"], - ["constant.numeric","0"], - ["punctuation.operator",":"], - ["markup.list","${"], - ["keyword","TM_SELECTED_TEXT"], - ["punctuation.operator",":"], - ["text","/* code */"], - ["markup.list","}}"] -],[ - "sn-start", - ["text","\t}("], - ["markup.list","${"], - ["constant.numeric","1"], - ["markup.list","}"], - ["text","));"] -],[ - "start", - ["comment","# if"] -],[ - "start", - ["constant.language.escape","snippet"], - ["text"," if"] -],[ - "sn-start", - ["text","\tif ("], - ["markup.list","${"], - ["constant.numeric","1"], - ["punctuation.operator",":"], - ["text","true"], - ["markup.list","}"], - ["text",") {"] -],[ - "sn-start", - ["text","\t\t"], - ["markup.list","${"], - ["constant.numeric","0"], - ["markup.list","}"] -],[ - "sn-start", - ["text","\t}"] -],[ - "sn-start", - ["text","\t"] -],[ - "sn-start", - ["text","\t"] -],[ - "sn-start", - ["text","\t"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_soy_template.json b/lib/ace/mode/_test/tokens_soy_template.json deleted file mode 100644 index 9ae7c4ed..00000000 --- a/lib/ace/mode/_test/tokens_soy_template.json +++ /dev/null @@ -1,286 +0,0 @@ -[[ - "punctuation.definition.comment.begin.soy1", - ["punctuation.definition.comment.begin.soy","/**"] -],[ - "punctuation.definition.comment.begin.soy1", - ["comment.block.documentation.soy"," * Greets a person using \"Hello\" by default."] -],[ - "punctuation.definition.comment.begin.soy1", - ["comment.block.documentation.soy"," * "], - ["support.type.soy","@param"], - ["text"," "], - ["variable.parameter.soy","name"], - ["comment.block.documentation.soy"," The name of the person."] -],[ - "punctuation.definition.comment.begin.soy1", - ["comment.block.documentation.soy"," * "], - ["support.type.soy","@param?"], - ["text"," "], - ["variable.parameter.soy","greetingWord"], - ["comment.block.documentation.soy"," Optional greeting word to use instead of \"Hello\"."] -],[ - "start", - ["comment.block.documentation.soy"," "], - ["punctuation.definition.comment.end.soy","*/"] -],[ - "start", - ["punctuation.definition.tag.begin.soy","{"], - ["entity.name.tag.soy","template"], - ["text"," "], - ["entity.name.function.soy",".helloName"], - ["meta.tag.template.soy"," #eee"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start", - ["text.xml"," "], - ["punctuation.definition.tag.begin.soy","{"], - ["entity.name.tag.soy","if"], - ["meta.tag.if.soy"," "], - ["keyword.operator.soy","not"], - ["meta.tag.if.soy"," "], - ["variable.other.soy","$greetingWord"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start", - ["text.xml"," Hello "], - ["punctuation.definition.tag.begin.soy","{"], - ["variable.other.soy","$name"], - ["punctuation.definition.tag.end.soy","}"], - ["text.xml","!"] -],[ - "start", - ["text.xml"," "], - ["punctuation.definition.tag.begin.soy","{"], - ["text","else"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start", - ["text.xml"," "], - ["punctuation.definition.tag.begin.soy","{"], - ["variable.other.soy","$greetingWord"], - ["punctuation.definition.tag.end.soy","}"], - ["text.xml"," "], - ["punctuation.definition.tag.begin.soy","{"], - ["variable.other.soy","$name"], - ["punctuation.definition.tag.end.soy","}"], - ["text.xml","!"] -],[ - "start", - ["text.xml"," "], - ["punctuation.definition.tag.begin.soy","{/"], - ["entity.name.tag.soy","if"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start", - ["punctuation.definition.tag.begin.soy","{/"], - ["meta.tag.template.soy","template"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start" -],[ - "punctuation.definition.comment.begin.soy1", - ["punctuation.definition.comment.begin.soy","/**"] -],[ - "punctuation.definition.comment.begin.soy1", - ["comment.block.documentation.soy"," * Greets a person and optionally a list of other people."] -],[ - "punctuation.definition.comment.begin.soy1", - ["comment.block.documentation.soy"," * "], - ["support.type.soy","@param"], - ["text"," "], - ["variable.parameter.soy","name"], - ["comment.block.documentation.soy"," The name of the person."] -],[ - "punctuation.definition.comment.begin.soy1", - ["comment.block.documentation.soy"," * "], - ["support.type.soy","@param"], - ["text"," "], - ["variable.parameter.soy","additionalNames"], - ["comment.block.documentation.soy"," The additional names to greet. May be an empty list."] -],[ - "start", - ["comment.block.documentation.soy"," "], - ["punctuation.definition.comment.end.soy","*/"] -],[ - "start", - ["punctuation.definition.tag.begin.soy","{"], - ["entity.name.tag.soy","template"], - ["text"," "], - ["entity.name.function.soy",".helloNames"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start", - ["comment.line.double-slash.soy"," "], - ["punctuation.definition.comment.soy","//"], - ["comment.line.double-slash.soy"," Greet the person."] -],[ - "start", - ["text.xml"," "], - ["punctuation.definition.tag.begin.soy","{"], - ["entity.name.tag.soy","call"], - ["variable.parameter.soy"," .helloName"], - ["meta.tag.call.soy"," "], - ["entity.other.attribute-name.soy","data"], - ["keyword.operator.soy","="], - ["string.quoted.double","\"all\""], - ["meta.tag.call.soy"," /"], - ["punctuation.definition.tag.end.soy","}"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","br"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["comment.line.double-slash.soy"," "], - ["punctuation.definition.comment.soy","//"], - ["comment.line.double-slash.soy"," Greet the additional people."] -],[ - "start", - ["text.xml"," "], - ["punctuation.definition.tag.begin.soy","{"], - ["entity.name.tag.soy","foreach"], - ["meta.tag.foreach.soy"," "], - ["variable.other.soy","$additionalName"], - ["meta.tag.foreach.soy"," "], - ["keyword.operator.soy","in"], - ["meta.tag.foreach.soy"," "], - ["variable.other.soy","$additionalNames"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start", - ["text.xml"," "], - ["punctuation.definition.tag.begin.soy","{"], - ["entity.name.tag.soy","call"], - ["variable.parameter.soy"," .helloName"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start", - ["text.xml"," "], - ["punctuation.definition.tag.begin.soy","{"], - ["entity.name.tag.soy","param"], - ["meta.tag.param.soy"," "], - ["entity.other.attribute-name.soy","name"], - ["keyword.operator.soy",":"], - ["meta.tag.param.soy"," "], - ["variable.other.soy","$additionalName"], - ["meta.tag.param.soy"," /"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start", - ["text.xml"," "], - ["punctuation.definition.tag.begin.soy","{/"], - ["meta.tag.call.soy","call"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start", - ["text.xml"," "], - ["punctuation.definition.tag.begin.soy","{"], - ["entity.name.tag.soy","if"], - ["meta.tag.if.soy"," "], - ["keyword.operator.soy","not"], - ["meta.tag.if.soy"," "], - ["support.function.soy","isLast"], - ["meta.tag.if.soy","("], - ["variable.other.soy","$additionalName"], - ["meta.tag.if.soy",")"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","br"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["comment.line.double-slash.soy"," "], - ["punctuation.definition.comment.soy","//"], - ["comment.line.double-slash.soy"," break after every line except the last"] -],[ - "start", - ["text.xml"," "], - ["punctuation.definition.tag.begin.soy","{/"], - ["entity.name.tag.soy","if"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start", - ["text.xml"," "], - ["punctuation.definition.tag.begin.soy","{"], - ["text","ifempty"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start", - ["text.xml"," No additional people to greet."] -],[ - "start", - ["text.xml"," "], - ["punctuation.definition.tag.begin.soy","{/"], - ["entity.name.tag.soy","foreach"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start", - ["punctuation.definition.tag.begin.soy","{/"], - ["meta.tag.template.soy","template"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start" -],[ - "start" -],[ - "start", - ["punctuation.definition.tag.begin.soy","{/"], - ["entity.name.tag.soy","foreach"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start", - ["punctuation.definition.tag.begin.soy","{"], - ["entity.name.tag.soy","if"], - ["meta.tag.if.soy"," "], - ["support.function.soy","length"], - ["meta.tag.if.soy","("], - ["variable.other.soy","$items"], - ["meta.tag.if.soy",") > 5"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start", - ["punctuation.definition.tag.begin.soy","{"], - ["entity.name.tag.soy","msg"], - ["meta.tag.msg.soy"," "], - ["entity.other.attribute-name.soy","desc"], - ["keyword.operator.soy","="], - ["string.quoted.double","\"Says hello to the user.\""], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start" -],[ - "start" -],[ - "start", - ["punctuation.definition.tag.begin.soy","{"], - ["entity.name.tag.soy","namespace"], - ["text"," "], - ["variable.parameter.soy","ns"], - ["text"," autoescape=\"contextual\""], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start" -],[ - "start", - ["punctuation.definition.comment.begin.soy","/**"], - ["comment.block.documentation.soy"," Example. "], - ["punctuation.definition.comment.end.soy","*/"] -],[ - "start", - ["punctuation.definition.tag.begin.soy","{"], - ["entity.name.tag.soy","template"], - ["text"," "], - ["entity.name.function.soy",".example"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start", - ["text.xml"," foo is "], - ["punctuation.definition.tag.begin.soy","{"], - ["variable.other.soy","$ij.foo"], - ["punctuation.definition.tag.end.soy","}"] -],[ - "start", - ["punctuation.definition.tag.begin.soy","{/"], - ["meta.tag.template.soy","template"], - ["punctuation.definition.tag.end.soy","}"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_space.json b/lib/ace/mode/_test/tokens_space.json deleted file mode 100644 index 918b9a67..00000000 --- a/lib/ace/mode/_test/tokens_space.json +++ /dev/null @@ -1,322 +0,0 @@ -[[ - "start", - ["variable","query"] -],[ - "start", - ["empty_line"," "], - ["variable","count"], - ["keyword.operator"," "], - ["string","10"] -],[ - "start", - ["empty_line"," "], - ["variable","created"], - ["keyword.operator"," "], - ["string","2011-06-21T08:10:46Z"] -],[ - "start", - ["empty_line"," "], - ["variable","lang"], - ["keyword.operator"," "], - ["string","en-US"] -],[ - "start", - ["empty_line"," "], - ["variable","results"] -],[ - "start", - ["empty_line"," "], - ["variable","photo"] -],[ - "start", - ["empty_line"," "], - ["variable","0"] -],[ - "start", - ["empty_line"," "], - ["variable","farm"], - ["keyword.operator"," "], - ["string","6"] -],[ - "start", - ["empty_line"," "], - ["variable","id"], - ["keyword.operator"," "], - ["string","5855620975"] -],[ - "start", - ["empty_line"," "], - ["variable","isfamily"], - ["keyword.operator"," "], - ["string","0"] -],[ - "start", - ["empty_line"," "], - ["variable","isfriend"], - ["keyword.operator"," "], - ["string","0"] -],[ - "start", - ["empty_line"," "], - ["variable","ispublic"], - ["keyword.operator"," "], - ["string","1"] -],[ - "start", - ["empty_line"," "], - ["variable","owner"], - ["keyword.operator"," "], - ["string","32021554@N04"] -],[ - "start", - ["empty_line"," "], - ["variable","secret"], - ["keyword.operator"," "], - ["string","f1f5e8515d"] -],[ - "start", - ["empty_line"," "], - ["variable","server"], - ["keyword.operator"," "], - ["string","5110"] -],[ - "start", - ["empty_line"," "], - ["variable","title"], - ["keyword.operator"," "], - ["string","7087 bandit cat"] -],[ - "start", - ["empty_line"," "], - ["variable","1"] -],[ - "start", - ["empty_line"," "], - ["variable","farm"], - ["keyword.operator"," "], - ["string","4"] -],[ - "start", - ["empty_line"," "], - ["variable","id"], - ["keyword.operator"," "], - ["string","5856170534"] -],[ - "start", - ["empty_line"," "], - ["variable","isfamily"], - ["keyword.operator"," "], - ["string","0"] -],[ - "start", - ["empty_line"," "], - ["variable","isfriend"], - ["keyword.operator"," "], - ["string","0"] -],[ - "start", - ["empty_line"," "], - ["variable","ispublic"], - ["keyword.operator"," "], - ["string","1"] -],[ - "start", - ["empty_line"," "], - ["variable","owner"], - ["keyword.operator"," "], - ["string","32021554@N04"] -],[ - "start", - ["empty_line"," "], - ["variable","secret"], - ["keyword.operator"," "], - ["string","ff1efb2a6f"] -],[ - "start", - ["empty_line"," "], - ["variable","server"], - ["keyword.operator"," "], - ["string","3217"] -],[ - "start", - ["empty_line"," "], - ["variable","title"], - ["keyword.operator"," "], - ["string","6975 rusty cat"] -],[ - "start", - ["empty_line"," "], - ["variable","2"] -],[ - "start", - ["empty_line"," "], - ["variable","farm"], - ["keyword.operator"," "], - ["string","6"] -],[ - "start", - ["empty_line"," "], - ["variable","id"], - ["keyword.operator"," "], - ["string","5856172972"] -],[ - "start", - ["empty_line"," "], - ["variable","isfamily"], - ["keyword.operator"," "], - ["string","0"] -],[ - "start", - ["empty_line"," "], - ["variable","isfriend"], - ["keyword.operator"," "], - ["string","0"] -],[ - "start", - ["empty_line"," "], - ["variable","ispublic"], - ["keyword.operator"," "], - ["string","1"] -],[ - "start", - ["empty_line"," "], - ["variable","owner"], - ["keyword.operator"," "], - ["string","51249875@N03"] -],[ - "start", - ["empty_line"," "], - ["variable","secret"], - ["keyword.operator"," "], - ["string","6c6887347c"] -],[ - "start", - ["empty_line"," "], - ["variable","server"], - ["keyword.operator"," "], - ["string","5192"] -],[ - "start", - ["empty_line"," "], - ["variable","title"], - ["keyword.operator"," "], - ["string","watermarked-cats"] -],[ - "start", - ["empty_line"," "], - ["variable","3"] -],[ - "start", - ["empty_line"," "], - ["variable","farm"], - ["keyword.operator"," "], - ["string","6"] -],[ - "start", - ["empty_line"," "], - ["variable","id"], - ["keyword.operator"," "], - ["string","5856168328"] -],[ - "start", - ["empty_line"," "], - ["variable","isfamily"], - ["keyword.operator"," "], - ["string","0"] -],[ - "start", - ["empty_line"," "], - ["variable","isfriend"], - ["keyword.operator"," "], - ["string","0"] -],[ - "start", - ["empty_line"," "], - ["variable","ispublic"], - ["keyword.operator"," "], - ["string","1"] -],[ - "start", - ["empty_line"," "], - ["variable","owner"], - ["keyword.operator"," "], - ["string","32021554@N04"] -],[ - "start", - ["empty_line"," "], - ["variable","secret"], - ["keyword.operator"," "], - ["string","0c1cfdf64c"] -],[ - "start", - ["empty_line"," "], - ["variable","server"], - ["keyword.operator"," "], - ["string","5078"] -],[ - "start", - ["empty_line"," "], - ["variable","title"], - ["keyword.operator"," "], - ["string","7020 mandy cat"] -],[ - "start", - ["empty_line"," "], - ["variable","4"] -],[ - "start", - ["empty_line"," "], - ["variable","farm"], - ["keyword.operator"," "], - ["string","3"] -],[ - "start", - ["empty_line"," "], - ["variable","id"], - ["keyword.operator"," "], - ["string","5856171774"] -],[ - "start", - ["empty_line"," "], - ["variable","isfamily"], - ["keyword.operator"," "], - ["string","0"] -],[ - "start", - ["empty_line"," "], - ["variable","isfriend"], - ["keyword.operator"," "], - ["string","0"] -],[ - "start", - ["empty_line"," "], - ["variable","ispublic"], - ["keyword.operator"," "], - ["string","1"] -],[ - "start", - ["empty_line"," "], - ["variable","owner"], - ["keyword.operator"," "], - ["string","32021554@N04"] -],[ - "start", - ["empty_line"," "], - ["variable","secret"], - ["keyword.operator"," "], - ["string","7f5a3180ab"] -],[ - "start", - ["empty_line"," "], - ["variable","server"], - ["keyword.operator"," "], - ["string","2696"] -],[ - "start", - ["empty_line"," "], - ["variable","title"], - ["keyword.operator"," "], - ["string","7448 bobby cat"] -],[ - "key" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_sql.json b/lib/ace/mode/_test/tokens_sql.json deleted file mode 100644 index 09a3ef99..00000000 --- a/lib/ace/mode/_test/tokens_sql.json +++ /dev/null @@ -1,54 +0,0 @@ -[[ - "start", - ["keyword","SELECT"], - ["text"," "], - ["identifier","city"], - ["text",", "], - ["support.function","COUNT"], - ["paren.lparen","("], - ["identifier","id"], - ["paren.rparen",")"], - ["text"," "], - ["keyword","AS"], - ["text"," "], - ["identifier","users_count"] -],[ - "start", - ["keyword","FROM"], - ["text"," "], - ["identifier","users"] -],[ - "start", - ["keyword","WHERE"], - ["text"," "], - ["identifier","group_name"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string","'salesman'"] -],[ - "start", - ["keyword","AND"], - ["text"," "], - ["identifier","created"], - ["text"," "], - ["keyword.operator",">"], - ["text"," "], - ["string","'2011-05-21'"] -],[ - "start", - ["keyword","GROUP"], - ["text"," "], - ["keyword","BY"], - ["text"," "], - ["constant.numeric","1"] -],[ - "start", - ["keyword","ORDER"], - ["text"," "], - ["keyword","BY"], - ["text"," "], - ["constant.numeric","2"], - ["text"," "], - ["keyword","DESC"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_stylus.json b/lib/ace/mode/_test/tokens_stylus.json deleted file mode 100644 index f24993f7..00000000 --- a/lib/ace/mode/_test/tokens_stylus.json +++ /dev/null @@ -1,271 +0,0 @@ -[[ - "start", - ["comment","// I'm a comment!"] -],[ - "start" -],[ - "comment", - ["comment","/*"] -],[ - "comment", - ["comment"," * Adds the given numbers together."] -],[ - "start", - ["comment"," */"] -],[ - "start" -],[ - "start" -],[ - "comment", - ["comment","/*!"] -],[ - "comment", - ["comment"," * Adds the given numbers together."] -],[ - "start", - ["comment"," */"] -],[ - "start" -],[ - "start" -],[ - "start", - ["entity.name.function.stylus","asdasdasdad"], - ["text","("], - ["text","df, ad"], - ["keyword.operator.stylus","="], - ["constant.numeric","23"], - ["text",")"] -],[ - "start" -],[ - "start", - ["entity.name.function.stylus","add"], - ["text","("], - ["entity.name.tag.stylus","a"], - ["text",", "], - ["entity.name.tag.stylus","b"], - ["text"," "], - ["keyword.operator.stylus","="], - ["text"," "], - ["entity.name.tag.stylus","a"], - ["text",")"] -],[ - "start", - ["text"," "], - ["entity.name.tag.stylus","a"], - ["text"," "], - ["keyword.operator.stylus","+"], - ["text"," "], - ["entity.name.tag.stylus","b"] -],[ - "start", - ["entity.name.function.stylus","green"], - ["text","("], - ["constant.numeric","#0c0"], - ["text",")"] -],[ - "start", - ["text"," add("], - ["constant.numeric","10"], - ["text",", "], - ["constant.numeric","5"], - ["text",")"] -],[ - "start", - ["text"," "], - ["comment","// => 15"] -],[ - "start" -],[ - "start", - ["text"," add("], - ["constant.numeric","10"], - ["text",")"] -],[ - "start", - ["text"," add("], - ["entity.name.tag.stylus","a"], - ["text",", "], - ["entity.name.tag.stylus","b"], - ["text",")"] -],[ - "start" -],[ - "start", - ["entity.language.stylus"," &"], - ["text","asdasd"] -],[ - "start" -],[ - "start", - ["text"," ("], - ["variable.language.stylus","arguments"], - ["text",")"] -],[ - "start" -],[ - "start", - ["text"," "], - ["keyword.stylus","@sdfsdf"] -],[ - "start", - ["entity.other.attribute-name.class.stylus",".signatures"] -],[ - "start", - ["text"," "], - ["support.type","background-color"], - ["text"," "], - ["constant.numeric","#e0e8e0"] -],[ - "start", - ["text"," "], - ["support.type","border"], - ["text"," "], - ["constant.numeric","1"], - ["keyword","px"], - ["text"," "], - ["support.constant","solid"], - ["text"," grayLighter"] -],[ - "start", - ["text"," "], - ["support.type","box-shadow"], - ["text"," "], - ["constant.numeric","0"], - ["text"," "], - ["constant.numeric","0"], - ["text"," "], - ["constant.numeric","3"], - ["keyword","px"], - ["text"," grayLightest"] -],[ - "start", - ["text"," "], - ["support.type","border-radius"], - ["text"," "], - ["constant.numeric","3"], - ["keyword","px"] -],[ - "start", - ["text"," "], - ["support.type","padding"], - ["text"," "], - ["constant.numeric","3"], - ["keyword","px"], - ["text"," "], - ["constant.numeric","5"], - ["keyword","px"] -],[ - "start", - ["text"," "], - ["string","\"adsads\""] -],[ - "start", - ["text"," "], - ["support.type","margin-left"], - ["text"," "], - ["constant.numeric","0"] -],[ - "start", - ["text"," "], - ["support.type","list-style"], - ["text"," "], - ["support.constant","none"] -],[ - "start", - ["entity.other.attribute-name.class.stylus",".signature"] -],[ - "start", - ["text"," "], - ["support.type","list-style"], - ["text"," "], - ["support.constant","none"] -],[ - "start", - ["text"," "], - ["support.type","display"], - ["text",": "], - ["support.constant","inline"] -],[ - "start", - ["text"," "], - ["support.type","margin-left"], - ["text"," "], - ["constant.numeric","0"] -],[ - "start", - ["text"," "], - ["keyword.operator.stylus",">"], - ["text"," "], - ["entity.name.tag.stylus","li"] -],[ - "start", - ["text"," "], - ["support.type","display"], - ["text"," "], - ["support.constant","inline"] -],[ - "start", - ["keyword.operator.stylus","is"], - ["text"," "], - ["keyword.operator.stylus","not"] -],[ - "start", - ["entity.other.attribute-name.class.stylus",".signature-values"] -],[ - "start", - ["text"," "], - ["support.type","list-style"], - ["text"," "], - ["support.constant","none"] -],[ - "start", - ["text"," "], - ["support.type","display"], - ["text"," "], - ["support.constant","inline"] -],[ - "start", - ["text"," "], - ["support.type","margin-left"], - ["text"," "], - ["constant.numeric","0"] -],[ - "start", - ["entity.language.stylus"," &"], - ["punctuation",":"], - ["entity.other.attribute-name.pseudo-element.css","before"] -],[ - "start", - ["text"," "], - ["support.type","content"], - ["text"," "], - ["string","'→'"] -],[ - "start", - ["text"," "], - ["support.type","margin"], - ["text"," "], - ["constant.numeric","0"], - ["text"," "], - ["constant.numeric","5"], - ["keyword","px"] -],[ - "start", - ["text"," "], - ["keyword.operator.stylus",">"], - ["text"," "], - ["entity.name.tag.stylus","li"] -],[ - "start", - ["text"," "], - ["keyword.control.stylus","!important"] -],[ - "start" -],[ - "start", - ["text"," "], - ["keyword.control.stylus","unless"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_svg.json b/lib/ace/mode/_test/tokens_svg.json deleted file mode 100644 index 66ebae75..00000000 --- a/lib/ace/mode/_test/tokens_svg.json +++ /dev/null @@ -1,684 +0,0 @@ -[[ - "meta.tag.punctuation.tag-open.xml1", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","svg"] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","width"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"800\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","height"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"600\""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","xmlns"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"http://www.w3.org/2000/svg\""] -],[ - "start", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","onload"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"StartAnimation(evt)\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start" -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","title"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Test Tube Progress Bar"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","desc"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","Created for the Web Directions SVG competition"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "js-no_regex", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.script.tag-name.xml","script"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","type"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"text/ecmascript\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["string.cdata.xml",""], - ["text"," "], - ["identifier","max_time"], - ["paren.rparen",")"] -],[ - "js-start", - ["text"," "], - ["keyword","return"], - ["punctuation.operator",";"] -],[ - "js-start", - ["text"," "], - ["comment","// Scale the text string gradually until it is 20 times larger"] -],[ - "js-start", - ["text"," "], - ["identifier","scalefactor"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["paren.lparen","("], - ["identifier","timevalue"], - ["text"," "], - ["keyword.operator","*"], - ["text"," "], - ["constant.numeric","650"], - ["paren.rparen",")"], - ["text"," "], - ["keyword.operator","/"], - ["text"," "], - ["identifier","max_time"], - ["punctuation.operator",";"] -],[ - "js-start" -],[ - "js-start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["paren.lparen","("], - ["identifier","timevalue"], - ["text"," "], - ["keyword.operator","<"], - ["text"," "], - ["constant.numeric","30"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "js-start", - ["text"," "], - ["identifier","hickory"], - ["punctuation.operator","."], - ["support.function.dom","setAttribute"], - ["paren.lparen","("], - ["string","\"display\""], - ["punctuation.operator",","], - ["text"," "], - ["string","\"\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "js-start", - ["text"," "], - ["identifier","hickory"], - ["punctuation.operator","."], - ["support.function.dom","setAttribute"], - ["paren.lparen","("], - ["string","\"transform\""], - ["punctuation.operator",","], - ["text"," "], - ["string","\"translate(\""], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["paren.lparen","("], - ["constant.numeric","600"], - ["keyword.operator","+"], - ["identifier","scalefactor"], - ["keyword.operator","*"], - ["constant.numeric","3"], - ["keyword.operator","*"], - ["constant.numeric","-1"], - ["text"," "], - ["paren.rparen",")"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","\", -144 )\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "js-no_regex", - ["text"," "], - ["paren.rparen","}"] -],[ - "js-no_regex" -],[ - "js-start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["paren.lparen","("], - ["identifier","timevalue"], - ["text"," "], - ["keyword.operator",">"], - ["text"," "], - ["constant.numeric","30"], - ["text"," "], - ["keyword.operator","&&"], - ["text"," "], - ["identifier","timevalue"], - ["text"," "], - ["keyword.operator","<"], - ["text"," "], - ["constant.numeric","66"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "js-start", - ["text"," "], - ["identifier","dickory"], - ["punctuation.operator","."], - ["support.function.dom","setAttribute"], - ["paren.lparen","("], - ["string","\"display\""], - ["punctuation.operator",","], - ["text"," "], - ["string","\"\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "js-start", - ["text"," "], - ["identifier","dickory"], - ["punctuation.operator","."], - ["support.function.dom","setAttribute"], - ["paren.lparen","("], - ["string","\"transform\""], - ["punctuation.operator",","], - ["text"," "], - ["string","\"translate(\""], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["paren.lparen","("], - ["constant.numeric","-795"], - ["keyword.operator","+"], - ["identifier","scalefactor"], - ["keyword.operator","*"], - ["constant.numeric","2"], - ["paren.rparen",")"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","\", 0 )\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "js-no_regex", - ["text"," "], - ["paren.rparen","}"] -],[ - "js-start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["paren.lparen","("], - ["identifier","timevalue"], - ["text"," "], - ["keyword.operator",">"], - ["text"," "], - ["constant.numeric","66"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "js-start", - ["text"," "], - ["identifier","dock"], - ["punctuation.operator","."], - ["support.function.dom","setAttribute"], - ["paren.lparen","("], - ["string","\"display\""], - ["punctuation.operator",","], - ["text"," "], - ["string","\"\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "js-start", - ["text"," "], - ["identifier","dock"], - ["punctuation.operator","."], - ["support.function.dom","setAttribute"], - ["paren.lparen","("], - ["string","\"transform\""], - ["punctuation.operator",","], - ["text"," "], - ["string","\"translate(\""], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["paren.lparen","("], - ["constant.numeric","1450"], - ["keyword.operator","+"], - ["identifier","scalefactor"], - ["keyword.operator","*"], - ["constant.numeric","2"], - ["keyword.operator","*"], - ["constant.numeric","-1"], - ["paren.rparen",")"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","\", 144 )\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "js-no_regex", - ["text"," "], - ["paren.rparen","}"] -],[ - "js-no_regex" -],[ - "js-no_regex", - ["text"," "], - ["comment","// Call ShowAndGrowElement again milliseconds later."] -],[ - "js-no_regex", - ["text"," "], - ["identifier","setTimeout"], - ["paren.lparen","("], - ["string","\"ShowAndGrowElement()\""], - ["punctuation.operator",","], - ["text"," "], - ["identifier","timer_increment"], - ["paren.rparen",")"] -],[ - "js-no_regex", - ["text"," "], - ["paren.rparen","}"] -],[ - "js-no_regex", - ["text"," "], - ["variable.language","window"], - ["punctuation.operator","."], - ["identifier","ShowAndGrowElement"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","ShowAndGrowElement"] -],[ - "start", - ["text"," "], - ["string.cdata.xml","]]>"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","rect"] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","fill"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"#2e3436\""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","fill-rule"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"nonzero\""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","stroke-width"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"3\""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","y"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"0\""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","x"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"0\""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","height"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"600\""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","width"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"800\""] -],[ - "start", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","id"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"rect3590\""], - ["meta.tag.punctuation.tag-close.xml","/>"] -],[ - "start" -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","text"] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","style"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"font-size:144px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans Bold\""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","x"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"50\""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","y"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"350\""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","id"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"hickory\""] -],[ - "start", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","display"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"none\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," Hickory,"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","text"] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","style"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"font-size:144px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans Bold\""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","x"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"50\""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","y"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"350\""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","id"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"dickory\""] -],[ - "start", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","display"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"none\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," dickory,"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","text"] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","style"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"font-size:144px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans Bold\""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","x"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"50\""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","y"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"350\""] -],[ - "meta.tag.punctuation.tag-open.xml1", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","id"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"dock\""] -],[ - "start", - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","display"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"none\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," dock!"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_tcl.json b/lib/ace/mode/_test/tokens_tcl.json deleted file mode 100644 index 6a032ddc..00000000 --- a/lib/ace/mode/_test/tokens_tcl.json +++ /dev/null @@ -1,385 +0,0 @@ -[[ - "commandItem" -],[ - "commandItem", - ["keyword","proc"], - ["text"," "], - ["identifier","dijkstra"], - ["text"," "], - ["paren.lparen","{"], - ["keyword","graph"], - ["text"," "], - ["identifier","origin"], - ["paren.rparen","}"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["comment","# Initialize"] -],[ - "commandItem", - ["text"," "], - ["keyword","dict"], - ["text"," "], - ["identifier","for"], - ["text"," "], - ["paren.lparen","{"], - ["keyword","vertex"], - ["text"," "], - ["identifier","distmap"], - ["paren.rparen","}"], - ["text"," "], - ["variable.instance","$graph"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text","\t"], - ["keyword","dict"], - ["text"," "], - ["identifier","set"], - ["text"," "], - ["identifier","dist"], - ["text"," "], - ["variable.instance","$vertex"], - ["text"," "], - ["identifier","Inf"] -],[ - "commandItem", - ["text","\t"], - ["keyword","dict"], - ["text"," "], - ["identifier","set"], - ["text"," "], - ["identifier","path"], - ["text"," "], - ["variable.instance","$vertex"], - ["text"," "], - ["paren.lparen","{"], - ["paren.rparen","}"] -],[ - "commandItem", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["keyword","dict"], - ["text"," "], - ["identifier","set"], - ["text"," "], - ["identifier","dist"], - ["text"," "], - ["variable.instance","$origin"], - ["text"," 0"] -],[ - "start", - ["text"," "], - ["keyword","dict"], - ["text"," "], - ["identifier","set"], - ["text"," "], - ["identifier","path"], - ["text"," "], - ["variable.instance","$origin"], - ["text"," "], - ["paren.lparen","["], - ["keyword","list"], - ["text"," "], - ["variable.instance","$origin"], - ["paren.rparen","]"] -],[ - "commandItem", - ["text"," "] -],[ - "commandItem", - ["text"," "], - ["keyword","while"], - ["text"," "], - ["paren.lparen","{"], - ["text","["], - ["keyword","dict"], - ["text"," "], - ["identifier","size"], - ["text"," "], - ["variable.instance","$graph"], - ["paren.rparen","]}"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text","\t"], - ["comment","# Find unhandled node with least weight"] -],[ - "start", - ["text","\t"], - ["keyword","set"], - ["text"," "], - ["identifier","d"], - ["text"," "], - ["identifier","Inf"] -],[ - "commandItem", - ["text","\t"], - ["keyword","dict"], - ["text"," "], - ["identifier","for"], - ["text"," "], - ["paren.lparen","{"], - ["keyword","uu"], - ["text"," "], - ["support.function","-"], - ["paren.rparen","}"], - ["text"," "], - ["variable.instance","$graph"], - ["text"," "], - ["paren.lparen","{"] -],[ - "commandItem", - ["text","\t "], - ["keyword","if"], - ["text"," "], - ["paren.lparen","{"], - ["variable.instance","$d"], - ["text"," "], - ["support.function",">"], - ["text"," "], - ["paren.lparen","["], - ["keyword","set"], - ["text"," "], - ["identifier","dd"], - ["text"," "], - ["paren.lparen","["], - ["keyword","dict"], - ["text"," "], - ["identifier","get"], - ["text"," "], - ["variable.instance","$dist"], - ["text"," "], - ["variable.instance","$uu"], - ["paren.rparen","]]}"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text","\t\t"], - ["keyword","set"], - ["text"," "], - ["identifier","u"], - ["text"," "], - ["variable.instance","$uu"] -],[ - "start", - ["text","\t\t"], - ["keyword","set"], - ["text"," "], - ["identifier","d"], - ["text"," "], - ["variable.instance","$dd"] -],[ - "commandItem", - ["text","\t "], - ["paren.rparen","}"] -],[ - "commandItem", - ["text","\t"], - ["paren.rparen","}"] -],[ - "commandItem", - ["text"," "] -],[ - "start", - ["text","\t"], - ["comment","# No such node; graph must be disconnected"] -],[ - "start", - ["text","\t"], - ["keyword","if"], - ["text"," "], - ["paren.lparen","{"], - ["variable.instance","$d"], - ["text"," "], - ["support.function","=="], - ["text"," "], - ["identifier","Inf"], - ["paren.rparen","}"], - ["text"," "], - ["identifier","break"] -],[ - "commandItem", - ["text"," "] -],[ - "commentfollow", - ["text","\t"], - ["comment","# Update the weights for nodes\\"] -],[ - "start", - ["comment","\t lead to by the node we've picked"] -],[ - "commandItem", - ["text","\t"], - ["keyword","dict"], - ["text"," "], - ["identifier","for"], - ["text"," "], - ["paren.lparen","{"], - ["keyword","v"], - ["text"," "], - ["identifier","dd"], - ["paren.rparen","}"], - ["text"," "], - ["paren.lparen","["], - ["keyword","dict"], - ["text"," "], - ["identifier","get"], - ["text"," "], - ["variable.instance","$graph"], - ["text"," "], - ["variable.instance","$u"], - ["paren.rparen","]"], - ["text"," "], - ["paren.lparen","{"] -],[ - "commandItem", - ["text","\t "], - ["keyword","if"], - ["text"," "], - ["paren.lparen","{"], - ["text","["], - ["keyword","dict"], - ["text"," "], - ["identifier","exists"], - ["text"," "], - ["variable.instance","$graph"], - ["text"," "], - ["variable.instance","$v"], - ["paren.rparen","]}"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text","\t\t"], - ["keyword","set"], - ["text"," "], - ["identifier","alt"], - ["text"," "], - ["paren.lparen","["], - ["keyword","expr"], - ["text"," "], - ["paren.lparen","{"], - ["variable.instance","$d"], - ["text"," "], - ["support.function","+"], - ["text"," "], - ["variable.instance","$dd"], - ["paren.rparen","}]"] -],[ - "commandItem", - ["text","\t\t"], - ["keyword","if"], - ["text"," "], - ["paren.lparen","{"], - ["variable.instance","$alt"], - ["text"," "], - ["support.function","<"], - ["text"," "], - ["paren.lparen","["], - ["keyword","dict"], - ["text"," "], - ["identifier","get"], - ["text"," "], - ["variable.instance","$dist"], - ["text"," "], - ["variable.instance","$v"], - ["paren.rparen","]}"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text","\t\t "], - ["keyword","dict"], - ["text"," "], - ["identifier","set"], - ["text"," "], - ["identifier","dist"], - ["text"," "], - ["variable.instance","$v"], - ["text"," "], - ["variable.instance","$alt"] -],[ - "start", - ["text","\t\t "], - ["keyword","dict"], - ["text"," "], - ["identifier","set"], - ["text"," "], - ["identifier","path"], - ["text"," "], - ["variable.instance","$v"], - ["text"," "], - ["paren.lparen","["], - ["keyword","list"], - ["text"," "], - ["support.function","{*}"], - ["paren.lparen","["], - ["keyword","dict"], - ["text"," "], - ["identifier","get"], - ["text"," "], - ["variable.instance","$path"], - ["text"," "], - ["variable.instance","$u"], - ["paren.rparen","]"], - ["text"," "], - ["variable.instance","$v"], - ["paren.rparen","]"] -],[ - "commandItem", - ["text","\t\t"], - ["paren.rparen","}"] -],[ - "commandItem", - ["text","\t "], - ["paren.rparen","}"] -],[ - "commandItem", - ["text","\t"], - ["paren.rparen","}"] -],[ - "commandItem", - ["text"," "] -],[ - "start", - ["text","\t"], - ["comment","# Remove chosen node from graph still to be handled"] -],[ - "start", - ["text","\t"], - ["keyword","dict"], - ["text"," "], - ["identifier","unset"], - ["text"," "], - ["identifier","graph"], - ["text"," "], - ["variable.instance","$u"] -],[ - "commandItem", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["keyword","return"], - ["text"," "], - ["paren.lparen","["], - ["keyword","list"], - ["text"," "], - ["variable.instance","$dist"], - ["text"," "], - ["variable.instance","$path"], - ["paren.rparen","]"] -],[ - "commandItem", - ["paren.rparen","}"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_tex.json b/lib/ace/mode/_test/tokens_tex.json deleted file mode 100644 index 2d023676..00000000 --- a/lib/ace/mode/_test/tokens_tex.json +++ /dev/null @@ -1,130 +0,0 @@ -[[ - "start", - ["text","The quadratic formula is $$-b "], - ["keyword","\\pm"], - ["text"," "], - ["keyword","\\sqrt"], - ["paren.keyword.operator","{"], - ["text","b^2 - 4ac"], - ["paren.keyword.operator","}"], - ["text"," "], - ["keyword","\\over"], - ["text"," 2a$$"] -],[ - "start", - ["keyword","\\bye"] -],[ - "start" -],[ - "start", - ["keyword","\\makeatletter"] -],[ - "start", - ["text"," "], - ["keyword","\\newcommand"], - ["paren.keyword.operator","{"], - ["keyword","\\be"], - ["paren.keyword.operator","}{"], - ["comment","%"] -],[ - "start", - ["text"," "], - ["keyword","\\begingroup"] -],[ - "start", - ["text"," "], - ["comment","% \\setlength{\\arraycolsep}{2pt}"] -],[ - "start", - ["text"," "], - ["keyword","\\eqnarray"], - ["comment","%"] -],[ - "start", - ["text"," "], - ["keyword","\\@"], - ["text","ifstar"], - ["paren.keyword.operator","{"], - ["keyword","\\nonumber"], - ["paren.keyword.operator","}{}"], - ["comment","%"] -],[ - "start", - ["text"," "], - ["paren.keyword.operator","}"] -],[ - "start", - ["text"," "], - ["keyword","\\newcommand"], - ["paren.keyword.operator","{"], - ["keyword","\\ee"], - ["paren.keyword.operator","}{"], - ["keyword","\\endeqnarray\\endgroup"], - ["paren.keyword.operator","}"] -],[ - "start", - ["text"," "], - ["keyword","\\makeatother"] -],[ - "start" -],[ - "start", - ["text"," "], - ["keyword","\\begin"], - ["paren.keyword.operator","{"], - ["nospell.text","equation"], - ["paren.keyword.operator","}"] -],[ - "start", - ["text"," x="], - ["keyword","\\left\\"], - ["paren.keyword.operator","{"], - ["text"," "], - ["keyword","\\begin"], - ["paren.keyword.operator","{"], - ["nospell.text","array"], - ["paren.keyword.operator","}{"], - ["text","cl"], - ["paren.keyword.operator","}"] -],[ - "start", - ["text"," 0 & "], - ["keyword","\\textrm"], - ["paren.keyword.operator","{"], - ["text","if "], - ["paren.keyword.operator","}"], - ["text","A="], - ["keyword","\\ldots\\\\"] -],[ - "start", - ["text"," 1 & "], - ["keyword","\\textrm"], - ["paren.keyword.operator","{"], - ["text","if "], - ["paren.keyword.operator","}"], - ["text","B="], - ["keyword","\\ldots\\\\"] -],[ - "start", - ["text"," x & "], - ["keyword","\\textrm"], - ["paren.keyword.operator","{"], - ["text","this runs with as much text as you like, but without an raggeright text"] -],[ - "start", - ["text","."], - ["paren.keyword.operator","}"], - ["keyword","\\end"], - ["paren.keyword.operator","{"], - ["nospell.text","array"], - ["paren.keyword.operator","}"], - ["keyword","\\right"], - ["text","."] -],[ - "start", - ["text"," "], - ["keyword","\\end"], - ["paren.keyword.operator","{"], - ["nospell.text","equation"], - ["paren.keyword.operator","}"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_text.json b/lib/ace/mode/_test/tokens_text.json deleted file mode 100644 index fff7ef42..00000000 --- a/lib/ace/mode/_test/tokens_text.json +++ /dev/null @@ -1,29 +0,0 @@ -[[ - "start", - ["text","Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."] -],[ - "start" -],[ - "start", - ["text","Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat."] -],[ - "start" -],[ - "start", - ["text","Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi."] -],[ - "start" -],[ - "start", - ["text","Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat."] -],[ - "start" -],[ - "start", - ["text","Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis."] -],[ - "start" -],[ - "start", - ["text","At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, At accusam aliquyam diam diam dolore dolores duo eirmod eos erat, et nonumy sed tempor et et invidunt justo labore Stet clita ea et gubergren, kasd magna no rebum. sanctus sea sed takimata ut vero voluptua. est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_textile.json b/lib/ace/mode/_test/tokens_textile.json deleted file mode 100644 index 59000ce3..00000000 --- a/lib/ace/mode/_test/tokens_textile.json +++ /dev/null @@ -1,113 +0,0 @@ -[[ - "start", - ["markup.heading.1","h1"], - ["keyword",". "], - ["text","Textile document"] -],[ - "start" -],[ - "start", - ["markup.heading.2","h2"], - ["keyword",". "], - ["text","Heading Two"] -],[ - "start" -],[ - "start", - ["markup.heading.3","h3"], - ["keyword",". "], - ["text","A two-line"] -],[ - "start", - ["text"," header"] -],[ - "start" -],[ - "start", - ["markup.heading.2","h2"], - ["keyword",". "], - ["text","Another two-line"] -],[ - "start", - ["text","header"] -],[ - "start" -],[ - "start", - ["text","Paragraph:"] -],[ - "start", - ["text","one, two,"] -],[ - "start", - ["text","thee lines!"] -],[ - "start" -],[ - "start", - ["markup.heading","p"], - ["keyword","("], - ["string","classone"], - ["text"," "], - ["string","two"], - ["text"," "], - ["string","three"], - ["keyword","). "], - ["text","This is a paragraph with classes"] -],[ - "start" -],[ - "start", - ["markup.heading","p"], - ["keyword","(#"], - ["string","id"], - ["keyword","). "], - ["text","(one with an id)"] -],[ - "start" -],[ - "start", - ["markup.heading","p"], - ["keyword","("], - ["string","one"], - ["text"," "], - ["string","two"], - ["text"," "], - ["string","three"], - ["keyword","#"], - ["string","my_id"], - ["keyword","). "], - ["text","..classes + id"] -],[ - "start" -],[ - "start", - ["keyword","*"], - ["text"," Unordered list"] -],[ - "start", - ["keyword","**"], - ["text"," sublist"] -],[ - "start", - ["keyword","*"], - ["text"," back again!"] -],[ - "start", - ["keyword","**"], - ["text"," sublist again.."] -],[ - "start" -],[ - "start", - ["keyword","#"], - ["text"," ordered"] -],[ - "start" -],[ - "start", - ["text","bg. Blockquote!"] -],[ - "start", - ["text"," This is a two-list blockquote..!"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_toml.json b/lib/ace/mode/_test/tokens_toml.json deleted file mode 100644 index ec471f74..00000000 --- a/lib/ace/mode/_test/tokens_toml.json +++ /dev/null @@ -1,131 +0,0 @@ -[[ - "start", - ["comment.toml","# This is a TOML document. Boom."] -],[ - "start" -],[ - "start", - ["identifier","title"], - ["text"," = "], - ["string","\"TOML Example\""] -],[ - "start" -],[ - "start", - ["variable.keygroup.toml","[owner]"] -],[ - "start", - ["identifier","name"], - ["text"," = "], - ["string","\"Tom Preston-Werner\""] -],[ - "start", - ["identifier","organization"], - ["text"," = "], - ["string","\"GitHub\""] -],[ - "start", - ["identifier","bio"], - ["text"," = "], - ["string","\"GitHub Cofounder & CEO"], - ["constant.language.escape","\\n"], - ["string","Likes tater tots and beer.\""] -],[ - "start", - ["identifier","dob"], - ["text"," = "], - ["support.date.toml","1979-05-27T07:32:00Z"], - ["text"," "], - ["comment.toml","# First class dates? Why not?"] -],[ - "start" -],[ - "start", - ["variable.keygroup.toml","[database]"] -],[ - "start", - ["identifier","server"], - ["text"," = "], - ["string","\"192.168.1.1\""] -],[ - "start", - ["identifier","ports"], - ["text"," = [ "], - ["constant.numeric.toml","8001"], - ["text",", "], - ["constant.numeric.toml","8001"], - ["text",", "], - ["constant.numeric.toml","8002"], - ["text"," ]"] -],[ - "start", - ["identifier","connection_max"], - ["text"," = "], - ["constant.numeric.toml","5000"] -],[ - "start", - ["identifier","enabled"], - ["text"," = "], - ["constant.language.boolean","true"] -],[ - "start" -],[ - "start", - ["variable.keygroup.toml","[servers]"] -],[ - "start" -],[ - "start", - ["text"," "], - ["comment.toml","# You can indent as you please. Tabs or spaces. TOML don't care."] -],[ - "start", - ["variable.keygroup.toml"," [servers.alpha]"] -],[ - "start", - ["text"," "], - ["identifier","ip"], - ["text"," = "], - ["string","\"10.0.0.1\""] -],[ - "start", - ["text"," "], - ["identifier","dc"], - ["text"," = "], - ["string","\"eqdc10\""] -],[ - "start" -],[ - "start", - ["variable.keygroup.toml"," [servers.beta]"] -],[ - "start", - ["text"," "], - ["identifier","ip"], - ["text"," = "], - ["string","\"10.0.0.2\""] -],[ - "start", - ["text"," "], - ["identifier","dc"], - ["text"," = "], - ["string","\"eqdc10\""] -],[ - "start" -],[ - "start", - ["variable.keygroup.toml","[clients]"] -],[ - "start", - ["identifier","data"], - ["text"," = [ ["], - ["string","\"gamma\""], - ["text",", "], - ["string","\"delta\""], - ["text","], ["], - ["constant.numeric.toml","1"], - ["text",", "], - ["constant.numeric.toml","2"], - ["text","] ] "], - ["comment.toml","# just an update to make sure parsers support it"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_twig.json b/lib/ace/mode/_test/tokens_twig.json deleted file mode 100644 index ada8b4a7..00000000 --- a/lib/ace/mode/_test/tokens_twig.json +++ /dev/null @@ -1,288 +0,0 @@ -[[ - "start", - ["xml-pe.doctype.xml",""] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","html"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","head"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","title"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","My Webpage"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","body"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","ul"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","id"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"navigation\""], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.twig","{%"], - ["text"," "], - ["keyword.control.twig","for"], - ["text"," "], - ["identifier","item"], - ["text"," "], - ["keyword.operator.twig","in"], - ["text"," "], - ["identifier","navigation"], - ["text"," "], - ["meta.tag.twig","%}"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","li"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.anchor.tag-name.xml","a"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","href"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\""], - ["variable.other.readwrite.local.twig","{{"], - ["text"," "], - ["identifier","item"], - ["punctuation.operator","."], - ["identifier","href"], - ["keyword.operator.other","|"], - ["support.function.twig","escape"], - ["text"," "], - ["variable.other.readwrite.local.twig","}}"], - ["string.attribute-value.xml","\""], - ["meta.tag.punctuation.tag-close.xml",">"], - ["variable.other.readwrite.local.twig","{{"], - ["text"," "], - ["identifier","item"], - ["punctuation.operator","."], - ["identifier","caption"], - ["text"," "], - ["variable.other.readwrite.local.twig","}}"], - ["meta.tag.punctuation.end-tag-open.xml",""], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["meta.tag.twig","{%"], - ["text"," "], - ["keyword.control.twig","endfor"], - ["text"," "], - ["meta.tag.twig","%}"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "start", - ["text.xml"," "], - ["meta.tag.twig","{%"], - ["text"," "], - ["keyword.control.twig","if"], - ["text"," "], - ["constant.numeric","1"], - ["text"," "], - ["keyword.operator.twig","not"], - ["text"," "], - ["keyword.operator.twig","in"], - ["text"," "], - ["paren.lparen","["], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["text"," "], - ["constant.numeric","2"], - ["punctuation.operator",","], - ["text"," "], - ["constant.numeric","3"], - ["paren.rparen","]"], - ["text"," "], - ["meta.tag.twig","%}"] -],[ - "start" -],[ - "start", - ["text.xml"," "], - ["comment.block.twig","{# is equivalent to #}"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.twig","{%"], - ["text"," "], - ["keyword.control.twig","if"], - ["text"," "], - ["keyword.operator.twig","not"], - ["text"," "], - ["paren.lparen","("], - ["constant.numeric","1"], - ["text"," "], - ["keyword.operator.twig","in"], - ["text"," "], - ["paren.lparen","["], - ["constant.numeric","1"], - ["punctuation.operator",","], - ["text"," "], - ["constant.numeric","2"], - ["punctuation.operator",","], - ["text"," "], - ["constant.numeric","3"], - ["paren.rparen","])"], - ["text"," "], - ["meta.tag.twig","%}"] -],[ - "start" -],[ - "start", - ["text.xml"," "], - ["meta.tag.twig","{%"], - ["text"," "], - ["keyword.control.twig","autoescape"], - ["text"," "], - ["constant.language.boolean","true"], - ["text"," "], - ["meta.tag.twig","%}"] -],[ - "start", - ["text.xml"," "], - ["variable.other.readwrite.local.twig","{{"], - ["text"," "], - ["identifier","var"], - ["text"," "], - ["variable.other.readwrite.local.twig","}}"] -],[ - "start", - ["text.xml"," "], - ["variable.other.readwrite.local.twig","{{"], - ["text"," "], - ["identifier","var"], - ["keyword.operator.other","|"], - ["support.function.twig","raw"], - ["text"," "], - ["variable.other.readwrite.local.twig","}}"], - ["text.xml"," "], - ["comment.block.twig","{# var won't be escaped #}"] -],[ - "start", - ["text.xml"," "], - ["variable.other.readwrite.local.twig","{{"], - ["text"," "], - ["identifier","var"], - ["keyword.operator.other","|"], - ["support.function.twig","escape"], - ["text"," "], - ["variable.other.readwrite.local.twig","}}"], - ["text.xml"," "], - ["comment.block.twig","{# var won't be doubled-escaped #}"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.twig","{%"], - ["text"," "], - ["keyword.control.twig","endautoescape"], - ["text"," "], - ["meta.tag.twig","%}"] -],[ - "start" -],[ - "start", - ["text.xml"," "], - ["variable.other.readwrite.local.twig","{{"], - ["text"," "], - ["keyword.control.twig","include"], - ["paren.lparen","("], - ["string","'twig.html'"], - ["punctuation.operator",","], - ["text"," "], - ["identifier","sandboxed"], - ["text"," "], - ["keyword.operator.assignment","="], - ["text"," "], - ["constant.language.boolean","true"], - ["paren.rparen",")"], - ["text"," "], - ["variable.other.readwrite.local.twig","}}"] -],[ - "start" -],[ - "start", - ["text.xml"," "], - ["variable.other.readwrite.local.twig","{{"], - ["string","\"string "], - ["constant.language.escape","#{with}"], - ["string"," "], - ["constant.language.escape","\\\""], - ["string"," escapes\""], - ["text"," "], - ["string","'another#one'"], - ["text"," "], - ["variable.other.readwrite.local.twig","}}"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","h1"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","My Webpage"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml"," "], - ["variable.other.readwrite.local.twig","{{"], - ["text"," "], - ["identifier","a_variable"], - ["text"," "], - ["variable.other.readwrite.local.twig","}}"] -],[ - "start", - ["text.xml"," "], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_typescript.json b/lib/ace/mode/_test/tokens_typescript.json deleted file mode 100644 index 18f2eea6..00000000 --- a/lib/ace/mode/_test/tokens_typescript.json +++ /dev/null @@ -1,559 +0,0 @@ -[[ - "start", - ["keyword.operator.ts","class"], - ["text"," "], - ["identifier","Greeter"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text","\t"], - ["variable.parameter.function.ts","greeting"], - ["text",": "], - ["variable.parameter.function.ts","string"], - ["punctuation.operator",";"] -],[ - "start", - ["text","\t"], - ["keyword.operator.ts","constructor"], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter.function.ts","message"], - ["text",": "], - ["variable.parameter.function.ts","string"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text","\t\t"], - ["storage.type.variable.ts","this."], - ["identifier","greeting"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","message"], - ["punctuation.operator",";"] -],[ - "no_regex", - ["text","\t"], - ["paren.rparen","}"] -],[ - "start", - ["text","\t"], - ["identifier","greet"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text","\t\t"], - ["keyword","return"], - ["text"," "], - ["string","\"Hello, \""], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["storage.type.variable.ts","this."], - ["identifier","greeting"], - ["punctuation.operator",";"] -],[ - "no_regex", - ["text","\t"], - ["paren.rparen","}"] -],[ - "no_regex", - ["paren.rparen","}"], - ["text"," "] -],[ - "no_regex" -],[ - "start", - ["storage.type","var"], - ["text"," "], - ["identifier","greeter"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["keyword","new"], - ["text"," "], - ["identifier","Greeter"], - ["paren.lparen","("], - ["string","\"world\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start" -],[ - "no_regex", - ["storage.type","var"], - ["text"," "], - ["identifier","button"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["variable.language","document"], - ["punctuation.operator","."], - ["support.function.dom","createElement"], - ["paren.lparen","("], - ["string","'button'"], - ["paren.rparen",")"] -],[ - "no_regex", - ["identifier","button"], - ["punctuation.operator","."], - ["identifier","innerText"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string","\"Say Hello\""] -],[ - "start", - ["storage.type","button"], - ["punctuation.operator","."], - ["entity.name.function","onclick"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["storage.type","function"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "no_regex", - ["text","\t"], - ["support.function","alert"], - ["paren.lparen","("], - ["entity.name.function.ts","greeter.greet"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["paren.rparen",")"] -],[ - "no_regex", - ["paren.rparen","}"] -],[ - "no_regex" -],[ - "no_regex", - ["variable.language","document"], - ["punctuation.operator","."], - ["identifier","body"], - ["punctuation.operator","."], - ["support.function.dom","appendChild"], - ["paren.lparen","("], - ["identifier","button"], - ["paren.rparen",")"] -],[ - "no_regex" -],[ - "start", - ["keyword","class"], - ["text"," "], - ["identifier","Snake"], - ["text"," "], - ["keyword","extends"], - ["text"," "], - ["identifier","Animal"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["entity.name.function.ts","move"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["support.function","alert"], - ["paren.lparen","("], - ["string","\"Slithering...\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["storage.type.variable.ts","super"], - ["text","("], - ["keyword.other.ts","5"], - ["text",")"], - ["punctuation.operator",";"] -],[ - "no_regex", - ["text"," "], - ["paren.rparen","}"] -],[ - "no_regex", - ["paren.rparen","}"] -],[ - "no_regex" -],[ - "start", - ["keyword","class"], - ["text"," "], - ["identifier","Horse"], - ["text"," "], - ["keyword","extends"], - ["text"," "], - ["identifier","Animal"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["entity.name.function.ts","move"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["support.function","alert"], - ["paren.lparen","("], - ["string","\"Galloping...\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword.operator.ts","super"], - ["punctuation.operator","."], - ["identifier","move"], - ["paren.lparen","("], - ["constant.numeric","45"], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "no_regex", - ["text"," "], - ["paren.rparen","}"] -],[ - "no_regex", - ["paren.rparen","}"] -],[ - "no_regex" -],[ - "start", - ["identifier","module"], - ["text"," "], - ["identifier","Sayings"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword.operator.ts","export"], - ["text"," "], - ["keyword.operator.ts","class"], - ["text"," "], - ["identifier","Greeter"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["variable.parameter.function.ts","greeting"], - ["text",": "], - ["variable.parameter.function.ts","string"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword.operator.ts","constructor"], - ["text"," "], - ["paren.lparen","("], - ["variable.parameter.function.ts","message"], - ["text",": "], - ["variable.parameter.function.ts","string"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["storage.type.variable.ts","this."], - ["identifier","greeting"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","message"], - ["punctuation.operator",";"] -],[ - "no_regex", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["identifier","greet"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword","return"], - ["text"," "], - ["string","\"Hello, \""], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["storage.type.variable.ts","this."], - ["identifier","greeting"], - ["punctuation.operator",";"] -],[ - "no_regex", - ["text"," "], - ["paren.rparen","}"] -],[ - "no_regex", - ["text"," "], - ["paren.rparen","}"] -],[ - "no_regex", - ["paren.rparen","}"] -],[ - "start", - ["identifier","module"], - ["text"," "], - ["identifier","Mankala"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword.operator.ts","export"], - ["text"," "], - ["keyword.operator.ts","class"], - ["text"," "], - ["identifier","Features"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["keyword.operator.ts","public"], - ["text"," "], - ["identifier","turnContinues"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.language.boolean","false"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword.operator.ts","public"], - ["text"," "], - ["identifier","seedStoredCount"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","0"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword.operator.ts","public"], - ["text"," "], - ["identifier","capturedCount"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","0"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword.operator.ts","public"], - ["text"," "], - ["identifier","spaceCaptured"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","NoSpace"], - ["punctuation.operator",";"] -],[ - "start" -],[ - "start", - ["text"," "], - ["keyword.operator.ts","public"], - ["text"," "], - ["entity.name.function.ts","clear"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["storage.type.variable.ts","this."], - ["identifier","turnContinues"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.language.boolean","false"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["storage.type.variable.ts","this."], - ["identifier","seedStoredCount"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","0"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["storage.type.variable.ts","this."], - ["identifier","capturedCount"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["constant.numeric","0"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["storage.type.variable.ts","this."], - ["identifier","spaceCaptured"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","NoSpace"], - ["punctuation.operator",";"] -],[ - "no_regex", - ["text"," "], - ["paren.rparen","}"] -],[ - "no_regex" -],[ - "start", - ["text"," "], - ["keyword","public"], - ["text"," "], - ["identifier","toString"], - ["paren.lparen","("], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["storage.type","var"], - ["text"," "], - ["identifier","stringBuilder"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string","\"\""], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["paren.lparen","("], - ["storage.type.variable.ts","this."], - ["identifier","turnContinues"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["identifier","stringBuilder"], - ["text"," "], - ["keyword.operator","+="], - ["text"," "], - ["string","\" turn continues,\""], - ["punctuation.operator",";"] -],[ - "no_regex", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["identifier","stringBuilder"], - ["text"," "], - ["keyword.operator","+="], - ["text"," "], - ["string","\" stores \""], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["storage.type.variable.ts","this."], - ["identifier","seedStoredCount"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["paren.lparen","("], - ["storage.type.variable.ts","this."], - ["identifier","capturedCount"], - ["text"," "], - ["keyword.operator",">"], - ["text"," "], - ["constant.numeric","0"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "start", - ["text"," "], - ["identifier","stringBuilder"], - ["text"," "], - ["keyword.operator","+="], - ["text"," "], - ["string","\" captures \""], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["storage.type.variable.ts","this."], - ["identifier","capturedCount"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","\" from space \""], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["storage.type.variable.ts","this."], - ["identifier","spaceCaptured"], - ["punctuation.operator",";"] -],[ - "no_regex", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["text"," "], - ["keyword","return"], - ["text"," "], - ["identifier","stringBuilder"], - ["punctuation.operator",";"] -],[ - "no_regex", - ["text"," "], - ["paren.rparen","}"] -],[ - "no_regex", - ["text"," "], - ["paren.rparen","}"] -],[ - "no_regex", - ["paren.rparen","}"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_vala.json b/lib/ace/mode/_test/tokens_vala.json deleted file mode 100644 index efe6e7c8..00000000 --- a/lib/ace/mode/_test/tokens_vala.json +++ /dev/null @@ -1,158 +0,0 @@ -[[ - "start", - ["meta.using.vala",""], - ["keyword.other.using.vala","using"], - ["meta.using.vala"," "], - ["storage.modifier.using.vala","Gtk"], - ["punctuation.terminator.vala",";"] -],[ - "start", - ["text"," "] -],[ - "text0", - ["storage.type.primitive.array.vala","int"], - ["text"," main ("], - ["storage.type.primitive.array.vala","string"], - ["text","[] args) {"] -],[ - "text0", - ["text"," "], - ["storage.type.vala","Gtk"], - ["keyword.operator.dereference.vala","."], - ["text","init ("], - ["storage.modifier.vala","ref"], - ["text"," args)"], - ["punctuation.terminator.vala",";"] -],[ - "text0", - ["text"," "], - ["storage.type.primitive.vala","var"], - ["text"," foo "], - ["keyword.operator.assignment.vala","="], - ["text"," "], - ["keyword.control.new.vala","new"], - ["text"," "], - ["storage.type.generic.vala","MyFoo>"], - ["text","()"], - ["punctuation.terminator.vala",";"] -],[ - "text0" -],[ - "text0", - ["text"," "], - ["storage.type.primitive.vala","var"], - ["text"," window "], - ["keyword.operator.assignment.vala","="], - ["text"," "], - ["keyword.control.new.vala","new"], - ["text"," "], - ["storage.type.vala","Window"], - ["text","()"], - ["punctuation.terminator.vala",";"] -],[ - "text0", - ["text"," window"], - ["keyword.operator.dereference.vala","."], - ["text","title "], - ["keyword.operator.assignment.vala","="], - ["text"," "], - ["punctuation.definition.string.begin.vala","\""], - ["string.quoted.double.vala","Hello, World!"], - ["punctuation.definition.string.end.vala","\""], - ["punctuation.terminator.vala",";"] -],[ - "text0", - ["text"," window"], - ["keyword.operator.dereference.vala","."], - ["text","border_width "], - ["keyword.operator.assignment.vala","="], - ["text"," "], - ["constant.numeric.vala","10"], - ["punctuation.terminator.vala",";"] -],[ - "text0", - ["text"," window"], - ["keyword.operator.dereference.vala","."], - ["text","window_position "], - ["keyword.operator.assignment.vala","="], - ["text"," "], - ["storage.type.vala","WindowPosition"], - ["keyword.operator.dereference.vala","."], - ["constant.other.vala","CENTER"], - ["punctuation.terminator.vala",";"] -],[ - "text0", - ["text"," window"], - ["keyword.operator.dereference.vala","."], - ["text","set_default_size("], - ["constant.numeric.vala","350"], - ["text",", "], - ["constant.numeric.vala","70"], - ["text",")"], - ["punctuation.terminator.vala",";"] -],[ - "text0", - ["text"," window"], - ["keyword.operator.dereference.vala","."], - ["text","destroy"], - ["keyword.operator.dereference.vala","."], - ["text","connect("], - ["storage.type.vala","Gtk"], - ["keyword.operator.dereference.vala","."], - ["text","main_quit)"], - ["punctuation.terminator.vala",";"] -],[ - "text0", - ["text"," "] -],[ - "text0", - ["text"," "], - ["storage.type.primitive.vala","var"], - ["text"," label "], - ["keyword.operator.assignment.vala","="], - ["text"," "], - ["keyword.control.new.vala","new"], - ["text"," "], - ["storage.type.vala","Label"], - ["text","("], - ["punctuation.definition.string.begin.vala","\""], - ["string.quoted.double.vala","Hello, World!"], - ["punctuation.definition.string.end.vala","\""], - ["text",")"], - ["punctuation.terminator.vala",";"] -],[ - "text0", - ["text"," "] -],[ - "text0", - ["text"," window"], - ["keyword.operator.dereference.vala","."], - ["text","add(label)"], - ["punctuation.terminator.vala",";"] -],[ - "text0", - ["text"," window"], - ["keyword.operator.dereference.vala","."], - ["text","show_all()"], - ["punctuation.terminator.vala",";"] -],[ - "text0", - ["text"," "] -],[ - "text0", - ["text"," "], - ["storage.type.vala","Gtk"], - ["keyword.operator.dereference.vala","."], - ["text","main()"], - ["punctuation.terminator.vala",";"] -],[ - "text0", - ["text"," "], - ["keyword.control.vala","return"], - ["text"," "], - ["constant.numeric.vala","0"], - ["punctuation.terminator.vala",";"] -],[ - "start", - ["text","}"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_vbscript.json b/lib/ace/mode/_test/tokens_vbscript.json deleted file mode 100644 index 05d5dd22..00000000 --- a/lib/ace/mode/_test/tokens_vbscript.json +++ /dev/null @@ -1,203 +0,0 @@ -[[ - "start", - ["text","myfilename "], - ["keyword.operator.asp","="], - ["text"," "], - ["punctuation.definition.string.begin.asp","\""], - ["string.quoted.double.asp","C:\\Wikipedia - VBScript - Example - Hello World.txt\""] -],[ - "start", - ["text","MakeHelloWorldFile myfilename"] -],[ - "state_4", - ["meta.leading-space"," "] -],[ - "start", - ["storage.type.function.asp","Sub"], - ["text"," "], - ["entity.name.function.asp","MakeHelloWorldFile"], - ["text"," "], - ["punctuation.definition.parameters.asp","("], - ["variable.parameter.function.asp","FileName"], - ["punctuation.definition.parameters.asp",")"] -],[ - "start", - ["punctuation.definition.comment.asp","'"], - ["comment.line.apostrophe.asp","Create a new file in C: drive or overwrite existing file"] -],[ - "start", - ["meta.odd-tab.spaces"," "], - ["meta.leading-space"," "], - ["storage.type.asp","Set"], - ["text"," FSO "], - ["keyword.operator.asp","="], - ["text"," "], - ["support.function.asp","CreateObject"], - ["text","("], - ["punctuation.definition.string.begin.asp","\""], - ["string.quoted.double.asp","Scripting.FileSystemObject\""], - ["text",")"] -],[ - "start", - ["meta.odd-tab.spaces"," "], - ["meta.leading-space"," "], - ["keyword.control.asp","If"], - ["text"," FSO."], - ["entity.name.function.asp","FileExists"], - ["text","(FileName) "], - ["keyword.control.asp","Then"], - ["text"," "] -],[ - "start", - ["meta.odd-tab.spaces"," "], - ["meta.even-tab.spaces"," "], - ["meta.odd-tab.spaces"," "], - ["text","Answer "], - ["keyword.operator.asp","="], - ["text"," "], - ["support.function.vb.asp","MsgBox"], - ["text"," ("], - ["punctuation.definition.string.begin.asp","\""], - ["string.quoted.double.asp","File \""], - ["text"," "], - ["keyword.operator.asp","&"], - ["text"," FileName "], - ["keyword.operator.asp","&"], - ["text"," "], - ["punctuation.definition.string.begin.asp","\""], - ["string.quoted.double.asp"," exists ... OK to overwrite?\""], - ["text",", vbOKCancel)"] -],[ - "start", - ["meta.odd-tab.spaces"," "], - ["meta.even-tab.spaces"," "], - ["meta.odd-tab.spaces"," "], - ["punctuation.definition.comment.asp","'"], - ["comment.line.apostrophe.asp","If button selected is not OK, then quit now"] -],[ - "start", - ["meta.odd-tab.spaces"," "], - ["meta.even-tab.spaces"," "], - ["meta.odd-tab.spaces"," "], - ["punctuation.definition.comment.asp","'"], - ["comment.line.apostrophe.asp","vbOK is a language constant"] -],[ - "start", - ["meta.odd-tab.spaces"," "], - ["meta.even-tab.spaces"," "], - ["meta.odd-tab.spaces"," "], - ["keyword.control.asp","If"], - ["text"," Answer "], - ["keyword.operator.asp","<>"], - ["text"," vbOK "], - ["keyword.control.asp","Then"], - ["text"," "], - ["keyword.control.asp","Exit Sub"] -],[ - "start", - ["meta.odd-tab.spaces"," "], - ["meta.leading-space"," "], - ["keyword.control.asp","Else"] -],[ - "start", - ["meta.odd-tab.spaces"," "], - ["meta.even-tab.spaces"," "], - ["meta.odd-tab.spaces"," "], - ["punctuation.definition.comment.asp","'"], - ["comment.line.apostrophe.asp","Confirm OK to create"] -],[ - "start", - ["meta.odd-tab.spaces"," "], - ["meta.even-tab.spaces"," "], - ["meta.odd-tab.spaces"," "], - ["text","Answer "], - ["keyword.operator.asp","="], - ["text"," "], - ["support.function.vb.asp","MsgBox"], - ["text"," ("], - ["punctuation.definition.string.begin.asp","\""], - ["string.quoted.double.asp","File \""], - ["text"," "], - ["keyword.operator.asp","&"], - ["text"," FileName "], - ["keyword.operator.asp","&"], - ["text"," "], - ["punctuation.definition.string.begin.asp","\""], - ["string.quoted.double.asp"," ... OK to create?\""], - ["text",", vbOKCancel)"] -],[ - "start", - ["meta.odd-tab.spaces"," "], - ["meta.even-tab.spaces"," "], - ["meta.odd-tab.spaces"," "], - ["keyword.control.asp","If"], - ["text"," Answer "], - ["keyword.operator.asp","<>"], - ["text"," vbOK "], - ["keyword.control.asp","Then"], - ["text"," "], - ["keyword.control.asp","Exit Sub"] -],[ - "start", - ["meta.odd-tab.spaces"," "], - ["meta.leading-space"," "], - ["keyword.control.asp","End If"] -],[ - "start", - ["meta.odd-tab.spaces"," "], - ["meta.leading-space"," "], - ["punctuation.definition.comment.asp","'"], - ["comment.line.apostrophe.asp","Create new file (or replace an existing file)"] -],[ - "start", - ["meta.odd-tab.spaces"," "], - ["meta.leading-space"," "], - ["storage.type.asp","Set"], - ["text"," FileObject "], - ["keyword.operator.asp","="], - ["text"," FSO.CreateTextFile (FileName)"] -],[ - "start", - ["meta.odd-tab.spaces"," "], - ["meta.leading-space"," "], - ["text","FileObject.WriteLine "], - ["punctuation.definition.string.begin.asp","\""], - ["string.quoted.double.asp","Time ... \""], - ["text"," "], - ["keyword.operator.asp","&"], - ["text"," "], - ["support.function.vb.asp","Now"], - ["text","()"] -],[ - "start", - ["meta.odd-tab.spaces"," "], - ["meta.leading-space"," "], - ["text","FileObject.WriteLine "], - ["punctuation.definition.string.begin.asp","\""], - ["string.quoted.double.asp","Hello World\""] -],[ - "start", - ["meta.odd-tab.spaces"," "], - ["meta.leading-space"," "], - ["text","FileObject."], - ["entity.name.function.asp","Close"], - ["text","()"] -],[ - "start", - ["meta.odd-tab.spaces"," "], - ["meta.leading-space"," "], - ["support.function.vb.asp","MsgBox"], - ["text"," "], - ["punctuation.definition.string.begin.asp","\""], - ["string.quoted.double.asp","File \""], - ["text"," "], - ["keyword.operator.asp","&"], - ["text"," FileName "], - ["keyword.operator.asp","&"], - ["text"," "], - ["punctuation.definition.string.begin.asp","\""], - ["string.quoted.double.asp"," ... updated.\""] -],[ - "start", - ["storage.type.asp","End Sub"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_velocity.json b/lib/ace/mode/_test/tokens_velocity.json deleted file mode 100644 index ee40761c..00000000 --- a/lib/ace/mode/_test/tokens_velocity.json +++ /dev/null @@ -1,285 +0,0 @@ -[[ - "vm_comment", - ["comment.block","#*"] -],[ - "vm_comment", - ["comment"," This is a sample comment block that"] -],[ - "vm_comment", - ["comment"," spans multiple lines."] -],[ - "start", - ["comment","*#"] -],[ - "start" -],[ - "start", - ["keyword","#macro"], - ["text"," "], - ["lparen","("], - ["text"," "], - ["identifier","outputItem"], - ["text"," "], - ["variable","$item"], - ["text"," "], - ["rparen",")"] -],[ - "start", - ["text"," "], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","li"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["variable","${"], - ["identifier","item"], - ["variable","}"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["keyword","#end"] -],[ - "start" -],[ - "start", - ["comment","## Define the items to iterate"] -],[ - "start", - ["keyword","#set"], - ["text"," "], - ["lparen","("], - ["text"," "], - ["variable","$items"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["lparen","["], - ["constant.numeric","1"], - ["text.xml",","], - ["text"," "], - ["constant.numeric","2"], - ["text.xml",","], - ["text"," "], - ["constant.numeric","3"], - ["text.xml",","], - ["text"," "], - ["constant.numeric","4"], - ["rparen","]"], - ["text"," "], - ["rparen",")"] -],[ - "start" -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","ul"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text"," "], - ["comment","## Iterate over the items and output the evens."] -],[ - "start", - ["text"," "], - ["keyword","#foreach"], - ["text"," "], - ["lparen","("], - ["text"," "], - ["variable","$item"], - ["text"," "], - ["identifier","in"], - ["text"," "], - ["variable","$items"], - ["text"," "], - ["rparen",")"] -],[ - "start", - ["text"," "], - ["keyword","#if"], - ["text"," "], - ["lparen","("], - ["text"," "], - ["support.function","$_MathTool"], - ["text.xml","."], - ["identifier","mod"], - ["lparen","("], - ["variable","$item"], - ["text.xml",","], - ["text"," "], - ["constant.numeric","2"], - ["rparen",")"], - ["text"," "], - ["keyword.operator","=="], - ["text"," "], - ["constant.numeric","0"], - ["text"," "], - ["rparen",")"] -],[ - "start", - ["text"," "], - ["identifier","#outputItem"], - ["text"," "], - ["lparen","("], - ["variable","$item"], - ["rparen",")"] -],[ - "start", - ["text"," "], - ["keyword","#end"] -],[ - "start", - ["text"," "], - ["keyword","#end"] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "js-start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.script.tag-name.xml","script"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "js-comment_regex_allowed", - ["text"," "], - ["comment","/*"] -],[ - "js-comment_regex_allowed", - ["comment"," A sample function to decomstrate"] -],[ - "js-comment_regex_allowed", - ["comment"," JavaScript highlighting and folding."] -],[ - "js-start", - ["comment"," */"] -],[ - "js-start", - ["text"," "], - ["storage.type","function"], - ["text"," "], - ["entity.name.function","foo"], - ["paren.lparen","("], - ["variable.parameter","items"], - ["punctuation.operator",", "], - ["variable.parameter","nada"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "js-start", - ["text"," "], - ["keyword","for"], - ["text"," "], - ["paren.lparen","("], - ["storage.type","var"], - ["text"," "], - ["identifier","i"], - ["keyword.operator","="], - ["constant.numeric","0"], - ["punctuation.operator",";"], - ["text"," "], - ["identifier","i"], - ["keyword.operator","<"], - ["identifier","items"], - ["punctuation.operator","."], - ["support.constant","length"], - ["punctuation.operator",";"], - ["text"," "], - ["identifier","i"], - ["keyword.operator","++"], - ["paren.rparen",")"], - ["text"," "], - ["paren.lparen","{"] -],[ - "js-start", - ["text"," "], - ["support.function","alert"], - ["paren.lparen","("], - ["identifier","items"], - ["paren.lparen","["], - ["identifier","i"], - ["paren.rparen","]"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["string","\"juhu"], - ["constant.language.escape","\\n"], - ["string","\""], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "js-no_regex", - ["text"," "], - ["paren.rparen","}"] -],[ - "js-no_regex", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start" -],[ - "css-start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.style.tag-name.xml","style"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - ["css-comment","css-start"], - ["text"," "], - ["comment","/*"] -],[ - ["css-comment","css-start"], - ["comment"," A sample style to decomstrate"] -],[ - ["css-comment","css-start"], - ["comment"," CSS highlighting and folding."] -],[ - "css-start", - ["comment"," */"] -],[ - ["css-ruleset","css-start"], - ["text"," "], - ["variable",".class"], - ["text"," "], - ["paren.lparen","{"] -],[ - ["css-ruleset","css-start"], - ["text"," "], - ["support.type","font-family"], - ["text",": Monaco, "], - ["string","\"Courier New\""], - ["text",", "], - ["support.constant.fonts","monospace"], - ["text",";"] -],[ - ["css-ruleset","css-start"], - ["text"," "], - ["support.type","font-size"], - ["text",": "], - ["constant.numeric","12"], - ["keyword","px"], - ["text",";"] -],[ - ["css-ruleset","css-start"], - ["text"," "], - ["support.type","cursor"], - ["text",": "], - ["support.constant","text"], - ["text",";"] -],[ - "css-start", - ["text"," "], - ["paren.rparen","}"] -],[ - "start", - ["meta.tag.punctuation.end-tag-open.xml",""] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_verilog.json b/lib/ace/mode/_test/tokens_verilog.json deleted file mode 100644 index 9680a964..00000000 --- a/lib/ace/mode/_test/tokens_verilog.json +++ /dev/null @@ -1,113 +0,0 @@ -[[ - "start", - ["keyword","always"], - ["text"," @"], - ["paren.lparen","("], - ["keyword","negedge"], - ["text"," "], - ["identifier","reset"], - ["text"," "], - ["keyword","or"], - ["text"," "], - ["keyword","posedge"], - ["text"," "], - ["identifier","clk"], - ["paren.rparen",")"], - ["text"," "], - ["keyword","begin"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["text"," "], - ["paren.lparen","("], - ["identifier","reset"], - ["text"," "], - ["keyword.operator","=="], - ["text"," "], - ["constant.numeric","0"], - ["paren.rparen",")"], - ["text"," "], - ["keyword","begin"] -],[ - "start", - ["text"," "], - ["identifier","d_out"], - ["text"," "], - ["keyword.operator","<="], - ["text"," "], - ["constant.numeric","16"], - ["text","'"], - ["identifier","h0000"], - ["text",";"] -],[ - "start", - ["text"," "], - ["identifier","d_out_mem"], - ["text","["], - ["identifier","resetcount"], - ["text","] "], - ["keyword.operator","<="], - ["text"," "], - ["identifier","d_out"], - ["text",";"] -],[ - "start", - ["text"," "], - ["identifier","laststoredvalue"], - ["text"," "], - ["keyword.operator","<="], - ["text"," "], - ["identifier","d_out"], - ["text",";"] -],[ - "start", - ["text"," "], - ["keyword","end"], - ["text"," "], - ["keyword","else"], - ["text"," "], - ["keyword","begin"] -],[ - "start", - ["text"," "], - ["identifier","d_out"], - ["text"," "], - ["keyword.operator","<="], - ["text"," "], - ["identifier","d_out"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric","1"], - ["text","'"], - ["identifier","b1"], - ["text","; "] -],[ - "start", - ["text"," "], - ["keyword","end"] -],[ - "start", - ["keyword","end"] -],[ - "start" -],[ - "start", - ["keyword","always"], - ["text"," @"], - ["paren.lparen","("], - ["identifier","bufreadaddr"], - ["paren.rparen",")"] -],[ - "start", - ["text"," "], - ["identifier","bufreadval"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["identifier","d_out_mem"], - ["text","["], - ["identifier","bufreadaddr"], - ["text","];"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_vhdl.json b/lib/ace/mode/_test/tokens_vhdl.json deleted file mode 100644 index 88c6e222..00000000 --- a/lib/ace/mode/_test/tokens_vhdl.json +++ /dev/null @@ -1,271 +0,0 @@ -[[ - "start", - ["keyword","library"], - ["text"," "], - ["identifier","IEEE"] -],[ - "start", - ["identifier","user"], - ["text"," "], - ["identifier","IEEE"], - ["punctuation.operator","."], - ["identifier","std_logic_1164"], - ["punctuation.operator","."], - ["keyword","all"], - ["punctuation.operator",";"] -],[ - "start", - ["keyword","use"], - ["text"," "], - ["identifier","IEEE"], - ["punctuation.operator","."], - ["identifier","numeric_std"], - ["punctuation.operator","."], - ["keyword","all"], - ["punctuation.operator",";"] -],[ - "start" -],[ - "start", - ["keyword","entity"], - ["text"," "], - ["identifier","COUNT16"], - ["text"," "], - ["keyword","is"] -],[ - "start" -],[ - "start", - ["text"," "], - ["keyword","port"], - ["text"," "], - ["paren.lparen","("] -],[ - "start", - ["text"," "], - ["identifier","cOut"], - ["text"," "], - ["punctuation.operator",":"], - ["keyword","out"], - ["text"," "], - ["storage.type","std_logic_vector"], - ["paren.lparen","("], - ["constant.numeric","15"], - ["text"," "], - ["keyword","downto"], - ["text"," "], - ["constant.numeric","0"], - ["paren.rparen",")"], - ["punctuation.operator",";"], - ["text"," "], - ["comment","-- counter output"] -],[ - "start", - ["text"," "], - ["identifier","clkEn"], - ["text"," "], - ["punctuation.operator",":"], - ["keyword","in"], - ["text"," "], - ["storage.type","std_logic"], - ["punctuation.operator",";"], - ["text"," "], - ["comment","-- count enable"] -],[ - "start", - ["text"," "], - ["identifier","clk"], - ["text"," "], - ["punctuation.operator",":"], - ["keyword","in"], - ["text"," "], - ["storage.type","std_logic"], - ["punctuation.operator",";"], - ["text"," "], - ["comment","-- clock input"] -],[ - "start", - ["text"," "], - ["identifier","rst"], - ["text"," "], - ["punctuation.operator",":"], - ["keyword","in"], - ["text"," "], - ["storage.type","std_logic"], - ["text"," "], - ["comment","-- reset input"] -],[ - "start", - ["text"," "], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "] -],[ - "start", - ["keyword","end"], - ["text"," "], - ["keyword","entity"], - ["punctuation.operator",";"] -],[ - "start" -],[ - "start", - ["keyword","architecture"], - ["text"," "], - ["identifier","count_rtl"], - ["text"," "], - ["keyword","of"], - ["text"," "], - ["identifier","COUNT16"], - ["text"," "], - ["keyword","is"] -],[ - "start", - ["text"," "], - ["storage.type","signal"], - ["text"," "], - ["identifier","count"], - ["text"," "], - ["punctuation.operator",":"], - ["storage.type","std_logic_vector"], - ["text"," "], - ["paren.lparen","("], - ["constant.numeric","15"], - ["text"," "], - ["keyword","downto"], - ["text"," "], - ["constant.numeric","0"], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "] -],[ - "start", - ["keyword","begin"] -],[ - "start", - ["text"," "], - ["keyword","process"], - ["text"," "], - ["paren.lparen","("], - ["identifier","clk"], - ["punctuation.operator",","], - ["text"," "], - ["identifier","rst"], - ["paren.rparen",")"], - ["text"," "], - ["keyword","begin"] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["paren.lparen","("], - ["identifier","rst"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string","'1'"], - ["paren.rparen",")"], - ["text"," "], - ["keyword","then"] -],[ - "start", - ["text"," "], - ["identifier","count"], - ["text"," "], - ["keyword.operator","<="], - ["text"," "], - ["paren.lparen","("], - ["keyword","others"], - ["keyword.operator","=>"], - ["string","'0'"], - ["paren.rparen",")"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword","elsif"], - ["paren.lparen","("], - ["identifier","rising_edge"], - ["paren.lparen","("], - ["identifier","clk"], - ["paren.rparen","))"], - ["text"," "], - ["keyword","then"] -],[ - "start", - ["text"," "], - ["keyword","if"], - ["paren.lparen","("], - ["identifier","clkEn"], - ["text"," "], - ["keyword.operator","="], - ["text"," "], - ["string","'1'"], - ["paren.rparen",")"], - ["text"," "], - ["keyword","then"] -],[ - "start", - ["text"," "], - ["identifier","count"], - ["text"," "], - ["keyword.operator","<="], - ["text"," "], - ["identifier","count"], - ["text"," "], - ["keyword.operator","+"], - ["text"," "], - ["constant.numeric","1"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword","end"], - ["text"," "], - ["keyword","if"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["keyword","end"], - ["text"," "], - ["keyword","if"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "] -],[ - "start", - ["text"," "], - ["keyword","end"], - ["text"," "], - ["keyword","process"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "], - ["identifier","cOut"], - ["text"," "], - ["keyword.operator","<="], - ["text"," "], - ["identifier","count"], - ["punctuation.operator",";"] -],[ - "start" -],[ - "start", - ["keyword","end"], - ["text"," "], - ["keyword","architecture"], - ["punctuation.operator",";"] -],[ - "start", - ["text"," "] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_xml.json b/lib/ace/mode/_test/tokens_xml.json deleted file mode 100644 index 728be4db..00000000 --- a/lib/ace/mode/_test/tokens_xml.json +++ /dev/null @@ -1,43 +0,0 @@ -[[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","Juhu"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["text.xml","//Juhu Kinners"], - ["meta.tag.punctuation.end-tag-open.xml",""] -],[ - "start", - ["text.xml","test: two tags in the same lines should be in separate tokens\""] -],[ - "start", - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","Juhu"], - ["meta.tag.punctuation.tag-close.xml",">"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","Kinners"], - ["meta.tag.punctuation.tag-close.xml",">"] -],[ - "start", - ["text.xml","test: multiline attributes\""] -],[ - ["string.attribute-value.xml0","meta.tag.punctuation.tag-open.xml"], - ["meta.tag.punctuation.tag-open.xml","<"], - ["meta.tag.tag-name.xml","copy"], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","set"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"{"] -],[ - ["string.attribute-value.xml0","meta.tag.punctuation.tag-open.xml"], - ["string.attribute-value.xml","}\""], - ["text.tag-whitespace.xml"," "], - ["entity.other.attribute-name.xml","undo"], - ["keyword.operator.attribute-equals.xml","="], - ["string.attribute-value.xml","\"{"] -],[ - "start", - ["string.attribute-value.xml","}\""], - ["meta.tag.punctuation.tag-close.xml","/>"] -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_xquery.json b/lib/ace/mode/_test/tokens_xquery.json deleted file mode 100644 index aaf9ab9b..00000000 --- a/lib/ace/mode/_test/tokens_xquery.json +++ /dev/null @@ -1,44 +0,0 @@ -[[ - "[\"start\"]", - ["keyword","xquery"], - ["text"," "], - ["keyword","version"], - ["text"," "], - ["string","\""], - ["string","1.0"], - ["string","\""], - ["text",";"] -],[ - "[\"start\"]" -],[ - "[\"start\"]", - ["keyword","let"], - ["text"," "], - ["variable","$message"], - ["text"," "], - ["keyword.operator",":="], - ["text"," "], - ["string","\""], - ["string","Hello World!"], - ["string","\""] -],[ - "[\"start\",\"StartTag\",\"TagContent\"]", - ["keyword","return"], - ["text"," "], - ["meta.tag",""] -],[ - "[\"start\",\"StartTag\",\"TagContent\"]", - ["text"," "], - ["meta.tag",""], - ["text","{"], - ["variable","$message"], - ["text","}"], - ["meta.tag",""] -],[ - "[\"start\"]", - ["meta.tag",""] -],[ - "[\"start\"]" -]] \ No newline at end of file diff --git a/lib/ace/mode/_test/tokens_yaml.json b/lib/ace/mode/_test/tokens_yaml.json deleted file mode 100644 index 7c9b45f3..00000000 --- a/lib/ace/mode/_test/tokens_yaml.json +++ /dev/null @@ -1,150 +0,0 @@ -[[ - "start", - ["comment","# This sample document was taken from wikipedia:"] -],[ - "start", - ["comment","# http://en.wikipedia.org/wiki/YAML#Sample_document"] -],[ - "start", - ["list.markup","---"] -],[ - "start", - ["meta.tag","receipt"], - ["keyword",": "], - ["text","Oz-Ware Purchase Invoice"] -],[ - "start", - ["meta.tag","date"], - ["keyword",": "], - ["constant.numeric","2007-08-06"] -],[ - "start", - ["meta.tag","customer"], - ["keyword",":"] -],[ - "start", - ["meta.tag"," given"], - ["keyword",": "], - ["text","Dorothy"] -],[ - "start", - ["meta.tag"," family"], - ["keyword",": "], - ["text","Gale"] -],[ - "start" -],[ - "start", - ["meta.tag","items"], - ["keyword",":"] -],[ - "start", - ["list.markup"," - "], - ["meta.tag","part_no"], - ["keyword",": "], - ["string","'A4786'"] -],[ - "start", - ["meta.tag"," descrip"], - ["keyword",": "], - ["text","Water Bucket "], - ["paren.lparen","("], - ["text","Filled"], - ["paren.rparen",")"] -],[ - "start", - ["meta.tag"," price"], - ["keyword",": "], - ["constant.numeric","1.47"] -],[ - "start", - ["meta.tag"," quantity"], - ["keyword",": "], - ["constant.numeric","4"] -],[ - "start" -],[ - "start", - ["list.markup"," - "], - ["meta.tag","part_no"], - ["keyword",": "], - ["string","'E1628'"] -],[ - "start", - ["meta.tag"," descrip"], - ["keyword",": "], - ["text","High Heeled "], - ["string","\"Ruby\""], - ["text"," Slippers"] -],[ - "start", - ["meta.tag"," size"], - ["keyword",": "], - ["constant.numeric","8"] -],[ - "start", - ["meta.tag"," price"], - ["keyword",": "], - ["constant.numeric","100.27"] -],[ - "start", - ["meta.tag"," quantity"], - ["keyword",": "], - ["constant.numeric","1"] -],[ - "start" -],[ - "start", - ["meta.tag","bill-to"], - ["keyword",": "], - ["constant.language","&id001"] -],[ - "qqstring", - ["meta.tag"," street"], - ["keyword",": "], - ["string","|"] -],[ - "qqstring", - ["string"," 123 Tornado Alley"] -],[ - "qqstring", - ["string"," Suite 16"] -],[ - "start", - ["meta.tag"," city"], - ["keyword",": "], - ["text","East Centerville"] -],[ - "start", - ["meta.tag"," state"], - ["keyword",": "], - ["text","KS"] -],[ - "start" -],[ - "start", - ["meta.tag","ship-to"], - ["keyword",": "], - ["constant.language","*id001"] -],[ - "start" -],[ - "qqstring", - ["meta.tag","specialDelivery"], - ["keyword",": "], - ["string",">"] -],[ - "qqstring", - ["string"," Follow the Yellow Brick"] -],[ - "qqstring", - ["string"," Road to the Emerald City."] -],[ - "qqstring", - ["string"," Pay no attention to the"] -],[ - "qqstring", - ["string"," man behind the curtain."] -],[ - "qqstring" -]] \ No newline at end of file diff --git a/lib/ace/mode/abap.js b/lib/ace/mode/abap.js deleted file mode 100644 index c9d5a991..00000000 --- a/lib/ace/mode/abap.js +++ /dev/null @@ -1,77 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var Rules = require("./abap_highlight_rules").AbapHighlightRules; -var FoldMode = require("./folding/coffee").FoldMode; -var Range = require("../range").Range; -var TextMode = require("./text").Mode; -var oop = require("../lib/oop"); - -function Mode() { - this.HighlightRules = Rules; - this.foldingRules = new FoldMode(); -} - -oop.inherits(Mode, TextMode); - -(function() { - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - return indent; - }; - - this.toggleCommentLines = function(state, doc, startRow, endRow){ - 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.$id = "ace/mode/abap"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); diff --git a/lib/ace/mode/abap_highlight_rules.js b/lib/ace/mode/abap_highlight_rules.js deleted file mode 100644 index bab1e504..00000000 --- a/lib/ace/mode/abap_highlight_rules.js +++ /dev/null @@ -1,134 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -/* - * based on - * " Vim ABAP syntax file - * " Language: SAP - ABAP/R4 - * " Revision: 2.1 - * " Maintainer: Marius Piedallu van Wyk - * " Last Change: 2012 Oct 23 - */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var AbapHighlightRules = function() { - - var keywordMapper = this.createKeywordMapper({ - "variable.language": "this", - "keyword": - "ADD ALIAS ALIASES ASSERT ASSIGN ASSIGNING AT BACK" + - " CALL CASE CATCH CHECK CLASS CLEAR CLOSE CNT COLLECT COMMIT COMMUNICATION COMPUTE CONCATENATE CONDENSE CONSTANTS CONTINUE CONTROLS CONVERT CREATE CURRENCY" + - " DATA DEFINE DEFINITION DEFERRED DELETE DESCRIBE DETAIL DIVIDE DO" + - " ELSE ELSEIF ENDAT ENDCASE ENDCLASS ENDDO ENDEXEC ENDFORM ENDFUNCTION ENDIF ENDIFEND ENDINTERFACE ENDLOOP ENDMETHOD ENDMODULE ENDON ENDPROVIDE ENDSELECT ENDTRY ENDWHILE EVENT EVENTS EXEC EXIT EXPORT EXPORTING EXTRACT" + - " FETCH FIELDS FORM FORMAT FREE FROM FUNCTION" + - " GENERATE GET" + - " HIDE" + - " IF IMPORT IMPORTING INDEX INFOTYPES INITIALIZATION INTERFACE INTERFACES INPUT INSERT IMPLEMENTATION" + - " LEAVE LIKE LINE LOAD LOCAL LOOP" + - " MESSAGE METHOD METHODS MODIFY MODULE MOVE MULTIPLY" + - " ON OVERLAY OPTIONAL OTHERS" + - " PACK PARAMETERS PERFORM POSITION PROGRAM PROVIDE PUT" + - " RAISE RANGES READ RECEIVE RECEIVING REDEFINITION REFERENCE REFRESH REJECT REPLACE REPORT RESERVE RESTORE RETURNING ROLLBACK" + - " SCAN SCROLL SEARCH SELECT SET SHIFT SKIP SORT SORTED SPLIT STANDARD STATICS STEP STOP SUBMIT SUBTRACT SUM SUMMARY SUPPRESS" + - " TABLES TIMES TRANSFER TRANSLATE TRY TYPE TYPES" + - " UNASSIGN ULINE UNPACK UPDATE" + - " WHEN WHILE WINDOW WRITE" + - " OCCURS STRUCTURE OBJECT PROPERTY" + - " CASTING APPEND RAISING VALUE COLOR" + - " CHANGING EXCEPTION EXCEPTIONS DEFAULT CHECKBOX COMMENT" + - " ID NUMBER FOR TITLE OUTPUT" + - " WITH EXIT USING" + - " INTO WHERE GROUP BY HAVING ORDER BY SINGLE" + - " APPENDING CORRESPONDING FIELDS OF TABLE" + - " LEFT RIGHT OUTER INNER JOIN AS CLIENT SPECIFIED BYPASSING BUFFER UP TO ROWS CONNECTING" + - " EQ NE LT LE GT GE NOT AND OR XOR IN LIKE BETWEEN", - "constant.language": - "TRUE FALSE NULL SPACE", - "support.type": - "c n i p f d t x string xstring decfloat16 decfloat34", - "keyword.operator": - "abs sign ceil floor trunc frac acos asin atan cos sin tan" + - " abapOperator cosh sinh tanh exp log log10 sqrt" + - " strlen xstrlen charlen numofchar dbmaxlen lines" - }, "text", true, " "); - - var compoundKeywords = "WITH\\W+(?:HEADER\\W+LINE|FRAME|KEY)|NO\\W+STANDARD\\W+PAGE\\W+HEADING|"+ - "EXIT\\W+FROM\\W+STEP\\W+LOOP|BEGIN\\W+OF\\W+(?:BLOCK|LINE)|BEGIN\\W+OF|"+ - "END\\W+OF\\W+(?:BLOCK|LINE)|END\\W+OF|NO\\W+INTERVALS|"+ - "RESPECTING\\W+BLANKS|SEPARATED\\W+BY|USING\\W+(?:EDIT\\W+MASK)|"+ - "WHERE\\W+(?:LINE)|RADIOBUTTON\\W+GROUP|REF\\W+TO|"+ - "(?:PUBLIC|PRIVATE|PROTECTED)(?:\\W+SECTION)?|DELETING\\W+(?:TRAILING|LEADING)"+ - "(?:ALL\\W+OCCURRENCES)|(?:FIRST|LAST)\\W+OCCURRENCE|INHERITING\\W+FROM|"+ - "LINE-COUNT|ADD-CORRESPONDING|AUTHORITY-CHECK|BREAK-POINT|CLASS-DATA|CLASS-METHODS|"+ - "CLASS-METHOD|DIVIDE-CORRESPONDING|EDITOR-CALL|END-OF-DEFINITION|END-OF-PAGE|END-OF-SELECTION|"+ - "FIELD-GROUPS|FIELD-SYMBOLS|FUNCTION-POOL|MOVE-CORRESPONDING|MULTIPLY-CORRESPONDING|NEW-LINE|"+ - "NEW-PAGE|NEW-SECTION|PRINT-CONTROL|RP-PROVIDE-FROM-LAST|SELECT-OPTIONS|SELECTION-SCREEN|"+ - "START-OF-SELECTION|SUBTRACT-CORRESPONDING|SYNTAX-CHECK|SYNTAX-TRACE|TOP-OF-PAGE|TYPE-POOL|"+ - "TYPE-POOLS|LINE-SIZE|LINE-COUNT|MESSAGE-ID|DISPLAY-MODE|READ(?:-ONLY)?|"+ - "IS\\W+(?:NOT\\W+)?(?:ASSIGNED|BOUND|INITIAL|SUPPLIED)"; - - this.$rules = { - "start" : [ - {token : "string", regex : "`", next : "string"}, - {token : "string", regex : "'", next : "qstring"}, - {token : "doc.comment", regex : /^\*.+/}, - {token : "comment", regex : /".+$/}, - {token : "invalid", regex: "\\.{2,}"}, - {token : "keyword.operator", regex: /\W[\-+\%=<>*]\W|\*\*|[~:,\.&$]|->*?|=>/}, - {token : "paren.lparen", regex : "[\\[({]"}, - {token : "paren.rparen", regex : "[\\])}]"}, - {token : "constant.numeric", regex: "[+-]?\\d+\\b"}, - {token : "variable.parameter", regex : /sy|pa?\d\d\d\d\|t\d\d\d\.|innnn/}, - {token : "keyword", regex : compoundKeywords}, - {token : "variable.parameter", regex : /\w+-\w+(?:-\w+)*/}, - {token : keywordMapper, regex : "\\b\\w+\\b"}, - {caseInsensitive: true} - ], - "qstring" : [ - {token : "constant.language.escape", regex : "''"}, - {token : "string", regex : "'", next : "start"}, - {defaultToken : "string"} - ], - "string" : [ - {token : "constant.language.escape", regex : "``"}, - {token : "string", regex : "`", next : "start"}, - {defaultToken : "string"} - ] - }; -}; -oop.inherits(AbapHighlightRules, TextHighlightRules); - -exports.AbapHighlightRules = AbapHighlightRules; -}); diff --git a/lib/ace/mode/abc.js b/lib/ace/mode/abc.js deleted file mode 100644 index b6eb237a..00000000 --- a/lib/ace/mode/abc.js +++ /dev/null @@ -1,58 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -/* - THIS FILE WAS AUTOGENERATED BY mode.tmpl.js - */ - -define(function (require, exports, module) { - "use strict"; - - var oop = require("../lib/oop"); - var TextMode = require("./text").Mode; - var ABCHighlightRules = require("./abc_highlight_rules").ABCHighlightRules; -// TODO: pick appropriate fold mode - var FoldMode = require("./folding/cstyle").FoldMode; - - var Mode = function () { - this.HighlightRules = ABCHighlightRules; - this.foldingRules = new FoldMode(); - }; - oop.inherits(Mode, TextMode); - - (function () { - // this.lineCommentStart = ""%.*""; - // this.blockComment = {start: ""/*"", end: ""*/""}; - // Extra logic goes here. - this.$id = "ace/mode/abc" - }).call(Mode.prototype); - - exports.Mode = Mode; -}); \ No newline at end of file diff --git a/lib/ace/mode/abc_highlight_rules.js b/lib/ace/mode/abc_highlight_rules.js deleted file mode 100644 index 6ffe9c9b..00000000 --- a/lib/ace/mode/abc_highlight_rules.js +++ /dev/null @@ -1,114 +0,0 @@ -/* This file was partially autogenerated from https://github.com/jimhawkridge/SublimeABC - - Modifications - - - more classes to express the abc semantic - - added syntax highlighting for Zupfnoter conventions (https://github.com/bwl21/zupfnoter) - - separate note pitch and note duration - even if it looks the same - - ***********************************************************************************************/ - - -define(function (require, exports, module) { - "use strict"; - - var oop = require("../lib/oop"); - var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - - var ABCHighlightRules = function () { - // regexp must not have capturing parentheses. Use (?:) instead. - // regexps are ordered -> the first match is used - - this.$rules = { - start: [ - { - token: ['zupfnoter.information.comment.line.percentage', 'information.keyword', 'in formation.keyword.embedded'], - regex: '(%%%%)(hn\\.[a-z]*)(.*)', - comment: 'Instruction Comment' - }, - { - token: ['information.comment.line.percentage', 'information.keyword.embedded'], - regex: '(%%)(.*)', - comment: 'Instruction Comment' - }, - - { - token: 'comment.line.percentage', - regex: '%.*', - comment: 'Comments' - }, - - { - token: 'barline.keyword.operator', - regex: '[\\[:]*[|:][|\\]:]*(?:\\[?[0-9]+)?|\\[[0-9]+', - comment: 'Bar lines' - }, - { - token: ['information.keyword.embedded', 'information.argument.string.unquoted'], - regex: '(\\[[A-Za-z]:)([^\\]]*\\])', - comment: 'embedded Header lines' - }, - { - token: ['information.keyword', 'information.argument.string.unquoted'], - regex: '^([A-Za-z]:)([^%\\\\]*)', - comment: 'Header lines' - }, - { - token: ['text', 'entity.name.function', 'string.unquoted', 'text'], - regex: '(\\[)([A-Z]:)(.*?)(\\])', - comment: 'Inline fields' - }, - { - token: ['accent.constant.language', 'pitch.constant.numeric', 'duration.constant.numeric'], - regex: '([\\^=_]*)([A-Ga-gz][,\']*)([0-9]*/*[><0-9]*)', - comment: 'Notes' - }, - { - token: 'zupfnoter.jumptarget.string.quoted', - regex: '[\\"!]\\^\\:.*?[\\"!]', - comment: 'Zupfnoter jumptarget' - }, { - token: 'zupfnoter.goto.string.quoted', - regex: '[\\"!]\\^\\@.*?[\\"!]', - comment: 'Zupfnoter goto' - }, - { - token: 'zupfnoter.annotation.string.quoted', - regex: '[\\"!]\\^\\!.*?[\\"!]', - comment: 'Zupfnoter annoation' - }, - { - token: 'zupfnoter.annotationref.string.quoted', - regex: '[\\"!]\\^\\#.*?[\\"!]', - comment: 'Zupfnoter annotation reference' - }, - { - token: 'chordname.string.quoted', - regex: '[\\"!]\\^.*?[\\"!]', - comment: 'abc chord' - }, - { - token: 'string.quoted', - regex: '[\\"!].*?[\\"!]', - comment: 'abc annotation' - } - - ] - }; - - // this.embedRules(JsonHighlightRules, "json-") - - this.normalizeRules(); - }; - - ABCHighlightRules.metaData = { - fileTypes: ['abc'], - name: 'ABC', - scopeName: 'text.abcnotation' - }; - - - oop.inherits(ABCHighlightRules, TextHighlightRules); - - exports.ABCHighlightRules = ABCHighlightRules; -}); diff --git a/lib/ace/mode/actionscript.js b/lib/ace/mode/actionscript.js deleted file mode 100644 index 7daf2941..00000000 --- a/lib/ace/mode/actionscript.js +++ /dev/null @@ -1,58 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * ***** END LICENSE BLOCK ***** */ - -/* - THIS FILE WAS AUTOGENERATED BY mode.tmpl.js -*/ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var ActionScriptHighlightRules = require("./actionscript_highlight_rules").ActionScriptHighlightRules; -// TODO: pick appropriate fold mode -var FoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = ActionScriptHighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - this.$id = "ace/mode/actionscript"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); \ No newline at end of file diff --git a/lib/ace/mode/actionscript_highlight_rules.js b/lib/ace/mode/actionscript_highlight_rules.js deleted file mode 100644 index 1f30d9c2..00000000 --- a/lib/ace/mode/actionscript_highlight_rules.js +++ /dev/null @@ -1,141 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -/* This file was autogenerated from tm bundles\actionscript.tmbundle\Syntaxes\ActionScript.plist (uuid: ) */ -/**************************************************************************************** - * IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. * - * fileTypes * - ****************************************************************************************/ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var ActionScriptHighlightRules = function() { - // regexp must not have capturing parentheses. Use (?:) instead. - // regexps are ordered -> the first match is used - - this.$rules = { start: - [ { token: 'support.class.actionscript.2', - regex: '\\b(?:R(?:ecordset|DBMSResolver|adioButton(?:Group)?)|X(?:ML(?:Socket|Node|Connector)?|UpdateResolverDataHolder)|M(?:M(?:Save|Execute)|icrophoneMicrophone|o(?:use|vieClip(?:Loader)?)|e(?:nu(?:Bar)?|dia(?:Controller|Display|Playback))|ath)|B(?:yName|inding|utton)|S(?:haredObject|ystem|crollPane|t(?:yleSheet|age|ream)|ound|e(?:ndEvent|rviceObject)|OAPCall|lide)|N(?:umericStepper|et(?:stream|S(?:tream|ervices)|Connection|Debug(?:Config)?))|C(?:heckBox|o(?:ntextMenu(?:Item)?|okie|lor|m(?:ponentMixins|boBox))|ustomActions|lient|amera)|T(?:ypedValue|ext(?:Snapshot|Input|F(?:ield|ormat)|Area)|ree|AB)|Object|D(?:ownload|elta(?:Item|Packet)?|at(?:e(?:Chooser|Field)?|a(?:G(?:lue|rid)|Set|Type)))|U(?:RL|TC|IScrollBar)|P(?:opUpManager|endingCall|r(?:intJob|o(?:duct|gressBar)))|E(?:ndPoint|rror)|Video|Key|F(?:RadioButton|GridColumn|MessageBox|BarChart|S(?:croll(?:Bar|Pane)|tyleFormat|plitView)|orm|C(?:heckbox|omboBox|alendar)|unction|T(?:icker|ooltip(?:Lite)?|ree(?:Node)?)|IconButton|D(?:ataGrid|raggablePane)|P(?:ieChart|ushButton|ro(?:gressBar|mptBox))|L(?:i(?:stBox|neChart)|oadingBox)|AdvancedMessageBox)|W(?:indow|SDLURL|ebService(?:Connector)?)|L(?:ist|o(?:calConnection|ad(?:er|Vars)|g)|a(?:unch|bel))|A(?:sBroadcaster|cc(?:ordion|essibility)|S(?:Set(?:Native|PropFlags)|N(?:ew|ative)|C(?:onstructor|lamp(?:2)?)|InstanceOf)|pplication|lert|rray))\\b' }, - { token: 'support.function.actionscript.2', - regex: '\\b(?:s(?:h(?:ift|ow(?:GridLines|Menu|Border|Settings|Headers|ColumnHeaders|Today|Preferences)?|ad(?:ow|ePane))|c(?:hema|ale(?:X|Mode|Y|Content)|r(?:oll(?:Track|Drag)?|een(?:Resolution|Color|DPI)))|t(?:yleSheet|op(?:Drag|A(?:nimation|llSounds|gent))?|epSize|a(?:tus|rt(?:Drag|A(?:nimation|gent))?))|i(?:n|ze|lence(?:TimeOut|Level))|o(?:ngname|urce|rt(?:Items(?:By)?|On(?:HeaderRelease)?|able(?:Columns)?)?)|u(?:ppressInvalidCalls|bstr(?:ing)?)|p(?:li(?:ce|t)|aceCol(?:umnsEqually|lumnsEqually))|e(?:nd(?:DefaultPushButtonEvent|AndLoad)?|curity|t(?:R(?:GB|o(?:otNode|w(?:Height|Count))|esizable(?:Columns)?|a(?:nge|te))|G(?:ain|roupName)|X(?:AxisTitle)?|M(?:i(?:n(?:imum|utes)|lliseconds)|o(?:nth(?:Names)?|tionLevel|de)|ultilineMode|e(?:ssage|nu(?:ItemEnabled(?:At)?|EnabledAt)|dia)|a(?:sk|ximum))|B(?:u(?:tton(?:s|Width)|fferTime)|a(?:seTabIndex|ndwidthLimit|ckground))|S(?:howAsDisabled|croll(?:ing|Speed|Content|Target|P(?:osition|roperties)|barState|Location)|t(?:yle(?:Property)?|opOnFocus|at(?:us|e))|i(?:ze|lenceLevel)|ort(?:able(?:Columns)?|Function)|p(?:litterBarPosition|acing)|e(?:conds|lect(?:Multiple|ion(?:Required|Type)?|Style|Color|ed(?:Node(?:s)?|Cell|I(?:nd(?:ices|ex)|tem(?:s)?))?|able))|kin|m(?:oothness|allScroll))|H(?:ighlight(?:s|Color)|Scroll|o(?:urs|rizontal)|eader(?:Symbol|Height|Text|Property|Format|Width|Location)?|as(?:Shader|CloseBox))|Y(?:ear|AxisTitle)?|N(?:ode(?:Properties|ExpansionHandler)|ewTextFormat)|C(?:h(?:ildNodes|a(?:ngeHandler|rt(?:Title|EventHandler)))|o(?:ntent(?:Size)?|okie|lumns)|ell(?:Symbol|Data)|l(?:i(?:ckHandler|pboard)|oseHandler)|redentials)|T(?:ype(?:dVaule)?|i(?:tle(?:barHeight)?|p(?:Target|Offset)?|me(?:out(?:Handler)?)?)|oggle|extFormat|ransform)|I(?:s(?:Branch|Open)|n(?:terval|putProperty)|con(?:SymbolName)?|te(?:rator|m(?:ByKey|Symbol)))|Orientation|D(?:i(?:splay(?:Range|Graphics|Mode|Clip|Text|edMonth)|rection)|uration|e(?:pth(?:Below|To|Above)|fault(?:GatewayURL|Mappings|NodeIconSymbolName)|l(?:iveryMode|ay)|bug(?:ID)?)|a(?:yOfWeekNames|t(?:e(?:Filter)?|a(?:Mapping(?:s)?|Item(?:Text|Property|Format)|Provider|All(?:Height|Property|Format|Width))?))|ra(?:wConnectors|gContent))|U(?:se(?:Shadow|HandCursor|EchoSuppression|rInput|Fade)|TC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear))|P(?:osition|ercentComplete|an(?:e(?:M(?:inimumSize|aximumSize)|Size|Title))?|ro(?:pert(?:y(?:Data)?|iesAt)|gress))|E(?:nabled|dit(?:Handler|able)|xpand(?:NodeTrigger|erSymbolName))|V(?:Scroll|olume|alue(?:Source)?)|KeyFrameInterval|Quality|F(?:i(?:eld|rst(?:DayOfWeek|VisibleNode))|ocus|ullYear|ps|ade(?:InLength|OutLength)|rame(?:Color|Width))|Width|L(?:ine(?:Color|Weight)|o(?:opback|adTarget)|a(?:rgeScroll|bel(?:Source|Placement)?))|A(?:s(?:Boolean|String|Number)|n(?:yTypedValue|imation)|ctiv(?:e(?:State(?:Handler)?|Handler)|ateHandler)|utoH(?:ideScrollBar|eight)))?|paratorBefore|ek|lect(?:ion(?:Disabled|Unfocused)?|ed(?:Node(?:s)?|Child|I(?:nd(?:ices|ex)|tem(?:s)?)|Dat(?:e|a))?|able(?:Ranges)?)|rver(?:String)?)|kip|qrt|wapDepths|lice|aveToSharedObj|moothing)|h(?:scroll(?:Policy)?|tml(?:Text)?|i(?:t(?:Test(?:TextNearPos)?|Area)|de(?:BuiltInItems|Child)?|ghlight(?:2D|3D)?)|orizontal|e(?:ight|ader(?:Re(?:nderer|lease)|Height|Text))|P(?:osition|ageScrollSize)|a(?:s(?:childNodes|MP3|S(?:creen(?:Broadcast|Playback)|treaming(?:Video|Audio)|ort)|Next|OwnProperty|Pr(?:inting|evious)|EmbeddedVideo|VideoEncoder|A(?:ccesibility|udio(?:Encoder)?))|ndlerName)|LineScrollSize)|ye(?:sLabel|ar)|n(?:o(?:t|de(?:Name|Close|Type|Open|Value)|Label)|u(?:llValue|mChild(?:S(?:creens|lides)|ren|Forms))|e(?:w(?:Item|line|Value|LocationDialog)|xt(?:S(?:cene|ibling|lide)|TabIndex|Value|Frame)?)?|ame(?:s)?)|c(?:h(?:ildNodes|eck|a(?:nge(?:sPending)?|r(?:CodeAt|At))|r)|o(?:s|n(?:st(?:ant|ructor)|nect|c(?:urrency|at)|t(?:ent(?:Type|Path)?|ains|rol(?:Placement|lerPolicy))|denseWhite|version)|py|l(?:or|umn(?:Stretch|Name(?:s)?|Count))|m(?:p(?:onent|lete)|ment))|u(?:stomItems|ePoint(?:s)?|r(?:veTo|Value|rent(?:Slide|ChildSlide|Item|F(?:ocused(?:S(?:creen|lide)|Form)|ps))))|e(?:il|ll(?:Renderer|Press|Edit|Focus(?:In|Out)))|l(?:i(?:ck|ents)|o(?:se(?:Button|Pane)?|ne(?:Node)?)|ear(?:S(?:haredObjects|treams)|Timeout|Interval)?)|a(?:ncelLabel|tch|p(?:tion|abilities)|l(?:cFields|l(?:e(?:e|r))?))|reate(?:GatewayConnection|Menu|Se(?:rver|gment)|C(?:hild(?:AtDepth)?|l(?:ient|ass(?:ChildAtDepth|Object(?:AtDepth)?))|all)|Text(?:Node|Field)|Item|Object(?:AtDepth)?|PopUp|E(?:lement|mptyMovieClip)))|t(?:h(?:is|row)|ype(?:of|Name)?|i(?:tle(?:StyleDeclaration)?|me(?:out)?)|o(?:talTime|String|olTipText|p|UpperCase|ggle(?:HighQuality)?|Lo(?:caleString|werCase))|e(?:st|llTarget|xt(?:RightMargin|Bold|S(?:ize|elected)|Height|Color|I(?:ndent|talic)|Disabled|Underline|F(?:ield|ont)|Width|LeftMargin|Align)?)|a(?:n|rget(?:Path)?|b(?:Stops|Children|Index|Enabled|leName))|r(?:y|igger|ac(?:e|k(?:AsMenu)?)))|i(?:s(?:Running|Branch|NaN|Con(?:soleOpen|nected)|Toggled|Installed|Open|D(?:own|ebugger)|P(?:urchased|ro(?:totypeOf|pertyEnumerable))|Empty|F(?:inite|ullyPopulated)|Local|Active)|n(?:s(?:tall|ertBefore)|cludeDeltaPacketInfo|t|it(?:ialize|Component|Pod|A(?:pplication|gent))?|de(?:nt|terminate|x(?:InParent(?:Slide|Form)?|Of)?)|put|validate|finity|LocalInternetCache)?|con(?:F(?:ield|unction))?|t(?:e(?:ratorScrolled|m(?:s|RollO(?:ut|ver)|ClassName))|alic)|d3|p|fFrameLoaded|gnore(?:Case|White))|o(?:s|n(?:R(?:ollO(?:ut|ver)|e(?:s(?:ize|ult)|l(?:ease(?:Outside)?|aseOutside)))|XML|Mouse(?:Move|Down|Up|Wheel)|S(?:ync|croller|tatus|oundComplete|e(?:tFocus|lect(?:edItem)?))|N(?:oticeEvent|etworkChange)|C(?:hanged|onnect|l(?:ipEvent|ose))|ID3|D(?:isconnect|eactivate|ata|ragO(?:ut|ver))|Un(?:install|load)|P(?:aymentResult|ress)|EnterFrame|K(?:illFocus|ey(?:Down|Up))|Fault|Lo(?:ad|g)|A(?:ctiv(?:ity|ate)|ppSt(?:op|art)))?|pe(?:n|ration)|verLayChildren|kLabel|ldValue|r(?:d)?)|d(?:i(?:s(?:connect|play(?:Normal|ed(?:Month|Year)|Full)|able(?:Shader|d(?:Ranges|Days)|CloseBox|Events))|rection)|o(?:cTypeDecl|tall|Decoding|main|LazyDecoding)|u(?:plicateMovieClip|ration)|e(?:stroy(?:ChildAt|Object)|code|fault(?:PushButton(?:Enabled)?|KeydownHandler)?|l(?:ta(?:Packet(?:Changed)?)?|ete(?:PopUp|All)?)|blocking)|a(?:shBoardSave|yNames|ta(?:Provider)?|rkshadow)|r(?:opdown(?:Width)?|a(?:w|gO(?:ut|ver))))|u(?:se(?:Sort|HandCursor|Codepage|EchoSuppression)|n(?:shift|install|derline|escape|format|watch|lo(?:ck|ad(?:Movie(?:Num)?)?))|pdate(?:Results|Mode|I(?:nputProperties|tem(?:ByIndex)?)|P(?:acket|roperties)|View|AfterEvent)|rl)|join|p(?:ixelAspectRatio|o(?:sition|p|w)|u(?:sh|rge|blish)|ercen(?:tComplete|Loaded)|lay(?:head(?:Change|Time)|ing|Hidden|erType)?|a(?:ssword|use|r(?:se(?:XML|CSS|Int|Float)|ent(?:Node|Is(?:S(?:creen|lide)|Form))|ams))|r(?:int(?:Num|AsBitmap(?:Num)?)?|o(?:to(?:type)?|pert(?:y|ies)|gress)|e(?:ss|v(?:ious(?:S(?:ibling|lide)|Value)?|Scene|Frame)|ferred(?:Height|Width))))|e(?:scape|n(?:code(?:r)?|ter(?:Frame)?|dFill|able(?:Shader|d|CloseBox|Events))|dit(?:able|Field|LocationDialog)|v(?:ent|al(?:uate)?)|q|x(?:tended|p|ec(?:ute)?|actSettings)|m(?:phasized(?:StyleDeclaration)?|bedFonts))|v(?:i(?:sible|ewPod)|ScrollPolicy|o(?:id|lume)|ersion|P(?:osition|ageScrollSize)|a(?:l(?:idat(?:ionError|e(?:Property|ActivationKey)?)|ue(?:Of)?)|riable)|LineScrollSize)|k(?:ind|ey(?:Down|Up|Press|FrameInterval))|q(?:sort|uality)|f(?:scommand|i(?:n(?:d(?:Text|First|Last)?|ally)|eldInfo|lter(?:ed|Func)?|rst(?:Slide|Child|DayOfWeek|VisibleNode)?)|o(?:nt|cus(?:In|edCell|Out|Enabled)|r(?:egroundDisabled|mat(?:ter)?))|unctionName|ps|l(?:oor|ush)|ace|romCharCode)|w(?:i(?:th|dth)|ordWrap|atch|riteAccess)|l(?:t|i(?:st(?:Owner)?|ne(?:Style|To))|o(?:c(?:k|a(?:t(?:ion|eByld)|l(?:ToGlobal|FileReadDisable)))|opback|ad(?:Movie(?:Num)?|S(?:crollContent|ound)|ed|Variables(?:Num)?|Application)?|g(?:Changes)?)|e(?:ngth|ft(?:Margin)?|ading)?|a(?:st(?:Slide|Child|Index(?:Of)?)?|nguage|b(?:el(?:Placement|F(?:ield|unction))?|leField)))|a(?:s(?:scociate(?:Controller|Display)|in|pectRatio|function)|nd|c(?:ceptConnection|tiv(?:ityLevel|ePlayControl)|os)|t(?:t(?:ach(?:Movie|Sound|Video|Audio)|ributes)|an(?:2)?)|dd(?:header|RequestHeader|Menu(?:Item(?:At)?|At)?|Sort|Header|No(?:tice|de(?:At)?)|C(?:olumn(?:At)?|uePoint)|T(?:oLocalInternetCache|reeNode(?:At)?)|I(?:con|tem(?:s(?:At)?|At)?)|DeltaItem|P(?:od|age|roperty)|EventListener|View|FieldInfo|Listener|Animation)?|uto(?:Size|Play|KeyNav|Load)|pp(?:endChild|ly(?:Changes|Updates)?)|vHardwareDisable|fterLoaded|l(?:ternateRowColors|ign|l(?:ow(?:InsecureDomain|Domain)|Transitions(?:InDone|OutDone))|bum)|r(?:tist|row|g(?:uments|List))|gent|bs)|r(?:ight(?:Margin)?|o(?:ot(?:S(?:creen|lide)|Form)|und|w(?:Height|Count)|llO(?:ut|ver))|e(?:s(?:yncDepth|t(?:orePane|artAnimation|rict)|iz(?:e|able(?:Columns)?)|olveDelta|ult(?:s)?|ponse)|c(?:o(?:ncile(?:Results|Updates)|rd)|eive(?:Video|Audio))|draw|jectConnection|place(?:Sel|ItemAt|AllItems)?|ve(?:al(?:Child)?|rse)|quest(?:SizeChange|Payment)?|f(?:errer|resh(?:ScrollContent|Destinations|Pane|FromSources)?)|lease(?:Outside)?|ad(?:Only|Access)|gister(?:SkinElement|C(?:olor(?:Style|Name)|lass)|InheritingStyle|Proxy)|move(?:Range|M(?:ovieClip|enu(?:Item(?:At)?|At))|Background|Sort|No(?:tice|de(?:sAt|At)?)|C(?:olum(?:nAt|At)|uePoints)|T(?:extField|reeNode(?:At)?)|Item(?:At)?|Pod|EventListener|FromLocalInternetCache|Listener|All(?:C(?:olumns|uePoints)|Items)?))|a(?:ndom|te|dioDot))|g(?:t|oto(?:Slide|NextSlide|PreviousSlide|FirstSlide|LastSlide|And(?:Stop|Play))|e(?:nre|t(?:R(?:GB|o(?:otNode|wCount)|e(?:sizable|mote))|X(?:AxisTitle)?|M(?:i(?:n(?:imum(?:Size)?|utes)|lliseconds)|onth(?:Names)?|ultilineMode|e(?:ssage|nu(?:ItemAt|EnabledAt|At))|aximum(?:Size)?)|B(?:ytes(?:Total|Loaded)|ounds|utton(?:s|Width)|eginIndex|a(?:ndwidthLimit|ckground))|S(?:howAsDisabled|croll(?:ing|Speed|Content|Position|barState|Location)|t(?:yle(?:Names)?|opOnFocus|ate)|ize|o(?:urce|rtState)|p(?:litterBarPosition|acing)|e(?:conds|lect(?:Multiple|ion(?:Required|Type)|Style|ed(?:Node(?:s)?|Cell|Text|I(?:nd(?:ices|ex)|tem(?:s)?))?)|rvice)|moothness|WFVersion)|H(?:ighlight(?:s|Color)|ours|e(?:ight|ader(?:Height|Text|Property|Format|Width|Location)?)|as(?:Shader|CloseBox))|Y(?:ear|AxisTitle)?|N(?:o(?:tices|de(?:DisplayedAt|At))|um(?:Children|berAvailable)|e(?:wTextFormat|xtHighestDepth))|C(?:h(?:ild(?:S(?:creen|lide)|Nodes|Form|At)|artTitle)|o(?:n(?:tent|figInfo)|okie|de|unt|lumn(?:Names|Count|Index|At))|uePoint|ellIndex|loseHandler|a(?:ll|retIndex))|T(?:ypedValue|i(?:tle(?:barHeight)?|p(?:Target|Offset)?|me(?:stamp|zoneOffset|out(?:State|Handler)|r)?)|oggle|ext(?:Extent|Format)?|r(?:ee(?:NodeAt|Length)|ans(?:form|actionId)))|I(?:s(?:Branch|Open)|n(?:stanceAtDepth|d(?:icesByKey|exByKey))|con(?:SymbolName)?|te(?:rator|m(?:sByKey|By(?:Name|Key)|id|ID|At))|d)|O(?:utput(?:Parameter(?:s|ByName)?|Value(?:s)?)|peration|ri(?:entation|ginalCellData))|D(?:i(?:s(?:play(?:Range|Mode|Clip|Index|edMonth)|kUsage)|rection)|uration|e(?:pth|faultNodeIconSymbolName|l(?:taPacket|ay)|bug(?:Config|ID)?)|a(?:y(?:OfWeekNames)?|t(?:e|a(?:Mapping(?:s)?|Item(?:Text|Property|Format)|Label|All(?:Height|Property|Format|Width))?))|rawConnectors)|U(?:se(?:Shadow|HandCursor|rInput|Fade)|RL|TC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear))|P(?:o(?:sition|ds)|ercentComplete|a(?:n(?:e(?:M(?:inimums|aximums)|Height|Title|Width))?|rentNode)|r(?:operty(?:Name|Data)?|efer(?:ences|red(?:Height|Width))))|E(?:n(?:dIndex|abled)|ditingData|x(?:panderSymbolName|andNodeTrigger))|V(?:iewed(?:Pods|Applications)|olume|ersion|alue(?:Source)?)|F(?:i(?:eld|rst(?:DayOfWeek|VisibleNode))|o(?:ntList|cus)|ullYear|ade(?:InLength|OutLength)|rame(?:Color|Width))|Width|L(?:ine(?:Color|Weight)|o(?:cal|adTarget)|ength|a(?:stTabIndex|bel(?:Source)?))|A(?:s(?:cii|Boolean|String|Number)|n(?:yTypedValue|imation)|ctiv(?:eState(?:Handler)?|ateHandler)|utoH(?:ideScrollBar|eight)|llItems|gent))?)?|lobal(?:StyleFormat|ToLocal)?|ain|roupName)|x(?:updatePackety|mlDecl)?|m(?:y(?:MethodName|Call)|in(?:imum)?|o(?:nthNames|tion(?:TimeOut|Level)|de(?:lChanged)?|use(?:Move|O(?:ut|ver)|Down(?:Somewhere|Outside)?|Up(?:Somewhere)?|WheelEnabled)|ve(?:To)?)|u(?:ted|lti(?:pleS(?:imultaneousAllowed|elections)|line))|e(?:ssage|nu(?:Show|Hide)?|th(?:od)?|diaType)|a(?:nufacturer|tch|x(?:scroll|hscroll|imum|HPosition|Chars|VPosition)?)|b(?:substring|chr|ord|length))|b(?:ytes(?:Total|Loaded)|indFormat(?:Strings|Function)|o(?:ttom(?:Scroll)?|ld|rder(?:Color)?)|u(?:tton(?:Height|Width)|iltInItems|ffer(?:Time|Length)|llet)|e(?:foreApplyUpdates|gin(?:GradientFill|Fill))|lockIndent|a(?:ndwidth|ckground(?:Style|Color|Disabled)?)|roadcastMessage)|onHTTPStatus)\\b' }, - { token: 'support.constant.actionscript.2', - regex: '\\b(?:__proto__|__resolve|_accProps|_alpha|_changed|_currentframe|_droptarget|_flash|_focusrect|_framesloaded|_global|_height|_highquality|_level|_listeners|_lockroot|_name|_parent|_quality|_root|_rotation|_soundbuftime|_target|_totalframes|_url|_visible|_width|_x|_xmouse|_xscale|_y|_ymouse|_yscale)\\b' }, - { token: 'keyword.control.actionscript.2', - regex: '\\b(?:dynamic|extends|import|implements|interface|public|private|new|static|super|var|for|in|break|continue|while|do|return|if|else|case|switch)\\b' }, - { token: 'storage.type.actionscript.2', - regex: '\\b(?:Boolean|Number|String|Void)\\b' }, - { token: 'constant.language.actionscript.2', - regex: '\\b(?:null|undefined|true|false)\\b' }, - { token: 'constant.numeric.actionscript.2', - regex: '\\b(?:0(?:x|X)[0-9a-fA-F]*|(?:[0-9]+\\.?[0-9]*|\\.[0-9]+)(?:(?:e|E)(?:\\+|-)?[0-9]+)?)(?:L|l|UL|ul|u|U|F|f)?\\b' }, - { token: 'punctuation.definition.string.begin.actionscript.2', - regex: '"', - push: - [ { token: 'punctuation.definition.string.end.actionscript.2', - regex: '"', - next: 'pop' }, - { token: 'constant.character.escape.actionscript.2', - regex: '\\\\.' }, - { defaultToken: 'string.quoted.double.actionscript.2' } ] }, - { token: 'punctuation.definition.string.begin.actionscript.2', - regex: '\'', - push: - [ { token: 'punctuation.definition.string.end.actionscript.2', - regex: '\'', - next: 'pop' }, - { token: 'constant.character.escape.actionscript.2', - regex: '\\\\.' }, - { defaultToken: 'string.quoted.single.actionscript.2' } ] }, - { token: 'support.constant.actionscript.2', - regex: '\\b(?:BACKSPACE|CAPSLOCK|CONTROL|DELETEKEY|DOWN|END|ENTER|HOME|INSERT|LEFT|LN10|LN2|LOG10E|LOG2E|MAX_VALUE|MIN_VALUE|NEGATIVE_INFINITY|NaN|PGDN|PGUP|PI|POSITIVE_INFINITY|RIGHT|SPACE|SQRT1_2|SQRT2|UP)\\b' }, - { token: 'punctuation.definition.comment.actionscript.2', - regex: '/\\*', - push: - [ { token: 'punctuation.definition.comment.actionscript.2', - regex: '\\*/', - next: 'pop' }, - { defaultToken: 'comment.block.actionscript.2' } ] }, - { token: 'punctuation.definition.comment.actionscript.2', - regex: '//.*$', - push_: - [ { token: 'comment.line.double-slash.actionscript.2', - regex: '$', - next: 'pop' }, - { defaultToken: 'comment.line.double-slash.actionscript.2' } ] }, - { token: 'keyword.operator.actionscript.2', - regex: '\\binstanceof\\b' }, - { token: 'keyword.operator.symbolic.actionscript.2', - regex: '[-!%&*+=/?:]' }, - { token: - [ 'meta.preprocessor.actionscript.2', - 'punctuation.definition.preprocessor.actionscript.2', - 'meta.preprocessor.actionscript.2' ], - regex: '^([ \\t]*)(#)([a-zA-Z]+)' }, - { token: - [ 'storage.type.function.actionscript.2', - 'meta.function.actionscript.2', - 'entity.name.function.actionscript.2', - 'meta.function.actionscript.2', - 'punctuation.definition.parameters.begin.actionscript.2' ], - regex: '\\b(function)(\\s+)([a-zA-Z_]\\w*)(\\s*)(\\()', - push: - [ { token: 'punctuation.definition.parameters.end.actionscript.2', - regex: '\\)', - next: 'pop' }, - { token: 'variable.parameter.function.actionscript.2', - regex: '[^,)$]+' }, - { defaultToken: 'meta.function.actionscript.2' } ] }, - { token: - [ 'storage.type.class.actionscript.2', - 'meta.class.actionscript.2', - 'entity.name.type.class.actionscript.2', - 'meta.class.actionscript.2', - 'storage.modifier.extends.actionscript.2', - 'meta.class.actionscript.2', - 'entity.other.inherited-class.actionscript.2' ], - regex: '\\b(class)(\\s+)([a-zA-Z_](?:\\w|\\.)*)(?:(\\s+)(extends)(\\s+)([a-zA-Z_](?:\\w|\\.)*))?' } ] } - - this.normalizeRules(); -}; - -ActionScriptHighlightRules.metaData = { fileTypes: [ 'as' ], - keyEquivalent: '^~A', - name: 'ActionScript', - scopeName: 'source.actionscript.2' } - - -oop.inherits(ActionScriptHighlightRules, TextHighlightRules); - -exports.ActionScriptHighlightRules = ActionScriptHighlightRules; -}); \ No newline at end of file diff --git a/lib/ace/mode/ada.js b/lib/ace/mode/ada.js deleted file mode 100644 index dc1dfa14..00000000 --- a/lib/ace/mode/ada.js +++ /dev/null @@ -1,54 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var AdaHighlightRules = require("./ada_highlight_rules").AdaHighlightRules; -var Range = require("../range").Range; - -var Mode = function() { - this.HighlightRules = AdaHighlightRules; -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "--"; - - this.$id = "ace/mode/ada"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); - diff --git a/lib/ace/mode/ada_highlight_rules.js b/lib/ace/mode/ada_highlight_rules.js deleted file mode 100644 index b345966c..00000000 --- a/lib/ace/mode/ada_highlight_rules.js +++ /dev/null @@ -1,93 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var AdaHighlightRules = function() { -var keywords = "abort|else|new|return|abs|elsif|not|reverse|abstract|end|null|accept|entry|select|" + -"access|exception|of|separate|aliased|exit|or|some|all|others|subtype|and|for|out|synchronized|" + -"array|function|overriding|at|tagged|generic|package|task|begin|goto|pragma|terminate|" + -"body|private|then|if|procedure|type|case|in|protected|constant|interface|until|" + -"|is|raise|use|declare|range|delay|limited|record|when|delta|loop|rem|while|digits|renames|with|do|mod|requeue|xor"; - - var builtinConstants = ( - "true|false|null" - ); - - var builtinFunctions = ( - "count|min|max|avg|sum|rank|now|coalesce|main" - ); - - 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(AdaHighlightRules, TextHighlightRules); - -exports.AdaHighlightRules = AdaHighlightRules; -}); \ No newline at end of file diff --git a/lib/ace/mode/apache_conf.js b/lib/ace/mode/apache_conf.js deleted file mode 100644 index 2379b44b..00000000 --- a/lib/ace/mode/apache_conf.js +++ /dev/null @@ -1,62 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * - * - * ***** END LICENSE BLOCK ***** */ - -/* - THIS FILE WAS AUTOGENERATED BY mode.tmpl.js -*/ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var ApacheConfHighlightRules = require("./apache_conf_highlight_rules").ApacheConfHighlightRules; -// TODO: pick appropriate fold mode -var FoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = ApacheConfHighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "#"; - this.$id = "ace/mode/apache_conf"; - // Extra logic goes here. -}).call(Mode.prototype); - -exports.Mode = Mode; -}); \ No newline at end of file diff --git a/lib/ace/mode/apache_conf_highlight_rules.js b/lib/ace/mode/apache_conf_highlight_rules.js deleted file mode 100644 index c310612d..00000000 --- a/lib/ace/mode/apache_conf_highlight_rules.js +++ /dev/null @@ -1,231 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -/* This file was autogenerated from https://raw.github.com/colinta/ApacheConf.tmLanguage/master/ApacheConf.tmLanguage (uuid: ) */ -/**************************************************************************************** - * IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. * - * fileTypes * - ****************************************************************************************/ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var ApacheConfHighlightRules = function() { - // regexp must not have capturing parentheses. Use (?:) instead. - // regexps are ordered -> the first match is used - - this.$rules = { start: - [ { token: - [ 'punctuation.definition.comment.apacheconf', - 'comment.line.hash.ini', - 'comment.line.hash.ini' ], - regex: '^((?:\\s)*)(#)(.*$)' }, - { token: - [ 'punctuation.definition.tag.apacheconf', - 'entity.tag.apacheconf', - 'text', - 'string.value.apacheconf', - 'punctuation.definition.tag.apacheconf' ], - regex: '(<)(Proxy|ProxyMatch|IfVersion|Directory|DirectoryMatch|Files|FilesMatch|IfDefine|IfModule|Limit|LimitExcept|Location|LocationMatch|VirtualHost)(?:(\\s)(.+?))?(>)' }, - { token: - [ 'punctuation.definition.tag.apacheconf', - 'entity.tag.apacheconf', - 'punctuation.definition.tag.apacheconf' ], - regex: '()' }, - { token: - [ 'keyword.alias.apacheconf', 'text', - 'string.regexp.apacheconf', 'text', - 'string.replacement.apacheconf', 'text' ], - regex: '(Rewrite(?:Rule|Cond))(\\s+)(.+?)(\\s+)(.+?)($|\\s)' }, - { token: - [ 'keyword.alias.apacheconf', 'text', - 'entity.status.apacheconf', 'text', - 'string.regexp.apacheconf', 'text', - 'string.path.apacheconf', 'text' ], - regex: '(RedirectMatch)(?:(\\s+)(\\d\\d\\d|permanent|temp|seeother|gone))?(\\s+)(.+?)(\\s+)(?:(.+?)($|\\s))?' }, - { token: - [ 'keyword.alias.apacheconf', 'text', - 'entity.status.apacheconf', 'text', - 'string.path.apacheconf', 'text', - 'string.path.apacheconf', 'text' ], - regex: '(Redirect)(?:(\\s+)(\\d\\d\\d|permanent|temp|seeother|gone))?(\\s+)(.+?)(\\s+)(?:(.+?)($|\\s))?' }, - { token: - [ 'keyword.alias.apacheconf', 'text', - 'string.regexp.apacheconf', 'text', - 'string.path.apacheconf', 'text' ], - regex: '(ScriptAliasMatch|AliasMatch)(\\s+)(.+?)(\\s+)(?:(.+?)(\\s))?' }, - { token: - [ 'keyword.alias.apacheconf', 'text', - 'string.path.apacheconf', 'text', - 'string.path.apacheconf', 'text' ], - regex: '(RedirectPermanent|RedirectTemp|ScriptAlias|Alias)(\\s+)(.+?)(\\s+)(?:(.+?)($|\\s))?' }, - { token: 'keyword.core.apacheconf', - regex: '\\b(?:AcceptPathInfo|AccessFileName|AddDefaultCharset|AddOutputFilterByType|AllowEncodedSlashes|AllowOverride|AuthName|AuthType|CGIMapExtension|ContentDigest|DefaultType|DocumentRoot|EnableMMAP|EnableSendfile|ErrorDocument|ErrorLog|FileETag|ForceType|HostnameLookups|IdentityCheck|Include|KeepAlive|KeepAliveTimeout|LimitInternalRecursion|LimitRequestBody|LimitRequestFields|LimitRequestFieldSize|LimitRequestLine|LimitXMLRequestBody|LogLevel|MaxKeepAliveRequests|NameVirtualHost|Options|Require|RLimitCPU|RLimitMEM|RLimitNPROC|Satisfy|ScriptInterpreterSource|ServerAdmin|ServerAlias|ServerName|ServerPath|ServerRoot|ServerSignature|ServerTokens|SetHandler|SetInputFilter|SetOutputFilter|TimeOut|TraceEnable|UseCanonicalName)\\b' }, - { token: 'keyword.mpm.apacheconf', - regex: '\\b(?:AcceptMutex|AssignUserID|BS2000Account|ChildPerUserID|CoreDumpDirectory|EnableExceptionHook|Group|Listen|ListenBacklog|LockFile|MaxClients|MaxMemFree|MaxRequestsPerChild|MaxRequestsPerThread|MaxSpareServers|MaxSpareThreads|MaxThreads|MaxThreadsPerChild|MinSpareServers|MinSpareThreads|NumServers|PidFile|ReceiveBufferSize|ScoreBoardFile|SendBufferSize|ServerLimit|StartServers|StartThreads|ThreadLimit|ThreadsPerChild|ThreadStackSize|User|Win32DisableAcceptEx)\\b' }, - { token: 'keyword.access.apacheconf', - regex: '\\b(?:Allow|Deny|Order)\\b' }, - { token: 'keyword.actions.apacheconf', - regex: '\\b(?:Action|Script)\\b' }, - { token: 'keyword.alias.apacheconf', - regex: '\\b(?:Alias|AliasMatch|Redirect|RedirectMatch|RedirectPermanent|RedirectTemp|ScriptAlias|ScriptAliasMatch)\\b' }, - { token: 'keyword.auth.apacheconf', - regex: '\\b(?:AuthAuthoritative|AuthGroupFile|AuthUserFile)\\b' }, - { token: 'keyword.auth_anon.apacheconf', - regex: '\\b(?:Anonymous|Anonymous_Authoritative|Anonymous_LogEmail|Anonymous_MustGiveEmail|Anonymous_NoUserID|Anonymous_VerifyEmail)\\b' }, - { token: 'keyword.auth_dbm.apacheconf', - regex: '\\b(?:AuthDBMAuthoritative|AuthDBMGroupFile|AuthDBMType|AuthDBMUserFile)\\b' }, - { token: 'keyword.auth_digest.apacheconf', - regex: '\\b(?:AuthDigestAlgorithm|AuthDigestDomain|AuthDigestFile|AuthDigestGroupFile|AuthDigestNcCheck|AuthDigestNonceFormat|AuthDigestNonceLifetime|AuthDigestQop|AuthDigestShmemSize)\\b' }, - { token: 'keyword.auth_ldap.apacheconf', - regex: '\\b(?:AuthLDAPAuthoritative|AuthLDAPBindDN|AuthLDAPBindPassword|AuthLDAPCharsetConfig|AuthLDAPCompareDNOnServer|AuthLDAPDereferenceAliases|AuthLDAPEnabled|AuthLDAPFrontPageHack|AuthLDAPGroupAttribute|AuthLDAPGroupAttributeIsDN|AuthLDAPRemoteUserIsDN|AuthLDAPUrl)\\b' }, - { token: 'keyword.autoindex.apacheconf', - regex: '\\b(?:AddAlt|AddAltByEncoding|AddAltByType|AddDescription|AddIcon|AddIconByEncoding|AddIconByType|DefaultIcon|HeaderName|IndexIgnore|IndexOptions|IndexOrderDefault|ReadmeName)\\b' }, - { token: 'keyword.cache.apacheconf', - regex: '\\b(?:CacheDefaultExpire|CacheDisable|CacheEnable|CacheForceCompletion|CacheIgnoreCacheControl|CacheIgnoreHeaders|CacheIgnoreNoLastMod|CacheLastModifiedFactor|CacheMaxExpire)\\b' }, - { token: 'keyword.cern_meta.apacheconf', - regex: '\\b(?:MetaDir|MetaFiles|MetaSuffix)\\b' }, - { token: 'keyword.cgi.apacheconf', - regex: '\\b(?:ScriptLog|ScriptLogBuffer|ScriptLogLength)\\b' }, - { token: 'keyword.cgid.apacheconf', - regex: '\\b(?:ScriptLog|ScriptLogBuffer|ScriptLogLength|ScriptSock)\\b' }, - { token: 'keyword.charset_lite.apacheconf', - regex: '\\b(?:CharsetDefault|CharsetOptions|CharsetSourceEnc)\\b' }, - { token: 'keyword.dav.apacheconf', - regex: '\\b(?:Dav|DavDepthInfinity|DavMinTimeout|DavLockDB)\\b' }, - { token: 'keyword.deflate.apacheconf', - regex: '\\b(?:DeflateBufferSize|DeflateCompressionLevel|DeflateFilterNote|DeflateMemLevel|DeflateWindowSize)\\b' }, - { token: 'keyword.dir.apacheconf', - regex: '\\b(?:DirectoryIndex|DirectorySlash)\\b' }, - { token: 'keyword.disk_cache.apacheconf', - regex: '\\b(?:CacheDirLength|CacheDirLevels|CacheExpiryCheck|CacheGcClean|CacheGcDaily|CacheGcInterval|CacheGcMemUsage|CacheGcUnused|CacheMaxFileSize|CacheMinFileSize|CacheRoot|CacheSize|CacheTimeMargin)\\b' }, - { token: 'keyword.dumpio.apacheconf', - regex: '\\b(?:DumpIOInput|DumpIOOutput)\\b' }, - { token: 'keyword.env.apacheconf', - regex: '\\b(?:PassEnv|SetEnv|UnsetEnv)\\b' }, - { token: 'keyword.expires.apacheconf', - regex: '\\b(?:ExpiresActive|ExpiresByType|ExpiresDefault)\\b' }, - { token: 'keyword.ext_filter.apacheconf', - regex: '\\b(?:ExtFilterDefine|ExtFilterOptions)\\b' }, - { token: 'keyword.file_cache.apacheconf', - regex: '\\b(?:CacheFile|MMapFile)\\b' }, - { token: 'keyword.headers.apacheconf', - regex: '\\b(?:Header|RequestHeader)\\b' }, - { token: 'keyword.imap.apacheconf', - regex: '\\b(?:ImapBase|ImapDefault|ImapMenu)\\b' }, - { token: 'keyword.include.apacheconf', - regex: '\\b(?:SSIEndTag|SSIErrorMsg|SSIStartTag|SSITimeFormat|SSIUndefinedEcho|XBitHack)\\b' }, - { token: 'keyword.isapi.apacheconf', - regex: '\\b(?:ISAPIAppendLogToErrors|ISAPIAppendLogToQuery|ISAPICacheFile|ISAPIFakeAsync|ISAPILogNotSupported|ISAPIReadAheadBuffer)\\b' }, - { token: 'keyword.ldap.apacheconf', - regex: '\\b(?:LDAPCacheEntries|LDAPCacheTTL|LDAPConnectionTimeout|LDAPOpCacheEntries|LDAPOpCacheTTL|LDAPSharedCacheFile|LDAPSharedCacheSize|LDAPTrustedCA|LDAPTrustedCAType)\\b' }, - { token: 'keyword.log.apacheconf', - regex: '\\b(?:BufferedLogs|CookieLog|CustomLog|LogFormat|TransferLog|ForensicLog)\\b' }, - { token: 'keyword.mem_cache.apacheconf', - regex: '\\b(?:MCacheMaxObjectCount|MCacheMaxObjectSize|MCacheMaxStreamingBuffer|MCacheMinObjectSize|MCacheRemovalAlgorithm|MCacheSize)\\b' }, - { token: 'keyword.mime.apacheconf', - regex: '\\b(?:AddCharset|AddEncoding|AddHandler|AddInputFilter|AddLanguage|AddOutputFilter|AddType|DefaultLanguage|ModMimeUsePathInfo|MultiviewsMatch|RemoveCharset|RemoveEncoding|RemoveHandler|RemoveInputFilter|RemoveLanguage|RemoveOutputFilter|RemoveType|TypesConfig)\\b' }, - { token: 'keyword.misc.apacheconf', - regex: '\\b(?:ProtocolEcho|Example|AddModuleInfo|MimeMagicFile|CheckSpelling|ExtendedStatus|SuexecUserGroup|UserDir)\\b' }, - { token: 'keyword.negotiation.apacheconf', - regex: '\\b(?:CacheNegotiatedDocs|ForceLanguagePriority|LanguagePriority)\\b' }, - { token: 'keyword.nw_ssl.apacheconf', - regex: '\\b(?:NWSSLTrustedCerts|NWSSLUpgradeable|SecureListen)\\b' }, - { token: 'keyword.proxy.apacheconf', - regex: '\\b(?:AllowCONNECT|NoProxy|ProxyBadHeader|ProxyBlock|ProxyDomain|ProxyErrorOverride|ProxyFtpDirCharset|ProxyIOBufferSize|ProxyMaxForwards|ProxyPass|ProxyPassReverse|ProxyPreserveHost|ProxyReceiveBufferSize|ProxyRemote|ProxyRemoteMatch|ProxyRequests|ProxyTimeout|ProxyVia)\\b' }, - { token: 'keyword.rewrite.apacheconf', - regex: '\\b(?:RewriteBase|RewriteCond|RewriteEngine|RewriteLock|RewriteLog|RewriteLogLevel|RewriteMap|RewriteOptions|RewriteRule)\\b' }, - { token: 'keyword.setenvif.apacheconf', - regex: '\\b(?:BrowserMatch|BrowserMatchNoCase|SetEnvIf|SetEnvIfNoCase)\\b' }, - { token: 'keyword.so.apacheconf', - regex: '\\b(?:LoadFile|LoadModule)\\b' }, - { token: 'keyword.ssl.apacheconf', - regex: '\\b(?:SSLCACertificateFile|SSLCACertificatePath|SSLCARevocationFile|SSLCARevocationPath|SSLCertificateChainFile|SSLCertificateFile|SSLCertificateKeyFile|SSLCipherSuite|SSLEngine|SSLMutex|SSLOptions|SSLPassPhraseDialog|SSLProtocol|SSLProxyCACertificateFile|SSLProxyCACertificatePath|SSLProxyCARevocationFile|SSLProxyCARevocationPath|SSLProxyCipherSuite|SSLProxyEngine|SSLProxyMachineCertificateFile|SSLProxyMachineCertificatePath|SSLProxyProtocol|SSLProxyVerify|SSLProxyVerifyDepth|SSLRandomSeed|SSLRequire|SSLRequireSSL|SSLSessionCache|SSLSessionCacheTimeout|SSLUserName|SSLVerifyClient|SSLVerifyDepth)\\b' }, - { token: 'keyword.usertrack.apacheconf', - regex: '\\b(?:CookieDomain|CookieExpires|CookieName|CookieStyle|CookieTracking)\\b' }, - { token: 'keyword.vhost_alias.apacheconf', - regex: '\\b(?:VirtualDocumentRoot|VirtualDocumentRootIP|VirtualScriptAlias|VirtualScriptAliasIP)\\b' }, - { token: - [ 'keyword.php.apacheconf', - 'text', - 'entity.property.apacheconf', - 'text', - 'string.value.apacheconf', - 'text' ], - regex: '\\b(php_value|php_flag)\\b(?:(\\s+)(.+?)(?:(\\s+)(.+?))?)?(\\s)' }, - { token: - [ 'punctuation.variable.apacheconf', - 'variable.env.apacheconf', - 'variable.misc.apacheconf', - 'punctuation.variable.apacheconf' ], - regex: '(%\\{)(?:(HTTP_USER_AGENT|HTTP_REFERER|HTTP_COOKIE|HTTP_FORWARDED|HTTP_HOST|HTTP_PROXY_CONNECTION|HTTP_ACCEPT|REMOTE_ADDR|REMOTE_HOST|REMOTE_PORT|REMOTE_USER|REMOTE_IDENT|REQUEST_METHOD|SCRIPT_FILENAME|PATH_INFO|QUERY_STRING|AUTH_TYPE|DOCUMENT_ROOT|SERVER_ADMIN|SERVER_NAME|SERVER_ADDR|SERVER_PORT|SERVER_PROTOCOL|SERVER_SOFTWARE|TIME_YEAR|TIME_MON|TIME_DAY|TIME_HOUR|TIME_MIN|TIME_SEC|TIME_WDAY|TIME|API_VERSION|THE_REQUEST|REQUEST_URI|REQUEST_FILENAME|IS_SUBREQ|HTTPS)|(.*?))(\\})' }, - { token: [ 'entity.mime-type.apacheconf', 'text' ], - regex: '\\b((?:text|image|application|video|audio)/.+?)(\\s)' }, - { token: 'entity.helper.apacheconf', - regex: '\\b(?:from|unset|set|on|off)\\b', - caseInsensitive: true }, - { token: 'constant.integer.apacheconf', regex: '\\b\\d+\\b' }, - { token: - [ 'text', - 'punctuation.definition.flag.apacheconf', - 'string.flag.apacheconf', - 'punctuation.definition.flag.apacheconf', - 'text' ], - regex: '(\\s)(\\[)(.*?)(\\])(\\s)' } ] } - - this.normalizeRules(); -}; - -ApacheConfHighlightRules.metaData = { fileTypes: - [ 'conf', - 'CONF', - 'htaccess', - 'HTACCESS', - 'htgroups', - 'HTGROUPS', - 'htpasswd', - 'HTPASSWD', - '.htaccess', - '.HTACCESS', - '.htgroups', - '.HTGROUPS', - '.htpasswd', - '.HTPASSWD' ], - name: 'Apache Conf', - scopeName: 'source.apacheconf' } - - -oop.inherits(ApacheConfHighlightRules, TextHighlightRules); - -exports.ApacheConfHighlightRules = ApacheConfHighlightRules; -}); \ No newline at end of file diff --git a/lib/ace/mode/applescript.js b/lib/ace/mode/applescript.js deleted file mode 100644 index 81bc3533..00000000 --- a/lib/ace/mode/applescript.js +++ /dev/null @@ -1,55 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var AppleScriptHighlightRules = require("./applescript_highlight_rules").AppleScriptHighlightRules; -// TODO: pick appropriate fold mode -var FoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = AppleScriptHighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "--"; - this.blockComment = {start: "(*", end: "*)"}; - this.$id = "ace/mode/applescript"; - // Extra logic goes here. -}).call(Mode.prototype); - -exports.Mode = Mode; -}); diff --git a/lib/ace/mode/applescript_highlight_rules.js b/lib/ace/mode/applescript_highlight_rules.js deleted file mode 100644 index d830d780..00000000 --- a/lib/ace/mode/applescript_highlight_rules.js +++ /dev/null @@ -1,139 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var AppleScriptHighlightRules = function() { - // regexp must not have capturing parentheses. Use (?:) instead. - // regexps are ordered -> the first match is used - var keywords = ( - "about|above|after|against|and|around|as|at|back|before|beginning|" + - "behind|below|beneath|beside|between|but|by|considering|" + - "contain|contains|continue|copy|div|does|eighth|else|end|equal|" + - "equals|error|every|exit|fifth|first|for|fourth|from|front|" + - "get|given|global|if|ignoring|in|into|is|it|its|last|local|me|" + - "middle|mod|my|ninth|not|of|on|onto|or|over|prop|property|put|ref|" + - "reference|repeat|returning|script|second|set|seventh|since|" + - "sixth|some|tell|tenth|that|the|then|third|through|thru|" + - "timeout|times|to|transaction|try|until|where|while|whose|with|without" - ); - - var builtinConstants = ( - "AppleScript|false|linefeed|return|pi|quote|result|space|tab|true" - ); - - var builtinFunctions = ( - "activate|beep|count|delay|launch|log|offset|read|round|run|say|" + - "summarize|write" - ); - - var builtinTypes = ( - "alias|application|boolean|class|constant|date|file|integer|list|" + - "number|real|record|string|text|character|characters|contents|day|" + - "frontmost|id|item|length|month|name|paragraph|paragraphs|rest|" + - "reverse|running|time|version|weekday|word|words|year" - ); - - var keywordMapper = this.createKeywordMapper({ - "support.function": builtinFunctions, - "constant.language": builtinConstants, - "support.type": builtinTypes, - "keyword": keywords - }, "identifier"); - - this.$rules = { - "start": [ - { - token: "comment", - regex: "--.*$" - }, - { - token : "comment", // multi line comment - regex : "\\(\\*", - next : "comment" - }, - { - token: "string", // " string - regex: '".*?"' - }, - { - token: "support.type", - regex: '\\b(POSIX file|POSIX path|(date|time) string|quoted form)\\b' - }, - { - token: "support.function", - regex: '\\b(clipboard info|the clipboard|info for|list (disks|folder)|' + - 'mount volume|path to|(close|open for) access|(get|set) eof|' + - 'current date|do shell script|get volume settings|random number|' + - 'set volume|system attribute|system info|time to GMT|' + - '(load|run|store) script|scripting components|' + - 'ASCII (character|number)|localized string|' + - 'choose (application|color|file|file name|' + - 'folder|from list|remote application|URL)|' + - 'display (alert|dialog))\\b|^\\s*return\\b' - }, - { - token: "constant.language", - regex: '\\b(text item delimiters|current application|missing value)\\b' - }, - { - token: "keyword", - regex: '\\b(apart from|aside from|instead of|out of|greater than|' + - "isn't|(doesn't|does not) (equal|come before|come after|contain)|" + - '(greater|less) than( or equal)?|(starts?|ends|begins?) with|' + - 'contained by|comes (before|after)|a (ref|reference))\\b' - }, - { - token: keywordMapper, - regex: "[a-zA-Z][a-zA-Z0-9_]*\\b" - } - ], - "comment": [ - { - token: "comment", // closing comment - regex: "\\*\\)", - next: "start" - }, { - defaultToken: "comment" - } - ] - } - - this.normalizeRules(); -}; - -oop.inherits(AppleScriptHighlightRules, TextHighlightRules); - -exports.AppleScriptHighlightRules = AppleScriptHighlightRules; -}); diff --git a/lib/ace/mode/asciidoc.js b/lib/ace/mode/asciidoc.js deleted file mode 100644 index 894d9763..00000000 --- a/lib/ace/mode/asciidoc.js +++ /dev/null @@ -1,64 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var AsciidocHighlightRules = require("./asciidoc_highlight_rules").AsciidocHighlightRules; -var AsciidocFoldMode = require("./folding/asciidoc").FoldMode; - -var Mode = function() { - this.HighlightRules = AsciidocHighlightRules; - - this.foldingRules = new AsciidocFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.type = "text"; - this.getNextLineIndent = function(state, line, tab) { - if (state == "listblock") { - var match = /^((?:.+)?)([-+*][ ]+)/.exec(line); - if (match) { - return new Array(match[1].length + 1).join(" ") + match[2]; - } else { - return ""; - } - } else { - return this.$getIndent(line); - } - }; - this.$id = "ace/mode/asciidoc"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); diff --git a/lib/ace/mode/asciidoc_highlight_rules.js b/lib/ace/mode/asciidoc_highlight_rules.js deleted file mode 100644 index c0d1a305..00000000 --- a/lib/ace/mode/asciidoc_highlight_rules.js +++ /dev/null @@ -1,234 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var AsciidocHighlightRules = function() { - var identifierRe = "[a-zA-Z\u00a1-\uffff]+\\b"; - - this.$rules = { - "start": [ - {token: "empty", regex: /$/}, - {token: "literal", regex: /^\.{4,}\s*$/, next: "listingBlock"}, - {token: "literal", regex: /^-{4,}\s*$/, next: "literalBlock"}, - {token: "string", regex: /^\+{4,}\s*$/, next: "passthroughBlock"}, - {token: "keyword", regex: /^={4,}\s*$/}, - {token: "text", regex: /^\s*$/}, - // immediately return to the start mode without matching anything - {token: "empty", regex: "", next: "dissallowDelimitedBlock"} - ], - - "dissallowDelimitedBlock": [ - {include: "paragraphEnd"}, - {token: "comment", regex: '^//.+$'}, - {token: "keyword", regex: "^(?:NOTE|TIP|IMPORTANT|WARNING|CAUTION):"}, - - {include: "listStart"}, - {token: "literal", regex: /^\s+.+$/, next: "indentedBlock"}, - {token: "empty", regex: "", next: "text"} - ], - - "paragraphEnd": [ - {token: "doc.comment", regex: /^\/{4,}\s*$/, next: "commentBlock"}, - {token: "tableBlock", regex: /^\s*[|!]=+\s*$/, next: "tableBlock"}, - // open block, ruller - {token: "keyword", regex: /^(?:--|''')\s*$/, next: "start"}, - {token: "option", regex: /^\[.*\]\s*$/, next: "start"}, - {token: "pageBreak", regex: /^>{3,}$/, next: "start"}, - {token: "literal", regex: /^\.{4,}\s*$/, next: "listingBlock"}, - {token: "titleUnderline", regex: /^(?:={2,}|-{2,}|~{2,}|\^{2,}|\+{2,})\s*$/, next: "start"}, - {token: "singleLineTitle", regex: /^={1,5}\s+\S.*$/, next: "start"}, - - {token: "otherBlock", regex: /^(?:\*{2,}|_{2,})\s*$/, next: "start"}, - // .optional title - {token: "optionalTitle", regex: /^\.[^.\s].+$/, next: "start"} - ], - - "listStart": [ - {token: "keyword", regex: /^\s*(?:\d+\.|[a-zA-Z]\.|[ixvmIXVM]+\)|\*{1,5}|-|\.{1,5})\s/, next: "listText"}, - {token: "meta.tag", regex: /^.+(?::{2,4}|;;)(?: |$)/, next: "listText"}, - {token: "support.function.list.callout", regex: /^(?:<\d+>|\d+>|>) /, next: "text"}, - // continuation - {token: "keyword", regex: /^\+\s*$/, next: "start"} - ], - - "text": [ - {token: ["link", "variable.language"], regex: /((?:https?:\/\/|ftp:\/\/|file:\/\/|mailto:|callto:)[^\s\[]+)(\[.*?\])/}, - {token: "link", regex: /(?:https?:\/\/|ftp:\/\/|file:\/\/|mailto:|callto:)[^\s\[]+/}, - {token: "link", regex: /\b[\w\.\/\-]+@[\w\.\/\-]+\b/}, - {include: "macros"}, - {include: "paragraphEnd"}, - {token: "literal", regex:/\+{3,}/, next:"smallPassthrough"}, - {token: "escape", regex: /\((?:C|TM|R)\)|\.{3}|->|<-|=>|<=|&#(?:\d+|x[a-fA-F\d]+);|(?: |^)--(?=\s+\S)/}, - {token: "escape", regex: /\\[_*'`+#]|\\{2}[_*'`+#]{2}/}, - {token: "keyword", regex: /\s\+$/}, - // any word - {token: "text", regex: identifierRe}, - {token: ["keyword", "string", "keyword"], - regex: /(<<[\w\d\-$]+,)(.*?)(>>|$)/}, - {token: "keyword", regex: /<<[\w\d\-$]+,?|>>/}, - {token: "constant.character", regex: /\({2,3}.*?\){2,3}/}, - // Anchor - {token: "keyword", regex: /\[\[.+?\]\]/}, - // bibliography - {token: "support", regex: /^\[{3}[\w\d =\-]+\]{3}/}, - - {include: "quotes"}, - // text block end - {token: "empty", regex: /^\s*$/, next: "start"} - ], - - "listText": [ - {include: "listStart"}, - {include: "text"} - ], - - "indentedBlock": [ - {token: "literal", regex: /^[\s\w].+$/, next: "indentedBlock"}, - {token: "literal", regex: "", next: "start"} - ], - - "listingBlock": [ - {token: "literal", regex: /^\.{4,}\s*$/, next: "dissallowDelimitedBlock"}, - {token: "constant.numeric", regex: '<\\d+>'}, - {token: "literal", regex: '[^<]+'}, - {token: "literal", regex: '<'} - ], - "literalBlock": [ - {token: "literal", regex: /^-{4,}\s*$/, next: "dissallowDelimitedBlock"}, - {token: "constant.numeric", regex: '<\\d+>'}, - {token: "literal", regex: '[^<]+'}, - {token: "literal", regex: '<'} - ], - "passthroughBlock": [ - {token: "literal", regex: /^\+{4,}\s*$/, next: "dissallowDelimitedBlock"}, - {token: "literal", regex: identifierRe + "|\\d+"}, - {include: "macros"}, - {token: "literal", regex: "."} - ], - - "smallPassthrough": [ - {token: "literal", regex: /[+]{3,}/, next: "dissallowDelimitedBlock"}, - {token: "literal", regex: /^\s*$/, next: "dissallowDelimitedBlock"}, - {token: "literal", regex: identifierRe + "|\\d+"}, - {include: "macros"} - ], - - "commentBlock": [ - {token: "doc.comment", regex: /^\/{4,}\s*$/, next: "dissallowDelimitedBlock"}, - {token: "doc.comment", regex: '^.*$'} - ], - "tableBlock": [ - {token: "tableBlock", regex: /^\s*\|={3,}\s*$/, next: "dissallowDelimitedBlock"}, - {token: "tableBlock", regex: /^\s*!={3,}\s*$/, next: "innerTableBlock"}, - {token: "tableBlock", regex: /\|/}, - {include: "text", noEscape: true} - ], - "innerTableBlock": [ - {token: "tableBlock", regex: /^\s*!={3,}\s*$/, next: "tableBlock"}, - {token: "tableBlock", regex: /^\s*|={3,}\s*$/, next: "dissallowDelimitedBlock"}, - {token: "tableBlock", regex: /\!/} - ], - "macros": [ - {token: "macro", regex: /{[\w\-$]+}/}, - {token: ["text", "string", "text", "constant.character", "text"], regex: /({)([\w\-$]+)(:)?(.+)?(})/}, - {token: ["text", "markup.list.macro", "keyword", "string"], regex: /(\w+)(footnote(?:ref)?::?)([^\s\[]+)?(\[.*?\])?/}, - {token: ["markup.list.macro", "keyword", "string"], regex: /([a-zA-Z\-][\w\.\/\-]*::?)([^\s\[]+)(\[.*?\])?/}, - {token: ["markup.list.macro", "keyword"], regex: /([a-zA-Z\-][\w\.\/\-]+::?)(\[.*?\])/}, - {token: "keyword", regex: /^:.+?:(?= |$)/} - ], - - "quotes": [ - {token: "string.italic", regex: /__[^_\s].*?__/}, - {token: "string.italic", regex: quoteRule("_")}, - - {token: "keyword.bold", regex: /\*\*[^*\s].*?\*\*/}, - {token: "keyword.bold", regex: quoteRule("\\*")}, - - {token: "literal", regex: quoteRule("\\+")}, - {token: "literal", regex: /\+\+[^+\s].*?\+\+/}, - {token: "literal", regex: /\$\$.+?\$\$/}, - {token: "literal", regex: quoteRule("`")}, - - {token: "keyword", regex: quoteRule("^")}, - {token: "keyword", regex: quoteRule("~")}, - {token: "keyword", regex: /##?/}, - {token: "keyword", regex: /(?:\B|^)``|\b''/} - ] - - }; - - function quoteRule(ch) { - var prefix = /\w/.test(ch) ? "\\b" : "(?:\\B|^)"; - return prefix + ch + "[^" + ch + "].*?" + ch + "(?![\\w*])"; - } - - //addQuoteBlock("text") - - var tokenMap = { - macro: "constant.character", - tableBlock: "doc.comment", - titleUnderline: "markup.heading", - singleLineTitle: "markup.heading", - pageBreak: "string", - option: "string.regexp", - otherBlock: "markup.list", - literal: "support.function", - optionalTitle: "constant.numeric", - escape: "constant.language.escape", - link: "markup.underline.list" - }; - - for (var state in this.$rules) { - var stateRules = this.$rules[state]; - for (var i = stateRules.length; i--; ) { - var rule = stateRules[i]; - if (rule.include || typeof rule == "string") { - var args = [i, 1].concat(this.$rules[rule.include || rule]); - if (rule.noEscape) { - args = args.filter(function(x) { - return !x.next; - }); - } - stateRules.splice.apply(stateRules, args); - } else if (rule.token in tokenMap) { - rule.token = tokenMap[rule.token]; - } - } - } -}; -oop.inherits(AsciidocHighlightRules, TextHighlightRules); - -exports.AsciidocHighlightRules = AsciidocHighlightRules; -}); diff --git a/lib/ace/mode/assembly_x86.js b/lib/ace/mode/assembly_x86.js deleted file mode 100644 index d6343e80..00000000 --- a/lib/ace/mode/assembly_x86.js +++ /dev/null @@ -1,56 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * ***** END LICENSE BLOCK ***** */ - -/* - THIS FILE WAS AUTOGENERATED BY mode.tmpl.js -*/ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var AssemblyX86HighlightRules = require("./assembly_x86_highlight_rules").AssemblyX86HighlightRules; -var FoldMode = require("./folding/coffee").FoldMode; - -var Mode = function() { - this.HighlightRules = AssemblyX86HighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = ";"; - this.$id = "ace/mode/assembly_x86"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); \ No newline at end of file diff --git a/lib/ace/mode/assembly_x86_highlight_rules.js b/lib/ace/mode/assembly_x86_highlight_rules.js deleted file mode 100644 index 247d1d0c..00000000 --- a/lib/ace/mode/assembly_x86_highlight_rules.js +++ /dev/null @@ -1,114 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -/* This file was autogenerated from Assembly x86.tmLanguage (uuid: ) */ -/**************************************************************************************** - * IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. * - * fileTypes * - ****************************************************************************************/ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var AssemblyX86HighlightRules = function() { - // regexp must not have capturing parentheses. Use (?:) instead. - // regexps are ordered -> the first match is used - - this.$rules = { start: - [ { token: 'keyword.control.assembly', - regex: '\\b(?:aaa|aad|aam|aas|adc|add|addpd|addps|addsd|addss|addsubpd|addsubps|aesdec|aesdeclast|aesenc|aesenclast|aesimc|aeskeygenassist|and|andpd|andps|andnpd|andnps|arpl|blendpd|blendps|blendvpd|blendvps|bound|bsf|bsr|bswap|bt|btc|btr|bts|cbw|cwde|cdqe|clc|cld|cflush|clts|cmc|cmov(?:n?e|ge?|ae?|le?|be?|n?o|n?z)|cmp|cmppd|cmpps|cmps|cnpsb|cmpsw|cmpsd|cmpsq|cmpss|cmpxchg|cmpxchg8b|cmpxchg16b|comisd|comiss|cpuid|crc32|cvtdq2pd|cvtdq2ps|cvtpd2dq|cvtpd2pi|cvtpd2ps|cvtpi2pd|cvtpi2ps|cvtps2dq|cvtps2pd|cvtps2pi|cvtsd2si|cvtsd2ss|cvts2sd|cvtsi2ss|cvtss2sd|cvtss2si|cvttpd2dq|cvtpd2pi|cvttps2dq|cvttps2pi|cvttps2dq|cvttps2pi|cvttsd2si|cvttss2si|cwd|cdq|cqo|daa|das|dec|div|divpd|divps|divsd|divss|dppd|dpps|emms|enter|extractps|f2xm1|fabs|fadd|faddp|fiadd|fbld|fbstp|fchs|fclex|fnclex|fcmov(?:n?e|ge?|ae?|le?|be?|n?o|n?z)|fcom|fcmop|fcompp|fcomi|fcomip|fucomi|fucomip|fcos|fdecstp|fdiv|fdivp|fidiv|fdivr|fdivrp|fidivr|ffree|ficom|ficomp|fild|fincstp|finit|fnint|fist|fistp|fisttp|fld|fld1|fldl2t|fldl2e|fldpi|fldlg2|fldln2|fldz|fldcw|fldenv|fmul|fmulp|fimul|fnop|fpatan|fprem|fprem1|fptan|frndint|frstor|fsave|fnsave|fscale|fsin|fsincos|fsqrt|fst|fstp|fstcw|fnstcw|fstenv|fnstenv|fsts|fnstsw|fsub|fsubp|fisub|fsubr|fsubrp|fisubr|ftst|fucom|fucomp|fucompp|fxam|fxch|fxrstor|fxsave|fxtract|fyl2x|fyl2xp1|haddpd|haddps|husbpd|hsubps|idiv|imul|in|inc|ins|insb|insw|insd|insertps|int|into|invd|invplg|invpcid|iret|iretd|iretq|lahf|lar|lddqu|ldmxcsr|lds|les|lfs|lgs|lss|lea|leave|lfence|lgdt|lidt|llgdt|lmsw|lock|lods|lodsb|lodsw|lodsd|lodsq|lsl|ltr|maskmovdqu|maskmovq|maxpd|maxps|maxsd|maxss|mfence|minpd|minps|minsd|minss|monitor|mov|movapd|movaps|movbe|movd|movq|movddup|movdqa|movdqu|movq2q|movhlps|movhpd|movhps|movlhps|movlpd|movlps|movmskpd|movmskps|movntdqa|movntdq|movnti|movntpd|movntps|movntq|movq|movq2dq|movs|movsb|movsw|movsd|movsq|movsd|movshdup|movsldup|movss|movsx|movsxd|movupd|movups|movzx|mpsadbw|mul|mulpd|mulps|mulsd|mulss|mwait|neg|not|or|orpd|orps|out|outs|outsb|outsw|outsd|pabsb|pabsw|pabsd|packsswb|packssdw|packusdw|packuswbpaddb|paddw|paddd|paddq|paddsb|paddsw|paddusb|paddusw|palignr|pand|pandn|pause|pavgb|pavgw|pblendvb|pblendw|pclmulqdq|pcmpeqb|pcmpeqw|pcmpeqd|pcmpeqq|pcmpestri|pcmpestrm|pcmptb|pcmptgw|pcmpgtd|pcmpgtq|pcmpistri|pcmpisrm|pextrb|pextrd|pextrq|pextrw|phaddw|phaddd|phaddsw|phinposuw|phsubw|phsubd|phsubsw|pinsrb|pinsrd|pinsrq|pinsrw|pmaddubsw|pmadddwd|pmaxsb|pmaxsd|pmaxsw|pmaxsw|pmaxub|pmaxud|pmaxuw|pminsb|pminsd|pminsw|pminub|pminud|pminuw|pmovmskb|pmovsx|pmovzx|pmuldq|pmulhrsw|pmulhuw|pmulhw|pmulld|pmullw|pmuludw|pop|popa|popad|popcnt|popf|popfd|popfq|por|prefetch|psadbw|pshufb|pshufd|pshufhw|pshuflw|pshufw|psignb|psignw|psignd|pslldq|psllw|pslld|psllq|psraw|psrad|psrldq|psrlw|psrld|psrlq|psubb|psubw|psubd|psubq|psubsb|psubsw|psubusb|psubusw|test|ptest|punpckhbw|punpckhwd|punpckhdq|punpckhddq|punpcklbw|punpcklwd|punpckldq|punpckldqd|push|pusha|pushad|pushf|pushfd|pxor|prcl|rcr|rol|ror|rcpps|rcpss|rdfsbase|rdgsbase|rdmsr|rdpmc|rdrand|rdtsc|rdtscp|rep|repe|repz|repne|repnz|roundpd|roundps|roundsd|roundss|rsm|rsqrps|rsqrtss|sahf|sal|sar|shl|shr|sbb|scas|scasb|scasw|scasd|set(?:n?e|ge?|ae?|le?|be?|n?o|n?z)|sfence|sgdt|shld|shrd|shufpd|shufps|sidt|sldt|smsw|sqrtpd|sqrtps|sqrtsd|sqrtss|stc|std|stmxcsr|stos|stosb|stosw|stosd|stosq|str|sub|subpd|subps|subsd|subss|swapgs|syscall|sysenter|sysexit|sysret|teset|ucomisd|ucomiss|ud2|unpckhpd|unpckhps|unpcklpd|unpcklps|vbroadcast|vcvtph2ps|vcvtp2sph|verr|verw|vextractf128|vinsertf128|vmaskmov|vpermilpd|vpermilps|vperm2f128|vtestpd|vtestps|vzeroall|vzeroupper|wait|fwait|wbinvd|wrfsbase|wrgsbase|wrmsr|xadd|xchg|xgetbv|xlat|xlatb|xor|xorpd|xorps|xrstor|xsave|xsaveopt|xsetbv|lzcnt|extrq|insertq|movntsd|movntss|vfmaddpd|vfmaddps|vfmaddsd|vfmaddss|vfmaddsubbpd|vfmaddsubps|vfmsubaddpd|vfmsubaddps|vfmsubpd|vfmsubps|vfmsubsd|vfnmaddpd|vfnmaddps|vfnmaddsd|vfnmaddss|vfnmsubpd|vfnmusbps|vfnmusbsd|vfnmusbss|cvt|xor|cli|sti|hlt|nop|lock|wait|enter|leave|ret|loop(?:n?e|n?z)?|call|j(?:mp|n?e|ge?|ae?|le?|be?|n?o|n?z))\\b', - caseInsensitive: true }, - { token: 'variable.parameter.register.assembly', - regex: '\\b(?:CS|DS|ES|FS|GS|SS|RAX|EAX|RBX|EBX|RCX|ECX|RDX|EDX|RCX|RIP|EIP|IP|RSP|ESP|SP|RSI|ESI|SI|RDI|EDI|DI|RFLAGS|EFLAGS|FLAGS|R8-15|(?:Y|X)MM(?:[0-9]|10|11|12|13|14|15)|(?:A|B|C|D)(?:X|H|L)|CR(?:[0-4]|DR(?:[0-7]|TR6|TR7|EFER)))\\b', - caseInsensitive: true }, - { token: 'constant.character.decimal.assembly', - regex: '\\b[0-9]+\\b' }, - { token: 'constant.character.hexadecimal.assembly', - regex: '\\b0x[A-F0-9]+\\b', - caseInsensitive: true }, - { token: 'constant.character.hexadecimal.assembly', - regex: '\\b[A-F0-9]+h\\b', - caseInsensitive: true }, - { token: 'string.assembly', regex: /'([^\\']|\\.)*'/ }, - { token: 'string.assembly', regex: /"([^\\"]|\\.)*"/ }, - { token: 'support.function.directive.assembly', - regex: '^\\[', - push: - [ { token: 'support.function.directive.assembly', - regex: '\\]$', - next: 'pop' }, - { defaultToken: 'support.function.directive.assembly' } ] }, - { token: - [ 'support.function.directive.assembly', - 'support.function.directive.assembly', - 'entity.name.function.assembly' ], - regex: '(^struc)( )([_a-zA-Z][_a-zA-Z0-9]*)' }, - { token: 'support.function.directive.assembly', - regex: '^endstruc\\b' }, - { token: - [ 'support.function.directive.assembly', - 'entity.name.function.assembly', - 'support.function.directive.assembly', - 'constant.character.assembly' ], - regex: '^(%macro )([_a-zA-Z][_a-zA-Z0-9]*)( )([0-9]+)' }, - { token: 'support.function.directive.assembly', - regex: '^%endmacro' }, - { token: - [ 'text', - 'support.function.directive.assembly', - 'text', - 'entity.name.function.assembly' ], - regex: '(\\s*)(%define|%xdefine|%idefine|%undef|%assign|%defstr|%strcat|%strlen|%substr|%00|%0|%rotate|%rep|%endrep|%include|\\$\\$|\\$|%unmacro|%if|%elif|%else|%endif|%(?:el)?ifdef|%(?:el)?ifmacro|%(?:el)?ifctx|%(?:el)?ifidn|%(?:el)?ifidni|%(?:el)?ifid|%(?:el)?ifnum|%(?:el)?ifstr|%(?:el)?iftoken|%(?:el)?ifempty|%(?:el)?ifenv|%pathsearch|%depend|%use|%push|%pop|%repl|%arg|%stacksize|%local|%error|%warning|%fatal|%line|%!|%comment|%endcomment|__NASM_VERSION_ID__|__NASM_VER__|__FILE__|__LINE__|__BITS__|__OUTPUT_FORMAT__|__DATE__|__TIME__|__DATE_NUM__|_TIME__NUM__|__UTC_DATE__|__UTC_TIME__|__UTC_DATE_NUM__|__UTC_TIME_NUM__|__POSIX_TIME__|__PASS__|ISTRUC|AT|IEND|BITS 16|BITS 32|BITS 64|USE16|USE32|__SECT__|ABSOLUTE|EXTERN|GLOBAL|COMMON|CPU|FLOAT)\\b( ?)((?:[_a-zA-Z][_a-zA-Z0-9]*)?)', - caseInsensitive: true }, - { token: 'support.function.directive.assembly', - regex: '\\b(?:d[bwdqtoy]|res[bwdqto]|equ|times|align|alignb|sectalign|section|ptr|byte|word|dword|qword|incbin)\\b', - caseInsensitive: true }, - { token: 'entity.name.function.assembly', regex: '^\\s*%%[\\w.]+?:$' }, - { token: 'entity.name.function.assembly', regex: '^\\s*%\\$[\\w.]+?:$' }, - { token: 'entity.name.function.assembly', regex: '^[\\w.]+?:' }, - { token: 'entity.name.function.assembly', regex: '^[\\w.]+?\\b' }, - { token: 'comment.assembly', regex: ';.*$' } ] - } - - this.normalizeRules(); -}; - -AssemblyX86HighlightRules.metaData = { fileTypes: [ 'asm' ], - name: 'Assembly x86', - scopeName: 'source.assembly' } - - -oop.inherits(AssemblyX86HighlightRules, TextHighlightRules); - -exports.AssemblyX86HighlightRules = AssemblyX86HighlightRules; -}); \ No newline at end of file diff --git a/lib/ace/mode/autohotkey.js b/lib/ace/mode/autohotkey.js deleted file mode 100644 index d7093fd5..00000000 --- a/lib/ace/mode/autohotkey.js +++ /dev/null @@ -1,57 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -/* - THIS FILE WAS AUTOGENERATED BY mode.tmpl.js -*/ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var AutoHotKeyHighlightRules = require("./autohotkey_highlight_rules").AutoHotKeyHighlightRules; -// TODO: pick appropriate fold mode -var FoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = AutoHotKeyHighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = ";"; - this.blockComment = {start: "/*", end: "*/"}; - this.$id = "ace/mode/autohotkey"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); \ No newline at end of file diff --git a/lib/ace/mode/autohotkey_highlight_rules.js b/lib/ace/mode/autohotkey_highlight_rules.js deleted file mode 100644 index 45193996..00000000 --- a/lib/ace/mode/autohotkey_highlight_rules.js +++ /dev/null @@ -1,107 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -/* This file was autogenerated from C:\Users\LED\Desktop\AutoHotKey.tmLanguage (uuid: ) */ -/**************************************************************************************** - * IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. * - * fileTypes * - ****************************************************************************************/ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var AutoHotKeyHighlightRules = function() { - var autoItKeywords = 'And|ByRef|Case|Const|ContinueCase|ContinueLoop|Default|Dim|Do|Else|ElseIf|EndFunc|EndIf|EndSelect|EndSwitch|EndWith|Enum|Exit|ExitLoop|False|For|Func|Global|If|In|Local|Next|Not|Or|ReDim|Return|Select|Step|Switch|Then|To|True|Until|WEnd|While|With|' + - 'Abs|ACos|AdlibDisable|AdlibEnable|Asc|AscW|ASin|Assign|ATan|AutoItSetOption|AutoItWinGetTitle|AutoItWinSetTitle|Beep|Binary|BinaryLen|BinaryMid|BinaryToString|BitAND|BitNOT|BitOR|BitRotate|BitShift|BitXOR|BlockInput|Break|Call|CDTray|Ceiling|Chr|ChrW|ClipGet|ClipPut|ConsoleRead|ConsoleWrite|ConsoleWriteError|ControlClick|ControlCommand|ControlDisable|ControlEnable|ControlFocus|ControlGetFocus|ControlGetHandle|ControlGetPos|ControlGetText|ControlHide|ControlListView|ControlMove|ControlSend|ControlSetText|ControlShow|ControlTreeView|Cos|Dec|DirCopy|DirCreate|DirGetSize|DirMove|DirRemove|DllCall|DllCallbackFree|DllCallbackGetPtr|DllCallbackRegister|DllClose|DllOpen|DllStructCreate|DllStructGetData|DllStructGetPtr|DllStructGetSize|DllStructSetData|DriveGetDrive|DriveGetFileSystem|DriveGetLabel|DriveGetSerial|DriveGetType|DriveMapAdd|DriveMapDel|DriveMapGet|DriveSetLabel|DriveSpaceFree|DriveSpaceTotal|DriveStatus|EnvGet|EnvSet|EnvUpdate|Eval|Execute|Exp|FileChangeDir|FileClose|FileCopy|FileCreateNTFSLink|FileCreateShortcut|FileDelete|FileExists|FileFindFirstFile|FileFindNextFile|FileGetAttrib|FileGetLongName|FileGetShortcut|FileGetShortName|FileGetSize|FileGetTime|FileGetVersion|FileInstall|FileMove|FileOpen|FileOpenDialog|FileRead|FileReadLine|FileRecycle|FileRecycleEmpty|FileSaveDialog|FileSelectFolder|FileSetAttrib|FileSetTime|FileWrite|FileWriteLine|Floor|FtpSetProxy|GUICreate|GUICtrlCreateAvi|GUICtrlCreateButton|GUICtrlCreateCheckbox|GUICtrlCreateCombo|GUICtrlCreateContextMenu|GUICtrlCreateDate|GUICtrlCreateDummy|GUICtrlCreateEdit|GUICtrlCreateGraphic|GUICtrlCreateGroup|GUICtrlCreateIcon|GUICtrlCreateInput|GUICtrlCreateLabel|GUICtrlCreateList|GUICtrlCreateListView|GUICtrlCreateListViewItem|GUICtrlCreateMenu|GUICtrlCreateMenuItem|GUICtrlCreateMonthCal|GUICtrlCreateObj|GUICtrlCreatePic|GUICtrlCreateProgress|GUICtrlCreateRadio|GUICtrlCreateSlider|GUICtrlCreateTab|GUICtrlCreateTabItem|GUICtrlCreateTreeView|GUICtrlCreateTreeViewItem|GUICtrlCreateUpdown|GUICtrlDelete|GUICtrlGetHandle|GUICtrlGetState|GUICtrlRead|GUICtrlRecvMsg|GUICtrlRegisterListViewSort|GUICtrlSendMsg|GUICtrlSendToDummy|GUICtrlSetBkColor|GUICtrlSetColor|GUICtrlSetCursor|GUICtrlSetData|GUICtrlSetFont|GUICtrlSetDefColor|GUICtrlSetDefBkColor|GUICtrlSetGraphic|GUICtrlSetImage|GUICtrlSetLimit|GUICtrlSetOnEvent|GUICtrlSetPos|GUICtrlSetResizing|GUICtrlSetState|GUICtrlSetStyle|GUICtrlSetTip|GUIDelete|GUIGetCursorInfo|GUIGetMsg|GUIGetStyle|GUIRegisterMsg|GUISetAccelerators()|GUISetBkColor|GUISetCoord|GUISetCursor|GUISetFont|GUISetHelp|GUISetIcon|GUISetOnEvent|GUISetState|GUISetStyle|GUIStartGroup|GUISwitch|Hex|HotKeySet|HttpSetProxy|HWnd|InetGet|InetGetSize|IniDelete|IniRead|IniReadSection|IniReadSectionNames|IniRenameSection|IniWrite|IniWriteSection|InputBox|Int|IsAdmin|IsArray|IsBinary|IsBool|IsDeclared|IsDllStruct|IsFloat|IsHWnd|IsInt|IsKeyword|IsNumber|IsObj|IsPtr|IsString|Log|MemGetStats|Mod|MouseClick|MouseClickDrag|MouseDown|MouseGetCursor|MouseGetPos|MouseMove|MouseUp|MouseWheel|MsgBox|Number|ObjCreate|ObjEvent|ObjGet|ObjName|Opt|Ping|PixelChecksum|PixelGetColor|PixelSearch|PluginClose|PluginOpen|ProcessClose|ProcessExists|ProcessGetStats|ProcessList|ProcessSetPriority|ProcessWait|ProcessWaitClose|ProgressOff|ProgressOn|ProgressSet|Ptr|Random|RegDelete|RegEnumKey|RegEnumVal|RegRead|RegWrite|Round|Run|RunAs|RunAsWait|RunWait|Send|SendKeepActive|SetError|SetExtended|ShellExecute|ShellExecuteWait|Shutdown|Sin|Sleep|SoundPlay|SoundSetWaveVolume|SplashImageOn|SplashOff|SplashTextOn|Sqrt|SRandom|StatusbarGetText|StderrRead|StdinWrite|StdioClose|StdoutRead|String|StringAddCR|StringCompare|StringFormat|StringInStr|StringIsAlNum|StringIsAlpha|StringIsASCII|StringIsDigit|StringIsFloat|StringIsInt|StringIsLower|StringIsSpace|StringIsUpper|StringIsXDigit|StringLeft|StringLen|StringLower|StringMid|StringRegExp|StringRegExpReplace|StringReplace|StringRight|StringSplit|StringStripCR|StringStripWS|StringToBinary|StringTrimLeft|StringTrimRight|StringUpper|Tan|TCPAccept|TCPCloseSocket|TCPConnect|TCPListen|TCPNameToIP|TCPRecv|TCPSend|TCPShutdown|TCPStartup|TimerDiff|TimerInit|ToolTip|TrayCreateItem|TrayCreateMenu|TrayGetMsg|TrayItemDelete|TrayItemGetHandle|TrayItemGetState|TrayItemGetText|TrayItemSetOnEvent|TrayItemSetState|TrayItemSetText|TraySetClick|TraySetIcon|TraySetOnEvent|TraySetPauseIcon|TraySetState|TraySetToolTip|TrayTip|UBound|UDPBind|UDPCloseSocket|UDPOpen|UDPRecv|UDPSend|UDPShutdown|UDPStartup|VarGetType|WinActivate|WinActive|WinClose|WinExists|WinFlash|WinGetCaretPos|WinGetClassList|WinGetClientSize|WinGetHandle|WinGetPos|WinGetProcess|WinGetState|WinGetText|WinGetTitle|WinKill|WinList|WinMenuSelectItem|WinMinimizeAll|WinMinimizeAllUndo|WinMove|WinSetOnTop|WinSetState|WinSetTitle|WinSetTrans|WinWait|WinWaitActive|WinWaitClose|WinWaitNotActive|' + - 'ArrayAdd|ArrayBinarySearch|ArrayConcatenate|ArrayDelete|ArrayDisplay|ArrayFindAll|ArrayInsert|ArrayMax|ArrayMaxIndex|ArrayMin|ArrayMinIndex|ArrayPop|ArrayPush|ArrayReverse|ArraySearch|ArraySort|ArraySwap|ArrayToClip|ArrayToString|ArrayTrim|ChooseColor|ChooseFont|ClipBoard_ChangeChain|ClipBoard_Close|ClipBoard_CountFormats|ClipBoard_Empty|ClipBoard_EnumFormats|ClipBoard_FormatStr|ClipBoard_GetData|ClipBoard_GetDataEx|ClipBoard_GetFormatName|ClipBoard_GetOpenWindow|ClipBoard_GetOwner|ClipBoard_GetPriorityFormat|ClipBoard_GetSequenceNumber|ClipBoard_GetViewer|ClipBoard_IsFormatAvailable|ClipBoard_Open|ClipBoard_RegisterFormat|ClipBoard_SetData|ClipBoard_SetDataEx|ClipBoard_SetViewer|ClipPutFile|ColorConvertHSLtoRGB|ColorConvertRGBtoHSL|ColorGetBlue|ColorGetGreen|ColorGetRed|Date_Time_CompareFileTime|Date_Time_DOSDateTimeToArray|Date_Time_DOSDateTimeToFileTime|Date_Time_DOSDateTimeToStr|Date_Time_DOSDateToArray|Date_Time_DOSDateToStr|Date_Time_DOSTimeToArray|Date_Time_DOSTimeToStr|Date_Time_EncodeFileTime|Date_Time_EncodeSystemTime|Date_Time_FileTimeToArray|Date_Time_FileTimeToDOSDateTime|Date_Time_FileTimeToLocalFileTime|Date_Time_FileTimeToStr|Date_Time_FileTimeToSystemTime|Date_Time_GetFileTime|Date_Time_GetLocalTime|Date_Time_GetSystemTime|Date_Time_GetSystemTimeAdjustment|Date_Time_GetSystemTimeAsFileTime|Date_Time_GetSystemTimes|Date_Time_GetTickCount|Date_Time_GetTimeZoneInformation|Date_Time_LocalFileTimeToFileTime|Date_Time_SetFileTime|Date_Time_SetLocalTime|Date_Time_SetSystemTime|Date_Time_SetSystemTimeAdjustment|Date_Time_SetTimeZoneInformation|Date_Time_SystemTimeToArray|Date_Time_SystemTimeToDateStr|Date_Time_SystemTimeToDateTimeStr|Date_Time_SystemTimeToFileTime|Date_Time_SystemTimeToTimeStr|Date_Time_SystemTimeToTzSpecificLocalTime|Date_Time_TzSpecificLocalTimeToSystemTime|DateAdd|DateDayOfWeek|DateDaysInMonth|DateDiff|DateIsLeapYear|DateIsValid|DateTimeFormat|DateTimeSplit|DateToDayOfWeek|DateToDayOfWeekISO|DateToDayValue|DateToMonth|DayValueToDate|DebugBugReportEnv|DebugOut|DebugSetup|Degree|EventLog__Backup|EventLog__Clear|EventLog__Close|EventLog__Count|EventLog__DeregisterSource|EventLog__Full|EventLog__Notify|EventLog__Oldest|EventLog__Open|EventLog__OpenBackup|EventLog__Read|EventLog__RegisterSource|EventLog__Report|FileCountLines|FileCreate|FileListToArray|FilePrint|FileReadToArray|FileWriteFromArray|FileWriteLog|FileWriteToLine|GDIPlus_ArrowCapCreate|GDIPlus_ArrowCapDispose|GDIPlus_ArrowCapGetFillState|GDIPlus_ArrowCapGetHeight|GDIPlus_ArrowCapGetMiddleInset|GDIPlus_ArrowCapGetWidth|GDIPlus_ArrowCapSetFillState|GDIPlus_ArrowCapSetHeight|GDIPlus_ArrowCapSetMiddleInset|GDIPlus_ArrowCapSetWidth|GDIPlus_BitmapCloneArea|GDIPlus_BitmapCreateFromFile|GDIPlus_BitmapCreateFromGraphics|GDIPlus_BitmapCreateFromHBITMAP|GDIPlus_BitmapCreateHBITMAPFromBitmap|GDIPlus_BitmapDispose|GDIPlus_BitmapLockBits|GDIPlus_BitmapUnlockBits|GDIPlus_BrushClone|GDIPlus_BrushCreateSolid|GDIPlus_BrushDispose|GDIPlus_BrushGetType|GDIPlus_CustomLineCapDispose|GDIPlus_Decoders|GDIPlus_DecodersGetCount|GDIPlus_DecodersGetSize|GDIPlus_Encoders|GDIPlus_EncodersGetCLSID|GDIPlus_EncodersGetCount|GDIPlus_EncodersGetParamList|GDIPlus_EncodersGetParamListSize|GDIPlus_EncodersGetSize|GDIPlus_FontCreate|GDIPlus_FontDispose|GDIPlus_FontFamilyCreate|GDIPlus_FontFamilyDispose|GDIPlus_GraphicsClear|GDIPlus_GraphicsCreateFromHDC|GDIPlus_GraphicsCreateFromHWND|GDIPlus_GraphicsDispose|GDIPlus_GraphicsDrawArc|GDIPlus_GraphicsDrawBezier|GDIPlus_GraphicsDrawClosedCurve|GDIPlus_GraphicsDrawCurve|GDIPlus_GraphicsDrawEllipse|GDIPlus_GraphicsDrawImage|GDIPlus_GraphicsDrawImageRect|GDIPlus_GraphicsDrawImageRectRect|GDIPlus_GraphicsDrawLine|GDIPlus_GraphicsDrawPie|GDIPlus_GraphicsDrawPolygon|GDIPlus_GraphicsDrawRect|GDIPlus_GraphicsDrawString|GDIPlus_GraphicsDrawStringEx|GDIPlus_GraphicsFillClosedCurve|GDIPlus_GraphicsFillEllipse|GDIPlus_GraphicsFillPie|GDIPlus_GraphicsFillRect|GDIPlus_GraphicsGetDC|GDIPlus_GraphicsGetSmoothingMode|GDIPlus_GraphicsMeasureString|GDIPlus_GraphicsReleaseDC|GDIPlus_GraphicsSetSmoothingMode|GDIPlus_GraphicsSetTransform|GDIPlus_ImageDispose|GDIPlus_ImageGetGraphicsContext|GDIPlus_ImageGetHeight|GDIPlus_ImageGetWidth|GDIPlus_ImageLoadFromFile|GDIPlus_ImageSaveToFile|GDIPlus_ImageSaveToFileEx|GDIPlus_MatrixCreate|GDIPlus_MatrixDispose|GDIPlus_MatrixRotate|GDIPlus_ParamAdd|GDIPlus_ParamInit|GDIPlus_PenCreate|GDIPlus_PenDispose|GDIPlus_PenGetAlignment|GDIPlus_PenGetColor|GDIPlus_PenGetCustomEndCap|GDIPlus_PenGetDashCap|GDIPlus_PenGetDashStyle|GDIPlus_PenGetEndCap|GDIPlus_PenGetWidth|GDIPlus_PenSetAlignment|GDIPlus_PenSetColor|GDIPlus_PenSetCustomEndCap|GDIPlus_PenSetDashCap|GDIPlus_PenSetDashStyle|GDIPlus_PenSetEndCap|GDIPlus_PenSetWidth|GDIPlus_RectFCreate|GDIPlus_Shutdown|GDIPlus_Startup|GDIPlus_StringFormatCreate|GDIPlus_StringFormatDispose|GetIP|GUICtrlAVI_Close|GUICtrlAVI_Create|GUICtrlAVI_Destroy|GUICtrlAVI_Open|GUICtrlAVI_OpenEx|GUICtrlAVI_Play|GUICtrlAVI_Seek|GUICtrlAVI_Show|GUICtrlAVI_Stop|GUICtrlButton_Click|GUICtrlButton_Create|GUICtrlButton_Destroy|GUICtrlButton_Enable|GUICtrlButton_GetCheck|GUICtrlButton_GetFocus|GUICtrlButton_GetIdealSize|GUICtrlButton_GetImage|GUICtrlButton_GetImageList|GUICtrlButton_GetState|GUICtrlButton_GetText|GUICtrlButton_GetTextMargin|GUICtrlButton_SetCheck|GUICtrlButton_SetFocus|GUICtrlButton_SetImage|GUICtrlButton_SetImageList|GUICtrlButton_SetSize|GUICtrlButton_SetState|GUICtrlButton_SetStyle|GUICtrlButton_SetText|GUICtrlButton_SetTextMargin|GUICtrlButton_Show|GUICtrlComboBox_AddDir|GUICtrlComboBox_AddString|GUICtrlComboBox_AutoComplete|GUICtrlComboBox_BeginUpdate|GUICtrlComboBox_Create|GUICtrlComboBox_DeleteString|GUICtrlComboBox_Destroy|GUICtrlComboBox_EndUpdate|GUICtrlComboBox_FindString|GUICtrlComboBox_FindStringExact|GUICtrlComboBox_GetComboBoxInfo|GUICtrlComboBox_GetCount|GUICtrlComboBox_GetCurSel|GUICtrlComboBox_GetDroppedControlRect|GUICtrlComboBox_GetDroppedControlRectEx|GUICtrlComboBox_GetDroppedState|GUICtrlComboBox_GetDroppedWidth|GUICtrlComboBox_GetEditSel|GUICtrlComboBox_GetEditText|GUICtrlComboBox_GetExtendedUI|GUICtrlComboBox_GetHorizontalExtent|GUICtrlComboBox_GetItemHeight|GUICtrlComboBox_GetLBText|GUICtrlComboBox_GetLBTextLen|GUICtrlComboBox_GetList|GUICtrlComboBox_GetListArray|GUICtrlComboBox_GetLocale|GUICtrlComboBox_GetLocaleCountry|GUICtrlComboBox_GetLocaleLang|GUICtrlComboBox_GetLocalePrimLang|GUICtrlComboBox_GetLocaleSubLang|GUICtrlComboBox_GetMinVisible|GUICtrlComboBox_GetTopIndex|GUICtrlComboBox_InitStorage|GUICtrlComboBox_InsertString|GUICtrlComboBox_LimitText|GUICtrlComboBox_ReplaceEditSel|GUICtrlComboBox_ResetContent|GUICtrlComboBox_SelectString|GUICtrlComboBox_SetCurSel|GUICtrlComboBox_SetDroppedWidth|GUICtrlComboBox_SetEditSel|GUICtrlComboBox_SetEditText|GUICtrlComboBox_SetExtendedUI|GUICtrlComboBox_SetHorizontalExtent|GUICtrlComboBox_SetItemHeight|GUICtrlComboBox_SetMinVisible|GUICtrlComboBox_SetTopIndex|GUICtrlComboBox_ShowDropDown|GUICtrlComboBoxEx_AddDir|GUICtrlComboBoxEx_AddString|GUICtrlComboBoxEx_BeginUpdate|GUICtrlComboBoxEx_Create|GUICtrlComboBoxEx_CreateSolidBitMap|GUICtrlComboBoxEx_DeleteString|GUICtrlComboBoxEx_Destroy|GUICtrlComboBoxEx_EndUpdate|GUICtrlComboBoxEx_FindStringExact|GUICtrlComboBoxEx_GetComboBoxInfo|GUICtrlComboBoxEx_GetComboControl|GUICtrlComboBoxEx_GetCount|GUICtrlComboBoxEx_GetCurSel|GUICtrlComboBoxEx_GetDroppedControlRect|GUICtrlComboBoxEx_GetDroppedControlRectEx|GUICtrlComboBoxEx_GetDroppedState|GUICtrlComboBoxEx_GetDroppedWidth|GUICtrlComboBoxEx_GetEditControl|GUICtrlComboBoxEx_GetEditSel|GUICtrlComboBoxEx_GetEditText|GUICtrlComboBoxEx_GetExtendedStyle|GUICtrlComboBoxEx_GetExtendedUI|GUICtrlComboBoxEx_GetImageList|GUICtrlComboBoxEx_GetItem|GUICtrlComboBoxEx_GetItemEx|GUICtrlComboBoxEx_GetItemHeight|GUICtrlComboBoxEx_GetItemImage|GUICtrlComboBoxEx_GetItemIndent|GUICtrlComboBoxEx_GetItemOverlayImage|GUICtrlComboBoxEx_GetItemParam|GUICtrlComboBoxEx_GetItemSelectedImage|GUICtrlComboBoxEx_GetItemText|GUICtrlComboBoxEx_GetItemTextLen|GUICtrlComboBoxEx_GetList|GUICtrlComboBoxEx_GetListArray|GUICtrlComboBoxEx_GetLocale|GUICtrlComboBoxEx_GetLocaleCountry|GUICtrlComboBoxEx_GetLocaleLang|GUICtrlComboBoxEx_GetLocalePrimLang|GUICtrlComboBoxEx_GetLocaleSubLang|GUICtrlComboBoxEx_GetMinVisible|GUICtrlComboBoxEx_GetTopIndex|GUICtrlComboBoxEx_InitStorage|GUICtrlComboBoxEx_InsertString|GUICtrlComboBoxEx_LimitText|GUICtrlComboBoxEx_ReplaceEditSel|GUICtrlComboBoxEx_ResetContent|GUICtrlComboBoxEx_SetCurSel|GUICtrlComboBoxEx_SetDroppedWidth|GUICtrlComboBoxEx_SetEditSel|GUICtrlComboBoxEx_SetEditText|GUICtrlComboBoxEx_SetExtendedStyle|GUICtrlComboBoxEx_SetExtendedUI|GUICtrlComboBoxEx_SetImageList|GUICtrlComboBoxEx_SetItem|GUICtrlComboBoxEx_SetItemEx|GUICtrlComboBoxEx_SetItemHeight|GUICtrlComboBoxEx_SetItemImage|GUICtrlComboBoxEx_SetItemIndent|GUICtrlComboBoxEx_SetItemOverlayImage|GUICtrlComboBoxEx_SetItemParam|GUICtrlComboBoxEx_SetItemSelectedImage|GUICtrlComboBoxEx_SetMinVisible|GUICtrlComboBoxEx_SetTopIndex|GUICtrlComboBoxEx_ShowDropDown|GUICtrlDTP_Create|GUICtrlDTP_Destroy|GUICtrlDTP_GetMCColor|GUICtrlDTP_GetMCFont|GUICtrlDTP_GetMonthCal|GUICtrlDTP_GetRange|GUICtrlDTP_GetRangeEx|GUICtrlDTP_GetSystemTime|GUICtrlDTP_GetSystemTimeEx|GUICtrlDTP_SetFormat|GUICtrlDTP_SetMCColor|GUICtrlDTP_SetMCFont|GUICtrlDTP_SetRange|GUICtrlDTP_SetRangeEx|GUICtrlDTP_SetSystemTime|GUICtrlDTP_SetSystemTimeEx|GUICtrlEdit_AppendText|GUICtrlEdit_BeginUpdate|GUICtrlEdit_CanUndo|GUICtrlEdit_CharFromPos|GUICtrlEdit_Create|GUICtrlEdit_Destroy|GUICtrlEdit_EmptyUndoBuffer|GUICtrlEdit_EndUpdate|GUICtrlEdit_Find|GUICtrlEdit_FmtLines|GUICtrlEdit_GetFirstVisibleLine|GUICtrlEdit_GetLimitText|GUICtrlEdit_GetLine|GUICtrlEdit_GetLineCount|GUICtrlEdit_GetMargins|GUICtrlEdit_GetModify|GUICtrlEdit_GetPasswordChar|GUICtrlEdit_GetRECT|GUICtrlEdit_GetRECTEx|GUICtrlEdit_GetSel|GUICtrlEdit_GetText|GUICtrlEdit_GetTextLen|GUICtrlEdit_HideBalloonTip|GUICtrlEdit_InsertText|GUICtrlEdit_LineFromChar|GUICtrlEdit_LineIndex|GUICtrlEdit_LineLength|GUICtrlEdit_LineScroll|GUICtrlEdit_PosFromChar|GUICtrlEdit_ReplaceSel|GUICtrlEdit_Scroll|GUICtrlEdit_SetLimitText|GUICtrlEdit_SetMargins|GUICtrlEdit_SetModify|GUICtrlEdit_SetPasswordChar|GUICtrlEdit_SetReadOnly|GUICtrlEdit_SetRECT|GUICtrlEdit_SetRECTEx|GUICtrlEdit_SetRECTNP|GUICtrlEdit_SetRectNPEx|GUICtrlEdit_SetSel|GUICtrlEdit_SetTabStops|GUICtrlEdit_SetText|GUICtrlEdit_ShowBalloonTip|GUICtrlEdit_Undo|GUICtrlHeader_AddItem|GUICtrlHeader_ClearFilter|GUICtrlHeader_ClearFilterAll|GUICtrlHeader_Create|GUICtrlHeader_CreateDragImage|GUICtrlHeader_DeleteItem|GUICtrlHeader_Destroy|GUICtrlHeader_EditFilter|GUICtrlHeader_GetBitmapMargin|GUICtrlHeader_GetImageList|GUICtrlHeader_GetItem|GUICtrlHeader_GetItemAlign|GUICtrlHeader_GetItemBitmap|GUICtrlHeader_GetItemCount|GUICtrlHeader_GetItemDisplay|GUICtrlHeader_GetItemFlags|GUICtrlHeader_GetItemFormat|GUICtrlHeader_GetItemImage|GUICtrlHeader_GetItemOrder|GUICtrlHeader_GetItemParam|GUICtrlHeader_GetItemRect|GUICtrlHeader_GetItemRectEx|GUICtrlHeader_GetItemText|GUICtrlHeader_GetItemWidth|GUICtrlHeader_GetOrderArray|GUICtrlHeader_GetUnicodeFormat|GUICtrlHeader_HitTest|GUICtrlHeader_InsertItem|GUICtrlHeader_Layout|GUICtrlHeader_OrderToIndex|GUICtrlHeader_SetBitmapMargin|GUICtrlHeader_SetFilterChangeTimeout|GUICtrlHeader_SetHotDivider|GUICtrlHeader_SetImageList|GUICtrlHeader_SetItem|GUICtrlHeader_SetItemAlign|GUICtrlHeader_SetItemBitmap|GUICtrlHeader_SetItemDisplay|GUICtrlHeader_SetItemFlags|GUICtrlHeader_SetItemFormat|GUICtrlHeader_SetItemImage|GUICtrlHeader_SetItemOrder|GUICtrlHeader_SetItemParam|GUICtrlHeader_SetItemText|GUICtrlHeader_SetItemWidth|GUICtrlHeader_SetOrderArray|GUICtrlHeader_SetUnicodeFormat|GUICtrlIpAddress_ClearAddress|GUICtrlIpAddress_Create|GUICtrlIpAddress_Destroy|GUICtrlIpAddress_Get|GUICtrlIpAddress_GetArray|GUICtrlIpAddress_GetEx|GUICtrlIpAddress_IsBlank|GUICtrlIpAddress_Set|GUICtrlIpAddress_SetArray|GUICtrlIpAddress_SetEx|GUICtrlIpAddress_SetFocus|GUICtrlIpAddress_SetFont|GUICtrlIpAddress_SetRange|GUICtrlIpAddress_ShowHide|GUICtrlListBox_AddFile|GUICtrlListBox_AddString|GUICtrlListBox_BeginUpdate|GUICtrlListBox_Create|GUICtrlListBox_DeleteString|GUICtrlListBox_Destroy|GUICtrlListBox_Dir|GUICtrlListBox_EndUpdate|GUICtrlListBox_FindInText|GUICtrlListBox_FindString|GUICtrlListBox_GetAnchorIndex|GUICtrlListBox_GetCaretIndex|GUICtrlListBox_GetCount|GUICtrlListBox_GetCurSel|GUICtrlListBox_GetHorizontalExtent|GUICtrlListBox_GetItemData|GUICtrlListBox_GetItemHeight|GUICtrlListBox_GetItemRect|GUICtrlListBox_GetItemRectEx|GUICtrlListBox_GetListBoxInfo|GUICtrlListBox_GetLocale|GUICtrlListBox_GetLocaleCountry|GUICtrlListBox_GetLocaleLang|GUICtrlListBox_GetLocalePrimLang|GUICtrlListBox_GetLocaleSubLang|GUICtrlListBox_GetSel|GUICtrlListBox_GetSelCount|GUICtrlListBox_GetSelItems|GUICtrlListBox_GetSelItemsText|GUICtrlListBox_GetText|GUICtrlListBox_GetTextLen|GUICtrlListBox_GetTopIndex|GUICtrlListBox_InitStorage|GUICtrlListBox_InsertString|GUICtrlListBox_ItemFromPoint|GUICtrlListBox_ReplaceString|GUICtrlListBox_ResetContent|GUICtrlListBox_SelectString|GUICtrlListBox_SelItemRange|GUICtrlListBox_SelItemRangeEx|GUICtrlListBox_SetAnchorIndex|GUICtrlListBox_SetCaretIndex|GUICtrlListBox_SetColumnWidth|GUICtrlListBox_SetCurSel|GUICtrlListBox_SetHorizontalExtent|GUICtrlListBox_SetItemData|GUICtrlListBox_SetItemHeight|GUICtrlListBox_SetLocale|GUICtrlListBox_SetSel|GUICtrlListBox_SetTabStops|GUICtrlListBox_SetTopIndex|GUICtrlListBox_Sort|GUICtrlListBox_SwapString|GUICtrlListBox_UpdateHScroll|GUICtrlListView_AddArray|GUICtrlListView_AddColumn|GUICtrlListView_AddItem|GUICtrlListView_AddSubItem|GUICtrlListView_ApproximateViewHeight|GUICtrlListView_ApproximateViewRect|GUICtrlListView_ApproximateViewWidth|GUICtrlListView_Arrange|GUICtrlListView_BeginUpdate|GUICtrlListView_CancelEditLabel|GUICtrlListView_ClickItem|GUICtrlListView_CopyItems|GUICtrlListView_Create|GUICtrlListView_CreateDragImage|GUICtrlListView_CreateSolidBitMap|GUICtrlListView_DeleteAllItems|GUICtrlListView_DeleteColumn|GUICtrlListView_DeleteItem|GUICtrlListView_DeleteItemsSelected|GUICtrlListView_Destroy|GUICtrlListView_DrawDragImage|GUICtrlListView_EditLabel|GUICtrlListView_EnableGroupView|GUICtrlListView_EndUpdate|GUICtrlListView_EnsureVisible|GUICtrlListView_FindInText|GUICtrlListView_FindItem|GUICtrlListView_FindNearest|GUICtrlListView_FindParam|GUICtrlListView_FindText|GUICtrlListView_GetBkColor|GUICtrlListView_GetBkImage|GUICtrlListView_GetCallbackMask|GUICtrlListView_GetColumn|GUICtrlListView_GetColumnCount|GUICtrlListView_GetColumnOrder|GUICtrlListView_GetColumnOrderArray|GUICtrlListView_GetColumnWidth|GUICtrlListView_GetCounterPage|GUICtrlListView_GetEditControl|GUICtrlListView_GetExtendedListViewStyle|GUICtrlListView_GetGroupInfo|GUICtrlListView_GetGroupViewEnabled|GUICtrlListView_GetHeader|GUICtrlListView_GetHotCursor|GUICtrlListView_GetHotItem|GUICtrlListView_GetHoverTime|GUICtrlListView_GetImageList|GUICtrlListView_GetISearchString|GUICtrlListView_GetItem|GUICtrlListView_GetItemChecked|GUICtrlListView_GetItemCount|GUICtrlListView_GetItemCut|GUICtrlListView_GetItemDropHilited|GUICtrlListView_GetItemEx|GUICtrlListView_GetItemFocused|GUICtrlListView_GetItemGroupID|GUICtrlListView_GetItemImage|GUICtrlListView_GetItemIndent|GUICtrlListView_GetItemParam|GUICtrlListView_GetItemPosition|GUICtrlListView_GetItemPositionX|GUICtrlListView_GetItemPositionY|GUICtrlListView_GetItemRect|GUICtrlListView_GetItemRectEx|GUICtrlListView_GetItemSelected|GUICtrlListView_GetItemSpacing|GUICtrlListView_GetItemSpacingX|GUICtrlListView_GetItemSpacingY|GUICtrlListView_GetItemState|GUICtrlListView_GetItemStateImage|GUICtrlListView_GetItemText|GUICtrlListView_GetItemTextArray|GUICtrlListView_GetItemTextString|GUICtrlListView_GetNextItem|GUICtrlListView_GetNumberOfWorkAreas|GUICtrlListView_GetOrigin|GUICtrlListView_GetOriginX|GUICtrlListView_GetOriginY|GUICtrlListView_GetOutlineColor|GUICtrlListView_GetSelectedColumn|GUICtrlListView_GetSelectedCount|GUICtrlListView_GetSelectedIndices|GUICtrlListView_GetSelectionMark|GUICtrlListView_GetStringWidth|GUICtrlListView_GetSubItemRect|GUICtrlListView_GetTextBkColor|GUICtrlListView_GetTextColor|GUICtrlListView_GetToolTips|GUICtrlListView_GetTopIndex|GUICtrlListView_GetUnicodeFormat|GUICtrlListView_GetView|GUICtrlListView_GetViewDetails|GUICtrlListView_GetViewLarge|GUICtrlListView_GetViewList|GUICtrlListView_GetViewRect|GUICtrlListView_GetViewSmall|GUICtrlListView_GetViewTile|GUICtrlListView_HideColumn|GUICtrlListView_HitTest|GUICtrlListView_InsertColumn|GUICtrlListView_InsertGroup|GUICtrlListView_InsertItem|GUICtrlListView_JustifyColumn|GUICtrlListView_MapIDToIndex|GUICtrlListView_MapIndexToID|GUICtrlListView_RedrawItems|GUICtrlListView_RegisterSortCallBack|GUICtrlListView_RemoveAllGroups|GUICtrlListView_RemoveGroup|GUICtrlListView_Scroll|GUICtrlListView_SetBkColor|GUICtrlListView_SetBkImage|GUICtrlListView_SetCallBackMask|GUICtrlListView_SetColumn|GUICtrlListView_SetColumnOrder|GUICtrlListView_SetColumnOrderArray|GUICtrlListView_SetColumnWidth|GUICtrlListView_SetExtendedListViewStyle|GUICtrlListView_SetGroupInfo|GUICtrlListView_SetHotItem|GUICtrlListView_SetHoverTime|GUICtrlListView_SetIconSpacing|GUICtrlListView_SetImageList|GUICtrlListView_SetItem|GUICtrlListView_SetItemChecked|GUICtrlListView_SetItemCount|GUICtrlListView_SetItemCut|GUICtrlListView_SetItemDropHilited|GUICtrlListView_SetItemEx|GUICtrlListView_SetItemFocused|GUICtrlListView_SetItemGroupID|GUICtrlListView_SetItemImage|GUICtrlListView_SetItemIndent|GUICtrlListView_SetItemParam|GUICtrlListView_SetItemPosition|GUICtrlListView_SetItemPosition32|GUICtrlListView_SetItemSelected|GUICtrlListView_SetItemState|GUICtrlListView_SetItemStateImage|GUICtrlListView_SetItemText|GUICtrlListView_SetOutlineColor|GUICtrlListView_SetSelectedColumn|GUICtrlListView_SetSelectionMark|GUICtrlListView_SetTextBkColor|GUICtrlListView_SetTextColor|GUICtrlListView_SetToolTips|GUICtrlListView_SetUnicodeFormat|GUICtrlListView_SetView|GUICtrlListView_SetWorkAreas|GUICtrlListView_SimpleSort|GUICtrlListView_SortItems|GUICtrlListView_SubItemHitTest|GUICtrlListView_UnRegisterSortCallBack|GUICtrlMenu_AddMenuItem|GUICtrlMenu_AppendMenu|GUICtrlMenu_CheckMenuItem|GUICtrlMenu_CheckRadioItem|GUICtrlMenu_CreateMenu|GUICtrlMenu_CreatePopup|GUICtrlMenu_DeleteMenu|GUICtrlMenu_DestroyMenu|GUICtrlMenu_DrawMenuBar|GUICtrlMenu_EnableMenuItem|GUICtrlMenu_FindItem|GUICtrlMenu_FindParent|GUICtrlMenu_GetItemBmp|GUICtrlMenu_GetItemBmpChecked|GUICtrlMenu_GetItemBmpUnchecked|GUICtrlMenu_GetItemChecked|GUICtrlMenu_GetItemCount|GUICtrlMenu_GetItemData|GUICtrlMenu_GetItemDefault|GUICtrlMenu_GetItemDisabled|GUICtrlMenu_GetItemEnabled|GUICtrlMenu_GetItemGrayed|GUICtrlMenu_GetItemHighlighted|GUICtrlMenu_GetItemID|GUICtrlMenu_GetItemInfo|GUICtrlMenu_GetItemRect|GUICtrlMenu_GetItemRectEx|GUICtrlMenu_GetItemState|GUICtrlMenu_GetItemStateEx|GUICtrlMenu_GetItemSubMenu|GUICtrlMenu_GetItemText|GUICtrlMenu_GetItemType|GUICtrlMenu_GetMenu|GUICtrlMenu_GetMenuBackground|GUICtrlMenu_GetMenuBarInfo|GUICtrlMenu_GetMenuContextHelpID|GUICtrlMenu_GetMenuData|GUICtrlMenu_GetMenuDefaultItem|GUICtrlMenu_GetMenuHeight|GUICtrlMenu_GetMenuInfo|GUICtrlMenu_GetMenuStyle|GUICtrlMenu_GetSystemMenu|GUICtrlMenu_InsertMenuItem|GUICtrlMenu_InsertMenuItemEx|GUICtrlMenu_IsMenu|GUICtrlMenu_LoadMenu|GUICtrlMenu_MapAccelerator|GUICtrlMenu_MenuItemFromPoint|GUICtrlMenu_RemoveMenu|GUICtrlMenu_SetItemBitmaps|GUICtrlMenu_SetItemBmp|GUICtrlMenu_SetItemBmpChecked|GUICtrlMenu_SetItemBmpUnchecked|GUICtrlMenu_SetItemChecked|GUICtrlMenu_SetItemData|GUICtrlMenu_SetItemDefault|GUICtrlMenu_SetItemDisabled|GUICtrlMenu_SetItemEnabled|GUICtrlMenu_SetItemGrayed|GUICtrlMenu_SetItemHighlighted|GUICtrlMenu_SetItemID|GUICtrlMenu_SetItemInfo|GUICtrlMenu_SetItemState|GUICtrlMenu_SetItemSubMenu|GUICtrlMenu_SetItemText|GUICtrlMenu_SetItemType|GUICtrlMenu_SetMenu|GUICtrlMenu_SetMenuBackground|GUICtrlMenu_SetMenuContextHelpID|GUICtrlMenu_SetMenuData|GUICtrlMenu_SetMenuDefaultItem|GUICtrlMenu_SetMenuHeight|GUICtrlMenu_SetMenuInfo|GUICtrlMenu_SetMenuStyle|GUICtrlMenu_TrackPopupMenu|GUICtrlMonthCal_Create|GUICtrlMonthCal_Destroy|GUICtrlMonthCal_GetColor|GUICtrlMonthCal_GetColorArray|GUICtrlMonthCal_GetCurSel|GUICtrlMonthCal_GetCurSelStr|GUICtrlMonthCal_GetFirstDOW|GUICtrlMonthCal_GetFirstDOWStr|GUICtrlMonthCal_GetMaxSelCount|GUICtrlMonthCal_GetMaxTodayWidth|GUICtrlMonthCal_GetMinReqHeight|GUICtrlMonthCal_GetMinReqRect|GUICtrlMonthCal_GetMinReqRectArray|GUICtrlMonthCal_GetMinReqWidth|GUICtrlMonthCal_GetMonthDelta|GUICtrlMonthCal_GetMonthRange|GUICtrlMonthCal_GetMonthRangeMax|GUICtrlMonthCal_GetMonthRangeMaxStr|GUICtrlMonthCal_GetMonthRangeMin|GUICtrlMonthCal_GetMonthRangeMinStr|GUICtrlMonthCal_GetMonthRangeSpan|GUICtrlMonthCal_GetRange|GUICtrlMonthCal_GetRangeMax|GUICtrlMonthCal_GetRangeMaxStr|GUICtrlMonthCal_GetRangeMin|GUICtrlMonthCal_GetRangeMinStr|GUICtrlMonthCal_GetSelRange|GUICtrlMonthCal_GetSelRangeMax|GUICtrlMonthCal_GetSelRangeMaxStr|GUICtrlMonthCal_GetSelRangeMin|GUICtrlMonthCal_GetSelRangeMinStr|GUICtrlMonthCal_GetToday|GUICtrlMonthCal_GetTodayStr|GUICtrlMonthCal_GetUnicodeFormat|GUICtrlMonthCal_HitTest|GUICtrlMonthCal_SetColor|GUICtrlMonthCal_SetCurSel|GUICtrlMonthCal_SetDayState|GUICtrlMonthCal_SetFirstDOW|GUICtrlMonthCal_SetMaxSelCount|GUICtrlMonthCal_SetMonthDelta|GUICtrlMonthCal_SetRange|GUICtrlMonthCal_SetSelRange|GUICtrlMonthCal_SetToday|GUICtrlMonthCal_SetUnicodeFormat|GUICtrlRebar_AddBand|GUICtrlRebar_AddToolBarBand|GUICtrlRebar_BeginDrag|GUICtrlRebar_Create|GUICtrlRebar_DeleteBand|GUICtrlRebar_Destroy|GUICtrlRebar_DragMove|GUICtrlRebar_EndDrag|GUICtrlRebar_GetBandBackColor|GUICtrlRebar_GetBandBorders|GUICtrlRebar_GetBandBordersEx|GUICtrlRebar_GetBandChildHandle|GUICtrlRebar_GetBandChildSize|GUICtrlRebar_GetBandCount|GUICtrlRebar_GetBandForeColor|GUICtrlRebar_GetBandHeaderSize|GUICtrlRebar_GetBandID|GUICtrlRebar_GetBandIdealSize|GUICtrlRebar_GetBandLength|GUICtrlRebar_GetBandLParam|GUICtrlRebar_GetBandMargins|GUICtrlRebar_GetBandMarginsEx|GUICtrlRebar_GetBandRect|GUICtrlRebar_GetBandRectEx|GUICtrlRebar_GetBandStyle|GUICtrlRebar_GetBandStyleBreak|GUICtrlRebar_GetBandStyleChildEdge|GUICtrlRebar_GetBandStyleFixedBMP|GUICtrlRebar_GetBandStyleFixedSize|GUICtrlRebar_GetBandStyleGripperAlways|GUICtrlRebar_GetBandStyleHidden|GUICtrlRebar_GetBandStyleHideTitle|GUICtrlRebar_GetBandStyleNoGripper|GUICtrlRebar_GetBandStyleTopAlign|GUICtrlRebar_GetBandStyleUseChevron|GUICtrlRebar_GetBandStyleVariableHeight|GUICtrlRebar_GetBandText|GUICtrlRebar_GetBarHeight|GUICtrlRebar_GetBKColor|GUICtrlRebar_GetColorScheme|GUICtrlRebar_GetRowCount|GUICtrlRebar_GetRowHeight|GUICtrlRebar_GetTextColor|GUICtrlRebar_GetToolTips|GUICtrlRebar_GetUnicodeFormat|GUICtrlRebar_HitTest|GUICtrlRebar_IDToIndex|GUICtrlRebar_MaximizeBand|GUICtrlRebar_MinimizeBand|GUICtrlRebar_MoveBand|GUICtrlRebar_SetBandBackColor|GUICtrlRebar_SetBandForeColor|GUICtrlRebar_SetBandHeaderSize|GUICtrlRebar_SetBandID|GUICtrlRebar_SetBandIdealSize|GUICtrlRebar_SetBandLength|GUICtrlRebar_SetBandLParam|GUICtrlRebar_SetBandStyle|GUICtrlRebar_SetBandStyleBreak|GUICtrlRebar_SetBandStyleChildEdge|GUICtrlRebar_SetBandStyleFixedBMP|GUICtrlRebar_SetBandStyleFixedSize|GUICtrlRebar_SetBandStyleGripperAlways|GUICtrlRebar_SetBandStyleHidden|GUICtrlRebar_SetBandStyleHideTitle|GUICtrlRebar_SetBandStyleNoGripper|GUICtrlRebar_SetBandStyleTopAlign|GUICtrlRebar_SetBandStyleUseChevron|GUICtrlRebar_SetBandStyleVariableHeight|GUICtrlRebar_SetBandText|GUICtrlRebar_SetBKColor|GUICtrlRebar_SetColorScheme|GUICtrlRebar_SetTextColor|GUICtrlRebar_SetToolTips|GUICtrlRebar_SetUnicodeFormat|GUICtrlRebar_ShowBand|GUICtrlSlider_ClearSel|GUICtrlSlider_ClearTics|GUICtrlSlider_Create|GUICtrlSlider_Destroy|GUICtrlSlider_GetBuddy|GUICtrlSlider_GetChannelRect|GUICtrlSlider_GetLineSize|GUICtrlSlider_GetNumTics|GUICtrlSlider_GetPageSize|GUICtrlSlider_GetPos|GUICtrlSlider_GetPTics|GUICtrlSlider_GetRange|GUICtrlSlider_GetRangeMax|GUICtrlSlider_GetRangeMin|GUICtrlSlider_GetSel|GUICtrlSlider_GetSelEnd|GUICtrlSlider_GetSelStart|GUICtrlSlider_GetThumbLength|GUICtrlSlider_GetThumbRect|GUICtrlSlider_GetThumbRectEx|GUICtrlSlider_GetTic|GUICtrlSlider_GetTicPos|GUICtrlSlider_GetToolTips|GUICtrlSlider_GetUnicodeFormat|GUICtrlSlider_SetBuddy|GUICtrlSlider_SetLineSize|GUICtrlSlider_SetPageSize|GUICtrlSlider_SetPos|GUICtrlSlider_SetRange|GUICtrlSlider_SetRangeMax|GUICtrlSlider_SetRangeMin|GUICtrlSlider_SetSel|GUICtrlSlider_SetSelEnd|GUICtrlSlider_SetSelStart|GUICtrlSlider_SetThumbLength|GUICtrlSlider_SetTic|GUICtrlSlider_SetTicFreq|GUICtrlSlider_SetTipSide|GUICtrlSlider_SetToolTips|GUICtrlSlider_SetUnicodeFormat|GUICtrlStatusBar_Create|GUICtrlStatusBar_Destroy|GUICtrlStatusBar_EmbedControl|GUICtrlStatusBar_GetBorders|GUICtrlStatusBar_GetBordersHorz|GUICtrlStatusBar_GetBordersRect|GUICtrlStatusBar_GetBordersVert|GUICtrlStatusBar_GetCount|GUICtrlStatusBar_GetHeight|GUICtrlStatusBar_GetIcon|GUICtrlStatusBar_GetParts|GUICtrlStatusBar_GetRect|GUICtrlStatusBar_GetRectEx|GUICtrlStatusBar_GetText|GUICtrlStatusBar_GetTextFlags|GUICtrlStatusBar_GetTextLength|GUICtrlStatusBar_GetTextLengthEx|GUICtrlStatusBar_GetTipText|GUICtrlStatusBar_GetUnicodeFormat|GUICtrlStatusBar_GetWidth|GUICtrlStatusBar_IsSimple|GUICtrlStatusBar_Resize|GUICtrlStatusBar_SetBkColor|GUICtrlStatusBar_SetIcon|GUICtrlStatusBar_SetMinHeight|GUICtrlStatusBar_SetParts|GUICtrlStatusBar_SetSimple|GUICtrlStatusBar_SetText|GUICtrlStatusBar_SetTipText|GUICtrlStatusBar_SetUnicodeFormat|GUICtrlStatusBar_ShowHide|GUICtrlTab_Create|GUICtrlTab_DeleteAllItems|GUICtrlTab_DeleteItem|GUICtrlTab_DeselectAll|GUICtrlTab_Destroy|GUICtrlTab_FindTab|GUICtrlTab_GetCurFocus|GUICtrlTab_GetCurSel|GUICtrlTab_GetDisplayRect|GUICtrlTab_GetDisplayRectEx|GUICtrlTab_GetExtendedStyle|GUICtrlTab_GetImageList|GUICtrlTab_GetItem|GUICtrlTab_GetItemCount|GUICtrlTab_GetItemImage|GUICtrlTab_GetItemParam|GUICtrlTab_GetItemRect|GUICtrlTab_GetItemRectEx|GUICtrlTab_GetItemState|GUICtrlTab_GetItemText|GUICtrlTab_GetRowCount|GUICtrlTab_GetToolTips|GUICtrlTab_GetUnicodeFormat|GUICtrlTab_HighlightItem|GUICtrlTab_HitTest|GUICtrlTab_InsertItem|GUICtrlTab_RemoveImage|GUICtrlTab_SetCurFocus|GUICtrlTab_SetCurSel|GUICtrlTab_SetExtendedStyle|GUICtrlTab_SetImageList|GUICtrlTab_SetItem|GUICtrlTab_SetItemImage|GUICtrlTab_SetItemParam|GUICtrlTab_SetItemSize|GUICtrlTab_SetItemState|GUICtrlTab_SetItemText|GUICtrlTab_SetMinTabWidth|GUICtrlTab_SetPadding|GUICtrlTab_SetToolTips|GUICtrlTab_SetUnicodeFormat|GUICtrlToolbar_AddBitmap|GUICtrlToolbar_AddButton|GUICtrlToolbar_AddButtonSep|GUICtrlToolbar_AddString|GUICtrlToolbar_ButtonCount|GUICtrlToolbar_CheckButton|GUICtrlToolbar_ClickAccel|GUICtrlToolbar_ClickButton|GUICtrlToolbar_ClickIndex|GUICtrlToolbar_CommandToIndex|GUICtrlToolbar_Create|GUICtrlToolbar_Customize|GUICtrlToolbar_DeleteButton|GUICtrlToolbar_Destroy|GUICtrlToolbar_EnableButton|GUICtrlToolbar_FindToolbar|GUICtrlToolbar_GetAnchorHighlight|GUICtrlToolbar_GetBitmapFlags|GUICtrlToolbar_GetButtonBitmap|GUICtrlToolbar_GetButtonInfo|GUICtrlToolbar_GetButtonInfoEx|GUICtrlToolbar_GetButtonParam|GUICtrlToolbar_GetButtonRect|GUICtrlToolbar_GetButtonRectEx|GUICtrlToolbar_GetButtonSize|GUICtrlToolbar_GetButtonState|GUICtrlToolbar_GetButtonStyle|GUICtrlToolbar_GetButtonText|GUICtrlToolbar_GetColorScheme|GUICtrlToolbar_GetDisabledImageList|GUICtrlToolbar_GetExtendedStyle|GUICtrlToolbar_GetHotImageList|GUICtrlToolbar_GetHotItem|GUICtrlToolbar_GetImageList|GUICtrlToolbar_GetInsertMark|GUICtrlToolbar_GetInsertMarkColor|GUICtrlToolbar_GetMaxSize|GUICtrlToolbar_GetMetrics|GUICtrlToolbar_GetPadding|GUICtrlToolbar_GetRows|GUICtrlToolbar_GetString|GUICtrlToolbar_GetStyle|GUICtrlToolbar_GetStyleAltDrag|GUICtrlToolbar_GetStyleCustomErase|GUICtrlToolbar_GetStyleFlat|GUICtrlToolbar_GetStyleList|GUICtrlToolbar_GetStyleRegisterDrop|GUICtrlToolbar_GetStyleToolTips|GUICtrlToolbar_GetStyleTransparent|GUICtrlToolbar_GetStyleWrapable|GUICtrlToolbar_GetTextRows|GUICtrlToolbar_GetToolTips|GUICtrlToolbar_GetUnicodeFormat|GUICtrlToolbar_HideButton|GUICtrlToolbar_HighlightButton|GUICtrlToolbar_HitTest|GUICtrlToolbar_IndexToCommand|GUICtrlToolbar_InsertButton|GUICtrlToolbar_InsertMarkHitTest|GUICtrlToolbar_IsButtonChecked|GUICtrlToolbar_IsButtonEnabled|GUICtrlToolbar_IsButtonHidden|GUICtrlToolbar_IsButtonHighlighted|GUICtrlToolbar_IsButtonIndeterminate|GUICtrlToolbar_IsButtonPressed|GUICtrlToolbar_LoadBitmap|GUICtrlToolbar_LoadImages|GUICtrlToolbar_MapAccelerator|GUICtrlToolbar_MoveButton|GUICtrlToolbar_PressButton|GUICtrlToolbar_SetAnchorHighlight|GUICtrlToolbar_SetBitmapSize|GUICtrlToolbar_SetButtonBitMap|GUICtrlToolbar_SetButtonInfo|GUICtrlToolbar_SetButtonInfoEx|GUICtrlToolbar_SetButtonParam|GUICtrlToolbar_SetButtonSize|GUICtrlToolbar_SetButtonState|GUICtrlToolbar_SetButtonStyle|GUICtrlToolbar_SetButtonText|GUICtrlToolbar_SetButtonWidth|GUICtrlToolbar_SetCmdID|GUICtrlToolbar_SetColorScheme|GUICtrlToolbar_SetDisabledImageList|GUICtrlToolbar_SetDrawTextFlags|GUICtrlToolbar_SetExtendedStyle|GUICtrlToolbar_SetHotImageList|GUICtrlToolbar_SetHotItem|GUICtrlToolbar_SetImageList|GUICtrlToolbar_SetIndent|GUICtrlToolbar_SetIndeterminate|GUICtrlToolbar_SetInsertMark|GUICtrlToolbar_SetInsertMarkColor|GUICtrlToolbar_SetMaxTextRows|GUICtrlToolbar_SetMetrics|GUICtrlToolbar_SetPadding|GUICtrlToolbar_SetParent|GUICtrlToolbar_SetRows|GUICtrlToolbar_SetStyle|GUICtrlToolbar_SetStyleAltDrag|GUICtrlToolbar_SetStyleCustomErase|GUICtrlToolbar_SetStyleFlat|GUICtrlToolbar_SetStyleList|GUICtrlToolbar_SetStyleRegisterDrop|GUICtrlToolbar_SetStyleToolTips|GUICtrlToolbar_SetStyleTransparent|GUICtrlToolbar_SetStyleWrapable|GUICtrlToolbar_SetToolTips|GUICtrlToolbar_SetUnicodeFormat|GUICtrlToolbar_SetWindowTheme|GUICtrlTreeView_Add|GUICtrlTreeView_AddChild|GUICtrlTreeView_AddChildFirst|GUICtrlTreeView_AddFirst|GUICtrlTreeView_BeginUpdate|GUICtrlTreeView_ClickItem|GUICtrlTreeView_Create|GUICtrlTreeView_CreateDragImage|GUICtrlTreeView_CreateSolidBitMap|GUICtrlTreeView_Delete|GUICtrlTreeView_DeleteAll|GUICtrlTreeView_DeleteChildren|GUICtrlTreeView_Destroy|GUICtrlTreeView_DisplayRect|GUICtrlTreeView_DisplayRectEx|GUICtrlTreeView_EditText|GUICtrlTreeView_EndEdit|GUICtrlTreeView_EndUpdate|GUICtrlTreeView_EnsureVisible|GUICtrlTreeView_Expand|GUICtrlTreeView_ExpandedOnce|GUICtrlTreeView_FindItem|GUICtrlTreeView_FindItemEx|GUICtrlTreeView_GetBkColor|GUICtrlTreeView_GetBold|GUICtrlTreeView_GetChecked|GUICtrlTreeView_GetChildCount|GUICtrlTreeView_GetChildren|GUICtrlTreeView_GetCount|GUICtrlTreeView_GetCut|GUICtrlTreeView_GetDropTarget|GUICtrlTreeView_GetEditControl|GUICtrlTreeView_GetExpanded|GUICtrlTreeView_GetFirstChild|GUICtrlTreeView_GetFirstItem|GUICtrlTreeView_GetFirstVisible|GUICtrlTreeView_GetFocused|GUICtrlTreeView_GetHeight|GUICtrlTreeView_GetImageIndex|GUICtrlTreeView_GetImageListIconHandle|GUICtrlTreeView_GetIndent|GUICtrlTreeView_GetInsertMarkColor|GUICtrlTreeView_GetISearchString|GUICtrlTreeView_GetItemByIndex|GUICtrlTreeView_GetItemHandle|GUICtrlTreeView_GetItemParam|GUICtrlTreeView_GetLastChild|GUICtrlTreeView_GetLineColor|GUICtrlTreeView_GetNext|GUICtrlTreeView_GetNextChild|GUICtrlTreeView_GetNextSibling|GUICtrlTreeView_GetNextVisible|GUICtrlTreeView_GetNormalImageList|GUICtrlTreeView_GetParentHandle|GUICtrlTreeView_GetParentParam|GUICtrlTreeView_GetPrev|GUICtrlTreeView_GetPrevChild|GUICtrlTreeView_GetPrevSibling|GUICtrlTreeView_GetPrevVisible|GUICtrlTreeView_GetScrollTime|GUICtrlTreeView_GetSelected|GUICtrlTreeView_GetSelectedImageIndex|GUICtrlTreeView_GetSelection|GUICtrlTreeView_GetSiblingCount|GUICtrlTreeView_GetState|GUICtrlTreeView_GetStateImageIndex|GUICtrlTreeView_GetStateImageList|GUICtrlTreeView_GetText|GUICtrlTreeView_GetTextColor|GUICtrlTreeView_GetToolTips|GUICtrlTreeView_GetTree|GUICtrlTreeView_GetUnicodeFormat|GUICtrlTreeView_GetVisible|GUICtrlTreeView_GetVisibleCount|GUICtrlTreeView_HitTest|GUICtrlTreeView_HitTestEx|GUICtrlTreeView_HitTestItem|GUICtrlTreeView_Index|GUICtrlTreeView_InsertItem|GUICtrlTreeView_IsFirstItem|GUICtrlTreeView_IsParent|GUICtrlTreeView_Level|GUICtrlTreeView_SelectItem|GUICtrlTreeView_SelectItemByIndex|GUICtrlTreeView_SetBkColor|GUICtrlTreeView_SetBold|GUICtrlTreeView_SetChecked|GUICtrlTreeView_SetCheckedByIndex|GUICtrlTreeView_SetChildren|GUICtrlTreeView_SetCut|GUICtrlTreeView_SetDropTarget|GUICtrlTreeView_SetFocused|GUICtrlTreeView_SetHeight|GUICtrlTreeView_SetIcon|GUICtrlTreeView_SetImageIndex|GUICtrlTreeView_SetIndent|GUICtrlTreeView_SetInsertMark|GUICtrlTreeView_SetInsertMarkColor|GUICtrlTreeView_SetItemHeight|GUICtrlTreeView_SetItemParam|GUICtrlTreeView_SetLineColor|GUICtrlTreeView_SetNormalImageList|GUICtrlTreeView_SetScrollTime|GUICtrlTreeView_SetSelected|GUICtrlTreeView_SetSelectedImageIndex|GUICtrlTreeView_SetState|GUICtrlTreeView_SetStateImageIndex|GUICtrlTreeView_SetStateImageList|GUICtrlTreeView_SetText|GUICtrlTreeView_SetTextColor|GUICtrlTreeView_SetToolTips|GUICtrlTreeView_SetUnicodeFormat|GUICtrlTreeView_Sort|GUIImageList_Add|GUIImageList_AddBitmap|GUIImageList_AddIcon|GUIImageList_AddMasked|GUIImageList_BeginDrag|GUIImageList_Copy|GUIImageList_Create|GUIImageList_Destroy|GUIImageList_DestroyIcon|GUIImageList_DragEnter|GUIImageList_DragLeave|GUIImageList_DragMove|GUIImageList_Draw|GUIImageList_DrawEx|GUIImageList_Duplicate|GUIImageList_EndDrag|GUIImageList_GetBkColor|GUIImageList_GetIcon|GUIImageList_GetIconHeight|GUIImageList_GetIconSize|GUIImageList_GetIconSizeEx|GUIImageList_GetIconWidth|GUIImageList_GetImageCount|GUIImageList_GetImageInfoEx|GUIImageList_Remove|GUIImageList_ReplaceIcon|GUIImageList_SetBkColor|GUIImageList_SetIconSize|GUIImageList_SetImageCount|GUIImageList_Swap|GUIScrollBars_EnableScrollBar|GUIScrollBars_GetScrollBarInfoEx|GUIScrollBars_GetScrollBarRect|GUIScrollBars_GetScrollBarRGState|GUIScrollBars_GetScrollBarXYLineButton|GUIScrollBars_GetScrollBarXYThumbBottom|GUIScrollBars_GetScrollBarXYThumbTop|GUIScrollBars_GetScrollInfo|GUIScrollBars_GetScrollInfoEx|GUIScrollBars_GetScrollInfoMax|GUIScrollBars_GetScrollInfoMin|GUIScrollBars_GetScrollInfoPage|GUIScrollBars_GetScrollInfoPos|GUIScrollBars_GetScrollInfoTrackPos|GUIScrollBars_GetScrollPos|GUIScrollBars_GetScrollRange|GUIScrollBars_Init|GUIScrollBars_ScrollWindow|GUIScrollBars_SetScrollInfo|GUIScrollBars_SetScrollInfoMax|GUIScrollBars_SetScrollInfoMin|GUIScrollBars_SetScrollInfoPage|GUIScrollBars_SetScrollInfoPos|GUIScrollBars_SetScrollRange|GUIScrollBars_ShowScrollBar|GUIToolTip_Activate|GUIToolTip_AddTool|GUIToolTip_AdjustRect|GUIToolTip_BitsToTTF|GUIToolTip_Create|GUIToolTip_DelTool|GUIToolTip_Destroy|GUIToolTip_EnumTools|GUIToolTip_GetBubbleHeight|GUIToolTip_GetBubbleSize|GUIToolTip_GetBubbleWidth|GUIToolTip_GetCurrentTool|GUIToolTip_GetDelayTime|GUIToolTip_GetMargin|GUIToolTip_GetMarginEx|GUIToolTip_GetMaxTipWidth|GUIToolTip_GetText|GUIToolTip_GetTipBkColor|GUIToolTip_GetTipTextColor|GUIToolTip_GetTitleBitMap|GUIToolTip_GetTitleText|GUIToolTip_GetToolCount|GUIToolTip_GetToolInfo|GUIToolTip_HitTest|GUIToolTip_NewToolRect|GUIToolTip_Pop|GUIToolTip_PopUp|GUIToolTip_SetDelayTime|GUIToolTip_SetMargin|GUIToolTip_SetMaxTipWidth|GUIToolTip_SetTipBkColor|GUIToolTip_SetTipTextColor|GUIToolTip_SetTitle|GUIToolTip_SetToolInfo|GUIToolTip_SetWindowTheme|GUIToolTip_ToolExists|GUIToolTip_ToolToArray|GUIToolTip_TrackActivate|GUIToolTip_TrackPosition|GUIToolTip_TTFToBits|GUIToolTip_Update|GUIToolTip_UpdateTipText|HexToString|IE_Example|IE_Introduction|IE_VersionInfo|IEAction|IEAttach|IEBodyReadHTML|IEBodyReadText|IEBodyWriteHTML|IECreate|IECreateEmbedded|IEDocGetObj|IEDocInsertHTML|IEDocInsertText|IEDocReadHTML|IEDocWriteHTML|IEErrorHandlerDeRegister|IEErrorHandlerRegister|IEErrorNotify|IEFormElementCheckBoxSelect|IEFormElementGetCollection|IEFormElementGetObjByName|IEFormElementGetValue|IEFormElementOptionSelect|IEFormElementRadioSelect|IEFormElementSetValue|IEFormGetCollection|IEFormGetObjByName|IEFormImageClick|IEFormReset|IEFormSubmit|IEFrameGetCollection|IEFrameGetObjByName|IEGetObjById|IEGetObjByName|IEHeadInsertEventScript|IEImgClick|IEImgGetCollection|IEIsFrameSet|IELinkClickByIndex|IELinkClickByText|IELinkGetCollection|IELoadWait|IELoadWaitTimeout|IENavigate|IEPropertyGet|IEPropertySet|IEQuit|IETableGetCollection|IETableWriteToArray|IETagNameAllGetCollection|IETagNameGetCollection|Iif|INetExplorerCapable|INetGetSource|INetMail|INetSmtpMail|IsPressed|MathCheckDiv|Max|MemGlobalAlloc|MemGlobalFree|MemGlobalLock|MemGlobalSize|MemGlobalUnlock|MemMoveMemory|MemMsgBox|MemShowError|MemVirtualAlloc|MemVirtualAllocEx|MemVirtualFree|MemVirtualFreeEx|Min|MouseTrap|NamedPipes_CallNamedPipe|NamedPipes_ConnectNamedPipe|NamedPipes_CreateNamedPipe|NamedPipes_CreatePipe|NamedPipes_DisconnectNamedPipe|NamedPipes_GetNamedPipeHandleState|NamedPipes_GetNamedPipeInfo|NamedPipes_PeekNamedPipe|NamedPipes_SetNamedPipeHandleState|NamedPipes_TransactNamedPipe|NamedPipes_WaitNamedPipe|Net_Share_ConnectionEnum|Net_Share_FileClose|Net_Share_FileEnum|Net_Share_FileGetInfo|Net_Share_PermStr|Net_Share_ResourceStr|Net_Share_SessionDel|Net_Share_SessionEnum|Net_Share_SessionGetInfo|Net_Share_ShareAdd|Net_Share_ShareCheck|Net_Share_ShareDel|Net_Share_ShareEnum|Net_Share_ShareGetInfo|Net_Share_ShareSetInfo|Net_Share_StatisticsGetSvr|Net_Share_StatisticsGetWrk|Now|NowCalc|NowCalcDate|NowDate|NowTime|PathFull|PathMake|PathSplit|ProcessGetName|ProcessGetPriority|Radian|ReplaceStringInFile|RunDOS|ScreenCapture_Capture|ScreenCapture_CaptureWnd|ScreenCapture_SaveImage|ScreenCapture_SetBMPFormat|ScreenCapture_SetJPGQuality|ScreenCapture_SetTIFColorDepth|ScreenCapture_SetTIFCompression|Security__AdjustTokenPrivileges|Security__GetAccountSid|Security__GetLengthSid|Security__GetTokenInformation|Security__ImpersonateSelf|Security__IsValidSid|Security__LookupAccountName|Security__LookupAccountSid|Security__LookupPrivilegeValue|Security__OpenProcessToken|Security__OpenThreadToken|Security__OpenThreadTokenEx|Security__SetPrivilege|Security__SidToStringSid|Security__SidTypeStr|Security__StringSidToSid|SendMessage|SendMessageA|SetDate|SetTime|Singleton|SoundClose|SoundLength|SoundOpen|SoundPause|SoundPlay|SoundPos|SoundResume|SoundSeek|SoundStatus|SoundStop|SQLite_Changes|SQLite_Close|SQLite_Display2DResult|SQLite_Encode|SQLite_ErrCode|SQLite_ErrMsg|SQLite_Escape|SQLite_Exec|SQLite_FetchData|SQLite_FetchNames|SQLite_GetTable|SQLite_GetTable2d|SQLite_LastInsertRowID|SQLite_LibVersion|SQLite_Open|SQLite_Query|SQLite_QueryFinalize|SQLite_QueryReset|SQLite_QuerySingleRow|SQLite_SaveMode|SQLite_SetTimeout|SQLite_Shutdown|SQLite_SQLiteExe|SQLite_Startup|SQLite_TotalChanges|StringAddComma|StringBetween|StringEncrypt|StringInsert|StringProper|StringRepeat|StringReverse|StringSplit|StringToHex|TCPIpToName|TempFile|TicksToTime|Timer_Diff|Timer_GetTimerID|Timer_Init|Timer_KillAllTimers|Timer_KillTimer|Timer_SetTimer|TimeToTicks|VersionCompare|viClose|viExecCommand|viFindGpib|viGpibBusReset|viGTL|viOpen|viSetAttribute|viSetTimeout|WeekNumberISO|WinAPI_AttachConsole|WinAPI_AttachThreadInput|WinAPI_Beep|WinAPI_BitBlt|WinAPI_CallNextHookEx|WinAPI_Check|WinAPI_ClientToScreen|WinAPI_CloseHandle|WinAPI_CommDlgExtendedError|WinAPI_CopyIcon|WinAPI_CreateBitmap|WinAPI_CreateCompatibleBitmap|WinAPI_CreateCompatibleDC|WinAPI_CreateEvent|WinAPI_CreateFile|WinAPI_CreateFont|WinAPI_CreateFontIndirect|WinAPI_CreateProcess|WinAPI_CreateSolidBitmap|WinAPI_CreateSolidBrush|WinAPI_CreateWindowEx|WinAPI_DefWindowProc|WinAPI_DeleteDC|WinAPI_DeleteObject|WinAPI_DestroyIcon|WinAPI_DestroyWindow|WinAPI_DrawEdge|WinAPI_DrawFrameControl|WinAPI_DrawIcon|WinAPI_DrawIconEx|WinAPI_DrawText|WinAPI_EnableWindow|WinAPI_EnumDisplayDevices|WinAPI_EnumWindows|WinAPI_EnumWindowsPopup|WinAPI_EnumWindowsTop|WinAPI_ExpandEnvironmentStrings|WinAPI_ExtractIconEx|WinAPI_FatalAppExit|WinAPI_FillRect|WinAPI_FindExecutable|WinAPI_FindWindow|WinAPI_FlashWindow|WinAPI_FlashWindowEx|WinAPI_FloatToInt|WinAPI_FlushFileBuffers|WinAPI_FormatMessage|WinAPI_FrameRect|WinAPI_FreeLibrary|WinAPI_GetAncestor|WinAPI_GetAsyncKeyState|WinAPI_GetClassName|WinAPI_GetClientHeight|WinAPI_GetClientRect|WinAPI_GetClientWidth|WinAPI_GetCurrentProcess|WinAPI_GetCurrentProcessID|WinAPI_GetCurrentThread|WinAPI_GetCurrentThreadId|WinAPI_GetCursorInfo|WinAPI_GetDC|WinAPI_GetDesktopWindow|WinAPI_GetDeviceCaps|WinAPI_GetDIBits|WinAPI_GetDlgCtrlID|WinAPI_GetDlgItem|WinAPI_GetFileSizeEx|WinAPI_GetFocus|WinAPI_GetForegroundWindow|WinAPI_GetIconInfo|WinAPI_GetLastError|WinAPI_GetLastErrorMessage|WinAPI_GetModuleHandle|WinAPI_GetMousePos|WinAPI_GetMousePosX|WinAPI_GetMousePosY|WinAPI_GetObject|WinAPI_GetOpenFileName|WinAPI_GetOverlappedResult|WinAPI_GetParent|WinAPI_GetProcessAffinityMask|WinAPI_GetSaveFileName|WinAPI_GetStdHandle|WinAPI_GetStockObject|WinAPI_GetSysColor|WinAPI_GetSysColorBrush|WinAPI_GetSystemMetrics|WinAPI_GetTextExtentPoint32|WinAPI_GetWindow|WinAPI_GetWindowDC|WinAPI_GetWindowHeight|WinAPI_GetWindowLong|WinAPI_GetWindowRect|WinAPI_GetWindowText|WinAPI_GetWindowThreadProcessId|WinAPI_GetWindowWidth|WinAPI_GetXYFromPoint|WinAPI_GlobalMemStatus|WinAPI_GUIDFromString|WinAPI_GUIDFromStringEx|WinAPI_HiWord|WinAPI_InProcess|WinAPI_IntToFloat|WinAPI_InvalidateRect|WinAPI_IsClassName|WinAPI_IsWindow|WinAPI_IsWindowVisible|WinAPI_LoadBitmap|WinAPI_LoadImage|WinAPI_LoadLibrary|WinAPI_LoadLibraryEx|WinAPI_LoadShell32Icon|WinAPI_LoadString|WinAPI_LocalFree|WinAPI_LoWord|WinAPI_MakeDWord|WinAPI_MAKELANGID|WinAPI_MAKELCID|WinAPI_MakeLong|WinAPI_MessageBeep|WinAPI_Mouse_Event|WinAPI_MoveWindow|WinAPI_MsgBox|WinAPI_MulDiv|WinAPI_MultiByteToWideChar|WinAPI_MultiByteToWideCharEx|WinAPI_OpenProcess|WinAPI_PointFromRect|WinAPI_PostMessage|WinAPI_PrimaryLangId|WinAPI_PtInRect|WinAPI_ReadFile|WinAPI_ReadProcessMemory|WinAPI_RectIsEmpty|WinAPI_RedrawWindow|WinAPI_RegisterWindowMessage|WinAPI_ReleaseCapture|WinAPI_ReleaseDC|WinAPI_ScreenToClient|WinAPI_SelectObject|WinAPI_SetBkColor|WinAPI_SetCapture|WinAPI_SetCursor|WinAPI_SetDefaultPrinter|WinAPI_SetDIBits|WinAPI_SetEvent|WinAPI_SetFocus|WinAPI_SetFont|WinAPI_SetHandleInformation|WinAPI_SetLastError|WinAPI_SetParent|WinAPI_SetProcessAffinityMask|WinAPI_SetSysColors|WinAPI_SetTextColor|WinAPI_SetWindowLong|WinAPI_SetWindowPos|WinAPI_SetWindowsHookEx|WinAPI_SetWindowText|WinAPI_ShowCursor|WinAPI_ShowError|WinAPI_ShowMsg|WinAPI_ShowWindow|WinAPI_StringFromGUID|WinAPI_SubLangId|WinAPI_SystemParametersInfo|WinAPI_TwipsPerPixelX|WinAPI_TwipsPerPixelY|WinAPI_UnhookWindowsHookEx|WinAPI_UpdateLayeredWindow|WinAPI_UpdateWindow|WinAPI_ValidateClassName|WinAPI_WaitForInputIdle|WinAPI_WaitForMultipleObjects|WinAPI_WaitForSingleObject|WinAPI_WideCharToMultiByte|WinAPI_WindowFromPoint|WinAPI_WriteConsole|WinAPI_WriteFile|WinAPI_WriteProcessMemory|WinNet_AddConnection|WinNet_AddConnection2|WinNet_AddConnection3|WinNet_CancelConnection|WinNet_CancelConnection2|WinNet_CloseEnum|WinNet_ConnectionDialog|WinNet_ConnectionDialog1|WinNet_DisconnectDialog|WinNet_DisconnectDialog1|WinNet_EnumResource|WinNet_GetConnection|WinNet_GetConnectionPerformance|WinNet_GetLastError|WinNet_GetNetworkInformation|WinNet_GetProviderName|WinNet_GetResourceInformation|WinNet_GetResourceParent|WinNet_GetUniversalName|WinNet_GetUser|WinNet_OpenEnum|WinNet_RestoreConnection|WinNet_UseConnection|Word_VersionInfo|WordAttach|WordCreate|WordDocAdd|WordDocAddLink|WordDocAddPicture|WordDocClose|WordDocFindReplace|WordDocGetCollection|WordDocLinkGetCollection|WordDocOpen|WordDocPrint|WordDocPropertyGet|WordDocPropertySet|WordDocSave|WordDocSaveAs|WordErrorHandlerDeRegister|WordErrorHandlerRegister|WordErrorNotify|WordMacroRun|WordPropertyGet|WordPropertySet|WordQuit|' + - 'ce|comments-end|comments-start|cs|include|include-once|NoTrayIcon|RequireAdmin|' + - 'AutoIt3Wrapper_Au3Check_Parameters|AutoIt3Wrapper_Au3Check_Stop_OnWarning|AutoIt3Wrapper_Change2CUI|AutoIt3Wrapper_Compression|AutoIt3Wrapper_cvsWrapper_Parameters|AutoIt3Wrapper_Icon|AutoIt3Wrapper_Outfile|AutoIt3Wrapper_Outfile_Type|AutoIt3Wrapper_Plugin_Funcs|AutoIt3Wrapper_Res_Comment|AutoIt3Wrapper_Res_Description|AutoIt3Wrapper_Res_Field|AutoIt3Wrapper_Res_File_Add|AutoIt3Wrapper_Res_Fileversion|AutoIt3Wrapper_Res_FileVersion_AutoIncrement|AutoIt3Wrapper_Res_Icon_Add|AutoIt3Wrapper_Res_Language|AutoIt3Wrapper_Res_LegalCopyright|AutoIt3Wrapper_res_requestedExecutionLevel|AutoIt3Wrapper_Res_SaveSource|AutoIt3Wrapper_Run_After|AutoIt3Wrapper_Run_Au3check|AutoIt3Wrapper_Run_Before|AutoIt3Wrapper_Run_cvsWrapper|AutoIt3Wrapper_Run_Debug_Mode|AutoIt3Wrapper_Run_Obfuscator|AutoIt3Wrapper_Run_Tidy|AutoIt3Wrapper_Tidy_Stop_OnError|AutoIt3Wrapper_UseAnsi|AutoIt3Wrapper_UseUpx|AutoIt3Wrapper_UseX64|AutoIt3Wrapper_Version|EndRegion|forceref|Obfuscator_Ignore_Funcs|Obfuscator_Ignore_Variables|Obfuscator_Parameters|Region|Tidy_Parameters' - var atKeywords = 'AppDataCommonDir|AppDataDir|AutoItExe|AutoItPID|AutoItUnicode|AutoItVersion|AutoItX64|COM_EventObj|CommonFilesDir|Compiled|ComputerName|ComSpec|CR|CRLF|DesktopCommonDir|DesktopDepth|DesktopDir|DesktopHeight|DesktopRefresh|DesktopWidth|DocumentsCommonDir|error|exitCode|exitMethod|extended|FavoritesCommonDir|FavoritesDir|GUI_CtrlHandle|GUI_CtrlId|GUI_DragFile|GUI_DragId|GUI_DropId|GUI_WinHandle|HomeDrive|HomePath|HomeShare|HotKeyPressed|HOUR|InetGetActive|InetGetBytesRead|IPAddress1|IPAddress2|IPAddress3|IPAddress4|KBLayout|LF|LogonDNSDomain|LogonDomain|LogonServer|MDAY|MIN|MON|MyDocumentsDir|NumParams|OSBuild|OSLang|OSServicePack|OSTYPE|OSVersion|ProcessorArch|ProgramFilesDir|ProgramsCommonDir|ProgramsDir|ScriptDir|ScriptFullPath|ScriptLineNumber|ScriptName|SEC|StartMenuCommonDir|StartMenuDir|StartupCommonDir|StartupDir|SW_DISABLE|SW_ENABLE|SW_HIDE|SW_LOCK|SW_MAXIMIZE|SW_MINIMIZE|SW_RESTORE|SW_SHOW|SW_SHOWDEFAULT|SW_SHOWMAXIMIZED|SW_SHOWMINIMIZED|SW_SHOWMINNOACTIVE|SW_SHOWNA|SW_SHOWNOACTIVATE|SW_SHOWNORMAL|SW_UNLOCK|SystemDir|TAB|TempDir|TRAY_ID|TrayIconFlashing|TrayIconVisible|UserName|UserProfileDir|WDAY|WindowsDir|WorkingDir|YDAY|YEAR' - - this.$rules = { start: - [ { token: 'comment.line.ahk', regex: '(?:^| );.*$' }, - { token: 'comment.block.ahk', - regex: '/\\*', push: - [ { token: 'comment.block.ahk', regex: '\\*/', next: 'pop' }, - { defaultToken: 'comment.block.ahk' } ] }, - { token: 'doc.comment.ahk', - regex: '#cs', push: - [ { token: 'doc.comment.ahk', regex: '#ce', next: 'pop' }, - { defaultToken: 'doc.comment.ahk' } ] }, - { token: 'keyword.command.ahk', - regex: '(?:\\b|^)(?:allowsamelinecomments|clipboardtimeout|commentflag|errorstdout|escapechar|hotkeyinterval|hotkeymodifiertimeout|hotstring|include|includeagain|installkeybdhook|installmousehook|keyhistory|ltrim|maxhotkeysperinterval|maxmem|maxthreads|maxthreadsbuffer|maxthreadsperhotkey|noenv|notrayicon|persistent|singleinstance|usehook|winactivateforce|autotrim|blockinput|click|clipwait|continue|control|controlclick|controlfocus|controlget|controlgetfocus|controlgetpos|controlgettext|controlmove|controlsend|controlsendraw|controlsettext|coordmode|critical|detecthiddentext|detecthiddenwindows|drive|driveget|drivespacefree|edit|endrepeat|envadd|envdiv|envget|envmult|envset|envsub|envupdate|exit|exitapp|fileappend|filecopy|filecopydir|filecreatedir|filecreateshortcut|filedelete|filegetattrib|filegetshortcut|filegetsize|filegettime|filegetversion|fileinstall|filemove|filemovedir|fileread|filereadline|filerecycle|filerecycleempty|fileremovedir|fileselectfile|fileselectfolder|filesetattrib|filesettime|formattime|getkeystate|gosub|goto|groupactivate|groupadd|groupclose|groupdeactivate|gui|guicontrol|guicontrolget|hideautoitwin|hotkey|ifequal|ifexist|ifgreater|ifgreaterorequal|ifinstring|ifless|iflessorequal|ifmsgbox|ifnotequal|ifnotexist|ifnotinstring|ifwinactive|ifwinexist|ifwinnotactive|ifwinnotexist|imagesearch|inidelete|iniread|iniwrite|input|inputbox|keyhistory|keywait|listhotkeys|listlines|listvars|menu|mouseclick|mouseclickdrag|mousegetpos|mousemove|msgbox|onexit|outputdebug|pause|pixelgetcolor|pixelsearch|postmessage|process|progress|random|regdelete|regread|regwrite|reload|repeat|run|runas|runwait|send|sendevent|sendinput|sendmode|sendplay|sendmessage|sendraw|setbatchlines|setcapslockstate|setcontroldelay|setdefaultmousespeed|setenv|setformat|setkeydelay|setmousedelay|setnumlockstate|setscrolllockstate|setstorecapslockmode|settimer|settitlematchmode|setwindelay|setworkingdir|shutdown|sleep|sort|soundbeep|soundget|soundgetwavevolume|soundplay|soundset|soundsetwavevolume|splashimage|splashtextoff|splashtexton|splitpath|statusbargettext|statusbarwait|stringcasesense|stringgetpos|stringleft|stringlen|stringlower|stringmid|stringreplace|stringright|stringsplit|stringtrimleft|stringtrimright|stringupper|suspend|sysget|thread|tooltip|transform|traytip|urldownloadtofile|while|winactivate|winactivatebottom|winclose|winget|wingetactivestats|wingetactivetitle|wingetclass|wingetpos|wingettext|wingettitle|winhide|winkill|winmaximize|winmenuselectitem|winminimize|winminimizeall|winminimizeallundo|winmove|winrestore|winset|winsettitle|winshow|winwait|winwaitactive|winwaitclose|winwaitnotactive)\\b', - caseInsensitive: true }, - { token: 'keyword.control.ahk', - regex: '(?:\\b|^)(?:if|else|return|loop|break|for|while|global|local|byref)\\b', - caseInsensitive: true }, - { token: 'support.function.ahk', - regex: '(?:\\b|^)(?:abs|acos|asc|asin|atan|ceil|chr|cos|dllcall|exp|fileexist|floor|getkeystate|il_add|il_create|il_destroy|instr|substr|isfunc|islabel|ln|log|lv_add|lv_delete|lv_deletecol|lv_getcount|lv_getnext|lv_gettext|lv_insert|lv_insertcol|lv_modify|lv_modifycol|lv_setimagelist|mod|onmessage|numget|numput|registercallback|regexmatch|regexreplace|round|sin|tan|sqrt|strlen|sb_seticon|sb_setparts|sb_settext|tv_add|tv_delete|tv_getchild|tv_getcount|tv_getnext|tv_get|tv_getparent|tv_getprev|tv_getselection|tv_gettext|tv_modify|varsetcapacity|winactive|winexist)\\b', - caseInsensitive: true }, - { token: 'variable.predefined.ahk', - regex: '(?:\\b|^)(?:a_ahkpath|a_ahkversion|a_appdata|a_appdatacommon|a_autotrim|a_batchlines|a_caretx|a_carety|a_computername|a_controldelay|a_cursor|a_dd|a_ddd|a_dddd|a_defaultmousespeed|a_desktop|a_desktopcommon|a_detecthiddentext|a_detecthiddenwindows|a_endchar|a_eventinfo|a_exitreason|a_formatfloat|a_formatinteger|a_gui|a_guievent|a_guicontrol|a_guicontrolevent|a_guiheight|a_guiwidth|a_guix|a_guiy|a_hour|a_iconfile|a_iconhidden|a_iconnumber|a_icontip|a_index|a_ipaddress1|a_ipaddress2|a_ipaddress3|a_ipaddress4|a_isadmin|a_iscompiled|a_iscritical|a_ispaused|a_issuspended|a_keydelay|a_language|a_lasterror|a_linefile|a_linenumber|a_loopfield|a_loopfileattrib|a_loopfiledir|a_loopfileext|a_loopfilefullpath|a_loopfilelongpath|a_loopfilename|a_loopfileshortname|a_loopfileshortpath|a_loopfilesize|a_loopfilesizekb|a_loopfilesizemb|a_loopfiletimeaccessed|a_loopfiletimecreated|a_loopfiletimemodified|a_loopreadline|a_loopregkey|a_loopregname|a_loopregsubkey|a_loopregtimemodified|a_loopregtype|a_mday|a_min|a_mm|a_mmm|a_mmmm|a_mon|a_mousedelay|a_msec|a_mydocuments|a_now|a_nowutc|a_numbatchlines|a_ostype|a_osversion|a_priorhotkey|programfiles|a_programfiles|a_programs|a_programscommon|a_screenheight|a_screenwidth|a_scriptdir|a_scriptfullpath|a_scriptname|a_sec|a_space|a_startmenu|a_startmenucommon|a_startup|a_startupcommon|a_stringcasesense|a_tab|a_temp|a_thisfunc|a_thishotkey|a_thislabel|a_thismenu|a_thismenuitem|a_thismenuitempos|a_tickcount|a_timeidle|a_timeidlephysical|a_timesincepriorhotkey|a_timesincethishotkey|a_titlematchmode|a_titlematchmodespeed|a_username|a_wday|a_windelay|a_windir|a_workingdir|a_yday|a_year|a_yweek|a_yyyy|clipboard|clipboardall|comspec|errorlevel)\\b', - caseInsensitive: true }, - { token: 'support.constant.ahk', - regex: '(?:\\b|^)(?:shift|lshift|rshift|alt|lalt|ralt|control|lcontrol|rcontrol|ctrl|lctrl|rctrl|lwin|rwin|appskey|altdown|altup|shiftdown|shiftup|ctrldown|ctrlup|lwindown|lwinup|rwindown|rwinup|lbutton|rbutton|mbutton|wheelup|wheelleft|wheelright|wheeldown|xbutton1|xbutton2|joy1|joy2|joy3|joy4|joy5|joy6|joy7|joy8|joy9|joy10|joy11|joy12|joy13|joy14|joy15|joy16|joy17|joy18|joy19|joy20|joy21|joy22|joy23|joy24|joy25|joy26|joy27|joy28|joy29|joy30|joy31|joy32|joyx|joyy|joyz|joyr|joyu|joyv|joypov|joyname|joybuttons|joyaxes|joyinfo|space|tab|enter|escape|esc|backspace|bs|delete|del|insert|ins|pgup|pgdn|home|end|up|down|left|right|printscreen|ctrlbreak|pause|scrolllock|capslock|numlock|numpad0|numpad1|numpad2|numpad3|numpad4|numpad5|numpad6|numpad7|numpad8|numpad9|numpadmult|numpadadd|numpadsub|numpaddiv|numpaddot|numpaddel|numpadins|numpadclear|numpadup|numpaddown|numpadleft|numpadright|numpadhome|numpadend|numpadpgup|numpadpgdn|numpadenter|f1|f2|f3|f4|f5|f6|f7|f8|f9|f10|f11|f12|f13|f14|f15|f16|f17|f18|f19|f20|f21|f22|f23|f24|browser_back|browser_forward|browser_refresh|browser_stop|browser_search|browser_favorites|browser_home|volume_mute|volume_down|volume_up|media_next|media_prev|media_stop|media_play_pause|launch_mail|launch_media|launch_app1|launch_app2)\\b', - caseInsensitive: true }, - { token: 'variable.parameter', - regex: '(?:\\b|^)(?:pixel|mouse|screen|relative|rgb|ltrim|rtrim|join|low|belownormal|normal|abovenormal|high|realtime|ahk_id|ahk_pid|ahk_class|ahk_group|between|contains|in|is|integer|float|integerfast|floatfast|number|digit|xdigit|alpha|upper|lower|alnum|time|date|not|or|and|alwaysontop|topmost|top|bottom|transparent|transcolor|redraw|region|id|idlast|processname|minmax|controllist|count|list|capacity|statuscd|eject|lock|unlock|label|filesystem|label|setlabel|serial|type|status|static|seconds|minutes|hours|days|read|parse|logoff|close|error|single|tray|add|rename|check|uncheck|togglecheck|enable|disable|toggleenable|default|nodefault|standard|nostandard|color|delete|deleteall|icon|noicon|tip|click|show|mainwindow|nomainwindow|useerrorlevel|text|picture|pic|groupbox|button|checkbox|radio|dropdownlist|ddl|combobox|listbox|listview|datetime|monthcal|updown|slider|tab|tab2|statusbar|treeview|iconsmall|tile|report|sortdesc|nosort|nosorthdr|grid|hdr|autosize|range|xm|ym|ys|xs|xp|yp|font|resize|owner|submit|nohide|minimize|maximize|restore|noactivate|na|cancel|destroy|center|margin|maxsize|minsize|owndialogs|guiescape|guiclose|guisize|guicontextmenu|guidropfiles|tabstop|section|altsubmit|wrap|hscroll|vscroll|border|top|bottom|buttons|expand|first|imagelist|lines|wantctrla|wantf2|vis|visfirst|number|uppercase|lowercase|limit|password|multi|wantreturn|group|background|bold|italic|strike|underline|norm|backgroundtrans|theme|caption|delimiter|minimizebox|maximizebox|sysmenu|toolwindow|flash|style|exstyle|check3|checked|checkedgray|readonly|password|hidden|left|right|center|notab|section|move|focus|hide|choose|choosestring|text|pos|enabled|disabled|visible|lastfound|lastfoundexist|alttab|shiftalttab|alttabmenu|alttabandmenu|alttabmenudismiss|notimers|interrupt|priority|waitclose|blind|raw|unicode|deref|pow|bitnot|bitand|bitor|bitxor|bitshiftleft|bitshiftright|yes|no|ok|cancel|abort|retry|ignore|tryagain|on|off|all|hkey_local_machine|hkey_users|hkey_current_user|hkey_classes_root|hkey_current_config|hklm|hku|hkcu|hkcr|hkcc|reg_sz|reg_expand_sz|reg_multi_sz|reg_dword|reg_qword|reg_binary|reg_link|reg_resource_list|reg_full_resource_descriptor|reg_resource_requirements_list|reg_dword_big_endian)\\b', - caseInsensitive: true }, - { keywordMap: {"constant.language": autoItKeywords}, regex: '\\w+\\b'}, - { keywordMap: {"variable.function": atKeywords}, regex: '@\\w+\\b'}, - { token : "constant.numeric", regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"}, - { token: 'keyword.operator.ahk', - regex: '=|==|<>|:=|<|>|\\*|\\/|\\+|:|\\?|\\-' }, - { token: 'punctuation.ahk', - regex: '#|`|::|,|\\{|\\}|\\(|\\)|\\%' }, - { token: - [ 'punctuation.quote.double', - 'string.quoted.ahk', - 'punctuation.quote.double' ], - regex: '(")((?:[^"]|"")*)(")' }, - { token: [ 'label.ahk', 'punctuation.definition.label.ahk' ], - regex: '^([^: ]+)(:)(?!:)' } ] } - - this.normalizeRules(); -}; - -AutoHotKeyHighlightRules.metaData = { name: 'AutoHotKey', - scopeName: 'source.ahk', - fileTypes: [ 'ahk' ], - foldingStartMarker: '^\\s*/\\*|^(?![^{]*?;|[^{]*?/\\*(?!.*?\\*/.*?\\{)).*?\\{\\s*($|;|/\\*(?!.*?\\*/.*\\S))', - foldingStopMarker: '^\\s*\\*/|^\\s*\\}' } - - -oop.inherits(AutoHotKeyHighlightRules, TextHighlightRules); - -exports.AutoHotKeyHighlightRules = AutoHotKeyHighlightRules; -}); \ No newline at end of file diff --git a/lib/ace/mode/batchfile.js b/lib/ace/mode/batchfile.js deleted file mode 100644 index e080464c..00000000 --- a/lib/ace/mode/batchfile.js +++ /dev/null @@ -1,61 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * - * - * ***** END LICENSE BLOCK ***** */ - -/* - THIS FILE WAS AUTOGENERATED BY mode.tmpl.js -*/ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var BatchFileHighlightRules = require("./batchfile_highlight_rules").BatchFileHighlightRules; -var FoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = BatchFileHighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "::"; - this.blockComment = ""; - this.$id = "ace/mode/batchfile"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); \ No newline at end of file diff --git a/lib/ace/mode/batchfile_highlight_rules.js b/lib/ace/mode/batchfile_highlight_rules.js deleted file mode 100644 index be0380d8..00000000 --- a/lib/ace/mode/batchfile_highlight_rules.js +++ /dev/null @@ -1,97 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -/* This file was autogenerated from C:\Users\LED\AppData\Roaming\Sublime Text 2\Packages\Batch File\Batch File.tmLanguage (uuid: ) */ -/**************************************************************************************** - * IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. * - * fileTypes * - ****************************************************************************************/ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var BatchFileHighlightRules = function() { - // regexp must not have capturing parentheses. Use (?:) instead. - // regexps are ordered -> the first match is used - - this.$rules = { start: - [ { token: 'keyword.command.dosbatch', - regex: '\\b(?:append|assoc|at|attrib|break|cacls|cd|chcp|chdir|chkdsk|chkntfs|cls|cmd|color|comp|compact|convert|copy|date|del|dir|diskcomp|diskcopy|doskey|echo|endlocal|erase|fc|find|findstr|format|ftype|graftabl|help|keyb|label|md|mkdir|mode|more|move|path|pause|popd|print|prompt|pushd|rd|recover|ren|rename|replace|restore|rmdir|set|setlocal|shift|sort|start|subst|time|title|tree|type|ver|verify|vol|xcopy)\\b', - caseInsensitive: true }, - { token: 'keyword.control.statement.dosbatch', - regex: '\\b(?:goto|call|exit)\\b', - caseInsensitive: true }, - { token: 'keyword.control.conditional.if.dosbatch', - regex: '\\bif\\s+not\\s+(?:exist|defined|errorlevel|cmdextversion)\\b', - caseInsensitive: true }, - { token: 'keyword.control.conditional.dosbatch', - regex: '\\b(?:if|else)\\b', - caseInsensitive: true }, - { token: 'keyword.control.repeat.dosbatch', - regex: '\\bfor\\b', - caseInsensitive: true }, - { token: 'keyword.operator.dosbatch', - regex: '\\b(?:EQU|NEQ|LSS|LEQ|GTR|GEQ)\\b' }, - { token: ['doc.comment', 'comment'], - regex: '(?:^|\\b)(rem)($|\\s.*$)', - caseInsensitive: true }, - { token: 'comment.line.colons.dosbatch', - regex: '::.*$' }, - { include: 'variable' }, - { token: 'punctuation.definition.string.begin.shell', - regex: '"', - push: [ - { token: 'punctuation.definition.string.end.shell', regex: '"', next: 'pop' }, - { include: 'variable' }, - { defaultToken: 'string.quoted.double.dosbatch' } ] }, - { token: 'keyword.operator.pipe.dosbatch', regex: '[|]' }, - { token: 'keyword.operator.redirect.shell', - regex: '&>|\\d*>&\\d*|\\d*(?:>>|>|<)|\\d*<&|\\d*<>' } ], - variable: [ - { token: 'constant.numeric', regex: '%%\\w+|%[*\\d]|%\\w+%'}, - { token: 'constant.numeric', regex: '%~\\d+'}, - { token: ['markup.list', 'constant.other', 'markup.list'], - regex: '(%)(\\w+)(%?)' }]} - - this.normalizeRules(); -}; - -BatchFileHighlightRules.metaData = { name: 'Batch File', - scopeName: 'source.dosbatch', - fileTypes: [ 'bat' ] } - - -oop.inherits(BatchFileHighlightRules, TextHighlightRules); - -exports.BatchFileHighlightRules = BatchFileHighlightRules; -}); \ No newline at end of file diff --git a/lib/ace/mode/behaviour.js b/lib/ace/mode/behaviour.js index c1c6cb15..0559ff64 100644 --- a/lib/ace/mode/behaviour.js +++ b/lib/ace/mode/behaviour.js @@ -1,30 +1,38 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: +/* vim:ts=4:sts=4:sw=4: + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Chris Spencer + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ diff --git a/lib/ace/mode/behaviour/behaviour_test.js b/lib/ace/mode/behaviour/behaviour_test.js deleted file mode 100644 index 245edf99..00000000 --- a/lib/ace/mode/behaviour/behaviour_test.js +++ /dev/null @@ -1,179 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -if (typeof process !== "undefined") { - require("amd-loader"); - require("../../test/mockdom"); -} - -define(function(require, exports, module) { -"use strict"; - -require("../../multi_select"); -var assert = require("../../test/assertions"); -var Range = require("../../range").Range; -var Editor = require("../../editor").Editor; -var EditSession = require("../../edit_session").EditSession; -var MockRenderer = require("../../test/mockrenderer").MockRenderer; -var JavaScriptMode = require("../javascript").Mode; -var XMLMode = require("../xml").Mode; -var editor; -var exec = function(name, times, args) { - do { - editor.commands.exec(name, editor, args); - } while(times --> 1); -}; -var testRanges = function(str) { - assert.equal(editor.selection.getAllRanges() + "", str + ""); -}; - -module.exports = { - "test: cstyle": function() { - function testValue(line) { - assert.equal(editor.getValue(), Array(4).join(line + "\n")); - } - function testSelection(line, col, inc) { - editor.selection.rangeList.ranges.forEach(function(r) { - assert.range(r, line, col, line, col); - line += (inc || 1); - }); - } - var doc = new EditSession([ - "", - "", - "", - "" - ], new JavaScriptMode()); - editor = new Editor(new MockRenderer(), doc); - editor.setOption("behavioursEnabled", true); - - editor.navigateFileStart(); - exec("addCursorBelow", 2); - - exec("insertstring", 1, "if "); - - // pairing ( - exec("insertstring", 1, "("); - testValue("if ()"); - testSelection(0, 4); - exec("insertstring", 1, ")"); - testValue("if ()"); - testSelection(0, 5); - - // pairing [ - exec("gotoleft", 1); - exec("insertstring", 1, "["); - testValue("if ([])"); - testSelection(0, 5); - - exec("insertstring", 1, "]"); - testValue("if ([])"); - testSelection(0, 6); - - // test deletion - exec("gotoleft", 1); - exec("backspace", 1); - testValue("if ()"); - testSelection(0, 4); - - exec("gotolineend", 1); - exec("insertstring", 1, "{"); - testValue("if (){}"); - testSelection(0, 6); - - exec("insertstring", 1, "}"); - testValue("if (){}"); - testSelection(0, 7); - - exec("gotolinestart", 1); - exec("insertstring", 1, "("); - testValue("(if (){}"); - exec("backspace", 1); - - editor.setValue(""); - exec("insertstring", 1, "{"); - assert.equal(editor.getValue(), "{"); - exec("insertstring", 1, "\n"); - assert.equal(editor.getValue(), "{\n \n}"); - - editor.setValue(""); - exec("insertstring", 1, "("); - exec("insertstring", 1, '"'); - exec("insertstring", 1, '"'); - assert.equal(editor.getValue(), '("")'); - exec("backspace", 1); - exec("insertstring", 1, '"'); - assert.equal(editor.getValue(), '("")'); - - editor.setValue("('foo')", 1); - exec("gotoleft", 1); - exec("selectleft", 1); - exec("selectMoreBefore", 1); - exec("insertstring", 1, "'"); - assert.equal(editor.getValue(), "('foo')"); - exec("selectleft", 1); - exec("insertstring", 1, '"'); - assert.equal(editor.getValue(), '("foo")'); - exec("selectleft", 1); - exec("insertstring", 1, '"'); - assert.equal(editor.getValue(), '("foo")'); - - editor.setValue("", 1); - exec("selectleft", 1); - exec("insertstring", 1, '"'); - assert.equal(editor.getValue(), '""'); - exec("insertstring", 1, '\\'); - exec("insertstring", 1, 'n'); - exec("insertstring", 1, '"'); - assert.equal(editor.getValue(), '"\\n"'); - - }, - "test: xml": function() { - editor = new Editor(new MockRenderer()); - editor.setValue(["", - " " - ].join("\n")); - editor.session.setMode(new XMLMode); - exec("gotolinedown", 1); - exec("gotolineend", 1); - exec("insertstring", 1, '\n'); - assert.equal(editor.session.getLine(2), " "); - exec("gotolineup", 1); - exec("gotolineend", 1); - exec("insertstring", 1, '\n'); - assert.equal(editor.session.getLine(2), " "); - } -}; - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec(); -} diff --git a/lib/ace/mode/behaviour/css.js b/lib/ace/mode/behaviour/css.js deleted file mode 100644 index 1c35f744..00000000 --- a/lib/ace/mode/behaviour/css.js +++ /dev/null @@ -1,108 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var CstyleBehaviour = require("./cstyle").CstyleBehaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; - -var CssBehaviour = function () { - - this.inherit(CstyleBehaviour); - - this.add("colon", "insertion", function (state, action, editor, session, text) { - if (text === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ':') { - return { - text: '', - selection: [1, 1] - } - } - if (!line.substring(cursor.column).match(/^\s*;/)) { - return { - text: ':;', - selection: [1, 1] - } - } - } - } - }); - - this.add("colon", "deletion", function (state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected === ':') { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - if (token && token.value.match(/\s+/)) { - token = iterator.stepBackward(); - } - if (token && token.type === 'support.type') { - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar === ';') { - range.end.column ++; - return range; - } - } - } - }); - - this.add("semicolon", "insertion", function (state, action, editor, session, text) { - if (text === ';') { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === ';') { - return { - text: '', - selection: [1, 1] - } - } - } - }); - -} -oop.inherits(CssBehaviour, CstyleBehaviour); - -exports.CssBehaviour = CssBehaviour; -}); diff --git a/lib/ace/mode/behaviour/cstyle.js b/lib/ace/mode/behaviour/cstyle.js index dd1b0d14..d8df3b31 100644 --- a/lib/ace/mode/behaviour/cstyle.js +++ b/lib/ace/mode/behaviour/cstyle.js @@ -1,30 +1,38 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: +/* vim:ts=4:sts=4:sw=4: + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Chris Spencer + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -33,155 +41,91 @@ define(function(require, exports, module) { var oop = require("../../lib/oop"); var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; +var CstyleBehaviour = function () { -var context; -var contextCache = {}; -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.index; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var getWrapped = function(selection, selected, opening, closing) { - var rowDiff = selection.end.row - selection.start.row; - return { - text: opening + selected + closing, - selection: [ - 0, - selection.start.column + 1, - rowDiff, - selection.end.column + (rowDiff ? 0 : 1) - ] - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); + this.add("braces", "insertion", function (state, action, editor, session, text) { if (text == '{') { - initContext(editor); var selection = editor.getSelectionRange(); var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return getWrapped(selection, selected, '{', '}'); - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } + if (selected !== "") { + return { + text: '{' + selected + '}', + selection: false + }; + } else { + return { + text: '{}', + selection: [1, 1] + }; } } else if (text == '}') { - initContext(editor); + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); var rightChar = line.substring(cursor.column, cursor.column + 1); if (rightChar == '}') { var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); + if (matching !== null) { return { text: '', selection: [1, 1] }; } } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } + } 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 (rightChar == '}') { + var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column + 1}); if (!openBracePos) return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); + 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) { + this.add("braces", "deletion", function (state, action, editor, session, range) { var selected = session.doc.getTextRange(range); if (!range.isMultiLine() && selected == '{') { - initContext(editor); var line = session.doc.getLine(range.start.row); var rightChar = line.substring(range.end.column, range.end.column + 1); if (rightChar == '}') { range.end.column++; return range; - } else { - context.maybeInsertedBrackets--; } } }); - this.add("parens", "insertion", function(state, action, editor, session, text) { + this.add("parens", "insertion", function (state, action, editor, session, text) { if (text == '(') { - initContext(editor); var selection = editor.getSelectionRange(); var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return getWrapped(selection, selected, '(', ')'); - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); + if (selected !== "") { + return { + text: '(' + selected + ')', + selection: false + }; + } else { return { text: '()', selection: [1, 1] }; } } else if (text == ')') { - initContext(editor); var cursor = editor.getCursorPosition(); var line = session.doc.getLine(cursor.row); var rightChar = line.substring(cursor.column, cursor.column + 1); if (rightChar == ')') { var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); + if (matching !== null) { return { text: '', selection: [1, 1] @@ -191,10 +135,9 @@ var CstyleBehaviour = function() { } }); - this.add("parens", "deletion", function(state, action, editor, session, range) { + this.add("parens", "deletion", function (state, action, editor, session, range) { var selected = session.doc.getTextRange(range); if (!range.isMultiLine() && selected == '(') { - initContext(editor); var line = session.doc.getLine(range.start.row); var rightChar = line.substring(range.start.column + 1, range.start.column + 2); if (rightChar == ')') { @@ -204,29 +147,28 @@ var CstyleBehaviour = function() { } }); - this.add("brackets", "insertion", function(state, action, editor, session, text) { + this.add("brackets", "insertion", function (state, action, editor, session, text) { if (text == '[') { - initContext(editor); var selection = editor.getSelectionRange(); var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return getWrapped(selection, selected, '[', ']'); - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); + if (selected !== "") { + return { + text: '[' + selected + ']', + selection: false + }; + } else { return { text: '[]', selection: [1, 1] }; } } else if (text == ']') { - initContext(editor); var cursor = editor.getCursorPosition(); var line = session.doc.getLine(cursor.row); var rightChar = line.substring(cursor.column, cursor.column + 1); if (rightChar == ']') { var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); + if (matching !== null) { return { text: '', selection: [1, 1] @@ -236,10 +178,9 @@ var CstyleBehaviour = function() { } }); - this.add("brackets", "deletion", function(state, action, editor, session, range) { + this.add("brackets", "deletion", function (state, action, editor, session, range) { var selected = session.doc.getTextRange(range); if (!range.isMultiLine() && selected == '[') { - initContext(editor); var line = session.doc.getLine(range.start.row); var rightChar = line.substring(range.start.column + 1, range.start.column + 2); if (rightChar == ']') { @@ -249,63 +190,70 @@ var CstyleBehaviour = function() { } }); - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { + this.add("string_dquotes", "insertion", function (state, action, editor, session, text) { if (text == '"' || text == "'") { - initContext(editor); var quote = text; var selection = editor.getSelectionRange(); var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return getWrapped(selection, selected, quote, quote); - } else if (!selected) { + 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); - var rightChar = line.substring(cursor.column, cursor.column + 1); - - var token = session.getTokenAt(cursor.row, cursor.column); - var rightToken = session.getTokenAt(cursor.row, cursor.column + 1); + // We're escaped. - if (leftChar == "\\" && token && /escape/.test(token.type)) + if (leftChar == '\\') { return null; - - var stringBefore = token && /string|escape/.test(token.type); - var stringAfter = !rightToken || /string|escape/.test(rightToken.type); - - var pair; - if (rightChar == quote) { - pair = stringBefore !== stringAfter; - } else { - if (stringBefore && !stringAfter) - return null; // wrap string with different quote - if (stringBefore && stringAfter) - return null; // do not pair quotes inside strings - var wordRe = session.$mode.tokenRe; - wordRe.lastIndex = 0; - var isWordBefore = wordRe.test(leftChar); - wordRe.lastIndex = 0; - var isWordAfter = wordRe.test(leftChar); - if (isWordBefore || isWordAfter) - return null; // before or after alphanumeric - if (rightChar && !/[\s;,.})\]\\]/.test(rightChar)) - return null; // there is rightChar and it isn't closing - pair = true; } - return { - text: pair ? quote + quote : "", - selection: [1,1] - }; + + // 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) { + this.add("string_dquotes", "deletion", function (state, action, editor, session, range) { var selected = session.doc.getTextRange(range); if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); var line = session.doc.getLine(range.start.row); var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { + if (rightChar == '"') { range.end.column++; return range; } @@ -314,79 +262,6 @@ var CstyleBehaviour = function() { }; - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - - // Don't insert in the middle of a keyword/identifier/lexical - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - // Look ahead in case we're at the end of a token - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - - // Only insert in front of whitespace/comments - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - // Reset previous state if text or context changed too much - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - oop.inherits(CstyleBehaviour, Behaviour); exports.CstyleBehaviour = CstyleBehaviour; diff --git a/lib/ace/mode/behaviour/html.js b/lib/ace/mode/behaviour/html.js index 181655c0..6c009ada 100644 --- a/lib/ace/mode/behaviour/html.js +++ b/lib/ace/mode/behaviour/html.js @@ -1,30 +1,38 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: +/* vim:ts=4:sts=4:sw=4: + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Chris Spencer + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -33,13 +41,57 @@ define(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 () { - XmlBehaviour.call(this); - -}; - + 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: '>' + '', + selection: [1, 1] + } + } + }); +} oop.inherits(HtmlBehaviour, XmlBehaviour); exports.HtmlBehaviour = HtmlBehaviour; diff --git a/lib/ace/mode/behaviour/xml.js b/lib/ace/mode/behaviour/xml.js index 068fdb31..34e8510b 100644 --- a/lib/ace/mode/behaviour/xml.js +++ b/lib/ace/mode/behaviour/xml.js @@ -1,30 +1,38 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: +/* vim:ts=4:sts=4:sw=4: + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. * - * 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. + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Chris Spencer + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -33,171 +41,72 @@ define(function(require, exports, module) { var oop = require("../../lib/oop"); var Behaviour = require("../behaviour").Behaviour; +var CstyleBehaviour = require("./cstyle").CstyleBehaviour; var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); -function is(token, type) { - return token.type.lastIndexOf(type + ".xml") > -1; +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.add("string_dquotes", "insertion", function (state, action, editor, session, text) { - if (text == '"' || text == "'") { - var quote = text; - var selected = session.doc.getTextRange(editor.getSelectionRange()); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return { - text: quote + selected + quote, - selection: false - }; - } - - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - - if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) { - // Ignore input and move right one if we're typing over the closing quote. - return { - text: "", - selection: [1, 1] - }; - } - - if (!token) - token = iterator.stepBackward(); - - if (!token) - return; - - while (is(token, "tag-whitespace") || is(token, "whitespace")) { - token = iterator.stepBackward(); - } - var rightSpace = !rightChar || rightChar.match(/\s/); - if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) { - return { - text: quote + quote, - selection: [1, 1] - }; - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - + + 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() || iterator.stepBackward(); - - // exit if we're not in a tag - if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value"))) - return; - - // exit if we're inside of a quoted attribute value - if (is(token, "reference.attribute-value")) - return; - if (is(token, "attribute-value")) { - var firstChar = token.value.charAt(0); - if (firstChar == '"' || firstChar == "'") { - var lastChar = token.value.charAt(token.value.length - 1); - var tokenEnd = iterator.getCurrentTokenColumn() + token.value.length; - if (tokenEnd > position.column || tokenEnd == position.column && firstChar != lastChar) - return; - } + 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; } - - // find tag name - while (!is(token, "tag-name")) { - token = iterator.stepBackward(); + 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); } - - var tokenRow = iterator.getCurrentTokenRow(); - var tokenColumn = iterator.getCurrentTokenColumn(); - - // exit if the tag is ending - if (is(iterator.stepBackward(), "end-tag-open")) - return; - - var element = token.value; - if (tokenRow == position.row) - element = element.substring(0, position.column - tokenColumn); - - if (this.voidElements.hasOwnProperty(element.toLowerCase())) - return; return { - text: ">" + "", + text: '>' + '', selection: [1, 1] - }; - } - }); - - this.add("autoindent", "insertion", function (state, action, editor, session, text) { - if (text == "\n") { - var cursor = editor.getCursorPosition(); - var line = session.getLine(cursor.row); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - var token = iterator.getCurrentToken(); - - if (token && token.type.indexOf("tag-close") !== -1) { - if (token.value == "/>") - return; - //get tag name - while (token && token.type.indexOf("tag-name") === -1) { - token = iterator.stepBackward(); - } - - if (!token) { - return; - } - - var tag = token.value; - var row = iterator.getCurrentTokenRow(); - - //don't indent after closing tag - token = iterator.stepBackward(); - if (!token || token.type.indexOf("end-tag") !== -1) { - return; - } - - if (this.voidElements && !this.voidElements[tag]) { - var nextToken = session.getTokenAt(cursor.row, cursor.column+1); - var line = session.getLine(row); - var nextIndent = this.$getIndent(line); - var indent = nextIndent + session.getTabString(); - - if (nextToken && nextToken.value === ". +*/ define(function(require, exports, module) { "use strict"; var oop = require("../../lib/oop"); var Behaviour = require('../behaviour').Behaviour; var CstyleBehaviour = require('./cstyle').CstyleBehaviour; - var XmlBehaviour = require("../behaviour/xml").XmlBehaviour; - 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 XQueryBehaviour = function () { + var XQueryBehaviour = function (parent) { this.inherit(CstyleBehaviour, ["braces", "parens", "string_dquotes"]); // Get string behaviour - this.inherit(XmlBehaviour); // Get xml behaviour + this.parent = parent; - 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; - var state = JSON.parse(state).pop(); - if ((token && token.value === '>') || state !== "StartTag") return; - 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; - } - var previous = iterator.stepBackward(); - if (!token || !hasType(token, 'meta.tag') || (previous !== null && previous.value.match('/'))) { - return - } - var tag = token.value.substring(1); - if (atCursor){ - var tag = tag.substring(0, position.column - token.start); - } - - return { - text: '>' + '', - selection: [1, 1] - } - } - }); +// 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 == ' 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); diff --git a/lib/ace/mode/c9search.js b/lib/ace/mode/c9search.js index 3286456a..37a89aab 100644 --- a/lib/ace/mode/c9search.js +++ b/lib/ace/mode/c9search.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Garen J. Torikian + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -33,12 +40,13 @@ define(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.HighlightRules = C9SearchHighlightRules; + this.$tokenizer = new Tokenizer(new C9SearchHighlightRules().getRules(), "i"); this.$outdent = new MatchingBraceOutdent(); this.foldingRules = new C9StyleFoldMode(); }; @@ -59,7 +67,6 @@ oop.inherits(Mode, TextMode); this.$outdent.autoOutdent(doc, row); }; - this.$id = "ace/mode/c9search"; }).call(Mode.prototype); exports.Mode = Mode; diff --git a/lib/ace/mode/c9search_highlight_rules.js b/lib/ace/mode/c9search_highlight_rules.js index 43ec4bf8..f5aae9b2 100644 --- a/lib/ace/mode/c9search_highlight_rules.js +++ b/lib/ace/mode/c9search_highlight_rules.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Garen J. Torikian + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,15 +39,8 @@ define(function(require, exports, module) { "use strict"; var oop = require("../lib/oop"); -var lang = require("../lib/lang"); var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -function safeCreateRegexp(source, flag) { - try { - return new RegExp(source, flag); - } catch(e) {} -} - var C9SearchHighlightRules = function() { // regexp must not have capturing parentheses. Use (?:) instead. @@ -48,128 +48,12 @@ var C9SearchHighlightRules = function() { this.$rules = { "start" : [ { - tokenNames : ["c9searchresults.constant.numeric", "c9searchresults.text", "c9searchresults.text", "c9searchresults.keyword"], - regex : "(^\\s+[0-9]+)(:\\s)(.+)", - onMatch : function(val, state, stack) { - var values = this.splitRegex.exec(val); - var types = this.tokenNames; - var tokens = [{ - type: types[0], - value: values[1] - },{ - type: types[1], - value: values[2] - }]; - - var regex = stack[1]; - var str = values[3]; - - var m; - var last = 0; - if (regex && regex.exec) { - regex.lastIndex = 0; - while (m = regex.exec(str)) { - var skipped = str.substring(last, m.index); - last = regex.lastIndex; - if (skipped) - tokens.push({type: types[2], value: skipped}); - if (m[0]) - tokens.push({type: types[3], value: m[0]}); - else if (!skipped) - break; - } - } - if (last < str.length) - tokens.push({type: types[2], value: str.substr(last)}); - return tokens; - } + token : ["c9searchresults.constant.numeric", "c9searchresults.text", "c9searchresults.text"], + regex : "(^\\s+[0-9]+)(:\\s*)(.+)" }, { token : ["string", "text"], // single line - regex : "(\\S.*)(:$)" - }, - { - regex : "Searching for .*$", - onMatch: function(val, state, stack) { - var parts = val.split("\x01"); - if (parts.length < 3) - return "text"; - - var options, search, replace; - - var i = 0; - var tokens = [{ - value: parts[i++] + "'", - type: "text" - }, { - value: search = parts[i++], - type: "text" // "c9searchresults.keyword" - }, { - value: "'" + parts[i++], - type: "text" - }]; - - // replaced - if (parts[2] !== " in") { - replace = parts[i]; - tokens.push({ - value: "'" + parts[i++] + "'", - type: "text" - }, { - value: parts[i++], - type: "text" - }); - } - // path - tokens.push({ - value: " " + parts[i++] + " ", - type: "text" - }); - // options - if (parts[i+1]) { - options = parts[i+1]; - tokens.push({ - value: "(" + parts[i+1] + ")", - type: "text" - }); - i += 1; - } else { - i -= 1; - } - while (i++ < parts.length) { - parts[i] && tokens.push({ - value: parts[i], - type: "text" - }); - } - - if (replace) { - search = replace; - options = ""; - } - - if (search) { - if (!/regex/.test(options)) - search = lang.escapeRegExp(search); - if (/whole/.test(options)) - search = "\\b" + search + "\\b"; - } - - var regex = search && safeCreateRegexp( - "(" + search + ")", - / sensitive/.test(options) ? "g" : "ig" - ); - if (regex) { - stack[0] = state; - stack[1] = regex; - } - - return tokens; - } - }, - { - regex : "\\d+", - token: "constant.numeric" + regex : "(.+)(:$)" } ] }; @@ -179,4 +63,4 @@ oop.inherits(C9SearchHighlightRules, TextHighlightRules); exports.C9SearchHighlightRules = C9SearchHighlightRules; -}); \ No newline at end of file +}); diff --git a/lib/ace/mode/c_cpp.js b/lib/ace/mode/c_cpp.js index a2dc133f..ccc1f551 100644 --- a/lib/ace/mode/c_cpp.js +++ b/lib/ace/mode/c_cpp.js @@ -1,30 +1,38 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * Gastón Kleiman + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -33,6 +41,7 @@ define(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; @@ -40,24 +49,47 @@ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; var CStyleFoldMode = require("./folding/cstyle").FoldMode; var Mode = function() { - this.HighlightRules = c_cppHighlightRules; - + 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.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; + 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.getTokenizer().getLineTokens(line, state); + var tokenizedLine = this.$tokenizer.getLineTokens(line, state); var tokens = tokenizedLine.tokens; var endState = tokenizedLine.state; @@ -94,7 +126,6 @@ oop.inherits(Mode, TextMode); this.$outdent.autoOutdent(doc, row); }; - this.$id = "ace/mode/c_cpp"; }).call(Mode.prototype); exports.Mode = Mode; diff --git a/lib/ace/mode/c_cpp_highlight_rules.js b/lib/ace/mode/c_cpp_highlight_rules.js index 9d2f33dc..236b7284 100644 --- a/lib/ace/mode/c_cpp_highlight_rules.js +++ b/lib/ace/mode/c_cpp_highlight_rules.js @@ -1,65 +1,81 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * Gastón Kleiman + * + * Based on Bespin's C/C++ Syntax Plugin by Marc McIntyre. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + define(function(require, exports, module) { "use strict"; 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; -// used by objective-c -var cFunctions = exports.cFunctions = "\\b(?:hypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len))))\\b" - var 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|char16_t|char32_t" + var keywords = lang.arrayToMap( + ("and|double|not_eq|throw|and_eq|dynamic_cast|operator|true|" + + "asm|else|or|try|auto|enum|or_eq|typedef|bitand|explicit|private|" + + "typeid|bitor|extern|protected|typename|bool|false|public|union|" + + "break|float|register|unsigned|case|fro|reinterpret-cast|using|catch|" + + "friend|return|virtual|char|goto|short|void|class|if|signed|volatile|" + + "compl|inline|sizeof|wchar_t|const|int|static|while|const-cast|long|" + + "static_cast|xor|continue|mutable|struct|xor_eq|default|namespace|" + + "switch|delete|new|template|do|not|this|for").split("|") ); - var storageModifiers = ( - "const|extern|register|restrict|static|volatile|inline|private|" + - "protected|public|friend|explicit|virtual|export|mutable|typename|" + - "constexpr|new|delete|alignas|alignof|decltype|noexcept|thread_local" + var buildinConstants = lang.arrayToMap( + ("NULL").split("|") ); - 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|nullptr" - ); - - var keywordMapper = this.$keywords = this.createKeywordMapper({ - "keyword.control" : keywordControls, - "storage.type" : storageType, - "storage.modifier" : storageModifiers, - "keyword.operator" : keywordOperators, - "variable.language": "this", - "constant.language": builtinConstants - }, "identifier"); - - var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\d\\$_\u00a1-\uffff]*\\b"; - // regexp must not have capturing parentheses. Use (?:) instead. // regexps are ordered -> the first match is used - this.$rules = { + this.$rules = { "start" : [ { token : "comment", - regex : "//", - next : "singleLineComment" + regex : "\\/\\/.*$" }, DocCommentHighlightRules.getStartRule("doc-start"), { token : "comment", // multi line comment + merge : true, regex : "\\/\\*", next : "comment" }, { @@ -67,6 +83,7 @@ var c_cppHighlightRules = function() { regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' }, { token : "string", // multi line string start + merge : true, regex : '["].*\\\\$', next : "qqstring" }, { @@ -74,26 +91,32 @@ var c_cppHighlightRules = function() { regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" }, { token : "string", // multi line string start + merge : true, regex : "['].*\\\\$", next : "qstring" }, { token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" + regex : "0[xX][0-9a-fA-F]+\\b" }, { token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" + regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" }, { - token : "keyword", // pre-compiler directives - regex : "#\\s*(?:include|import|pragma|line|define|undef)\\b", - next : "directive" + token : "constant", // + regex : "<[a-zA-Z0-9.]+>" }, { - token : "keyword", // special case pre-compiler directive - regex : "#\\s*(?:endif|if|ifdef|else|elif|ifndef)\\b" - }, { - token : "support.function.C99.c", - regex : cFunctions - }, { - token : keywordMapper, + token : "keyword", // pre-compiler directivs + regex : "(?:#include|#pragma|#line|#define|#undef|#ifdef|#else|#elif|#endif|#ifndef)" + }, { + token : function(value) { + if (value == "this") + return "variable.language"; + else if (keywords.hasOwnProperty(value)) + return "keyword"; + else if (buildinConstants.hasOwnProperty(value)) + return "constant.language"; + else + return "identifier"; + }, regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" }, { token : "keyword.operator", @@ -119,29 +142,19 @@ var c_cppHighlightRules = function() { next : "start" }, { token : "comment", // comment spanning whole line + merge : true, regex : ".+" } ], - "singleLineComment" : [ - { - token : "comment", - regex : /\\$/, - next : "singleLineComment" - }, { - token : "comment", - regex : /$/, - next : "start" - }, { - defaultToken: "comment" - } - ], "qqstring" : [ { token : "string", regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"', next : "start" }, { - defaultToken : "string" + token : "string", + merge : true, + regex : '.+' } ], "qstring" : [ @@ -150,42 +163,13 @@ var c_cppHighlightRules = function() { regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'", next : "start" }, { - defaultToken : "string" - } - ], - "directive" : [ - { - token : "constant.other.multiline", - regex : /\\/ - }, - { - token : "constant.other.multiline", - regex : /.*\\/ - }, - { - token : "constant.other", - regex : "\\s*<.+?>", - next : "start" - }, - { - token : "constant.other", // single line - regex : '\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]', - next : "start" - }, - { - token : "constant.other", // single line - regex : "\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']", - next : "start" - }, - // "\" implies multiline, while "/" implies comment - { - token : "constant.other", - regex : /[^\\\/]+/, - next : "start" + token : "string", + merge : true, + regex : '.+' } ] }; - + this.embedRules(DocCommentHighlightRules, "doc-", [ DocCommentHighlightRules.getEndRule("start") ]); }; diff --git a/lib/ace/mode/cirru.js b/lib/ace/mode/cirru.js deleted file mode 100644 index 5f1c4d9e..00000000 --- a/lib/ace/mode/cirru.js +++ /dev/null @@ -1,51 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2014, 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(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var CirruHighlightRules = require("./cirru_highlight_rules").CirruHighlightRules; -var CoffeeFoldMode = require("./folding/coffee").FoldMode; - -var Mode = function() { - this.HighlightRules = CirruHighlightRules; - this.foldingRules = new CoffeeFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "--"; - this.$id = "ace/mode/cirru"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); diff --git a/lib/ace/mode/cirru_highlight_rules.js b/lib/ace/mode/cirru_highlight_rules.js deleted file mode 100644 index 737ec0be..00000000 --- a/lib/ace/mode/cirru_highlight_rules.js +++ /dev/null @@ -1,125 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2014, 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(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -// see http://cirru.org for more about this language -var CirruHighlightRules = function() { - this.$rules = { - start: [{ - token: 'constant.numeric', - regex: /[\d\.]+/ - }, { - token: 'comment.line.double-dash', - regex: /--/, - next: 'comment', - }, { - token: 'storage.modifier', - regex: /\(/, - }, { - token: 'storage.modifier', - regex: /\,/, - next: 'line', - }, { - token: 'support.function', - regex: /[^\(\)\"\s]+/, - next: 'line' - }, { - token: 'string.quoted.double', - regex: /"/, - next: 'string', - }, { - token: 'storage.modifier', - regex: /\)/, - }], - comment: [{ - token: 'comment.line.double-dash', - regex: /\ +[^\n]+/, - next: 'start', - }], - string: [{ - token: 'string.quoted.double', - regex: /"/, - next: 'line', - }, { - token: 'constant.character.escape', - regex: /\\/, - next: 'escape', - }, { - token: 'string.quoted.double', - regex: /[^\\\"]+/, - }], - escape: [{ - token: 'constant.character.escape', - regex: /./, - next: 'string', - }], - line: [{ - token: 'constant.numeric', - regex: /[\d\.]+/ - }, { - token: 'markup.raw', - regex: /^\s*/, - next: 'start', - }, { - token: 'storage.modifier', - regex: /\$/, - next: 'start', - }, { - token: 'variable.parameter', - regex: /[^\(\)\"\s]+/ - }, { - token: 'storage.modifier', - regex: /\(/, - next: 'start' - }, { - token: 'storage.modifier', - regex: /\)/, - }, { - token: 'markup.raw', - regex: /^\ */, - next: 'start', - }, { - token: 'string.quoted.double', - regex: /"/, - next: 'string', - }] - } - -}; - -oop.inherits(CirruHighlightRules, TextHighlightRules); - -exports.CirruHighlightRules = CirruHighlightRules; -}); diff --git a/lib/ace/mode/clojure.js b/lib/ace/mode/clojure.js index ee44ac3e..37a0d588 100644 --- a/lib/ace/mode/clojure.js +++ b/lib/ace/mode/clojure.js @@ -1,30 +1,39 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. * - * 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. + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * Shlomo Zalman Heigh + * Carin Meier + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -33,84 +42,69 @@ define(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.HighlightRules = ClojureHighlightRules; + this.$tokenizer = new Tokenizer(new ClojureHighlightRules().getRules()); this.$outdent = new MatchingParensOutdent(); }; oop.inherits(Mode, TextMode); (function() { - this.lineCommentStart = ";"; - this.minorIndentFunctions = ["defn", "defn-", "defmacro", "def", "deftest", "testing"]; + this.toggleCommentLines = function(state, doc, startRow, endRow) { + var outdent = true; + var re = /^(\s*)#/; - this.$toIndent = function(str) { - return str.split('').map(function(ch) { - if (/\s/.exec(ch)) { - return ch; - } else { - return ' '; - } - }).join(''); - }; - - this.$calculateIndent = function(line, tab) { - var baseIndent = this.$getIndent(line); - var delta = 0; - var isParen, ch; - // Walk back from end of line, find matching braces - for (var i = line.length - 1; i >= 0; i--) { - ch = line[i]; - if (ch === '(') { - delta--; - isParen = true; - } else if (ch === '(' || ch === '[' || ch === '{') { - delta--; - isParen = false; - } else if (ch === ')' || ch === ']' || ch === '}') { - delta++; - } - if (delta < 0) { + for (var i=startRow; i<= endRow; i++) { + if (!re.test(doc.getLine(i))) { + outdent = false; break; } } - if (delta < 0 && isParen) { - // Were more brackets opened than closed and was a ( left open? - i += 1; - var iBefore = i; - var fn = ''; - while (true) { - ch = line[i]; - if (ch === ' ' || ch === '\t') { - if(this.minorIndentFunctions.indexOf(fn) !== -1) { - return this.$toIndent(line.substring(0, iBefore - 1) + tab); - } else { - return this.$toIndent(line.substring(0, i + 1)); - } - } else if (ch === undefined) { - return this.$toIndent(line.substring(0, iBefore - 1) + tab); - } - fn += line[i]; - i++; + + 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 if(delta < 0 && !isParen) { - // Were more brackets openend than closed and was it not a (? - return this.$toIndent(line.substring(0, i+1)); - } else if(delta > 0) { - // Mere more brackets closed than opened? Outdent. - baseIndent = baseIndent.substring(0, baseIndent.length - tab.length); - return baseIndent; - } else { - // Were they nicely matched? Just indent like line before. - return baseIndent; + } + else { + doc.indentRows(startRow, endRow, ";"); } }; this.getNextLineIndent = function(state, line, tab) { - return this.$calculateIndent(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) { @@ -121,7 +115,6 @@ oop.inherits(Mode, TextMode); this.$outdent.autoOutdent(doc, row); }; - this.$id = "ace/mode/clojure"; }).call(Mode.prototype); exports.Mode = Mode; diff --git a/lib/ace/mode/clojure_highlight_rules.js b/lib/ace/mode/clojure_highlight_rules.js index f7e28d87..3ac380c3 100644 --- a/lib/ace/mode/clojure_highlight_rules.js +++ b/lib/ace/mode/clojure_highlight_rules.js @@ -1,30 +1,39 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * Shlomo Zalman Heigh + * Carin Meier + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,94 +41,93 @@ define(function(require, exports, module) { "use strict"; var oop = require("../lib/oop"); +var lang = require("../lib/lang"); 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* + - -> ->> .. / < <= = ' + - '== > > >= >= 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 builtinFunctions = lang.arrayToMap( + ('* *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* + - -> -> ->> ->> .. / < < <= <= = ' + + '== > > >= >= 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 ').split(" ") ); - var keywords = ('throw try var ' + - 'def do fn if let loop monitor-enter monitor-exit new quote recur set!' + var keywords = lang.arrayToMap( + ('def do fn if let loop monitor-enter monitor-exit new quote recur set! ' + + 'throw try var').split(" ") ); - var buildinConstants = ("true false nil"); + var buildinConstants = lang.arrayToMap( + ("true false nil").split(" ") + ); - 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 @@ -129,6 +137,10 @@ var ClojureHighlightRules = function() { { token : "comment", regex : ";.*$" + }, { + token : "comment", // multi line comment + regex : "^=begin$", + next : "comment" }, { token : "keyword", //parens regex : "[\\(|\\)]" @@ -163,27 +175,51 @@ var ClojureHighlightRules = function() { token : "constant.language", regex : '[!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+||=|!=|<=|>=|<>|<|>|!|&&]' }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$\\-]*\\b" + token : function(value) { + if (keywords.hasOwnProperty(value)) + return "keyword"; + else if (buildinConstants.hasOwnProperty(value)) + return "constant.language"; + else if (builtinFunctions.hasOwnProperty(value)) + return "support.function"; + else + return "identifier"; + }, + // TODO: Unicode escape sequences + // TODO: Unicode identifiers + regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" }, { token : "string", // single line regex : '"', next: "string" }, { - token : "constant", // symbol - regex : /:[^()\[\]{}'"\^%`,;\s]+/ + 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", + token : "constant.language.escape", + merge : true, regex : "\\\\.|\\\\$" }, { - token : "string", + token : "string", + merge : true, regex : '[^"\\\\]+' }, { token : "string", diff --git a/lib/ace/mode/cobol.js b/lib/ace/mode/cobol.js deleted file mode 100644 index 91713bd0..00000000 --- a/lib/ace/mode/cobol.js +++ /dev/null @@ -1,53 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var CobolHighlightRules = require("./cobol_highlight_rules").CobolHighlightRules; -var Range = require("../range").Range; - -var Mode = function() { - this.HighlightRules = CobolHighlightRules; -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "*"; - - this.$id = "ace/mode/cobol"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); diff --git a/lib/ace/mode/cobol_highlight_rules.js b/lib/ace/mode/cobol_highlight_rules.js deleted file mode 100644 index 36335c93..00000000 --- a/lib/ace/mode/cobol_highlight_rules.js +++ /dev/null @@ -1,100 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var CobolHighlightRules = function() { -var keywords = "ACCEPT|MERGE|SUM|ADD||MESSAGE|TABLE|ADVANCING|MODE|TAPE|" + -"AFTER|MULTIPLY|TEST|ALL|NEGATIVE|TEXT|ALPHABET|NEXT|THAN|" + -"ALSO|NO|THEN|ALTERNATE|NOT|THROUGH|AND|NUMBER|THRU|ANY|OCCURS|" + -"TIME|ARE|OF|TO|AREA|OFF|TOP||ASCENDING|OMITTED|TRUE|ASSIGN|ON|TYPE|AT|OPEN|" + -"UNIT|AUTHOR|OR|UNTIL|BEFORE|OTHER|UP|BLANK|OUTPUT|USE|BLOCK|PAGE|USING|BOTTOM|" + -"PERFORM|VALUE|BY|PIC|VALUES|CALL|PICTURE|WHEN|CANCEL|PLUS|WITH|CD|POINTER|WRITE|" + -"CHARACTER|POSITION||ZERO|CLOSE|POSITIVE|ZEROS|COLUMN|PROCEDURE|ZEROES|COMMA|PROGRAM|" + -"COMMON|PROGRAM-ID|COMMUNICATION|QUOTE|COMP|RANDOM|COMPUTE|READ|CONTAINS|RECEIVE|CONFIGURATION|" + -"RECORD|CONTINUE|REDEFINES|CONTROL|REFERENCE|COPY|REMAINDER|COUNT|REPLACE|DATA|REPORT|DATE|RESERVE|" + -"DAY|RESET|DELETE|RETURN|DESTINATION|REWIND|DISABLE|REWRITE|DISPLAY|RIGHT|DIVIDE|RUN|DOWN|SAME|" + -"ELSE|SEARCH|ENABLE|SECTION|END|SELECT|ENVIRONMENT|SENTENCE|EQUAL|SET|ERROR|SIGN|EXIT|SEQUENTIAL|" + -"EXTERNAL|SIZE|FLASE|SORT|FILE|SOURCE|LENGTH|SPACE|LESS|STANDARD|LIMIT|START|LINE|STOP|LOCK|STRING|LOW-VALUE|SUBTRACT"; - - var builtinConstants = ( - "true|false|null" - ); - - var builtinFunctions = ( - "count|min|max|avg|sum|rank|now|coalesce|main" - ); - - var 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(CobolHighlightRules, TextHighlightRules); - -exports.CobolHighlightRules = CobolHighlightRules; -}); \ No newline at end of file diff --git a/lib/ace/mode/coffee.js b/lib/ace/mode/coffee.js index e866f2b0..6be4c0d1 100644 --- a/lib/ace/mode/coffee.js +++ b/lib/ace/mode/coffee.js @@ -1,36 +1,44 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Satoshi Murakami + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ define(function(require, exports, module) { "use strict"; +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; @@ -40,8 +48,8 @@ var WorkerClient = require("../worker/worker_client").WorkerClient; var oop = require("../lib/oop"); function Mode() { - this.HighlightRules = Rules; - this.$outdent = new Outdent(); + this.$tokenizer = new Tokenizer(new Rules().getRules()); + this.$outdent = new Outdent(); this.foldingRules = new FoldMode(); } @@ -49,35 +57,14 @@ oop.inherits(Mode, TextMode); (function() { - /*: - [({[=:] # Opening parentheses or brackets - |[-=]> # OR single or double arrow - |\b(?: # OR one of these words: - else # else - |try # OR try - |(?:swi|ca)tch # OR catch, optionally followed by: - (?:\s*[$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)? # a variable - |finally # OR finally - ))\s*$ # all as the last thing on a line (allowing trailing space) - | # ---- OR ---- : - ^\s* # a line starting with optional space - (else\b\s*)? # followed by an optional "else" - (?: # followed by one of the following: - if # if - |for # OR for - |while # OR while - |loop # OR loop - )\b # (as a word) - (?!.*\bthen\b) # ... but NOT followed by "then" on the line - */ - var indenter = /(?:[({[=:]|[-=]>|\b(?:else|try|(?:swi|ca)tch(?:\s+[$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)?|finally))\s*$|^\s*(else\b\s*)?(?:if|for|while|loop)\b(?!.*\bthen\b)/; + var indenter = /(?:[({[=:]|[-=]>|\b(?:else|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.getTokenizer().getLineTokens(line, state).tokens; + var tokens = this.$tokenizer.getLineTokens(line, state).tokens; if (!(tokens.length && tokens[tokens.length - 1].type === 'comment') && state === 'start' && indenter.test(line)) @@ -116,18 +103,17 @@ oop.inherits(Mode, TextMode); var worker = new WorkerClient(["ace"], "ace/mode/coffee_worker", "Worker"); worker.attachToDocument(session.getDocument()); - worker.on("annotate", function(e) { - session.setAnnotations(e.data); + worker.on("error", function(e) { + session.setAnnotations([e.data]); }); - worker.on("terminate", function() { + worker.on("ok", function(e) { session.clearAnnotations(); }); return worker; }; - this.$id = "ace/mode/coffee"; }).call(Mode.prototype); exports.Mode = Mode; diff --git a/lib/ace/mode/coffee/coffee-script.js b/lib/ace/mode/coffee/coffee-script.js index 9e9719f7..63bdcf5c 100644 --- a/lib/ace/mode/coffee/coffee-script.js +++ b/lib/ace/mode/coffee/coffee-script.js @@ -1,49 +1,50 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. * - * 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. + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ - + define(function(require, exports, module) { - + var Lexer = require("./lexer").Lexer; var parser = require("./parser"); var lexer = new Lexer(); parser.lexer = { lex: function() { - var tag, token; - token = this.tokens[this.pos++]; - if (token) { - tag = token[0], this.yytext = token[1], this.yylloc = token[2]; - this.yylineno = this.yylloc.first_line; - } else { - tag = ''; - } + var tag, _ref2; + _ref2 = this.tokens[this.pos++] || [''], tag = _ref2[0], this.yytext = _ref2[1], this.yylineno = _ref2[2]; return tag; }, setInput: function(tokens) { @@ -55,7 +56,7 @@ define(function(require, exports, module) { } }; parser.yy = require('./nodes'); - + exports.parse = function(code) { return parser.parse(lexer.tokenize(code)); }; diff --git a/lib/ace/mode/coffee/helpers.js b/lib/ace/mode/coffee/helpers.js index 60412fc6..69c55bc6 100644 --- a/lib/ace/mode/coffee/helpers.js +++ b/lib/ace/mode/coffee/helpers.js @@ -1,5 +1,5 @@ -/** - * Copyright (c) 2009-2013 Jeremy Ashkenas +/* + * Copyright (c) 2011 Jeremy Ashkenas * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -21,13 +21,12 @@ * 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. - * */ define(function(require, exports, module) { -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.2.1-pre - var buildLocationData, extend, flatten, last, repeat, syntaxErrorToString, _ref; + var extend, flatten; exports.starts = function(string, literal, start) { return literal === string.substr(start, literal.length); @@ -39,27 +38,12 @@ define(function(require, exports, module) { return literal === string.substr(string.length - len - (back || 0), len); }; - exports.repeat = repeat = function(str, n) { - var res; - res = ''; - while (n > 0) { - if (n & 1) { - res += str; - } - n >>>= 1; - str += str; - } - return res; - }; - 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); - } + if (item) _results.push(item); } return _results; }; @@ -67,9 +51,7 @@ define(function(require, exports, module) { exports.count = function(string, substr) { var num, pos; num = pos = 0; - if (!substr.length) { - return 1 / 0; - } + if (!substr.length) return 1 / 0; while (pos = 1 + string.indexOf(substr, pos)) { num++; } @@ -110,162 +92,9 @@ define(function(require, exports, module) { return val; }; - exports.last = last = function(array, back) { + exports.last = function(array, back) { return array[array.length - (back || 0) - 1]; }; - exports.some = (_ref = Array.prototype.some) != null ? _ref : function(fn) { - var e, _i, _len; - for (_i = 0, _len = this.length; _i < _len; _i++) { - e = this[_i]; - if (fn(e)) { - return true; - } - } - return false; - }; - exports.invertLiterate = function(code) { - var line, lines, maybe_code; - maybe_code = true; - lines = (function() { - var _i, _len, _ref1, _results; - _ref1 = code.split('\n'); - _results = []; - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - line = _ref1[_i]; - if (maybe_code && /^([ ]{4}|[ ]{0,3}\t)/.test(line)) { - _results.push(line); - } else if (maybe_code = /^\s*$/.test(line)) { - _results.push(line); - } else { - _results.push('# ' + line); - } - } - return _results; - })(); - return lines.join('\n'); - }; - - buildLocationData = function(first, last) { - if (!last) { - return first; - } else { - return { - first_line: first.first_line, - first_column: first.first_column, - last_line: last.last_line, - last_column: last.last_column - }; - } - }; - - exports.addLocationDataFn = function(first, last) { - return function(obj) { - if (((typeof obj) === 'object') && (!!obj['updateLocationDataIfMissing'])) { - obj.updateLocationDataIfMissing(buildLocationData(first, last)); - } - return obj; - }; - }; - - exports.locationDataToString = function(obj) { - var locationData; - if (("2" in obj) && ("first_line" in obj[2])) { - locationData = obj[2]; - } else if ("first_line" in obj) { - locationData = obj; - } - if (locationData) { - return ("" + (locationData.first_line + 1) + ":" + (locationData.first_column + 1) + "-") + ("" + (locationData.last_line + 1) + ":" + (locationData.last_column + 1)); - } else { - return "No location data"; - } - }; - - exports.baseFileName = function(file, stripExt, useWinPathSep) { - var parts, pathSep; - if (stripExt == null) { - stripExt = false; - } - if (useWinPathSep == null) { - useWinPathSep = false; - } - pathSep = useWinPathSep ? /\\|\// : /\//; - parts = file.split(pathSep); - file = parts[parts.length - 1]; - if (!(stripExt && file.indexOf('.') >= 0)) { - return file; - } - parts = file.split('.'); - parts.pop(); - if (parts[parts.length - 1] === 'coffee' && parts.length > 1) { - parts.pop(); - } - return parts.join('.'); - }; - - exports.isCoffee = function(file) { - return /\.((lit)?coffee|coffee\.md)$/.test(file); - }; - - exports.isLiterate = function(file) { - return /\.(litcoffee|coffee\.md)$/.test(file); - }; - - exports.throwSyntaxError = function(message, location) { - var error; - if (location.last_line == null) { - location.last_line = location.first_line; - } - if (location.last_column == null) { - location.last_column = location.first_column; - } - error = new SyntaxError(message); - error.location = location; - error.toString = syntaxErrorToString; - error.stack = error.toString(); - throw error; - }; - - exports.updateSyntaxError = function(error, code, filename) { - if (error.toString === syntaxErrorToString) { - error.code || (error.code = code); - error.filename || (error.filename = filename); - error.stack = error.toString(); - } - return error; - }; - - syntaxErrorToString = function() { - var codeLine, colorize, colorsEnabled, end, filename, first_column, first_line, last_column, last_line, marker, start, _ref1, _ref2; - if (!(this.code && this.location)) { - return Error.prototype.toString.call(this); - } - _ref1 = this.location, first_line = _ref1.first_line, first_column = _ref1.first_column, last_line = _ref1.last_line, last_column = _ref1.last_column; - if (last_line == null) { - last_line = first_line; - } - if (last_column == null) { - last_column = first_column; - } - filename = this.filename || '[stdin]'; - codeLine = this.code.split('\n')[first_line]; - start = first_column; - end = first_line === last_line ? last_column + 1 : codeLine.length; - marker = repeat(' ', start) + repeat('^', end - start); - if (typeof process !== "undefined" && process !== null) { - colorsEnabled = process.stdout.isTTY && !process.env.NODE_DISABLE_COLORS; - } - if ((_ref2 = this.colorful) != null ? _ref2 : colorsEnabled) { - colorize = function(str) { - return "\x1B[1;31m" + str + "\x1B[0m"; - }; - codeLine = codeLine.slice(0, start) + colorize(codeLine.slice(start, end)) + codeLine.slice(end); - marker = colorize(marker); - } - return "" + filename + ":" + (first_line + 1) + ":" + (first_column + 1) + ": error: " + this.message + "\n" + codeLine + "\n" + marker; - }; - - -}); \ No newline at end of file +}); diff --git a/lib/ace/mode/coffee/lexer.js b/lib/ace/mode/coffee/lexer.js index 05d85236..be857984 100644 --- a/lib/ace/mode/coffee/lexer.js +++ b/lib/ace/mode/coffee/lexer.js @@ -1,5 +1,5 @@ -/** - * Copyright (c) 2009-2013 Jeremy Ashkenas +/* + * Copyright (c) 2011 Jeremy Ashkenas * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -21,82 +21,56 @@ * 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. - * */ define(function(require, exports, module) { -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.2.1-pre - var BOM, 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, invertLiterate, key, last, locationDataToString, repeat, starts, throwSyntaxError, _ref, _ref1, + 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, repeat = _ref1.repeat, invertLiterate = _ref1.invertLiterate, locationDataToString = _ref1.locationDataToString, throwSyntaxError = _ref1.throwSyntaxError; + _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 consumed, i, tag, _ref2; - if (opts == null) { - opts = {}; - } - this.literate = opts.literate; + 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.baseIndent = 0; this.indebt = 0; this.outdebt = 0; this.indents = []; this.ends = []; this.tokens = []; - this.chunkLine = opts.line || 0; - this.chunkColumn = opts.column || 0; - code = this.clean(code); i = 0; while (this.chunk = code.slice(i)) { - consumed = this.identifierToken() || this.commentToken() || this.whitespaceToken() || this.lineToken() || this.heredocToken() || this.stringToken() || this.numberToken() || this.regexToken() || this.jsToken() || this.literalToken(); - _ref2 = this.getLineAndColumnFromChunk(consumed), this.chunkLine = _ref2[0], this.chunkColumn = _ref2[1]; - i += consumed; + 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; - } + if (tag = this.ends.pop()) this.error("missing " + tag); + if (opts.rewrite === false) return this.tokens; return (new Rewriter).rewrite(this.tokens); }; - Lexer.prototype.clean = function(code) { - if (code.charCodeAt(0) === BOM) { - code = code.slice(1); - } - code = code.replace(/\r/g, '').replace(TRAILING_SPACES, ''); - if (WHITESPACE.test(code)) { - code = "\n" + code; - this.chunkLine--; - } - if (this.literate) { - code = invertLiterate(code); - } - return code; - }; - Lexer.prototype.identifierToken = function() { - var colon, colonOffset, forcedIdentifier, id, idLength, input, match, poppedToken, prev, tag, tagToken, _ref2, _ref3, _ref4; - if (!(match = IDENTIFIER.exec(this.chunk))) { - return 0; - } + 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]; - idLength = id.length; - poppedToken = void 0; if (id === 'own' && this.tag() === 'FOR') { this.token('OWN', id); return id.length; } - forcedIdentifier = colon || (prev = last(this.tokens)) && (((_ref2 = prev[0]) === '.' || _ref2 === '?.' || _ref2 === '::' || _ref2 === '?::') || !prev.spaced && prev[0] === '@'); + 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(); @@ -115,7 +89,7 @@ define(function(require, exports, module) { } else { tag = 'RELATION'; if (this.value() === '!') { - poppedToken = this.tokens.pop(); + this.tokens.pop(); id = '!' + id; } } @@ -131,9 +105,7 @@ define(function(require, exports, module) { } } if (!forcedIdentifier) { - if (__indexOf.call(COFFEE_ALIASES, id) >= 0) { - id = COFFEE_ALIAS_MAP[id]; - } + if (__indexOf.call(COFFEE_ALIASES, id) >= 0) id = COFFEE_ALIAS_MAP[id]; tag = (function() { switch (id) { case '!': @@ -146,6 +118,8 @@ define(function(require, exports, module) { return 'LOGIC'; case 'true': case 'false': + case 'null': + case 'undefined': return 'BOOL'; case 'break': case 'continue': @@ -155,75 +129,63 @@ define(function(require, exports, module) { } })(); } - tagToken = this.token(tag, id, 0, idLength); - if (poppedToken) { - _ref4 = [poppedToken[2].first_line, poppedToken[2].first_column], tagToken[2].first_line = _ref4[0], tagToken[2].first_column = _ref4[1]; - } - if (colon) { - colonOffset = input.lastIndexOf(':'); - this.token(':', ':', colonOffset, colon.length); - } + 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; - } + if (!(match = NUMBER.exec(this.chunk))) return 0; number = match[0]; - if (/^0[BOX]/.test(number)) { - this.error("radix prefix '" + number + "' must be lowercase"); - } else if (/E/.test(number) && !/^0x/.test(number)) { + if (/E/.test(number)) { this.error("exponential notation '" + number + "' must be indicated with a lowercase 'e'"); - } else if (/^0\d*[89]/.test(number)) { + } 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\d+/.test(number)) { + } 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 = '0x' + parseInt(octalLiteral[1], 8).toString(16); + if (octalLiteral = /0o([0-7]+)/.exec(number)) { + number = (parseInt(octalLiteral[1], 8)).toString(); } - if (binaryLiteral = /^0b([01]+)/.exec(number)) { - number = '0x' + parseInt(binaryLiteral[1], 2).toString(16); + if (binaryLiteral = /0b([01]+)/.exec(number)) { + number = (parseInt(binaryLiteral[1], 2)).toString(); } - this.token('NUMBER', number, 0, lexedLength); + this.token('NUMBER', number); return lexedLength; }; Lexer.prototype.stringToken = function() { - var octalEsc, quote, string, trimmed; - switch (quote = this.chunk.charAt(0)) { + var match, octalEsc, string; + switch (this.chunk.charAt(0)) { case "'": - string = SIMPLESTR.exec(this.chunk)[0]; + if (!(match = SIMPLESTR.exec(this.chunk))) return 0; + this.token('STRING', (string = match[0]).replace(MULTILINER, '\\\n')); break; case '"': - string = this.balancedString(this.chunk, '"'); + 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 (!string) { - return 0; - } - trimmed = this.removeNewlines(string.slice(1, -1)); - if (quote === '"' && 0 < string.indexOf('#{', 1)) { - this.interpolateString(trimmed, { - strOffset: 1, - lexedLength: string.length - }); - } else { - this.token('STRING', quote + this.escapeLines(trimmed) + quote, 0, string.length); - } - if (octalEsc = /^(?:\\.|[^\\])*\\(?:0[0-7]|[1-7])/.test(string)) { + 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; - } + if (!(match = HEREDOC.exec(this.chunk))) return 0; heredoc = match[0]; quote = heredoc.charAt(0); doc = this.sanitizeHeredoc(match[2], { @@ -232,28 +194,26 @@ define(function(require, exports, module) { }); if (quote === '"' && 0 <= doc.indexOf('#{')) { this.interpolateString(doc, { - heredoc: true, - strOffset: 3, - lexedLength: heredoc.length + heredoc: true }); } else { - this.token('STRING', this.makeString(doc, quote, true), 0, heredoc.length); + 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; - } + 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: repeat(' ', this.indent) - }), 0, comment.length); + indent: Array(this.indent + 1).join(' ') + })); } + this.line += count(comment, '\n'); return comment.length; }; @@ -262,104 +222,84 @@ define(function(require, exports, module) { if (!(this.chunk.charAt(0) === '`' && (match = JSTOKEN.exec(this.chunk)))) { return 0; } - this.token('JS', (script = match[0]).slice(1, -1), 0, script.length); + 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 (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; - } + 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, 0, match.length); + if (regex === '//') regex = '/(?:)/'; + this.token('REGEX', "" + regex + flags); return match.length; }; Lexer.prototype.heregexToken = function(match) { - var body, flags, flagsOffset, heregex, plusToken, prev, re, tag, token, tokens, value, _i, _len, _ref2, _ref3, _ref4; + 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 = this.escapeLines(body.replace(HEREGEX_OMIT, '$1$2').replace(/\//g, '\\/'), true); + re = body.replace(HEREGEX_OMIT, '').replace(/\//g, '\\/'); if (re.match(/^\*/)) { this.error('regular expressions cannot begin with `*`'); } - this.token('REGEX', "/" + (re || '(?:)') + "/" + flags, 0, heregex.length); + this.token('REGEX', "/" + (re || '(?:)') + "/" + flags); return heregex.length; } - this.token('IDENTIFIER', 'RegExp', 0, 0); - this.token('CALL_START', '(', 0, 0); + 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++) { - token = _ref2[_i]; - tag = token[0], value = token[1]; + _ref3 = _ref2[_i], tag = _ref3[0], value = _ref3[1]; if (tag === 'TOKENS') { tokens.push.apply(tokens, value); - } else if (tag === 'NEOSTRING') { - if (!(value = value.replace(HEREGEX_OMIT, '$1$2'))) { - continue; - } - value = value.replace(/\\/g, '\\\\'); - token[0] = 'STRING'; - token[1] = this.makeString(value, '"', true); - tokens.push(token); } else { - this.error("Unexpected " + tag); + if (!(value = value.replace(HEREGEX_OMIT, ''))) continue; + value = value.replace(/\\/g, '\\\\'); + tokens.push(['STRING', this.makeString(value, '"', true)]); } - prev = last(this.tokens); - plusToken = ['+', '+']; - plusToken[2] = prev[2]; - tokens.push(plusToken); + tokens.push(['+', '+']); } tokens.pop(); - if (((_ref3 = tokens[0]) != null ? _ref3[0] : void 0) !== 'STRING') { - this.token('STRING', '""', 0, 0); - this.token('+', '+', 0, 0); + if (((_ref4 = tokens[0]) != null ? _ref4[0] : void 0) !== 'STRING') { + this.tokens.push(['STRING', '""'], ['+', '+']); } - (_ref4 = this.tokens).push.apply(_ref4, tokens); - if (flags) { - flagsOffset = heregex.lastIndexOf(flags); - this.token(',', ',', flagsOffset, 0); - this.token('STRING', '"' + flags + '"', flagsOffset, flags.length); - } - this.token(')', ')', heregex.length - 1, 0); + (_ref5 = this.tokens).push.apply(_ref5, tokens); + if (flags) this.tokens.push([',', ','], ['STRING', '"' + flags + '"']); + this.token(')', ')'); return heregex.length; }; Lexer.prototype.lineToken = function() { - var diff, indent, match, noNewlines, size; - if (!(match = MULTI_DENT.exec(this.chunk))) { - return 0; - } + 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(0); + this.newlineToken(); } return indent.length; } @@ -369,26 +309,20 @@ define(function(require, exports, module) { this.suppressNewlines(); return indent.length; } - if (!this.tokens.length) { - this.baseIndent = this.indent = size; - return indent.length; - } diff = size - this.indent + this.outdebt; - this.token('INDENT', diff, indent.length - size, size); + this.token('INDENT', diff); this.indents.push(diff); this.ends.push('OUTDENT'); this.outdebt = this.indebt = 0; - } else if (size < this.baseIndent) { - this.error('missing indentation', indent.length); } else { this.indebt = 0; - this.outdentToken(this.indent - size, noNewlines, indent.length); + this.outdentToken(this.indent - size, noNewlines); } this.indent = size; return indent.length; }; - Lexer.prototype.outdentToken = function(moveOut, noNewlines, outdentLength) { + Lexer.prototype.outdentToken = function(moveOut, noNewlines) { var dent, len; while (moveOut > 0) { len = this.indents.length - 1; @@ -401,21 +335,19 @@ define(function(require, exports, module) { this.outdebt -= this.indents[len]; moveOut -= this.indents[len]; } else { - dent = this.indents.pop() + this.outdebt; + dent = this.indents.pop() - this.outdebt; moveOut -= dent; this.outdebt = 0; this.pair('OUTDENT'); - this.token('OUTDENT', dent, 0, outdentLength); + this.token('OUTDENT', dent); } } - if (dent) { - this.outdebt -= moveOut; - } + if (dent) this.outdebt -= moveOut; while (this.value() === ';') { this.tokens.pop(); } if (!(this.tag() === 'TERMINATOR' || noNewlines)) { - this.token('TERMINATOR', '\n', outdentLength, 0); + this.token('TERMINATOR', '\n'); } return this; }; @@ -426,9 +358,7 @@ define(function(require, exports, module) { return 0; } prev = last(this.tokens); - if (prev) { - prev[match ? 'spaced' : 'newLine'] = true; - } + if (prev) prev[match ? 'spaced' : 'newLine'] = true; if (match) { return match[0].length; } else { @@ -436,20 +366,16 @@ define(function(require, exports, module) { } }; - Lexer.prototype.newlineToken = function(offset) { + Lexer.prototype.newlineToken = function() { while (this.value() === ';') { this.tokens.pop(); } - if (this.tag() !== 'TERMINATOR') { - this.token('TERMINATOR', '\n', offset, 0); - } + if (this.tag() !== 'TERMINATOR') this.token('TERMINATOR', '\n'); return this; }; Lexer.prototype.suppressNewlines = function() { - if (this.value() === '\\') { - this.tokens.pop(); - } + if (this.value() === '\\') this.tokens.pop(); return this; }; @@ -457,9 +383,7 @@ define(function(require, exports, module) { var match, prev, tag, value, _ref2, _ref3, _ref4, _ref5; if (match = OPERATOR.exec(this.chunk)) { value = match[0]; - if (CODE.test(value)) { - this.tagParameters(); - } + if (CODE.test(value)) this.tagParameters(); } else { value = this.chunk.charAt(0); } @@ -492,9 +416,7 @@ define(function(require, exports, module) { tag = 'LOGIC'; } else if (prev && !prev.spaced) { if (value === '(' && (_ref4 = prev[0], __indexOf.call(CALLABLE, _ref4) >= 0)) { - if (prev[0] === '?') { - prev[0] = 'FUNC_EXIST'; - } + if (prev[0] === '?') prev[0] = 'FUNC_EXIST'; tag = 'CALL_START'; } else if (value === '[' && (_ref5 = prev[0], __indexOf.call(INDEXABLE, _ref5) >= 0)) { tag = 'INDEX_START'; @@ -526,9 +448,7 @@ define(function(require, exports, module) { if (HEREDOC_ILLEGAL.test(doc)) { this.error("block comment cannot contain \"*/\", starting"); } - if (doc.indexOf('\n') < 0) { - return doc; - } + if (doc.indexOf('\n') <= 0) return doc; } else { while (match = HEREDOC_INDENT.exec(doc)) { attempt = match[1]; @@ -537,20 +457,14 @@ define(function(require, exports, module) { } } } - if (indent) { - doc = doc.replace(RegExp("\\n" + indent, "g"), '\n'); - } - if (!herecomment) { - doc = doc.replace(/^\n/, ''); - } + 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; - } + if (this.tag() !== ')') return this; stack = []; tokens = this.tokens; i = tokens.length; @@ -594,9 +508,7 @@ define(function(require, exports, module) { continue; case end: stack.pop(); - if (!stack.length) { - return str.slice(0, +i + 1 || 9e9); - } + if (!stack.length) return str.slice(0, i + 1 || 9e9); end = stack[stack.length - 1]; continue; } @@ -615,14 +527,9 @@ define(function(require, exports, module) { }; Lexer.prototype.interpolateString = function(str, options) { - var column, expr, heredoc, i, inner, interpolated, len, letter, lexedLength, line, locationToken, nested, offsetInChunk, pi, plusToken, popped, regex, rparen, strOffset, tag, token, tokens, value, _i, _len, _ref2, _ref3, _ref4; - if (options == null) { - options = {}; - } - heredoc = options.heredoc, regex = options.regex, offsetInChunk = options.offsetInChunk, strOffset = options.strOffset, lexedLength = options.lexedLength; - offsetInChunk = offsetInChunk || 0; - strOffset = strOffset || 0; - lexedLength = lexedLength || str.length; + 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; @@ -634,25 +541,21 @@ define(function(require, exports, module) { if (!(letter === '#' && str.charAt(i + 1) === '{' && (expr = this.balancedString(str.slice(i + 1), '}')))) { continue; } - if (pi < i) { - tokens.push(this.makeToken('NEOSTRING', str.slice(pi, i), strOffset + pi)); - } + if (pi < i) tokens.push(['NEOSTRING', str.slice(pi, i)]); inner = expr.slice(1, -1); if (inner.length) { - _ref2 = this.getLineAndColumnFromChunk(strOffset + i + 1), line = _ref2[0], column = _ref2[1]; nested = new Lexer().tokenize(inner, { - line: line, - column: column, + line: this.line, rewrite: false }); - popped = nested.pop(); - if (((_ref3 = nested[0]) != null ? _ref3[0] : void 0) === 'TERMINATOR') { - popped = nested.shift(); + nested.pop(); + if (((_ref2 = nested[0]) != null ? _ref2[0] : void 0) === 'TERMINATOR') { + nested.shift(); } if (len = nested.length) { if (len > 1) { - nested.unshift(this.makeToken('(', '(', strOffset + i + 1, 0)); - nested.push(this.makeToken(')', ')', strOffset + i + 1 + inner.length, 0)); + nested.unshift(['(', '(', this.line]); + nested.push([')', ')', this.line]); } tokens.push(['TOKENS', nested]); } @@ -660,60 +563,28 @@ define(function(require, exports, module) { i += expr.length; pi = i + 1; } - if ((i > pi && pi < str.length)) { - tokens.push(this.makeToken('NEOSTRING', str.slice(pi), strOffset + pi)); - } - if (regex) { - return tokens; - } - if (!tokens.length) { - return this.token('STRING', '""', offsetInChunk, lexedLength); - } - if (tokens[0][0] !== 'NEOSTRING') { - tokens.unshift(this.makeToken('NEOSTRING', '', offsetInChunk)); - } - if (interpolated = tokens.length > 1) { - this.token('(', '(', offsetInChunk, 0); - } + 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) { - token = tokens[i]; - tag = token[0], value = token[1]; - if (i) { - if (i) { - plusToken = this.token('+', '+'); - } - locationToken = tag === 'TOKENS' ? value[0] : token; - plusToken[2] = { - first_line: locationToken[2].first_line, - first_column: locationToken[2].first_column, - last_line: locationToken[2].first_line, - last_column: locationToken[2].first_column - }; - } + _ref3 = tokens[i], tag = _ref3[0], value = _ref3[1]; + if (i) this.token('+', '+'); if (tag === 'TOKENS') { (_ref4 = this.tokens).push.apply(_ref4, value); - } else if (tag === 'NEOSTRING') { - token[0] = 'STRING'; - token[1] = this.makeString(value, '"', heredoc); - this.tokens.push(token); } else { - this.error("Unexpected " + tag); + this.token('STRING', this.makeString(value, '"', heredoc)); } } - if (interpolated) { - rparen = this.makeToken(')', ')', offsetInChunk + lexedLength, 0); - rparen.stringEnd = true; - this.tokens.push(rparen); - } + 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); - } + if ('OUTDENT' !== wanted) this.error("unmatched " + tag); this.indent -= size = last(this.indents); this.outdentToken(size, true); return this.pair(tag); @@ -721,48 +592,8 @@ define(function(require, exports, module) { return this.ends.pop(); }; - Lexer.prototype.getLineAndColumnFromChunk = function(offset) { - var column, lineCount, lines, string; - if (offset === 0) { - return [this.chunkLine, this.chunkColumn]; - } - if (offset >= this.chunk.length) { - string = this.chunk; - } else { - string = this.chunk.slice(0, +(offset - 1) + 1 || 9e9); - } - lineCount = count(string, '\n'); - column = this.chunkColumn; - if (lineCount > 0) { - lines = string.split('\n'); - column = last(lines).length; - } else { - column += string.length; - } - return [this.chunkLine + lineCount, column]; - }; - - Lexer.prototype.makeToken = function(tag, value, offsetInChunk, length) { - var lastCharacter, locationData, token, _ref2, _ref3; - if (offsetInChunk == null) { - offsetInChunk = 0; - } - if (length == null) { - length = value.length; - } - locationData = {}; - _ref2 = this.getLineAndColumnFromChunk(offsetInChunk), locationData.first_line = _ref2[0], locationData.first_column = _ref2[1]; - lastCharacter = Math.max(0, length - 1); - _ref3 = this.getLineAndColumnFromChunk(offsetInChunk + lastCharacter), locationData.last_line = _ref3[0], locationData.last_column = _ref3[1]; - token = [tag, value, locationData]; - return token; - }; - - Lexer.prototype.token = function(tag, value, offsetInChunk, length) { - var token; - token = this.makeToken(tag, value, offsetInChunk, length); - this.tokens.push(token); - return token; + Lexer.prototype.token = function(tag, value) { + return this.tokens.push([tag, value, this.line]); }; Lexer.prototype.tag = function(index, tag) { @@ -777,34 +608,17 @@ define(function(require, exports, module) { Lexer.prototype.unfinished = function() { var _ref2; - return LINE_CONTINUER.test(this.chunk) || ((_ref2 = this.tag()) === '\\' || _ref2 === '.' || _ref2 === '?.' || _ref2 === '?::' || _ref2 === 'UNARY' || _ref2 === 'MATH' || _ref2 === '+' || _ref2 === '-' || _ref2 === 'SHIFT' || _ref2 === 'RELATION' || _ref2 === 'COMPARE' || _ref2 === 'LOGIC' || _ref2 === 'THROW' || _ref2 === 'EXTENDS'); - }; - - Lexer.prototype.removeNewlines = function(str) { - return str.replace(/^\s*\n\s*/, '').replace(/([^\\]|\\\\)\s*\n\s*$/, '$1'); + 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) { - str = str.replace(/\\[^\S\n]*(\n|\\)\s*/g, function(escaped, character) { - if (character === '\n') { - return ''; - } else { - return escaped; - } - }); - if (heredoc) { - return str.replace(MULTILINER, '\\n'); - } else { - return str.replace(/\s*\n\s*/g, ' '); - } + return str.replace(MULTILINER, heredoc ? '\\n' : ''); }; Lexer.prototype.makeString = function(body, quote, heredoc) { - if (!body) { - return quote + quote; - } - body = body.replace(RegExp("\\\\(" + quote + "|\\\\)", "g"), function(match, contents) { - if (contents === quote) { + if (!body) return quote + quote; + body = body.replace(/\\([\s\S])/g, function(match, contents) { + if (contents === '\n' || contents === quote) { return contents; } else { return match; @@ -814,16 +628,8 @@ define(function(require, exports, module) { return quote + this.escapeLines(body, heredoc) + quote; }; - Lexer.prototype.error = function(message, offset) { - var first_column, first_line, _ref2; - if (offset == null) { - offset = 0; - } - _ref2 = this.getLineAndColumnFromChunk(offset), first_line = _ref2[0], first_column = _ref2[1]; - return throwSyntaxError(message, { - first_line: first_line, - first_column: first_column - }); + Lexer.prototype.error = function(message) { + throw SyntaxError("" + message + " on line " + (this.line + 1)); }; return Lexer; @@ -857,7 +663,7 @@ define(function(require, exports, module) { COFFEE_KEYWORDS = COFFEE_KEYWORDS.concat(COFFEE_ALIASES); - RESERVED = ['case', 'default', 'function', 'var', 'void', 'with', 'const', 'let', 'enum', 'export', 'import', 'native', '__hasProp', '__extends', '__slice', '__bind', '__indexOf', 'implements', 'interface', 'package', 'private', 'protected', 'public', 'static', 'yield']; + 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']; @@ -867,33 +673,31 @@ define(function(require, exports, module) { exports.STRICT_PROSCRIBED = STRICT_PROSCRIBED; - BOM = 65279; - 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/; + HEREDOC = /^("""|''')([\s\S]*?)(?:\n[^\n\S]*)?\1/; - OPERATOR = /^(?:[-=]>|[-+*\/%<>&|^!?=]=|>>>=?|([-+:])\1|([&|<>])\2=?|\?(\.|::)|\.{2,3})/; + OPERATOR = /^(?:[-=]>|[-+*\/%<>&|^!?=]=|>>>=?|([-+:])\1|([&|<>])\2=?|\?\.|\.{2,3})/; WHITESPACE = /^[^\n\S]+/; - COMMENT = /^###([^#][\s\S]*?)(?:###[^\n\S]*|###$)|^(?:\s*#(?!##[^#]).*)+/; + COMMENT = /^###([^#][\s\S]*?)(?:###[^\n\S]*|(?:###)?$)|^(?:\s*#(?!##[^#]).*)+/; CODE = /^[-=]>/; MULTI_DENT = /^(?:\n[^\n\S]*)+/; - SIMPLESTR = /^'[^\\']*(?:\\[\s\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 = /^\/{3}([\s\S]+?)\/{3}([imgy]{0,4})(?!\w)/; - HEREGEX_OMIT = /((?:\\\\)+)|\\(\s|\/)|\s+(?:#.*)?/g; + HEREGEX_OMIT = /\s+(?:#.*)?/g; MULTILINER = /\n/g; @@ -919,17 +723,17 @@ define(function(require, exports, module) { RELATION = ['IN', 'OF', 'INSTANCEOF']; - BOOL = ['TRUE', 'FALSE']; + BOOL = ['TRUE', 'FALSE', 'NULL', 'UNDEFINED']; - NOT_REGEX = ['NUMBER', 'REGEX', 'BOOL', 'NULL', 'UNDEFINED', '++', '--']; + NOT_REGEX = ['NUMBER', 'REGEX', 'BOOL', '++', '--', ']']; - NOT_SPACED_REGEX = NOT_REGEX.concat(')', '}', 'THIS', 'IDENTIFIER', 'STRING', ']'); + NOT_SPACED_REGEX = NOT_REGEX.concat(')', '}', 'THIS', 'IDENTIFIER', 'STRING'); CALLABLE = ['IDENTIFIER', 'STRING', 'REGEX', ')', ']', '}', '?', '::', '@', 'THIS', 'SUPER']; - INDEXABLE = CALLABLE.concat('NUMBER', 'BOOL', 'NULL', 'UNDEFINED'); + INDEXABLE = CALLABLE.concat('NUMBER', 'BOOL'); LINE_BREAK = ['INDENT', 'OUTDENT', 'TERMINATOR']; -}); \ No newline at end of file +}); diff --git a/lib/ace/mode/coffee/nodes.js b/lib/ace/mode/coffee/nodes.js index 52afdf2c..693976ea 100644 --- a/lib/ace/mode/coffee/nodes.js +++ b/lib/ace/mode/coffee/nodes.js @@ -1,5 +1,5 @@ -/** - * Copyright (c) 2009-2013 Jeremy Ashkenas +/* + * Copyright (c) 2011 Jeremy Ashkenas * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -21,30 +21,24 @@ * 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. - * */ define(function(require, exports, module) { -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.2.1-pre - var Access, Arr, Assign, Base, Block, Call, Class, Code, CodeFragment, Comment, Existence, Extends, For, HEXNUM, IDENTIFIER, IDENTIFIER_STR, IS_REGEX, IS_STRING, If, In, Index, LEVEL_ACCESS, LEVEL_COND, LEVEL_LIST, LEVEL_OP, LEVEL_PAREN, LEVEL_TOP, Literal, METHOD_DEF, NEGATE, NO, NUMBER, Obj, Op, Param, Parens, RESERVED, Range, Return, SIMPLENUM, STRICT_PROSCRIBED, Scope, Slice, Splat, Switch, TAB, THIS, Throw, Try, UTILITIES, Value, While, YES, addLocationDataFn, compact, del, ends, extend, flatten, fragmentsToText, isLiteralArguments, isLiteralThis, last, locationDataToString, merge, multident, parseNum, some, starts, throwSyntaxError, unfoldSoak, utility, _ref, _ref1, + 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; }, - __slice = [].slice; - - Error.stackTraceLimit = Infinity; + __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; }, + __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; Scope = require('./scope').Scope; _ref = require('./lexer'), RESERVED = _ref.RESERVED, STRICT_PROSCRIBED = _ref.STRICT_PROSCRIBED; - _ref1 = require('./helpers'), compact = _ref1.compact, flatten = _ref1.flatten, extend = _ref1.extend, merge = _ref1.merge, del = _ref1.del, starts = _ref1.starts, ends = _ref1.ends, last = _ref1.last, some = _ref1.some, addLocationDataFn = _ref1.addLocationDataFn, locationDataToString = _ref1.locationDataToString, throwSyntaxError = _ref1.throwSyntaxError; + _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; - exports.addLocationDataFn = addLocationDataFn; - YES = function() { return true; }; @@ -62,48 +56,16 @@ define(function(require, exports, module) { return this; }; - exports.CodeFragment = CodeFragment = (function() { - function CodeFragment(parent, code) { - var _ref2; - this.code = "" + code; - this.locationData = parent != null ? parent.locationData : void 0; - this.type = (parent != null ? (_ref2 = parent.constructor) != null ? _ref2.name : void 0 : void 0) || 'unknown'; - } - - CodeFragment.prototype.toString = function() { - return "" + this.code + (this.locationData ? ": " + locationDataToString(this.locationData) : ''); - }; - - return CodeFragment; - - })(); - - fragmentsToText = function(fragments) { - var fragment; - return ((function() { - var _i, _len, _results; - _results = []; - for (_i = 0, _len = fragments.length; _i < _len; _i++) { - fragment = fragments[_i]; - _results.push(fragment.code); - } - return _results; - })()).join(''); - }; - exports.Base = Base = (function() { + + Base.name = 'Base'; + function Base() {} Base.prototype.compile = function(o, lvl) { - return fragmentsToText(this.compileToFragments(o, lvl)); - }; - - Base.prototype.compileToFragments = function(o, lvl) { var node; o = extend({}, o); - if (lvl) { - o.level = lvl; - } + if (lvl) o.level = lvl; node = this.unfoldSoak(o) || this; node.tab = o.indent; if (o.level === LEVEL_TOP || !node.isStatement(o)) { @@ -114,44 +76,36 @@ define(function(require, exports, module) { }; Base.prototype.compileClosure = function(o) { - var args, argumentsNode, func, jumpNode, meth; - if (jumpNode = this.jumps()) { - jumpNode.error('cannot use a pure statement in an expression'); + if (this.jumps()) { + throw SyntaxError('cannot use a pure statement in an expression.'); } o.sharedScope = true; - func = new Code([], Block.wrap([this])); - args = []; - if ((argumentsNode = this.contains(isLiteralArguments)) || this.contains(isLiteralThis)) { - args = [new Literal('this')]; - if (argumentsNode) { - meth = 'apply'; - args.push(new Literal('arguments')); - } else { - meth = 'call'; - } - func = new Value(func, [new Access(new Literal(meth))]); - } - return (new Call(func, args)).compileNode(o); + return Closure.wrap(this).compileNode(o); }; Base.prototype.cache = function(o, level, reused) { var ref, sub; if (!this.isComplex()) { - ref = level ? this.compileToFragments(o, level) : this; + 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.compileToFragments(o, level), [this.makeCode(ref.value)]]; + return [sub.compile(o, level), ref.value]; } else { return [sub, ref]; } } }; - Base.prototype.cacheToCodeFragments = function(cacheValues) { - return [fragmentsToText(cacheValues[0]), fragmentsToText(cacheValues[1])]; + 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) { @@ -165,40 +119,38 @@ define(function(require, exports, module) { }; Base.prototype.contains = function(pred) { - var node; - node = void 0; - this.traverseChildren(false, function(n) { - if (pred(n)) { - node = n; + var contains; + contains = false; + this.traverseChildren(false, function(node) { + if (pred(node)) { + contains = true; return false; } }); - return node; + 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]; - } + 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; - } + if (idt == null) idt = ''; + if (name == null) name = this.constructor.name; tree = '\n' + idt + name; - if (this.soak) { - tree += '?'; - } + if (this.soak) tree += '?'; this.eachChild(function(node) { return tree += node.toString(idt + TAB); }); @@ -207,9 +159,7 @@ define(function(require, exports, module) { Base.prototype.eachChild = function(func) { var attr, child, _i, _j, _len, _len1, _ref2, _ref3; - if (!this.children) { - return this; - } + if (!this.children) return this; _ref2 = this.children; for (_i = 0, _len = _ref2.length; _i < _len; _i++) { attr = _ref2[_i]; @@ -217,9 +167,7 @@ define(function(require, exports, module) { _ref3 = flatten([this[attr]]); for (_j = 0, _len1 = _ref3.length; _j < _len1; _j++) { child = _ref3[_j]; - if (func(child) === false) { - return this; - } + if (func(child) === false) return this; } } } @@ -228,11 +176,8 @@ define(function(require, exports, module) { Base.prototype.traverseChildren = function(crossScope, func) { return this.eachChild(function(child) { - var recur; - recur = func(child); - if (recur !== false) { - return child.traverseChildren(crossScope, func); - } + if (func(child) === false) return false; + return child.traverseChildren(crossScope, func); }); }; @@ -267,48 +212,16 @@ define(function(require, exports, module) { Base.prototype.assigns = NO; - Base.prototype.updateLocationDataIfMissing = function(locationData) { - if (this.locationData) { - return this; - } - this.locationData = locationData; - return this.eachChild(function(child) { - return child.updateLocationDataIfMissing(locationData); - }); - }; - - Base.prototype.error = function(message) { - return throwSyntaxError(message, this.locationData); - }; - - Base.prototype.makeCode = function(code) { - return new CodeFragment(this, code); - }; - - Base.prototype.wrapInBraces = function(fragments) { - return [].concat(this.makeCode('('), fragments, this.makeCode(')')); - }; - - Base.prototype.joinFragmentArrays = function(fragmentsList, joinStr) { - var answer, fragments, i, _i, _len; - answer = []; - for (i = _i = 0, _len = fragmentsList.length; _i < _len; i = ++_i) { - fragments = fragmentsList[i]; - if (i) { - answer.push(this.makeCode(joinStr)); - } - answer = answer.concat(fragments); - } - return answer; - }; - return Base; })(); exports.Block = Block = (function(_super) { + __extends(Block, _super); + Block.name = 'Block'; + function Block(nodes) { this.expressions = compact(flatten(nodes || [])); } @@ -346,21 +259,17 @@ define(function(require, exports, module) { _ref2 = this.expressions; for (_i = 0, _len = _ref2.length; _i < _len; _i++) { exp = _ref2[_i]; - if (exp.isStatement(o)) { - return true; - } + if (exp.isStatement(o)) return true; } return false; }; Block.prototype.jumps = function(o) { - var exp, jumpNode, _i, _len, _ref2; + var exp, _i, _len, _ref2; _ref2 = this.expressions; for (_i = 0, _len = _ref2.length; _i < _len; _i++) { exp = _ref2[_i]; - if (jumpNode = exp.jumps(o)) { - return jumpNode; - } + if (exp.jumps(o)) return exp; } }; @@ -380,82 +289,69 @@ define(function(require, exports, module) { return this; }; - Block.prototype.compileToFragments = function(o, level) { - if (o == null) { - o = {}; - } + Block.prototype.compile = function(o, level) { + if (o == null) o = {}; if (o.scope) { - return Block.__super__.compileToFragments.call(this, o, level); + return Block.__super__.compile.call(this, o, level); } else { return this.compileRoot(o); } }; Block.prototype.compileNode = function(o) { - var answer, compiledNodes, fragments, index, node, top, _i, _len, _ref2; + var code, codes, node, top, _i, _len, _ref2; this.tab = o.indent; top = o.level === LEVEL_TOP; - compiledNodes = []; + codes = []; _ref2 = this.expressions; - for (index = _i = 0, _len = _ref2.length; _i < _len; index = ++_i) { - node = _ref2[index]; + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + node = _ref2[_i]; node = node.unwrapAll(); node = node.unfoldSoak(o) || node; if (node instanceof Block) { - compiledNodes.push(node.compileNode(o)); + codes.push(node.compileNode(o)); } else if (top) { node.front = true; - fragments = node.compileToFragments(o); + code = node.compile(o); if (!node.isStatement(o)) { - fragments.unshift(this.makeCode("" + this.tab)); - fragments.push(this.makeCode(";")); + code = "" + this.tab + code + ";"; + if (node instanceof Literal) code = "" + code + "\n"; } - compiledNodes.push(fragments); + codes.push(code); } else { - compiledNodes.push(node.compileToFragments(o, LEVEL_LIST)); + codes.push(node.compile(o, LEVEL_LIST)); } } if (top) { if (this.spaced) { - return [].concat(this.joinFragmentArrays(compiledNodes, '\n\n'), this.makeCode("\n")); + return "\n" + (codes.join('\n\n')) + "\n"; } else { - return this.joinFragmentArrays(compiledNodes, '\n'); + return codes.join('\n'); } } - if (compiledNodes.length) { - answer = this.joinFragmentArrays(compiledNodes, ', '); + code = codes.join(', ') || 'void 0'; + if (codes.length > 1 && o.level >= LEVEL_LIST) { + return "(" + code + ")"; } else { - answer = [this.makeCode("void 0")]; - } - if (compiledNodes.length > 1 && o.level >= LEVEL_LIST) { - return this.wrapInBraces(answer); - } else { - return answer; + return code; } }; Block.prototype.compileRoot = function(o) { - var exp, fragments, i, name, prelude, preludeExps, rest, _i, _len, _ref2; + 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; - o.scope = new Scope(null, this, null); - _ref2 = o.locals || []; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - name = _ref2[_i]; - o.scope.parameter(name); - } - prelude = []; + prelude = ""; if (!o.bare) { preludeExps = (function() { - var _j, _len1, _ref3, _results; - _ref3 = this.expressions; + var _i, _len, _ref2, _results; + _ref2 = this.expressions; _results = []; - for (i = _j = 0, _len1 = _ref3.length; _j < _len1; i = ++_j) { - exp = _ref3[i]; - if (!(exp.unwrap() instanceof Comment)) { - break; - } + 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; @@ -463,31 +359,25 @@ define(function(require, exports, module) { rest = this.expressions.slice(preludeExps.length); this.expressions = preludeExps; if (preludeExps.length) { - prelude = this.compileNode(merge(o, { + prelude = "" + (this.compileNode(merge(o, { indent: '' - })); - prelude.push(this.makeCode("\n")); + }))) + "\n"; } this.expressions = rest; } - fragments = this.compileWithDeclarations(o); - if (o.bare) { - return fragments; - } - return [].concat(prelude, this.makeCode("(function() {\n"), fragments, this.makeCode("\n}).call(this);\n")); + 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, declars, exp, fragments, i, post, rest, scope, spaced, _i, _len, _ref2, _ref3, _ref4; - fragments = []; - post = []; + 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; - } + if (!(exp instanceof Comment || exp instanceof Literal)) break; } o = merge(o, { level: LEVEL_TOP @@ -495,7 +385,7 @@ define(function(require, exports, module) { if (i) { rest = this.expressions.splice(i, 9e9); _ref3 = [this.spaced, false], spaced = _ref3[0], this.spaced = _ref3[1]; - _ref4 = [this.compileNode(o), spaced], fragments = _ref4[0], this.spaced = _ref4[1]; + _ref4 = [this.compileNode(o), spaced], code = _ref4[0], this.spaced = _ref4[1]; this.expressions = rest; } post = this.compileNode(o); @@ -504,31 +394,21 @@ define(function(require, exports, module) { declars = o.scope.hasDeclarations(); assigns = scope.hasAssignments; if (declars || assigns) { - if (i) { - fragments.push(this.makeCode('\n')); - } - fragments.push(this.makeCode("" + this.tab + "var ")); - if (declars) { - fragments.push(this.makeCode(scope.declaredVariables().join(', '))); - } + if (i) code += '\n'; + code += "" + this.tab + "var "; + if (declars) code += scope.declaredVariables().join(', '); if (assigns) { - if (declars) { - fragments.push(this.makeCode(",\n" + (this.tab + TAB))); - } - fragments.push(this.makeCode(scope.assignedVariables().join(",\n" + (this.tab + TAB)))); + if (declars) code += ",\n" + (this.tab + TAB); + code += scope.assignedVariables().join(",\n" + (this.tab + TAB)); } - fragments.push(this.makeCode(";\n" + (this.spaced ? '\n' : ''))); - } else if (fragments.length && post.length) { - fragments.push(this.makeCode("\n")); + code += ';\n'; } } - return fragments.concat(post); + return code + post; }; Block.wrap = function(nodes) { - if (nodes.length === 1 && nodes[0] instanceof Block) { - return nodes[0]; - } + if (nodes.length === 1 && nodes[0] instanceof Block) return nodes[0]; return new Block(nodes); }; @@ -537,8 +417,11 @@ define(function(require, exports, module) { })(Base); exports.Literal = Literal = (function(_super) { + __extends(Literal, _super); + Literal.name = 'Literal'; + function Literal(value) { this.value = value; } @@ -570,16 +453,17 @@ define(function(require, exports, module) { 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; - } + if (this.value === 'continue' && !(o != null ? o.loop : void 0)) return this; }; Literal.prototype.compileNode = function(o) { - var answer, code, _ref2; - code = this.value === 'this' ? ((_ref2 = o.scope.method) != null ? _ref2.bound : void 0) ? o.scope.method.context : this.value : this.value.reserved ? "\"" + this.value + "\"" : this.value; - answer = this.isStatement() ? "" + this.tab + code + ";" : code; - return [this.makeCode(answer)]; + 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() { @@ -590,70 +474,14 @@ define(function(require, exports, module) { })(Base); - exports.Undefined = (function(_super) { - __extends(Undefined, _super); - - function Undefined() { - return Undefined.__super__.constructor.apply(this, arguments); - } - - Undefined.prototype.isAssignable = NO; - - Undefined.prototype.isComplex = NO; - - Undefined.prototype.compileNode = function(o) { - return [this.makeCode(o.level >= LEVEL_ACCESS ? '(void 0)' : 'void 0')]; - }; - - return Undefined; - - })(Base); - - exports.Null = (function(_super) { - __extends(Null, _super); - - function Null() { - return Null.__super__.constructor.apply(this, arguments); - } - - Null.prototype.isAssignable = NO; - - Null.prototype.isComplex = NO; - - Null.prototype.compileNode = function() { - return [this.makeCode("null")]; - }; - - return Null; - - })(Base); - - exports.Bool = (function(_super) { - __extends(Bool, _super); - - Bool.prototype.isAssignable = NO; - - Bool.prototype.isComplex = NO; - - Bool.prototype.compileNode = function() { - return [this.makeCode(this.val)]; - }; - - function Bool(val) { - this.val = val; - } - - return Bool; - - })(Base); - exports.Return = Return = (function(_super) { + __extends(Return, _super); + Return.name = 'Return'; + function Return(expr) { - if (expr && !expr.unwrap().isUndefined) { - this.expression = expr; - } + if (expr && !expr.unwrap().isUndefined) this.expression = expr; } Return.prototype.children = ['expression']; @@ -664,25 +492,18 @@ define(function(require, exports, module) { Return.prototype.jumps = THIS; - Return.prototype.compileToFragments = function(o, level) { + 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.compileToFragments(o, level); + return expr.compile(o, level); } else { - return Return.__super__.compileToFragments.call(this, o, level); + return Return.__super__.compile.call(this, o, level); } }; Return.prototype.compileNode = function(o) { - var answer; - answer = []; - answer.push(this.makeCode(this.tab + ("return" + (this.expression ? " " : "")))); - if (this.expression) { - answer = answer.concat(this.expression.compileToFragments(o, LEVEL_PAREN)); - } - answer.push(this.makeCode(";")); - return answer; + return this.tab + ("return" + [this.expression ? " " + (this.expression.compile(o, LEVEL_PAREN)) : void 0] + ";"); }; return Return; @@ -690,17 +511,16 @@ define(function(require, exports, module) { })(Base); exports.Value = Value = (function(_super) { + __extends(Value, _super); + Value.name = 'Value'; + function Value(base, props, tag) { - if (!props && base instanceof Value) { - return base; - } + if (!props && base instanceof Value) return base; this.base = base; this.properties = props || []; - if (tag) { - this[tag] = true; - } + if (tag) this[tag] = true; return this; } @@ -715,16 +535,8 @@ define(function(require, exports, module) { return !!this.properties.length; }; - Value.prototype.bareLiteral = function(type) { - return !this.properties.length && this.base instanceof type; - }; - Value.prototype.isArray = function() { - return this.bareLiteral(Arr); - }; - - Value.prototype.isRange = function() { - return this.bareLiteral(Range); + return !this.properties.length && this.base instanceof Arr; }; Value.prototype.isComplex = function() { @@ -736,15 +548,11 @@ define(function(require, exports, module) { }; Value.prototype.isSimpleNumber = function() { - return this.bareLiteral(Literal) && SIMPLENUM.test(this.base.value); + return this.base instanceof Literal && SIMPLENUM.test(this.base.value); }; Value.prototype.isString = function() { - return this.bareLiteral(Literal) && IS_STRING.test(this.base.value); - }; - - Value.prototype.isRegex = function() { - return this.bareLiteral(Literal) && IS_REGEX.test(this.base.value); + return this.base instanceof Literal && IS_STRING.test(this.base.value); }; Value.prototype.isAtomic = function() { @@ -752,17 +560,11 @@ define(function(require, exports, module) { _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; - } + if (node.soak || node instanceof Call) return false; } return true; }; - Value.prototype.isNotCallable = function() { - return this.isSimpleNumber() || this.isString() || this.isRegex() || this.isArray() || this.isRange() || this.isSplice() || this.isObject(); - }; - Value.prototype.isStatement = function(o) { return !this.properties.length && this.base.isStatement(o); }; @@ -776,9 +578,7 @@ define(function(require, exports, module) { }; Value.prototype.isObject = function(onlyGenerated) { - if (this.properties.length) { - return false; - } + if (this.properties.length) return false; return (this.base instanceof Obj) && (!onlyGenerated || this.base.generated); }; @@ -786,11 +586,6 @@ define(function(require, exports, module) { return last(this.properties) instanceof Slice; }; - Value.prototype.looksStatic = function(className) { - var _ref2; - return this.base.value === className && this.properties.length && ((_ref2 = this.properties[0].name) != null ? _ref2.value : void 0) !== 'prototype'; - }; - Value.prototype.unwrap = function() { if (this.properties.length) { return this; @@ -810,9 +605,7 @@ define(function(require, exports, module) { bref = new Literal(o.scope.freeVariable('base')); base = new Value(new Parens(new Assign(bref, base))); } - if (!name) { - return [base, bref]; - } + if (!name) return [base, bref]; if (name.isComplex()) { nref = new Literal(o.scope.freeVariable('name')); name = new Index(new Assign(nref, name.index)); @@ -822,49 +615,49 @@ define(function(require, exports, module) { }; Value.prototype.compileNode = function(o) { - var fragments, prop, props, _i, _len; + var code, prop, props, _i, _len; this.base.front = this.front; props = this.properties; - fragments = this.base.compileToFragments(o, (props.length ? LEVEL_ACCESS : null)); - if ((this.base instanceof Parens || props.length) && SIMPLENUM.test(fragmentsToText(fragments))) { - fragments.push(this.makeCode('.')); + 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]; - fragments.push.apply(fragments, prop.compileToFragments(o)); + code += prop.compile(o); } - return fragments; + return code; }; Value.prototype.unfoldSoak = function(o) { - return this.unfoldedSoak != null ? this.unfoldedSoak : this.unfoldedSoak = (function(_this) { - return function() { - var fst, i, ifn, prop, ref, snd, _i, _len, _ref2, _ref3; - if (ifn = _this.base.unfoldSoak(o)) { - (_ref2 = ifn.body.properties).push.apply(_ref2, _this.properties); - return ifn; + 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; } - _ref3 = _this.properties; - for (i = _i = 0, _len = _ref3.length; _i < _len; i = ++_i) { - prop = _ref3[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 false; - }; - })(this)(); + return new If(new Existence(fst), snd, { + soak: true + }); + } + return null; + })(); + return this.unfoldedSoak = result || false; }; return Value; @@ -872,8 +665,11 @@ define(function(require, exports, module) { })(Base); exports.Comment = Comment = (function(_super) { + __extends(Comment, _super); + Comment.name = 'Comment'; + function Comment(comment) { this.comment = comment; } @@ -883,13 +679,10 @@ define(function(require, exports, module) { Comment.prototype.makeReturn = THIS; Comment.prototype.compileNode = function(o, level) { - var code, comment; - comment = this.comment.replace(/^(\s*)#/gm, "$1 *"); - code = "/*" + (multident(comment, this.tab)) + (__indexOf.call(comment, '\n') >= 0 ? "\n" + this.tab : '') + " */"; - if ((level || o.level) === LEVEL_TOP) { - code = o.indent + code; - } - return [this.makeCode("\n"), this.makeCode(code)]; + 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; @@ -897,17 +690,17 @@ define(function(require, exports, module) { })(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; - if (variable instanceof Value && variable.isNotCallable()) { - variable.error("literal is not a function"); - } } Call.prototype.children = ['variable', 'args']; @@ -924,35 +717,30 @@ define(function(require, exports, module) { }; Call.prototype.superReference = function(o) { - var accesses, method; - method = o.scope.namedMethod(); - if (method != null ? method.klass : void 0) { + 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(method.name))); + accesses.push(new Access(new Literal(name))); return (new Value(new Literal(method.klass), accesses)).compile(o); - } else if (method != null ? method.ctor : void 0) { - return "" + method.name + ".__super__.constructor"; } else { - return this.error('cannot call super outside of an instance method.'); + return "" + name + ".__super__.constructor"; } }; - Call.prototype.superThis = function(o) { - var method; - method = o.scope.method; - return (method && !method.klass && method.context) || "this"; - }; - Call.prototype.unfoldSoak = function(o) { var call, ifn, left, list, rite, _i, _len, _ref2, _ref3; if (this.soak) { if (this.variable) { - if (ifn = unfoldSoak(o, this, 'variable')) { - return ifn; - } + 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)); @@ -973,13 +761,9 @@ define(function(require, exports, module) { call = call.variable; continue; } - if (!(call.variable instanceof Value)) { - break; - } + if (!(call.variable instanceof Value)) break; list.push(call); - if (!((call = call.variable.base) instanceof Call)) { - break; - } + if (!((call = call.variable.base) instanceof Call)) break; } _ref3 = list.reverse(); for (_i = 0, _len = _ref3.length; _i < _len; _i++) { @@ -996,71 +780,82 @@ define(function(require, exports, module) { 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, argIndex, compiledArgs, compiledArray, fragments, preface, _i, _len, _ref2, _ref3; - if ((_ref2 = this.variable) != null) { - _ref2.front = this.front; + 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); } - compiledArray = Splat.compileSplattedArray(o, this.args, true); - if (compiledArray.length) { - return this.compileSplat(o, compiledArray); - } - compiledArgs = []; - _ref3 = this.args; - for (argIndex = _i = 0, _len = _ref3.length; _i < _len; argIndex = ++_i) { - arg = _ref3[argIndex]; - if (argIndex) { - compiledArgs.push(this.makeCode(", ")); + 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)); } - compiledArgs.push.apply(compiledArgs, arg.compileToFragments(o, LEVEL_LIST)); - } - fragments = []; + return _results; + })()).join(', '); if (this.isSuper) { - preface = this.superReference(o) + (".call(" + (this.superThis(o))); - if (compiledArgs.length) { - preface += ", "; - } - fragments.push(this.makeCode(preface)); + return this.superReference(o) + (".call(this" + (args && ', ' + args) + ")"); } else { - if (this.isNew) { - fragments.push(this.makeCode('new ')); - } - fragments.push.apply(fragments, this.variable.compileToFragments(o, LEVEL_ACCESS)); - fragments.push(this.makeCode("(")); + return (this.isNew ? 'new ' : '') + this.variable.compile(o, LEVEL_ACCESS) + ("(" + args + ")"); } - fragments.push.apply(fragments, compiledArgs); - fragments.push(this.makeCode(")")); - return fragments; + }; + + Call.prototype.compileSuper = function(args, o) { + return "" + (this.superReference(o)) + ".call(this" + (args.length ? ', ' : '') + args + ")"; }; Call.prototype.compileSplat = function(o, splatArgs) { - var answer, base, fun, idt, name, ref; + var base, fun, idt, name, ref; if (this.isSuper) { - return [].concat(this.makeCode("" + (this.superReference(o)) + ".apply(" + (this.superThis(o)) + ", "), splatArgs, this.makeCode(")")); + return "" + (this.superReference(o)) + ".apply(this, " + splatArgs + ")"; } if (this.isNew) { idt = this.tab + TAB; - return [].concat(this.makeCode("(function(func, args, ctor) {\n" + idt + "ctor.prototype = func.prototype;\n" + idt + "var child = new ctor, result = func.apply(child, args);\n" + idt + "return Object(result) === result ? result : child;\n" + this.tab + "})("), this.variable.compileToFragments(o, LEVEL_LIST), this.makeCode(", "), splatArgs, this.makeCode(", function(){})")); + 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(){})"; } - answer = []; base = new Value(this.variable); if ((name = base.properties.pop()) && base.isComplex()) { ref = o.scope.freeVariable('ref'); - answer = answer.concat(this.makeCode("(" + ref + " = "), base.compileToFragments(o, LEVEL_LIST), this.makeCode(")"), name.compileToFragments(o)); + fun = "(" + ref + " = " + (base.compile(o, LEVEL_LIST)) + ")" + (name.compile(o)); } else { - fun = base.compileToFragments(o, LEVEL_ACCESS); - if (SIMPLENUM.test(fragmentsToText(fun))) { - fun = this.wrapInBraces(fun); - } + fun = base.compile(o, LEVEL_ACCESS); + if (SIMPLENUM.test(fun)) fun = "(" + fun + ")"; if (name) { - ref = fragmentsToText(fun); - fun.push.apply(fun, name.compileToFragments(o)); + ref = fun; + fun += name.compile(o); } else { ref = 'null'; } - answer = answer.concat(fun); } - return answer = answer.concat(this.makeCode(".apply(" + ref + ", "), splatArgs, this.makeCode(")")); + return "" + fun + ".apply(" + ref + ", " + splatArgs + ")"; }; return Call; @@ -1068,8 +863,11 @@ define(function(require, exports, module) { })(Base); exports.Extends = Extends = (function(_super) { + __extends(Extends, _super); + Extends.name = 'Extends'; + function Extends(child, parent) { this.child = child; this.parent = parent; @@ -1077,8 +875,8 @@ define(function(require, exports, module) { Extends.prototype.children = ['child', 'parent']; - Extends.prototype.compileToFragments = function(o) { - return new Call(new Value(new Literal(utility('extends'))), [this.child, this.parent]).compileToFragments(o); + Extends.prototype.compile = function(o) { + return new Call(new Value(new Literal(utility('extends'))), [this.child, this.parent]).compile(o); }; return Extends; @@ -1086,8 +884,11 @@ define(function(require, exports, module) { })(Base); exports.Access = Access = (function(_super) { + __extends(Access, _super); + Access.name = 'Access'; + function Access(name, tag) { this.name = name; this.name.asKey = true; @@ -1096,16 +897,14 @@ define(function(require, exports, module) { Access.prototype.children = ['name']; - Access.prototype.compileToFragments = function(o) { + Access.prototype.compile = function(o) { var name; - name = this.name.compileToFragments(o); - if (IDENTIFIER.test(fragmentsToText(name))) { - name.unshift(this.makeCode(".")); + name = this.name.compile(o); + if (IDENTIFIER.test(name)) { + return "." + name; } else { - name.unshift(this.makeCode("[")); - name.push(this.makeCode("]")); + return "[" + name + "]"; } - return name; }; Access.prototype.isComplex = NO; @@ -1115,16 +914,19 @@ define(function(require, exports, module) { })(Base); exports.Index = Index = (function(_super) { + __extends(Index, _super); + Index.name = 'Index'; + function Index(index) { this.index = index; } Index.prototype.children = ['index']; - Index.prototype.compileToFragments = function(o) { - return [].concat(this.makeCode("["), this.index.compileToFragments(o, LEVEL_PAREN), this.makeCode("]")); + Index.prototype.compile = function(o) { + return "[" + (this.index.compile(o, LEVEL_PAREN)) + "]"; }; Index.prototype.isComplex = function() { @@ -1136,8 +938,11 @@ define(function(require, exports, module) { })(Base); exports.Range = Range = (function(_super) { + __extends(Range, _super); + Range.name = 'Range'; + Range.prototype.children = ['from', 'to']; function Range(from, to, tag) { @@ -1152,46 +957,32 @@ define(function(require, exports, module) { o = merge(o, { top: true }); - _ref2 = this.cacheToCodeFragments(this.from.cache(o, LEVEL_LIST)), this.fromC = _ref2[0], this.fromVar = _ref2[1]; - _ref3 = this.cacheToCodeFragments(this.to.cache(o, LEVEL_LIST)), this.toC = _ref3[0], this.toVar = _ref3[1]; + _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 = this.cacheToCodeFragments(step.cache(o, LEVEL_LIST)), this.step = _ref4[0], this.stepVar = _ref4[1]; - } - _ref5 = [this.fromVar.match(NUMBER), this.toVar.match(NUMBER)], this.fromNum = _ref5[0], this.toNum = _ref5[1]; - if (this.stepVar) { - return this.stepNum = this.stepVar.match(NUMBER); + _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); - } + 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; - } + 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 ? parseNum(this.stepNum[0]) > 0 ? "" + lt + " " + this.toVar : "" + gt + " " + this.toVar : known ? ((_ref3 = [parseNum(this.fromNum[0]), parseNum(this.toNum[0])], from = _ref3[0], to = _ref3[1], _ref3), from <= to ? "" + lt + " " + to : "" + gt + " " + to) : (cond = this.stepVar ? "" + this.stepVar + " > 0" : "" + this.fromVar + " <= " + this.toVar, "" + cond + " ? " + lt + " " + this.toVar + " : " + gt + " " + this.toVar); + 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 [this.makeCode("" + varPart + "; " + condPart + "; " + stepPart)]; + if (namedIndex) varPart = "" + idxName + " = " + varPart; + if (namedIndex) stepPart = "" + idxName + " = " + stepPart; + return "" + varPart + "; " + condPart + "; " + stepPart; }; Range.prototype.compileArray = function(o) { @@ -1202,10 +993,8 @@ define(function(require, exports, module) { 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 [this.makeCode("[" + (range.join(', ')) + "]")]; + if (this.exclusive) range.pop(); + return "[" + (range.join(', ')) + "]"; } idt = this.tab + TAB; i = o.scope.freeVariable('i'); @@ -1213,7 +1002,7 @@ define(function(require, exports, module) { pre = "\n" + idt + result + " = [];"; if (this.fromNum && this.toNum) { o.index = i; - body = fragmentsToText(this.compileNode(o)); + body = this.compileNode(o); } else { vars = ("" + i + " = " + this.fromC) + (this.toC !== this.toVar ? ", " + this.toC : ''); cond = "" + this.fromVar + " <= " + this.toVar; @@ -1221,12 +1010,12 @@ define(function(require, exports, module) { } post = "{ " + result + ".push(" + i + "); }\n" + idt + "return " + result + ";\n" + o.indent; hasArgs = function(node) { - return node != null ? node.contains(isLiteralArguments) : void 0; + 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 [this.makeCode("(function() {" + pre + "\n" + idt + "for (" + body + ")" + post + "}).apply(this" + (args != null ? args : '') + ")")]; + if (hasArgs(this.from) || hasArgs(this.to)) args = ', arguments'; + return "(function() {" + pre + "\n" + idt + "for (" + body + ")" + post + "}).apply(this" + (args != null ? args : '') + ")"; }; return Range; @@ -1234,8 +1023,11 @@ define(function(require, exports, module) { })(Base); exports.Slice = Slice = (function(_super) { + __extends(Slice, _super); + Slice.name = 'Slice'; + Slice.prototype.children = ['range']; function Slice(range) { @@ -1244,17 +1036,14 @@ define(function(require, exports, module) { } Slice.prototype.compileNode = function(o) { - var compiled, compiledText, from, fromCompiled, to, toStr, _ref2; + var compiled, from, fromStr, to, toStr, _ref2; _ref2 = this.range, to = _ref2.to, from = _ref2.from; - fromCompiled = from && from.compileToFragments(o, LEVEL_PAREN) || [this.makeCode('0')]; - if (to) { - compiled = to.compileToFragments(o, LEVEL_PAREN); - compiledText = fragmentsToText(compiled); - if (!(!this.range.exclusive && +compiledText === -1)) { - toStr = ', ' + (this.range.exclusive ? compiledText : SIMPLENUM.test(compiledText) ? "" + (+compiledText + 1) : (compiled = to.compileToFragments(o, LEVEL_ACCESS), "+" + (fragmentsToText(compiled)) + " + 1 || 9e9")); - } + 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 [this.makeCode(".slice(" + (fragmentsToText(fromCompiled)) + (toStr || '') + ")")]; + return ".slice(" + fromStr + (toStr || '') + ")"; }; return Slice; @@ -1262,8 +1051,11 @@ define(function(require, exports, module) { })(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 || []; @@ -1272,52 +1064,56 @@ define(function(require, exports, module) { Obj.prototype.children = ['properties']; Obj.prototype.compileNode = function(o) { - var answer, i, idt, indent, join, lastNoncom, node, prop, props, _i, _j, _len, _len1; + var i, idt, indent, join, lastNoncom, node, obj, prop, propName, propNames, props, _i, _j, _len, _len1, _ref2; props = this.properties; - if (!props.length) { - return [this.makeCode(this.front ? '({})' : '{}')]; + 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 (_i = 0, _len = props.length; _i < _len; _i++) { - node = props[_i]; + for (_j = 0, _len1 = props.length; _j < _len1; _j++) { + node = props[_j]; if (node instanceof Value) { - node.error('cannot have an implicit value in an implicit object'); + throw new Error('cannot have an implicit value in an implicit object'); } } } idt = o.indent += TAB; lastNoncom = this.lastNonComment(this.properties); - answer = []; - for (i = _j = 0, _len1 = props.length; _j < _len1; i = ++_j) { - prop = props[i]; - join = i === props.length - 1 ? '' : prop === lastNoncom || prop instanceof Comment ? '\n' : ',\n'; - indent = prop instanceof Comment ? '' : idt; - if (prop instanceof Assign && prop.variable instanceof Value && prop.variable.hasProperties()) { - prop.variable.error('Invalid object key'); - } - 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'); + 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'); } - (prop.variable.base || prop.variable).asKey = true; + 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); } - if (indent) { - answer.push(this.makeCode(indent)); - } - answer.push.apply(answer, prop.compileToFragments(o, LEVEL_TOP)); - if (join) { - answer.push(this.makeCode(join)); - } - } - answer.unshift(this.makeCode("{" + (props.length && '\n'))); - answer.push(this.makeCode("" + (props.length && '\n' + this.tab) + "}")); + return _results; + })(); + props = props.join(''); + obj = "{" + (props && '\n' + props + '\n' + this.tab) + "}"; if (this.front) { - return this.wrapInBraces(answer); + return "(" + obj + ")"; } else { - return answer; + return obj; } }; @@ -1326,9 +1122,7 @@ define(function(require, exports, module) { _ref2 = this.properties; for (_i = 0, _len = _ref2.length; _i < _len; _i++) { prop = _ref2[_i]; - if (prop.assigns(name)) { - return true; - } + if (prop.assigns(name)) return true; } return false; }; @@ -1338,50 +1132,39 @@ define(function(require, exports, module) { })(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 answer, compiledObjs, fragments, index, obj, _i, _len; - if (!this.objects.length) { - return [this.makeCode('[]')]; - } + var code, obj, objs; + if (!this.objects.length) return '[]'; o.indent += TAB; - answer = Splat.compileSplattedArray(o, this.objects); - if (answer.length) { - return answer; - } - answer = []; - compiledObjs = (function() { - var _i, _len, _ref2, _results; - _ref2 = this.objects; + objs = this.filterImplicitObjects(this.objects); + if (code = Splat.compileSplattedArray(o, objs)) return code; + code = ((function() { + var _i, _len, _results; _results = []; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - obj = _ref2[_i]; - _results.push(obj.compileToFragments(o, LEVEL_LIST)); + for (_i = 0, _len = objs.length; _i < _len; _i++) { + obj = objs[_i]; + _results.push(obj.compile(o, LEVEL_LIST)); } return _results; - }).call(this); - for (index = _i = 0, _len = compiledObjs.length; _i < _len; index = ++_i) { - fragments = compiledObjs[index]; - if (index) { - answer.push(this.makeCode(", ")); - } - answer.push.apply(answer, fragments); - } - if (fragmentsToText(answer).indexOf('\n') >= 0) { - answer.unshift(this.makeCode("[\n" + o.indent)); - answer.push(this.makeCode("\n" + this.tab + "]")); + })()).join(', '); + if (code.indexOf('\n') >= 0) { + return "[\n" + o.indent + code + "\n" + this.tab + "]"; } else { - answer.unshift(this.makeCode("[")); - answer.push(this.makeCode("]")); + return "[" + code + "]"; } - return answer; }; Arr.prototype.assigns = function(name) { @@ -1389,9 +1172,7 @@ define(function(require, exports, module) { _ref2 = this.objects; for (_i = 0, _len = _ref2.length; _i < _len; _i++) { obj = _ref2[_i]; - if (obj.assigns(name)) { - return true; - } + if (obj.assigns(name)) return true; } return false; }; @@ -1401,8 +1182,11 @@ define(function(require, exports, module) { })(Base); exports.Class = Class = (function(_super) { + __extends(Class, _super); + Class.name = 'Class'; + function Class(variable, parent, body) { this.variable = variable; this.parent = parent; @@ -1415,39 +1199,37 @@ define(function(require, exports, module) { Class.prototype.determineName = function() { var decl, tail; - if (!this.variable) { - return null; - } + 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) { - this.variable.error("class variable name may not be " + decl); + 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.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; - } + if (node.bound) return node.context = name; } }); }; Class.prototype.addBoundFunctions = function(o) { - var bvar, lhs, _i, _len, _ref2; - _ref2 = this.boundFuncs; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - bvar = _ref2[_i]; - lhs = (new Value(new Literal("this"), [new Access(bvar)])).compile(o); - this.ctor.body.unshift(new Literal("" + lhs + " = " + (utility('bind')) + "(" + lhs + ", this)")); + 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; } }; @@ -1464,20 +1246,21 @@ define(function(require, exports, module) { func = assign.value; if (base.value === 'constructor') { if (this.ctor) { - assign.error('cannot define more than one constructor in a class'); + throw new Error('cannot define more than one constructor in a class'); } if (func.bound) { - assign.error('cannot define a constructor as a bound function'); + throw new Error('cannot define a constructor as a bound function'); } if (func instanceof Code) { assign = this.ctor = func; } else { - this.externalCtor = o.classScope.freeVariable('class'); + 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) { @@ -1495,29 +1278,21 @@ define(function(require, exports, module) { }; Class.prototype.walkBody = function(name, o) { - return this.traverseChildren(false, (function(_this) { - return function(child) { - var cont, exps, i, node, _i, _len, _ref2; - cont = true; - 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 Assign && node.variable.looksStatic(name)) { - node.value["static"] = true; - } else if (node instanceof Value && node.isObject(true)) { - cont = false; - exps[i] = _this.addProperties(node, 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); } - child.expressions = exps = flatten(exps); } - return cont && !(child instanceof Class); - }; - })(this)); + return child.expressions = exps = flatten(exps); + } + }); }; Class.prototype.hoistDirectivePrologue = function() { @@ -1533,10 +1308,11 @@ define(function(require, exports, module) { 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)")); - } else if (this.parent) { - this.ctor.body.push(new Literal("" + name + ".__super__.constructor.apply(this, arguments)")); } this.ctor.body.makeReturn(); this.body.expressions.unshift(this.ctor); @@ -1547,40 +1323,34 @@ define(function(require, exports, module) { }; Class.prototype.compileNode = function(o) { - var args, argumentsNode, func, jumpNode, klass, lname, name, superClass, _ref2; - if (jumpNode = this.body.jumps()) { - jumpNode.error('Class bodies cannot contain pure statements'); - } - if (argumentsNode = this.body.contains(isLiteralArguments)) { - argumentsNode.error("Class bodies shouldn't reference arguments"); - } - name = this.determineName() || '_Class'; - if (name.reserved) { - name = "_" + name; - } + var call, decl, klass, lname, name, params, _ref2; + decl = this.determineName(); + name = decl || '_Class'; + if (name.reserved) name = "_" + name; lname = new Literal(name); - func = new Code([], Block.wrap([this.body])); - args = []; - o.classScope = func.makeScope(o.scope); this.hoistDirectivePrologue(); this.setContext(name); this.walkBody(name, o); this.ensureConstructor(name); - this.addBoundFunctions(o); 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); - if (this.parent) { - superClass = new Literal(o.classScope.freeVariable('super', false)); - this.body.expressions.unshift(new Extends(lname, superClass)); - func.params.push(new Param(superClass)); - args.push(this.parent); - } (_ref2 = this.body.expressions).unshift.apply(_ref2, this.directives); - klass = new Parens(new Call(func, args)); - if (this.variable) { - klass = new Assign(this.variable, klass); + 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)); } - return klass.compileToFragments(o); + klass = new Parens(call, true); + if (this.variable) klass = new Assign(this.variable, klass); + return klass.compile(o); }; return Class; @@ -1588,8 +1358,11 @@ define(function(require, exports, module) { })(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; @@ -1599,7 +1372,7 @@ define(function(require, exports, module) { this.subpattern = options && options.subpattern; forbidden = (_ref2 = (name = this.variable.unwrapAll().value), __indexOf.call(STRICT_PROSCRIBED, _ref2) >= 0); if (forbidden && this.context !== 'object') { - this.variable.error("variable name may not be \"" + name + "\""); + throw SyntaxError("variable name may not be \"" + name + "\""); } } @@ -1618,24 +1391,20 @@ define(function(require, exports, module) { }; Assign.prototype.compileNode = function(o) { - var answer, compiledName, isValue, match, name, val, varBase, _ref2, _ref3, _ref4; + 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 (this.variable.isSplice()) return this.compileSplice(o); if ((_ref2 = this.context) === '||=' || _ref2 === '&&=' || _ref2 === '?=') { return this.compileConditional(o); } } - compiledName = this.variable.compileToFragments(o, LEVEL_LIST); - name = fragmentsToText(compiledName); + name = this.variable.compile(o, LEVEL_LIST); if (!this.context) { - varBase = this.variable.unwrapAll(); - if (!varBase.isAssignable()) { - this.variable.error("\"" + (this.variable.compile(o)) + "\" cannot be assigned"); + 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) { @@ -1646,32 +1415,28 @@ define(function(require, exports, module) { } } if (this.value instanceof Code && (match = METHOD_DEF.exec(name))) { - if (match[2]) { - this.value.klass = match[1]; - } - this.value.name = (_ref3 = (_ref4 = match[3]) != null ? _ref4 : match[4]) != null ? _ref3 : match[5]; + 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.compileToFragments(o, LEVEL_LIST); - if (this.context === 'object') { - return compiledName.concat(this.makeCode(": "), val); - } - answer = compiledName.concat(this.makeCode(" " + (this.context || '=') + " "), val); + 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 answer; + return val; } else { - return this.wrapInBraces(answer); + return "(" + val + ")"; } }; Assign.prototype.compilePatternMatch = function(o) { - var acc, assigns, code, fragments, i, idx, isObject, ivar, name, obj, objects, olen, ref, rest, splat, top, val, value, vvar, vvarText, _i, _len, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7; + 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.compileToFragments(o); + code = value.compile(o); if (o.level >= LEVEL_OP) { - return this.wrapInBraces(code); + return "(" + code + ")"; } else { return code; } @@ -1681,36 +1446,38 @@ define(function(require, exports, module) { if (obj instanceof Assign) { _ref2 = obj, (_ref3 = _ref2.variable, idx = _ref3.base), obj = _ref2.value; } else { - idx = isObject ? obj["this"] ? obj.properties[0].name : obj : new Literal(0); + 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 (_ref4 = obj.unwrap().value, __indexOf.call(RESERVED, _ref4) >= 0) { - obj.error("assignment to a reserved word: " + (obj.compile(o))); + 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 - }).compileToFragments(o, LEVEL_TOP); + }).compile(o, LEVEL_TOP); } - vvar = value.compileToFragments(o, LEVEL_LIST); - vvarText = fragmentsToText(vvar); + vvar = value.compile(o, LEVEL_LIST); assigns = []; splat = false; - if (!IDENTIFIER.test(vvarText) || this.variable.assigns(vvarText)) { - assigns.push([this.makeCode("" + (ref = o.scope.freeVariable('ref')) + " = ")].concat(__slice.call(vvar))); - vvar = [this.makeCode(ref)]; - vvarText = ref; + 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) { - _ref5 = obj, (_ref6 = _ref5.variable, idx = _ref6.base), obj = _ref5.value; + _ref6 = obj, (_ref7 = _ref6.variable, idx = _ref7.base), obj = _ref6.value; } else { if (obj.base instanceof Parens) { - _ref7 = new Value(obj.unwrapAll()).cacheReference(o), obj = _ref7[0], idx = _ref7[1]; + _ref8 = new Value(obj.unwrapAll()).cacheReference(o), obj = _ref8[0], idx = _ref8[1]; } else { idx = obj["this"] ? obj.properties[0].name : obj; } @@ -1719,10 +1486,10 @@ define(function(require, exports, module) { if (!splat && obj instanceof Splat) { name = obj.name.unwrap().value; obj = obj.unwrap(); - val = "" + olen + " <= " + vvarText + ".length ? " + (utility('slice')) + ".call(" + vvarText + ", " + i; + val = "" + olen + " <= " + vvar + ".length ? " + (utility('slice')) + ".call(" + vvar + ", " + i; if (rest = olen - i - 1) { ivar = o.scope.freeVariable('i'); - val += ", " + ivar + " = " + vvarText + ".length - " + rest + ") : (" + ivar + " = " + i + ", [])"; + val += ", " + ivar + " = " + vvar + ".length - " + rest + ") : (" + ivar + " = " + i + ", [])"; } else { val += ") : []"; } @@ -1731,7 +1498,8 @@ define(function(require, exports, module) { } else { name = obj.unwrap().value; if (obj instanceof Splat) { - obj.error("multiple splats are disallowed in an assignment"); + 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); @@ -1739,78 +1507,57 @@ define(function(require, exports, module) { } else { acc = isObject && IDENTIFIER.test(idx.unwrap().value || 0); } - val = new Value(new Literal(vvarText), [new (acc ? Access : Index)(idx)]); + val = new Value(new Literal(vvar), [new (acc ? Access : Index)(idx)]); } if ((name != null) && __indexOf.call(RESERVED, name) >= 0) { - obj.error("assignment to a reserved word: " + (obj.compile(o))); + 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 - }).compileToFragments(o, LEVEL_LIST)); + }).compile(o, LEVEL_LIST)); } - if (!(top || this.subpattern)) { - assigns.push(vvar); - } - fragments = this.joinFragmentArrays(assigns, ', '); + if (!(top || this.subpattern)) assigns.push(vvar); + code = assigns.join(', '); if (o.level < LEVEL_LIST) { - return fragments; + return code; } else { - return this.wrapInBraces(fragments); + return "(" + code + ")"; } }; Assign.prototype.compileConditional = function(o) { - var fragments, left, right, _ref2; + var left, right, _ref2; _ref2 = this.variable.cacheReference(o), left = _ref2[0], right = _ref2[1]; - if (!left.properties.length && left.base instanceof Literal && left.base.value !== "this" && !o.scope.check(left.base.value)) { - this.variable.error("the variable \"" + left.base.value + "\" can't be assigned with " + this.context + " because it has not been declared before"); - } - if (__indexOf.call(this.context, "?") >= 0) { - o.isExistentialEquals = true; - return new If(new Existence(left), right, { - type: 'if' - }).addElse(new Assign(right, this.value, '=')).compileToFragments(o); - } else { - fragments = new Op(this.context.slice(0, -1), left, new Assign(right, this.value, '=')).compileToFragments(o); - if (o.level <= LEVEL_LIST) { - return fragments; - } else { - return this.wrapInBraces(fragments); - } + 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 answer, exclusive, from, fromDecl, fromRef, name, to, valDef, valRef, _ref2, _ref3, _ref4; + 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); - if (from) { - _ref3 = this.cacheToCodeFragments(from.cache(o, LEVEL_OP)), fromDecl = _ref3[0], fromRef = _ref3[1]; - } else { - fromDecl = fromRef = '0'; - } + _ref3 = (from != null ? from.cache(o, LEVEL_OP) : void 0) || ['0', '0'], fromDecl = _ref3[0], fromRef = _ref3[1]; if (to) { - if (from instanceof Value && from.isSimpleNumber() && to instanceof Value && to.isSimpleNumber()) { - to = to.compile(o) - fromRef; - if (!exclusive) { - to += 1; - } + 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'; - } + if (!exclusive) to += ' + 1'; } } else { to = "9e9"; } _ref4 = this.value.cache(o, LEVEL_LIST), valDef = _ref4[0], valRef = _ref4[1]; - answer = [].concat(this.makeCode("[].splice.apply(" + name + ", [" + fromDecl + ", " + to + "].concat("), valDef, this.makeCode(")), "), valRef); + code = "[].splice.apply(" + name + ", [" + fromDecl + ", " + to + "].concat(" + valDef + ")), " + valRef; if (o.level > LEVEL_TOP) { - return this.wrapInBraces(answer); + return "(" + code + ")"; } else { - return answer; + return code; } }; @@ -1819,12 +1566,16 @@ define(function(require, exports, module) { })(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']; @@ -1835,70 +1586,47 @@ define(function(require, exports, module) { Code.prototype.jumps = NO; - Code.prototype.makeScope = function(parentScope) { - return new Scope(parentScope, this.body, this); - }; - Code.prototype.compileNode = function(o) { - var answer, boundfunc, code, exprs, i, lit, p, param, params, ref, splats, uniqs, val, wasEmpty, wrapper, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _len5, _m, _n, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7; - if (this.bound && ((_ref2 = o.scope.method) != null ? _ref2.bound : void 0)) { - this.context = o.scope.method.context; - } - if (this.bound && !this.context) { - this.context = '_this'; - wrapper = new Code([new Param(new Literal(this.context))], new Block([this])); - boundfunc = new Call(wrapper, [new Literal('this')]); - boundfunc.updateLocationDataIfMissing(this.locationData); - return boundfunc.compileNode(o); - } - o.scope = del(o, 'classScope') || this.makeScope(o.scope); + 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 = []; - _ref3 = this.params; - for (_i = 0, _len = _ref3.length; _i < _len; _i++) { - param = _ref3[_i]; - o.scope.parameter(param.asReference(o)); + _ref2 = this.paramNames(); + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + name = _ref2[_i]; + if (!o.scope.check(name)) o.scope.parameter(name); } - _ref4 = this.params; - for (_j = 0, _len1 = _ref4.length; _j < _len1; _j++) { - param = _ref4[_j]; - if (!param.splat) { - continue; - } - _ref5 = this.params; - for (_k = 0, _len2 = _ref5.length; _k < _len2; _k++) { - p = _ref5[_k].name; - if (p["this"]) { - p = p.properties[0].name; - } - if (p.value) { - o.scope.add(p.value, 'var', true); - } + _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, _ref6, _results; - _ref6 = this.params; + var _l, _len3, _ref5, _results; + _ref5 = this.params; _results = []; - for (_l = 0, _len3 = _ref6.length; _l < _len3; _l++) { - p = _ref6[_l]; + 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; } - _ref6 = this.params; - for (_l = 0, _len3 = _ref6.length; _l < _len3; _l++) { - param = _ref6[_l]; + _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); - } + if (param.value) val = new Op('?', ref, param.value); exprs.push(new Assign(new Value(param.name), val, '=', { param: true })); @@ -1910,69 +1638,59 @@ define(function(require, exports, module) { exprs.push(new If(lit, val)); } } - if (!splats) { - params.push(ref); - } + if (!splats) params.push(ref); } wasEmpty = this.body.isEmpty(); - if (splats) { - exprs.unshift(splats); - } + if (splats) exprs.unshift(splats); if (exprs.length) { - (_ref7 = this.body.expressions).unshift.apply(_ref7, exprs); + (_ref6 = this.body.expressions).unshift.apply(_ref6, exprs); } for (i = _m = 0, _len4 = params.length; _m < _len4; i = ++_m) { p = params[i]; - params[i] = p.compileToFragments(o); - o.scope.parameter(fragmentsToText(params[i])); + o.scope.parameter(params[i] = p.compile(o)); } uniqs = []; - this.eachParamName(function(name, node) { + _ref7 = this.paramNames(); + for (_n = 0, _len5 = _ref7.length; _n < _len5; _n++) { + name = _ref7[_n]; if (__indexOf.call(uniqs, name) >= 0) { - node.error("multiple parameters named '" + name + "'"); + throw SyntaxError("multiple parameters named '" + name + "'"); } - return uniqs.push(name); - }); - if (!(wasEmpty || this.noReturn)) { - this.body.makeReturn(); + 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 += '('; - answer = [this.makeCode(code)]; - for (i = _n = 0, _len5 = params.length; _n < _len5; i = ++_n) { - p = params[i]; - if (i) { - answer.push(this.makeCode(", ")); - } - answer.push.apply(answer, p); - } - answer.push(this.makeCode(') {')); + if (this.ctor) code += ' ' + this.name; + code += '(' + params.join(', ') + ') {'; if (!this.body.isEmpty()) { - answer = answer.concat(this.makeCode("\n"), this.body.compileWithDeclarations(o), this.makeCode("\n" + this.tab)); - } - answer.push(this.makeCode('}')); - if (this.ctor) { - return [this.makeCode(this.tab)].concat(__slice.call(answer)); + 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 this.wrapInBraces(answer); + return "(" + code + ")"; } else { - return answer; + return code; } }; - Code.prototype.eachParamName = function(iterator) { - var param, _i, _len, _ref2, _results; + Code.prototype.paramNames = function() { + var names, param, _i, _len, _ref2; + names = []; _ref2 = this.params; - _results = []; for (_i = 0, _len = _ref2.length; _i < _len; _i++) { param = _ref2[_i]; - _results.push(param.eachName(iterator)); + names.push.apply(names, param.names()); } - return _results; + return names; }; Code.prototype.traverseChildren = function(crossScope, func) { @@ -1986,29 +1704,30 @@ define(function(require, exports, module) { })(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) { - this.name.error("parameter name \"" + name + "\" is not allowed"); + throw SyntaxError("parameter name \"" + name + "\" is not allowed"); } } Param.prototype.children = ['name', 'value']; - Param.prototype.compileToFragments = function(o) { - return this.name.compileToFragments(o, LEVEL_LIST); + 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; - } + if (this.reference) return this.reference; node = this.name; if (node["this"]) { node = node.properties[0].name; @@ -2019,10 +1738,7 @@ define(function(require, exports, module) { node = new Literal(o.scope.freeVariable('arg')); } node = new Value(node); - if (this.splat) { - node = new Splat(node); - } - node.updateLocationDataIfMissing(this.locationData); + if (this.splat) node = new Splat(node); return this.reference = node; }; @@ -2030,44 +1746,35 @@ define(function(require, exports, module) { return this.name.isComplex(); }; - Param.prototype.eachName = function(iterator, name) { - var atParam, node, obj, _i, _len, _ref2; - if (name == null) { - name = this.name; - } + Param.prototype.names = function(name) { + var atParam, names, obj, _i, _len, _ref2; + if (name == null) name = this.name; atParam = function(obj) { - var node; - node = obj.properties[0].name; - if (!node.value.reserved) { - return iterator(node.value, node); + var value; + value = obj.properties[0].name.value; + if (value.reserved) { + return []; + } else { + return [value]; } }; - if (name instanceof Literal) { - return iterator(name.value, name); - } - if (name instanceof Value) { - return atParam(name); - } + 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) { - this.eachName(iterator, obj.value.unwrap()); - } else if (obj instanceof Splat) { - node = obj.name.unwrap(); - iterator(node.value, node); - } else if (obj instanceof Value) { - if (obj.isArray() || obj.isObject()) { - this.eachName(iterator, obj.base); - } else if (obj["this"]) { - atParam(obj); - } else { - iterator(obj.base.value, obj.base); - } + 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 { - obj.error("illegal parameter " + (obj.compile())); + names.push(obj.base.value); } } + return names; }; return Param; @@ -2075,8 +1782,11 @@ define(function(require, exports, module) { })(Base); exports.Splat = Splat = (function(_super) { + __extends(Splat, _super); + Splat.name = 'Splat'; + Splat.prototype.children = ['name']; Splat.prototype.isAssignable = YES; @@ -2089,8 +1799,12 @@ define(function(require, exports, module) { return this.name.assigns(name); }; - Splat.prototype.compileToFragments = function(o) { - return this.name.compileToFragments(o); + Splat.prototype.compile = function(o) { + if (this.index != null) { + return this.compileParam(o); + } else { + return this.name.compile(o); + } }; Splat.prototype.unwrap = function() { @@ -2098,32 +1812,25 @@ define(function(require, exports, module) { }; Splat.compileSplattedArray = function(o, list, apply) { - var args, base, compiledNode, concatPart, fragments, i, index, node, _i, _len; + 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 (index >= list.length) return ''; if (list.length === 1) { - node = list[0]; - fragments = node.compileToFragments(o, LEVEL_LIST); - if (apply) { - return fragments; - } - return [].concat(node.makeCode("" + (utility('slice')) + ".call("), fragments, node.makeCode(")")); + 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]; - compiledNode = node.compileToFragments(o, LEVEL_LIST); - args[i] = node instanceof Splat ? [].concat(node.makeCode("" + (utility('slice')) + ".call("), compiledNode, node.makeCode(")")) : [].concat(node.makeCode("["), compiledNode, node.makeCode("]")); + code = node.compile(o, LEVEL_LIST); + args[i] = node instanceof Splat ? "" + (utility('slice')) + ".call(" + code + ")" : "[" + code + "]"; } if (index === 0) { - node = list[0]; - concatPart = node.joinFragmentArrays(args.slice(1), ', '); - return args[0].concat(node.makeCode(".concat("), concatPart, node.makeCode(")")); + return args[0] + (".concat(" + (args.slice(1).join(', ')) + ")"); } base = (function() { var _j, _len1, _ref2, _results; @@ -2131,13 +1838,11 @@ define(function(require, exports, module) { _results = []; for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) { node = _ref2[_j]; - _results.push(node.compileToFragments(o, LEVEL_LIST)); + _results.push(node.compile(o, LEVEL_LIST)); } return _results; })(); - base = list[0].joinFragmentArrays(base, ', '); - concatPart = list[index].joinFragmentArrays(args, ', '); - return [].concat(list[0].makeCode("["), base, list[index].makeCode("].concat("), concatPart, (last(list)).makeCode(")")); + return "[" + (base.join(', ')) + "].concat(" + (args.join(', ')) + ")"; }; return Splat; @@ -2145,8 +1850,11 @@ define(function(require, exports, module) { })(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; @@ -2173,29 +1881,25 @@ define(function(require, exports, module) { }; While.prototype.jumps = function() { - var expressions, jumpNode, node, _i, _len; + var expressions, node, _i, _len; expressions = this.body.expressions; - if (!expressions.length) { - return false; - } + if (!expressions.length) return false; for (_i = 0, _len = expressions.length; _i < _len; _i++) { node = expressions[_i]; - if (jumpNode = node.jumps({ + if (node.jumps({ loop: true - })) { - return jumpNode; - } + })) return node; } return false; }; While.prototype.compileNode = function(o) { - var answer, body, rvar, set; + var body, code, rvar, set; o.indent += TAB; set = ''; body = this.body; if (body.isEmpty()) { - body = this.makeCode(''); + body = ''; } else { if (this.returns) { body.makeReturn(rvar = o.scope.freeVariable('results')); @@ -2205,18 +1909,14 @@ define(function(require, exports, module) { 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.guard) body = Block.wrap([new If(this.guard, body)]); } } - body = [].concat(this.makeCode("\n"), body.compileToFragments(o, LEVEL_TOP), this.makeCode("\n" + this.tab)); + body = "\n" + (body.compile(o, LEVEL_TOP)) + "\n" + this.tab; } - answer = [].concat(this.makeCode(set + this.tab + "while ("), this.condition.compileToFragments(o, LEVEL_PAREN), this.makeCode(") {"), body, this.makeCode("}")); - if (this.returns) { - answer.push(this.makeCode("\n" + this.tab + "return " + rvar + ";")); - } - return answer; + 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; @@ -2228,13 +1928,11 @@ define(function(require, exports, module) { __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 === '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(); @@ -2288,9 +1986,7 @@ define(function(require, exports, module) { allInvertable && (allInvertable = curr.operator in INVERSIONS); curr = curr.first; } - if (!allInvertable) { - return new Parens(this).invert(); - } + if (!allInvertable) return new Parens(this).invert(); curr = this; while (curr && curr.operator) { curr.invert = !curr.invert; @@ -2300,9 +1996,7 @@ define(function(require, exports, module) { return this; } else if (op = INVERSIONS[this.operator]) { this.operator = op; - if (this.first.unwrap() instanceof Op) { - this.first.invert(); - } + if (this.first.unwrap() instanceof Op) this.first.invert(); return this; } else if (this.second) { return new Parens(this).invert(); @@ -2338,45 +2032,37 @@ define(function(require, exports, module) { }; Op.prototype.compileNode = function(o) { - var answer, isChain, _ref2, _ref3; + var code, isChain, _ref2, _ref3; isChain = this.isChainable() && this.first.isChainable(); - if (!isChain) { - this.first.front = this.front; - } + if (!isChain) this.first.front = this.front; if (this.operator === 'delete' && o.scope.check(this.first.unwrapAll().value)) { - this.error('delete operand may not be argument or var'); + 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)) { - this.error("cannot increment/decrement \"" + (this.first.unwrapAll().value) + "\""); + 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); - } - answer = [].concat(this.first.compileToFragments(o, LEVEL_OP), this.makeCode(' ' + this.operator + ' '), this.second.compileToFragments(o, LEVEL_OP)); + 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 answer; + return code; } else { - return this.wrapInBraces(answer); + return "(" + code + ")"; } }; Op.prototype.compileChain = function(o) { - var fragments, fst, shared, _ref2; + var code, fst, shared, _ref2; _ref2 = this.first.second.cache(o), this.first.second = _ref2[0], shared = _ref2[1]; - fst = this.first.compileToFragments(o, LEVEL_OP); - fragments = fst.concat(this.makeCode(" " + (this.invert ? '&&' : '||') + " "), shared.compileToFragments(o), this.makeCode(" " + this.operator + " "), this.second.compileToFragments(o, LEVEL_OP)); - return this.wrapInBraces(fragments); + 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()) { + if (this.first.isComplex() && o.level > LEVEL_TOP) { ref = new Literal(o.scope.freeVariable('ref')); fst = new Parens(new Assign(ref, this.first)); } else { @@ -2385,33 +2071,23 @@ define(function(require, exports, module) { } return new If(new Existence(fst), ref, { type: 'if' - }).addElse(this.second).compileToFragments(o); + }).addElse(this.second).compile(o); }; Op.prototype.compileUnary = function(o) { var op, parts, plusMinus; - parts = []; - op = this.operator; - parts.push([this.makeCode(op)]); - if (op === '!' && this.first instanceof Existence) { - this.first.negated = !this.first.negated; - return this.first.compileToFragments(o); - } - if (o.level >= LEVEL_ACCESS) { - return (new Parens(this)).compileToFragments(o); - } + 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([this.makeCode(' ')]); + parts.push(' '); } if ((plusMinus && this.first instanceof Op) || (op === 'new' && this.first.isStatement(o))) { this.first = new Parens(this.first); } - parts.push(this.first.compileToFragments(o, LEVEL_OP)); - if (this.flip) { - parts.reverse(); - } - return this.joinFragmentArrays(parts, ''); + parts.push(this.first.compile(o, LEVEL_OP)); + if (this.flip) parts.reverse(); + return parts.join(''); }; Op.prototype.toString = function(idt) { @@ -2423,8 +2099,11 @@ define(function(require, exports, module) { })(Base); exports.In = In = (function(_super) { + __extends(In, _super); + In.name = 'In'; + function In(object, array) { this.object = object; this.array = array; @@ -2440,54 +2119,48 @@ define(function(require, exports, module) { _ref2 = this.array.base.objects; for (_i = 0, _len = _ref2.length; _i < _len; _i++) { obj = _ref2[_i]; - if (!(obj instanceof Splat)) { - continue; - } + if (!(obj instanceof Splat)) continue; hasSplat = true; break; } - if (!hasSplat) { - return this.compileOrTest(o); - } + if (!hasSplat) return this.compileOrTest(o); } return this.compileLoopTest(o); }; In.prototype.compileOrTest = function(o) { - var cmp, cnj, i, item, ref, sub, tests, _i, _len, _ref2, _ref3, _ref4; - if (this.array.base.objects.length === 0) { - return [this.makeCode("" + (!!this.negated))]; - } + 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 = []; - _ref4 = this.array.base.objects; - for (i = _i = 0, _len = _ref4.length; _i < _len; i = ++_i) { - item = _ref4[i]; - if (i) { - tests.push(this.makeCode(cnj)); + 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)); } - tests = tests.concat((i ? ref : sub), this.makeCode(cmp), item.compileToFragments(o, LEVEL_ACCESS)); - } + return _results; + }).call(this); + tests = tests.join(cnj); if (o.level < LEVEL_OP) { return tests; } else { - return this.wrapInBraces(tests); + return "(" + tests + ")"; } }; In.prototype.compileLoopTest = function(o) { - var fragments, ref, sub, _ref2; + var code, ref, sub, _ref2; _ref2 = this.object.cache(o, LEVEL_LIST), sub = _ref2[0], ref = _ref2[1]; - fragments = [].concat(this.makeCode(utility('indexOf') + ".call("), this.array.compileToFragments(o, LEVEL_LIST), this.makeCode(", "), ref, this.makeCode(") " + (this.negated ? '< 0' : '>= 0'))); - if (fragmentsToText(sub) === fragmentsToText(ref)) { - return fragments; - } - fragments = sub.concat(this.makeCode(', '), fragments); + 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 fragments; + return code; } else { - return this.wrapInBraces(fragments); + return "(" + code + ")"; } }; @@ -2500,11 +2173,14 @@ define(function(require, exports, module) { })(Base); exports.Try = Try = (function(_super) { + __extends(Try, _super); - function Try(attempt, errorVariable, recovery, ensure) { + Try.name = 'Try'; + + function Try(attempt, error, recovery, ensure) { this.attempt = attempt; - this.errorVariable = errorVariable; + this.error = error; this.recovery = recovery; this.ensure = ensure; } @@ -2519,22 +2195,32 @@ define(function(require, exports, module) { }; Try.prototype.makeReturn = function(res) { - if (this.attempt) { - this.attempt = this.attempt.makeReturn(res); - } - if (this.recovery) { - this.recovery = this.recovery.makeReturn(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, placeholder, tryPart; + var catchPart, ensurePart, errorPart, tryPart; o.indent += TAB; - tryPart = this.attempt.compileToFragments(o, LEVEL_TOP); - catchPart = this.recovery ? (placeholder = new Literal('_error'), this.errorVariable ? this.recovery.unshift(new Assign(this.errorVariable, placeholder)) : void 0, [].concat(this.makeCode(" catch ("), placeholder.compileToFragments(o), this.makeCode(") {\n"), this.recovery.compileToFragments(o, LEVEL_TOP), this.makeCode("\n" + this.tab + "}"))) : !(this.ensure || this.recovery) ? [this.makeCode(' catch (_error) {}')] : []; - ensurePart = this.ensure ? [].concat(this.makeCode(" finally {\n"), this.ensure.compileToFragments(o, LEVEL_TOP), this.makeCode("\n" + this.tab + "}")) : []; - return [].concat(this.makeCode("" + this.tab + "try {\n"), tryPart, this.makeCode("\n" + this.tab + "}"), catchPart, ensurePart); + 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; @@ -2542,8 +2228,11 @@ define(function(require, exports, module) { })(Base); exports.Throw = Throw = (function(_super) { + __extends(Throw, _super); + Throw.name = 'Throw'; + function Throw(expression) { this.expression = expression; } @@ -2557,7 +2246,7 @@ define(function(require, exports, module) { Throw.prototype.makeReturn = THIS; Throw.prototype.compileNode = function(o) { - return [].concat(this.makeCode(this.tab + "throw "), this.expression.compileToFragments(o), this.makeCode(";")); + return this.tab + ("throw " + (this.expression.compile(o)) + ";"); }; return Throw; @@ -2565,8 +2254,11 @@ define(function(require, exports, module) { })(Base); exports.Existence = Existence = (function(_super) { + __extends(Existence, _super); + Existence.name = 'Existence'; + function Existence(expression) { this.expression = expression; } @@ -2585,7 +2277,11 @@ define(function(require, exports, module) { } else { code = "" + code + " " + (this.negated ? '==' : '!=') + " null"; } - return [this.makeCode(o.level <= LEVEL_COND ? code : "(" + code + ")")]; + if (o.level <= LEVEL_COND) { + return code; + } else { + return "(" + code + ")"; + } }; return Existence; @@ -2593,8 +2289,11 @@ define(function(require, exports, module) { })(Base); exports.Parens = Parens = (function(_super) { + __extends(Parens, _super); + Parens.name = 'Parens'; + function Parens(body) { this.body = body; } @@ -2610,18 +2309,18 @@ define(function(require, exports, module) { }; Parens.prototype.compileNode = function(o) { - var bare, expr, fragments; + var bare, code, expr; expr = this.body.unwrap(); if (expr instanceof Value && expr.isAtomic()) { expr.front = this.front; - return expr.compileToFragments(o); + return expr.compile(o); } - fragments = expr.compileToFragments(o, LEVEL_PAREN); + 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 fragments; + return code; } else { - return this.wrapInBraces(fragments); + return "(" + code + ")"; } }; @@ -2630,8 +2329,11 @@ define(function(require, exports, module) { })(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; @@ -2642,18 +2344,15 @@ define(function(require, exports, module) { _ref2 = [this.index, this.name], this.name = _ref2[0], this.index = _ref2[1]; } if (this.index instanceof Value) { - this.index.error('index cannot be a pattern matching expression'); + 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) { - this.index.error('indexes do not apply to range loops'); + throw SyntaxError('indexes do not apply to range loops'); } if (this.range && this.pattern) { - this.name.error('cannot pattern match over range loops'); - } - if (this.own && !this.object) { - this.name.error('cannot use own with for-in'); + throw SyntaxError('cannot pattern match over range loops'); } this.returns = false; } @@ -2661,41 +2360,36 @@ define(function(require, exports, module) { For.prototype.children = ['body', 'source', 'guard', 'step']; For.prototype.compileNode = function(o) { - var body, bodyFragments, compare, compareDown, declare, declareDown, defPart, defPartFragments, down, forPartFragments, guardPart, idt1, increment, index, ivar, kvar, kvarAssign, lastJumps, lvar, name, namePart, ref, resultPart, returnResult, rvar, scope, source, step, stepNum, stepVar, svar, varPart, _ref2, _ref3; + 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; - } + 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)); + 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); + scope.find(name, { + immediate: true + }); } if (index) { - scope.find(index); - } - if (this.returns) { - rvar = scope.freeVariable('results'); + 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) { - _ref3 = this.cacheToCodeFragments(this.step.cache(o, LEVEL_LIST)), step = _ref3[0], stepVar = _ref3[1]; - stepNum = stepVar.match(NUMBER); - } - if (this.pattern) { - name = ivar; - } + if (this.step && !this.range) stepvar = scope.freeVariable("step"); + if (this.pattern) name = ivar; varPart = ''; guardPart = ''; defPart = ''; idt1 = this.tab + TAB; if (this.range) { - forPartFragments = source.compileToFragments(merge(o, { + forPart = source.compile(merge(o, { index: ivar, name: name, step: this.step @@ -2703,38 +2397,20 @@ define(function(require, exports, module) { } else { svar = this.source.compile(o, LEVEL_LIST); if ((name || this.own) && !IDENTIFIER.test(svar)) { - defPart += "" + this.tab + (ref = scope.freeVariable('ref')) + " = " + svar + ";\n"; + defPart = "" + this.tab + (ref = scope.freeVariable('ref')) + " = " + svar + ";\n"; svar = ref; } if (name && !this.pattern) { namePart = "" + name + " = " + svar + "[" + kvar + "]"; } if (!this.object) { - if (step !== stepVar) { - defPart += "" + this.tab + step + ";\n"; - } - if (!(this.step && stepNum && (down = parseNum(stepNum[0]) < 0))) { - lvar = scope.freeVariable('len'); - } - declare = "" + kvarAssign + ivar + " = 0, " + lvar + " = " + svar + ".length"; - declareDown = "" + kvarAssign + ivar + " = " + svar + ".length - 1"; - compare = "" + ivar + " < " + lvar; - compareDown = "" + ivar + " >= 0"; + lvar = scope.freeVariable('len'); + forVarPart = "" + kvarAssign + ivar + " = 0, " + lvar + " = " + svar + ".length"; if (this.step) { - if (stepNum) { - if (down) { - compare = compareDown; - declare = declareDown; - } - } else { - compare = "" + stepVar + " > 0 ? " + compare + " : " + compareDown; - declare = "(" + stepVar + " > 0 ? (" + declare + ") : " + declareDown + ")"; - } - increment = "" + ivar + " += " + stepVar; - } else { - increment = "" + (kvar !== ivar ? "++" + ivar : "" + ivar + "++"); + forVarPart += ", " + stepvar + " = " + (this.step.compile(o, LEVEL_OP)); } - forPartFragments = [this.makeCode("" + declare + "; " + compare + "; " + kvarAssign + increment)]; + stepPart = "" + kvarAssign + (this.step ? "" + ivar + " += " + stepvar : (kvar !== ivar ? "++" + ivar : "" + ivar + "++")); + forPart = "" + forVarPart + "; " + ivar + " < " + lvar + "; " + stepPart; } } if (this.returns) { @@ -2746,55 +2422,45 @@ define(function(require, exports, module) { 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.guard) body = Block.wrap([new If(this.guard, body)]); } } if (this.pattern) { body.expressions.unshift(new Assign(this.name, new Literal("" + svar + "[" + kvar + "]"))); } - defPartFragments = [].concat(this.makeCode(defPart), this.pluckDirectCall(o, body)); - if (namePart) { - varPart = "\n" + idt1 + namePart + ";"; - } + defPart += this.pluckDirectCall(o, body); + if (namePart) varPart = "\n" + idt1 + namePart + ";"; if (this.object) { - forPartFragments = [this.makeCode("" + kvar + " in " + svar)]; + forPart = "" + kvar + " in " + svar; if (this.own) { guardPart = "\n" + idt1 + "if (!" + (utility('hasProp')) + ".call(" + svar + ", " + kvar + ")) continue;"; } } - bodyFragments = body.compileToFragments(merge(o, { + body = body.compile(merge(o, { indent: idt1 }), LEVEL_TOP); - if (bodyFragments && (bodyFragments.length > 0)) { - bodyFragments = [].concat(this.makeCode("\n"), bodyFragments, this.makeCode("\n")); - } - return [].concat(defPartFragments, this.makeCode("" + (resultPart || '') + this.tab + "for ("), forPartFragments, this.makeCode(") {" + guardPart + varPart), bodyFragments, this.makeCode("" + this.tab + "}" + (returnResult || ''))); + 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, _ref8; - defs = []; + 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)) { + 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; } - val = (_ref3 = expr.variable) != null ? _ref3.unwrapAll() : void 0; - if (!((val instanceof Code) || (val instanceof Value && ((_ref4 = val.base) != null ? _ref4.unwrapAll() : void 0) instanceof Code && val.properties.length === 1 && ((_ref5 = (_ref6 = val.properties[0].name) != null ? _ref6.value : void 0) === 'call' || _ref5 === 'apply')))) { - continue; - } - fn = ((_ref7 = val.base) != null ? _ref7.unwrapAll() : void 0) || val; + fn = ((_ref6 = val.base) != null ? _ref6.unwrapAll() : void 0) || val; ref = new Literal(o.scope.freeVariable('fn')); base = new Value(ref); - if (val.base) { - _ref8 = [base, val], val.base = _ref8[0], base = _ref8[1]; - } + if (val.base) _ref7 = [base, val], val.base = _ref7[0], base = _ref7[1]; body.expressions[idx] = new Call(base, expr.args); - defs = defs.concat(this.makeCode(this.tab), new Assign(ref, fn).compileToFragments(o, LEVEL_TOP), this.makeCode(';\n')); + defs += this.tab + new Assign(ref, fn).compile(o, LEVEL_TOP) + ';\n'; } return defs; }; @@ -2804,8 +2470,11 @@ define(function(require, exports, module) { })(While); exports.Switch = Switch = (function(_super) { + __extends(Switch, _super); + Switch.name = 'Switch'; + function Switch(subject, cases, otherwise) { this.subject = subject; this.cases = cases; @@ -2817,7 +2486,7 @@ define(function(require, exports, module) { Switch.prototype.isStatement = YES; Switch.prototype.jumps = function(o) { - var block, conds, jumpNode, _i, _len, _ref2, _ref3, _ref4; + var block, conds, _i, _len, _ref2, _ref3, _ref4; if (o == null) { o = { block: true @@ -2826,9 +2495,7 @@ define(function(require, exports, module) { _ref2 = this.cases; for (_i = 0, _len = _ref2.length; _i < _len; _i++) { _ref3 = _ref2[_i], conds = _ref3[0], block = _ref3[1]; - if (jumpNode = block.jumps(o)) { - return jumpNode; - } + if (block.jumps(o)) return block; } return (_ref4 = this.otherwise) != null ? _ref4.jumps(o) : void 0; }; @@ -2843,45 +2510,36 @@ define(function(require, exports, module) { if (res) { this.otherwise || (this.otherwise = new Block([new Literal('void 0')])); } - if ((_ref3 = this.otherwise) != null) { - _ref3.makeReturn(res); - } + if ((_ref3 = this.otherwise) != null) _ref3.makeReturn(res); return this; }; Switch.prototype.compileNode = function(o) { - var block, body, cond, conditions, expr, fragments, i, idt1, idt2, _i, _j, _len, _len1, _ref2, _ref3, _ref4; + 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; - fragments = [].concat(this.makeCode(this.tab + "switch ("), (this.subject ? this.subject.compileToFragments(o, LEVEL_PAREN) : this.makeCode("false")), this.makeCode(") {\n")); - _ref2 = this.cases; - for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) { - _ref3 = _ref2[i], conditions = _ref3[0], block = _ref3[1]; - _ref4 = flatten([conditions]); - for (_j = 0, _len1 = _ref4.length; _j < _len1; _j++) { - cond = _ref4[_j]; - if (!this.subject) { - cond = cond.invert(); - } - fragments = fragments.concat(this.makeCode(idt1 + "case "), cond.compileToFragments(o, LEVEL_PAREN), this.makeCode(":\n")); - } - if ((body = block.compileToFragments(o, LEVEL_TOP)).length > 0) { - fragments = fragments.concat(body, this.makeCode('\n')); - } - if (i === this.cases.length - 1 && !this.otherwise) { - break; + 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; } - fragments.push(cond.makeCode(idt2 + 'break;\n')); + code += idt2 + 'break;\n'; } if (this.otherwise && this.otherwise.expressions.length) { - fragments.push.apply(fragments, [this.makeCode(idt1 + "default:\n")].concat(__slice.call(this.otherwise.compileToFragments(o, LEVEL_TOP)), [this.makeCode("\n")])); + code += idt1 + ("default:\n" + (this.otherwise.compile(o, LEVEL_TOP)) + "\n"); } - fragments.push(this.makeCode(this.tab + '}')); - return fragments; + return code + this.tab + '}'; }; return Switch; @@ -2889,13 +2547,14 @@ define(function(require, exports, module) { })(Base); exports.If = If = (function(_super) { + __extends(If, _super); + If.name = 'If'; + function If(condition, body, options) { this.body = body; - if (options == null) { - options = {}; - } + if (options == null) options = {}; this.condition = options.type === 'unless' ? condition.invert() : condition; this.elseBody = null; this.isChain = false; @@ -2920,7 +2579,6 @@ define(function(require, exports, module) { } else { this.isChain = elseBody instanceof If; this.elseBody = this.ensureBlock(elseBody); - this.elseBody.updateLocationDataIfMissing(elseBody.locationData); } return this; }; @@ -2961,48 +2619,38 @@ define(function(require, exports, module) { }; If.prototype.compileStatement = function(o) { - var answer, body, child, cond, exeq, ifPart, indent; + 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' - }).compileToFragments(o); + }).compile(o); } - indent = o.indent + TAB; - cond = this.condition.compileToFragments(o, LEVEL_PAREN); - body = this.ensureBlock(this.body).compileToFragments(merge(o, { - indent: indent - })); - ifPart = [].concat(this.makeCode("if ("), cond, this.makeCode(") {\n"), body, this.makeCode("\n" + this.tab + "}")); - if (!child) { - ifPart.unshift(this.makeCode(this.tab)); + 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 (!this.elseBody) { - return ifPart; - } - answer = ifPart.concat(this.makeCode(' else ')); - if (this.isChain) { - o.chainChild = true; - answer = answer.concat(this.elseBody.unwrap().compileToFragments(o, LEVEL_TOP)); - } else { - answer = answer.concat(this.makeCode("{\n"), this.elseBody.compileToFragments(merge(o, { - indent: indent - }), LEVEL_TOP), this.makeCode("\n" + this.tab + "}")); - } - return answer; + 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, cond, fragments; - cond = this.condition.compileToFragments(o, LEVEL_COND); - body = this.bodyNode().compileToFragments(o, LEVEL_LIST); - alt = this.elseBodyNode() ? this.elseBodyNode().compileToFragments(o, LEVEL_LIST) : [this.makeCode('void 0')]; - fragments = cond.concat(this.makeCode(" ? "), body, this.makeCode(" : "), alt); + 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 this.wrapInBraces(fragments); + return "(" + code + ")"; } else { - return fragments; + return code; } }; @@ -3014,9 +2662,45 @@ define(function(require, exports, module) { })(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; }"; + 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); }; }'; @@ -3052,16 +2736,10 @@ define(function(require, exports, module) { SIMPLENUM = /^[+-]?\d+$/; - HEXNUM = /^[+-]?0x[\da-f]+/i; - - NUMBER = /^[+-]?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)$/i; - - METHOD_DEF = RegExp("^(" + IDENTIFIER_STR + ")(\\.prototype)?(?:\\.(" + IDENTIFIER_STR + ")|\\[(\"(?:[^\\\\\"\\r\\n]|\\\\.)*\"|'(?:[^\\\\'\\r\\n]|\\\\.)*')\\]|\\[(0x[\\da-fA-F]+|\\d*\\.?\\d+(?:[eE][+-]?\\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 = /^['"]/; - IS_REGEX = /^\//; - utility = function(name) { var ref; ref = "__" + name; @@ -3074,33 +2752,5 @@ define(function(require, exports, module) { return code.replace(/\s+$/, ''); }; - parseNum = function(x) { - if (x == null) { - return 0; - } else if (x.match(HEXNUM)) { - return parseInt(x, 16); - } else { - return parseFloat(x); - } - }; - isLiteralArguments = function(node) { - return node instanceof Literal && node.value === 'arguments' && !node.asKey; - }; - - isLiteralThis = function(node) { - return (node instanceof Literal && node.value === 'this' && !node.asKey) || (node instanceof Code && node.bound) || (node instanceof Call && node.isSuper); - }; - - unfoldSoak = function(o, parent, name) { - var ifn; - if (!(ifn = parent[name].unfoldSoak(o))) { - return; - } - parent[name] = ifn.body; - ifn.body = new Value(parent); - return ifn; - }; - - -}); \ No newline at end of file +}); diff --git a/lib/ace/mode/coffee/parser.js b/lib/ace/mode/coffee/parser.js index 00d1b723..553179ca 100644 --- a/lib/ace/mode/coffee/parser.js +++ b/lib/ace/mode/coffee/parser.js @@ -1,5 +1,5 @@ -/** - * Copyright (c) 2009-2013 Jeremy Ashkenas +/* + * Copyright (c) 2011 Jeremy Ashkenas * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -21,105 +21,32 @@ * 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. - * */ define(function(require, exports, module) { -/* parser generated by jison 0.4.4 */ -/* - Returns a Parser object of the following structure: - - Parser: { - yy: {} - } - - Parser.prototype: { - yy: {}, - trace: function(), - symbols_: {associative list: name ==> number}, - terminals_: {associative list: number ==> name}, - productions_: [...], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), - table: [...], - defaultActions: {...}, - parseError: function(str, hash), - parse: function(input), - - lexer: { - EOF: 1, - parseError: function(str, hash), - setInput: function(input), - input: function(), - unput: function(str), - more: function(), - less: function(n), - pastInput: function(), - upcomingInput: function(), - showPosition: function(), - test_match: function(regex_match_array, rule_index), - next: function(), - lex: function(), - begin: function(condition), - popState: function(), - _currentRules: function(), - topState: function(), - pushState: function(condition), - - options: { - ranges: boolean (optional: true ==> token location info will include a .range[] member) - flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) - backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) - }, - - performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), - rules: [...], - conditions: {associative list: name ==> set}, - } - } - - - token location info (@$, _$, etc.): { - first_line: n, - last_line: n, - first_column: n, - last_column: n, - range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) - } - - - the parseError function receives a 'hash' object with these members for lexer and parser errors: { - text: (matched text) - token: (the produced terminal token, if any) - line: (yylineno) - } - while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { - loc: (yylloc) - expected: (string describing the set of expected tokens) - recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) - } -*/ +/* Jison generated parser */ +undefined var parser = {trace: function trace() { }, yy: {}, -symbols_: {"error":2,"Root":3,"Body":4,"Line":5,"TERMINATOR":6,"Expression":7,"Statement":8,"Return":9,"Comment":10,"STATEMENT":11,"Value":12,"Invocation":13,"Code":14,"Operation":15,"Assign":16,"If":17,"Try":18,"While":19,"For":20,"Switch":21,"Class":22,"Throw":23,"Block":24,"INDENT":25,"OUTDENT":26,"Identifier":27,"IDENTIFIER":28,"AlphaNumeric":29,"NUMBER":30,"STRING":31,"Literal":32,"JS":33,"REGEX":34,"DEBUGGER":35,"UNDEFINED":36,"NULL":37,"BOOL":38,"Assignable":39,"=":40,"AssignObj":41,"ObjAssignable":42,":":43,"ThisProperty":44,"RETURN":45,"HERECOMMENT":46,"PARAM_START":47,"ParamList":48,"PARAM_END":49,"FuncGlyph":50,"->":51,"=>":52,"OptComma":53,",":54,"Param":55,"ParamVar":56,"...":57,"Array":58,"Object":59,"Splat":60,"SimpleAssignable":61,"Accessor":62,"Parenthetical":63,"Range":64,"This":65,".":66,"?.":67,"::":68,"?::":69,"Index":70,"INDEX_START":71,"IndexValue":72,"INDEX_END":73,"INDEX_SOAK":74,"Slice":75,"{":76,"AssignList":77,"}":78,"CLASS":79,"EXTENDS":80,"OptFuncExist":81,"Arguments":82,"SUPER":83,"FUNC_EXIST":84,"CALL_START":85,"CALL_END":86,"ArgList":87,"THIS":88,"@":89,"[":90,"]":91,"RangeDots":92,"..":93,"Arg":94,"SimpleArgs":95,"TRY":96,"Catch":97,"FINALLY":98,"CATCH":99,"THROW":100,"(":101,")":102,"WhileSource":103,"WHILE":104,"WHEN":105,"UNTIL":106,"Loop":107,"LOOP":108,"ForBody":109,"FOR":110,"ForStart":111,"ForSource":112,"ForVariables":113,"OWN":114,"ForValue":115,"FORIN":116,"FOROF":117,"BY":118,"SWITCH":119,"Whens":120,"ELSE":121,"When":122,"LEADING_WHEN":123,"IfBlock":124,"IF":125,"POST_IF":126,"UNARY":127,"-":128,"+":129,"--":130,"++":131,"?":132,"MATH":133,"SHIFT":134,"COMPARE":135,"LOGIC":136,"RELATION":137,"COMPOUND_ASSIGN":138,"$accept":0,"$end":1}, -terminals_: {2:"error",6:"TERMINATOR",11:"STATEMENT",25:"INDENT",26:"OUTDENT",28:"IDENTIFIER",30:"NUMBER",31:"STRING",33:"JS",34:"REGEX",35:"DEBUGGER",36:"UNDEFINED",37:"NULL",38:"BOOL",40:"=",43:":",45:"RETURN",46:"HERECOMMENT",47:"PARAM_START",49:"PARAM_END",51:"->",52:"=>",54:",",57:"...",66:".",67:"?.",68:"::",69:"?::",71:"INDEX_START",73:"INDEX_END",74:"INDEX_SOAK",76:"{",78:"}",79:"CLASS",80:"EXTENDS",83:"SUPER",84:"FUNC_EXIST",85:"CALL_START",86:"CALL_END",88:"THIS",89:"@",90:"[",91:"]",93:"..",96:"TRY",98:"FINALLY",99:"CATCH",100:"THROW",101:"(",102:")",104:"WHILE",105:"WHEN",106:"UNTIL",108:"LOOP",110:"FOR",114:"OWN",116:"FORIN",117:"FOROF",118:"BY",119:"SWITCH",121:"ELSE",123:"LEADING_WHEN",125:"IF",126:"POST_IF",127:"UNARY",128:"-",129:"+",130:"--",131:"++",132:"?",133:"MATH",134:"SHIFT",135:"COMPARE",136:"LOGIC",137:"RELATION",138:"COMPOUND_ASSIGN"}, -productions_: [0,[3,0],[3,1],[4,1],[4,3],[4,2],[5,1],[5,1],[8,1],[8,1],[8,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[24,2],[24,3],[27,1],[29,1],[29,1],[32,1],[32,1],[32,1],[32,1],[32,1],[32,1],[32,1],[16,3],[16,4],[16,5],[41,1],[41,3],[41,5],[41,1],[42,1],[42,1],[42,1],[9,2],[9,1],[10,1],[14,5],[14,2],[50,1],[50,1],[53,0],[53,1],[48,0],[48,1],[48,3],[48,4],[48,6],[55,1],[55,2],[55,3],[56,1],[56,1],[56,1],[56,1],[60,2],[61,1],[61,2],[61,2],[61,1],[39,1],[39,1],[39,1],[12,1],[12,1],[12,1],[12,1],[12,1],[62,2],[62,2],[62,2],[62,2],[62,1],[62,1],[70,3],[70,2],[72,1],[72,1],[59,4],[77,0],[77,1],[77,3],[77,4],[77,6],[22,1],[22,2],[22,3],[22,4],[22,2],[22,3],[22,4],[22,5],[13,3],[13,3],[13,1],[13,2],[81,0],[81,1],[82,2],[82,4],[65,1],[65,1],[44,2],[58,2],[58,4],[92,1],[92,1],[64,5],[75,3],[75,2],[75,2],[75,1],[87,1],[87,3],[87,4],[87,4],[87,6],[94,1],[94,1],[95,1],[95,3],[18,2],[18,3],[18,4],[18,5],[97,3],[97,3],[97,2],[23,2],[63,3],[63,5],[103,2],[103,4],[103,2],[103,4],[19,2],[19,2],[19,2],[19,1],[107,2],[107,2],[20,2],[20,2],[20,2],[109,2],[109,2],[111,2],[111,3],[115,1],[115,1],[115,1],[115,1],[113,1],[113,3],[112,2],[112,2],[112,4],[112,4],[112,4],[112,6],[112,6],[21,5],[21,7],[21,4],[21,6],[120,1],[120,2],[122,3],[122,4],[124,3],[124,5],[17,1],[17,3],[17,3],[17,3],[15,2],[15,2],[15,2],[15,2],[15,2],[15,2],[15,2],[15,2],[15,3],[15,3],[15,3],[15,3],[15,3],[15,3],[15,3],[15,3],[15,5],[15,4],[15,3]], -performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { -/* this == yyval */ +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.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Block); +case 1:return this.$ = new yy.Block; break; case 2:return this.$ = $$[$0]; break; -case 3:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(yy.Block.wrap([$$[$0]])); +case 3:return this.$ = $$[$0-1]; break; -case 4:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-2].push($$[$0])); +case 4:this.$ = yy.Block.wrap([$$[$0]]); break; -case 5:this.$ = $$[$0-1]; +case 5:this.$ = $$[$0-2].push($$[$0]); break; -case 6:this.$ = $$[$0]; +case 6:this.$ = $$[$0-1]; break; case 7:this.$ = $$[$0]; break; @@ -127,9 +54,9 @@ case 8:this.$ = $$[$0]; break; case 9:this.$ = $$[$0]; break; -case 10:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0])); +case 10:this.$ = $$[$0]; break; -case 11:this.$ = $$[$0]; +case 11:this.$ = new yy.Literal($$[$0]); break; case 12:this.$ = $$[$0]; break; @@ -153,41 +80,46 @@ case 21:this.$ = $$[$0]; break; case 22:this.$ = $$[$0]; break; -case 23:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Block); +case 23:this.$ = $$[$0]; break; -case 24:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-1]); +case 24:this.$ = new yy.Block; break; -case 25:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0])); +case 25:this.$ = $$[$0-1]; break; -case 26:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0])); +case 26:this.$ = new yy.Literal($$[$0]); break; -case 27:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0])); +case 27:this.$ = new yy.Literal($$[$0]); break; -case 28:this.$ = $$[$0]; +case 28:this.$ = new yy.Literal($$[$0]); break; -case 29:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0])); +case 29:this.$ = $$[$0]; break; -case 30:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0])); +case 30:this.$ = new yy.Literal($$[$0]); break; -case 31:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0])); +case 31:this.$ = new yy.Literal($$[$0]); break; -case 32:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Undefined); +case 32:this.$ = new yy.Literal($$[$0]); break; -case 33:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Null); +case 33:this.$ = (function () { + var val; + val = new yy.Literal($$[$0]); + if ($$[$0] === 'undefined') val.isUndefined = true; + return val; + }()); break; -case 34:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Bool($$[$0])); +case 34:this.$ = new yy.Assign($$[$0-2], $$[$0]); break; -case 35:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Assign($$[$0-2], $$[$0])); +case 35:this.$ = new yy.Assign($$[$0-3], $$[$0]); break; -case 36:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Assign($$[$0-3], $$[$0])); +case 36:this.$ = new yy.Assign($$[$0-4], $$[$0-1]); break; -case 37:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Assign($$[$0-4], $$[$0-1])); +case 37:this.$ = new yy.Value($$[$0]); break; -case 38:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); +case 38:this.$ = new yy.Assign(new yy.Value($$[$0-2]), $$[$0], 'object'); break; -case 39:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Assign(yy.addLocationDataFn(_$[$0-2])(new yy.Value($$[$0-2])), $$[$0], 'object')); +case 39:this.$ = new yy.Assign(new yy.Value($$[$0-4]), $$[$0-1], 'object'); break; -case 40:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Assign(yy.addLocationDataFn(_$[$0-4])(new yy.Value($$[$0-4])), $$[$0-1], 'object')); +case 40:this.$ = $$[$0]; break; case 41:this.$ = $$[$0]; break; @@ -195,417 +127,388 @@ case 42:this.$ = $$[$0]; break; case 43:this.$ = $$[$0]; break; -case 44:this.$ = $$[$0]; +case 44:this.$ = new yy.Return($$[$0]); break; -case 45:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Return($$[$0])); +case 45:this.$ = new yy.Return; break; -case 46:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Return); +case 46:this.$ = new yy.Comment($$[$0]); break; -case 47:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Comment($$[$0])); +case 47:this.$ = new yy.Code($$[$0-3], $$[$0], $$[$0-1]); break; -case 48:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Code($$[$0-3], $$[$0], $$[$0-1])); +case 48:this.$ = new yy.Code([], $$[$0], $$[$0-1]); break; -case 49:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Code([], $$[$0], $$[$0-1])); +case 49:this.$ = 'func'; break; -case 50:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])('func'); +case 50:this.$ = 'boundfunc'; break; -case 51:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])('boundfunc'); +case 51:this.$ = $$[$0]; break; case 52:this.$ = $$[$0]; break; -case 53:this.$ = $$[$0]; +case 53:this.$ = []; break; -case 54:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([]); +case 54:this.$ = [$$[$0]]; break; -case 55:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([$$[$0]]); +case 55:this.$ = $$[$0-2].concat($$[$0]); break; -case 56:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-2].concat($$[$0])); +case 56:this.$ = new yy.Param($$[$0]); break; -case 57:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])($$[$0-3].concat($$[$0])); +case 57:this.$ = new yy.Param($$[$0-1], null, true); break; -case 58:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])($$[$0-5].concat($$[$0-2])); +case 58:this.$ = new yy.Param($$[$0-2], $$[$0]); break; -case 59:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Param($$[$0])); +case 59:this.$ = $$[$0]; break; -case 60:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Param($$[$0-1], null, true)); +case 60:this.$ = $$[$0]; break; -case 61:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Param($$[$0-2], $$[$0])); +case 61:this.$ = $$[$0]; break; case 62:this.$ = $$[$0]; break; -case 63:this.$ = $$[$0]; +case 63:this.$ = new yy.Splat($$[$0-1]); break; -case 64:this.$ = $$[$0]; +case 64:this.$ = new yy.Value($$[$0]); break; -case 65:this.$ = $$[$0]; +case 65:this.$ = $$[$0-1].add($$[$0]); break; -case 66:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Splat($$[$0-1])); +case 66:this.$ = new yy.Value($$[$0-1], [].concat($$[$0])); break; -case 67:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); +case 67:this.$ = $$[$0]; break; -case 68:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0-1].add($$[$0])); +case 68:this.$ = $$[$0]; break; -case 69:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Value($$[$0-1], [].concat($$[$0]))); +case 69:this.$ = new yy.Value($$[$0]); break; -case 70:this.$ = $$[$0]; +case 70:this.$ = new yy.Value($$[$0]); break; case 71:this.$ = $$[$0]; break; -case 72:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); +case 72:this.$ = new yy.Value($$[$0]); break; -case 73:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); +case 73:this.$ = new yy.Value($$[$0]); break; -case 74:this.$ = $$[$0]; +case 74:this.$ = new yy.Value($$[$0]); break; -case 75:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); +case 75:this.$ = $$[$0]; break; -case 76:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); +case 76:this.$ = new yy.Access($$[$0]); break; -case 77:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); +case 77:this.$ = new yy.Access($$[$0], 'soak'); break; -case 78:this.$ = $$[$0]; +case 78:this.$ = [new yy.Access(new yy.Literal('prototype')), new yy.Access($$[$0])]; break; -case 79:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Access($$[$0])); +case 79:this.$ = new yy.Access(new yy.Literal('prototype')); break; -case 80:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Access($$[$0], 'soak')); +case 80:this.$ = $$[$0]; break; -case 81:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])([yy.addLocationDataFn(_$[$0-1])(new yy.Access(new yy.Literal('prototype'))), yy.addLocationDataFn(_$[$0])(new yy.Access($$[$0]))]); +case 81:this.$ = $$[$0-1]; break; -case 82:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])([yy.addLocationDataFn(_$[$0-1])(new yy.Access(new yy.Literal('prototype'), 'soak')), yy.addLocationDataFn(_$[$0])(new yy.Access($$[$0]))]); -break; -case 83:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Access(new yy.Literal('prototype'))); -break; -case 84:this.$ = $$[$0]; -break; -case 85:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-1]); -break; -case 86:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(yy.extend($$[$0], { +case 82:this.$ = yy.extend($$[$0], { soak: true - })); -break; -case 87:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Index($$[$0])); -break; -case 88:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Slice($$[$0])); -break; -case 89:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Obj($$[$0-2], $$[$0-3].generated)); -break; -case 90:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([]); -break; -case 91:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([$$[$0]]); -break; -case 92:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-2].concat($$[$0])); -break; -case 93:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])($$[$0-3].concat($$[$0])); -break; -case 94:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])($$[$0-5].concat($$[$0-2])); -break; -case 95:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Class); -break; -case 96:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Class(null, null, $$[$0])); -break; -case 97:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Class(null, $$[$0])); -break; -case 98:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Class(null, $$[$0-1], $$[$0])); -break; -case 99:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Class($$[$0])); -break; -case 100:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Class($$[$0-1], null, $$[$0])); -break; -case 101:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Class($$[$0-2], $$[$0])); -break; -case 102:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Class($$[$0-3], $$[$0-1], $$[$0])); -break; -case 103:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Call($$[$0-2], $$[$0], $$[$0-1])); -break; -case 104:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Call($$[$0-2], $$[$0], $$[$0-1])); -break; -case 105:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Call('super', [new yy.Splat(new yy.Literal('arguments'))])); -break; -case 106:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Call('super', $$[$0])); -break; -case 107:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(false); -break; -case 108:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(true); -break; -case 109:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])([]); -break; -case 110:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])($$[$0-2]); -break; -case 111:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value(new yy.Literal('this'))); -break; -case 112:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value(new yy.Literal('this'))); -break; -case 113:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Value(yy.addLocationDataFn(_$[$0-1])(new yy.Literal('this')), [yy.addLocationDataFn(_$[$0])(new yy.Access($$[$0]))], 'this')); -break; -case 114:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Arr([])); -break; -case 115:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Arr($$[$0-2])); -break; -case 116:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])('inclusive'); -break; -case 117:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])('exclusive'); -break; -case 118:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Range($$[$0-3], $$[$0-1], $$[$0-2])); -break; -case 119:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Range($$[$0-2], $$[$0], $$[$0-1])); -break; -case 120:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Range($$[$0-1], null, $$[$0])); -break; -case 121:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Range(null, $$[$0], $$[$0-1])); -break; -case 122:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Range(null, null, $$[$0])); -break; -case 123:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([$$[$0]]); -break; -case 124:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-2].concat($$[$0])); -break; -case 125:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])($$[$0-3].concat($$[$0])); -break; -case 126:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])($$[$0-2]); -break; -case 127:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])($$[$0-5].concat($$[$0-2])); -break; -case 128:this.$ = $$[$0]; -break; -case 129:this.$ = $$[$0]; -break; -case 130:this.$ = $$[$0]; -break; -case 131:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])([].concat($$[$0-2], $$[$0])); -break; -case 132:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Try($$[$0])); -break; -case 133:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Try($$[$0-1], $$[$0][0], $$[$0][1])); -break; -case 134:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Try($$[$0-2], null, null, $$[$0])); -break; -case 135:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Try($$[$0-3], $$[$0-2][0], $$[$0-2][1], $$[$0])); -break; -case 136:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])([$$[$0-1], $$[$0]]); -break; -case 137:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])([yy.addLocationDataFn(_$[$0-1])(new yy.Value($$[$0-1])), $$[$0]]); -break; -case 138:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])([null, $$[$0]]); -break; -case 139:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Throw($$[$0])); -break; -case 140:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Parens($$[$0-1])); -break; -case 141:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Parens($$[$0-2])); -break; -case 142:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.While($$[$0])); -break; -case 143:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.While($$[$0-2], { - guard: $$[$0] - })); -break; -case 144:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.While($$[$0], { - invert: true - })); -break; -case 145:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.While($$[$0-2], { - invert: true, - guard: $$[$0] - })); -break; -case 146:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0-1].addBody($$[$0])); -break; -case 147:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0].addBody(yy.addLocationDataFn(_$[$0-1])(yy.Block.wrap([$$[$0-1]])))); -break; -case 148:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0].addBody(yy.addLocationDataFn(_$[$0-1])(yy.Block.wrap([$$[$0-1]])))); -break; -case 149:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])($$[$0]); -break; -case 150:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.While(yy.addLocationDataFn(_$[$0-1])(new yy.Literal('true'))).addBody($$[$0])); -break; -case 151:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.While(yy.addLocationDataFn(_$[$0-1])(new yy.Literal('true'))).addBody(yy.addLocationDataFn(_$[$0])(yy.Block.wrap([$$[$0]])))); -break; -case 152:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.For($$[$0-1], $$[$0])); -break; -case 153:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.For($$[$0-1], $$[$0])); -break; -case 154:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.For($$[$0], $$[$0-1])); -break; -case 155:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])({ - source: yy.addLocationDataFn(_$[$0])(new yy.Value($$[$0])) }); break; -case 156:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])((function () { +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 157:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0]); +case 151:this.$ = $$[$0]; break; -case 158:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])((function () { +case 152:this.$ = (function () { $$[$0].own = true; return $$[$0]; - }())); + }()); break; -case 159:this.$ = $$[$0]; +case 153:this.$ = $$[$0]; break; -case 160:this.$ = $$[$0]; +case 154:this.$ = new yy.Value($$[$0]); break; -case 161:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); +case 155:this.$ = new yy.Value($$[$0]); break; -case 162:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0])); +case 156:this.$ = [$$[$0]]; break; -case 163:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([$$[$0]]); +case 157:this.$ = [$$[$0-2], $$[$0]]; break; -case 164:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])([$$[$0-2], $$[$0]]); -break; -case 165:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])({ +case 158:this.$ = { source: $$[$0] - }); + }; break; -case 166:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])({ +case 159:this.$ = { source: $$[$0], object: true - }); + }; break; -case 167:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])({ +case 160:this.$ = { source: $$[$0-2], guard: $$[$0] - }); + }; break; -case 168:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])({ +case 161:this.$ = { source: $$[$0-2], guard: $$[$0], object: true - }); + }; break; -case 169:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])({ +case 162:this.$ = { source: $$[$0-2], step: $$[$0] - }); + }; break; -case 170:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])({ +case 163:this.$ = { source: $$[$0-4], guard: $$[$0-2], step: $$[$0] - }); + }; break; -case 171:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])({ +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 172:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Switch($$[$0-3], $$[$0-1])); -break; -case 173:this.$ = yy.addLocationDataFn(_$[$0-6], _$[$0])(new yy.Switch($$[$0-5], $$[$0-3], $$[$0-1])); -break; -case 174:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Switch(null, $$[$0-1])); -break; -case 175:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])(new yy.Switch(null, $$[$0-3], $$[$0-1])); -break; -case 176:this.$ = $$[$0]; -break; -case 177:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0-1].concat($$[$0])); -break; -case 178:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])([[$$[$0-1], $$[$0]]]); -break; -case 179:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])([[$$[$0-2], $$[$0-1]]]); -break; -case 180:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.If($$[$0-1], $$[$0], { +case 174:this.$ = $$[$0-4].addElse(new yy.If($$[$0-1], $$[$0], { type: $$[$0-2] })); break; -case 181:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])($$[$0-4].addElse(yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.If($$[$0-1], $$[$0], { - type: $$[$0-2] - })))); +case 175:this.$ = $$[$0]; break; -case 182:this.$ = $$[$0]; +case 176:this.$ = $$[$0-2].addElse($$[$0]); break; -case 183:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-2].addElse($$[$0])); -break; -case 184:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.If($$[$0], yy.addLocationDataFn(_$[$0-2])(yy.Block.wrap([$$[$0-2]])), { +case 177:this.$ = new yy.If($$[$0], yy.Block.wrap([$$[$0-2]]), { type: $$[$0-1], statement: true - })); + }); break; -case 185:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.If($$[$0], yy.addLocationDataFn(_$[$0-2])(yy.Block.wrap([$$[$0-2]])), { +case 178:this.$ = new yy.If($$[$0], yy.Block.wrap([$$[$0-2]]), { type: $$[$0-1], statement: true - })); + }); break; -case 186:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op($$[$0-1], $$[$0])); +case 179:this.$ = new yy.Op($$[$0-1], $$[$0]); break; -case 187:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('-', $$[$0])); +case 180:this.$ = new yy.Op('-', $$[$0]); break; -case 188:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('+', $$[$0])); +case 181:this.$ = new yy.Op('+', $$[$0]); break; -case 189:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('--', $$[$0])); +case 182:this.$ = new yy.Op('--', $$[$0]); break; -case 190:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('++', $$[$0])); +case 183:this.$ = new yy.Op('++', $$[$0]); break; -case 191:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('--', $$[$0-1], null, true)); +case 184:this.$ = new yy.Op('--', $$[$0-1], null, true); break; -case 192:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('++', $$[$0-1], null, true)); +case 185:this.$ = new yy.Op('++', $$[$0-1], null, true); break; -case 193:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Existence($$[$0-1])); +case 186:this.$ = new yy.Existence($$[$0-1]); break; -case 194:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op('+', $$[$0-2], $$[$0])); +case 187:this.$ = new yy.Op('+', $$[$0-2], $$[$0]); break; -case 195:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op('-', $$[$0-2], $$[$0])); +case 188:this.$ = new yy.Op('-', $$[$0-2], $$[$0]); break; -case 196:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op($$[$0-1], $$[$0-2], $$[$0])); +case 189:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]); break; -case 197:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op($$[$0-1], $$[$0-2], $$[$0])); +case 190:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]); break; -case 198:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op($$[$0-1], $$[$0-2], $$[$0])); +case 191:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]); break; -case 199:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op($$[$0-1], $$[$0-2], $$[$0])); +case 192:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]); break; -case 200:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])((function () { +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 201:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Assign($$[$0-2], $$[$0], $$[$0-1])); +case 194:this.$ = new yy.Assign($$[$0-2], $$[$0], $$[$0-1]); break; -case 202:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Assign($$[$0-4], $$[$0-1], $$[$0-3])); +case 195:this.$ = new yy.Assign($$[$0-4], $$[$0-1], $$[$0-3]); break; -case 203:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Assign($$[$0-3], $$[$0], $$[$0-2])); -break; -case 204:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Extends($$[$0-2], $$[$0])); +case 196:this.$ = new yy.Extends($$[$0-2], $$[$0]); break; } }, -table: [{1:[2,1],3:1,4:2,5:3,7:4,8:5,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[3]},{1:[2,2],6:[1,72]},{1:[2,3],6:[2,3],26:[2,3],102:[2,3]},{1:[2,6],6:[2,6],26:[2,6],102:[2,6],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,7],6:[2,7],26:[2,7],102:[2,7],103:85,104:[1,63],106:[1,64],109:86,110:[1,66],111:67,126:[1,84]},{1:[2,11],6:[2,11],25:[2,11],26:[2,11],49:[2,11],54:[2,11],57:[2,11],62:88,66:[1,90],67:[1,91],68:[1,92],69:[1,93],70:94,71:[1,95],73:[2,11],74:[1,96],78:[2,11],81:87,84:[1,89],85:[2,107],86:[2,11],91:[2,11],93:[2,11],102:[2,11],104:[2,11],105:[2,11],106:[2,11],110:[2,11],118:[2,11],126:[2,11],128:[2,11],129:[2,11],132:[2,11],133:[2,11],134:[2,11],135:[2,11],136:[2,11],137:[2,11]},{1:[2,12],6:[2,12],25:[2,12],26:[2,12],49:[2,12],54:[2,12],57:[2,12],62:98,66:[1,90],67:[1,91],68:[1,92],69:[1,93],70:94,71:[1,95],73:[2,12],74:[1,96],78:[2,12],81:97,84:[1,89],85:[2,107],86:[2,12],91:[2,12],93:[2,12],102:[2,12],104:[2,12],105:[2,12],106:[2,12],110:[2,12],118:[2,12],126:[2,12],128:[2,12],129:[2,12],132:[2,12],133:[2,12],134:[2,12],135:[2,12],136:[2,12],137:[2,12]},{1:[2,13],6:[2,13],25:[2,13],26:[2,13],49:[2,13],54:[2,13],57:[2,13],73:[2,13],78:[2,13],86:[2,13],91:[2,13],93:[2,13],102:[2,13],104:[2,13],105:[2,13],106:[2,13],110:[2,13],118:[2,13],126:[2,13],128:[2,13],129:[2,13],132:[2,13],133:[2,13],134:[2,13],135:[2,13],136:[2,13],137:[2,13]},{1:[2,14],6:[2,14],25:[2,14],26:[2,14],49:[2,14],54:[2,14],57:[2,14],73:[2,14],78:[2,14],86:[2,14],91:[2,14],93:[2,14],102:[2,14],104:[2,14],105:[2,14],106:[2,14],110:[2,14],118:[2,14],126:[2,14],128:[2,14],129:[2,14],132:[2,14],133:[2,14],134:[2,14],135:[2,14],136:[2,14],137:[2,14]},{1:[2,15],6:[2,15],25:[2,15],26:[2,15],49:[2,15],54:[2,15],57:[2,15],73:[2,15],78:[2,15],86:[2,15],91:[2,15],93:[2,15],102:[2,15],104:[2,15],105:[2,15],106:[2,15],110:[2,15],118:[2,15],126:[2,15],128:[2,15],129:[2,15],132:[2,15],133:[2,15],134:[2,15],135:[2,15],136:[2,15],137:[2,15]},{1:[2,16],6:[2,16],25:[2,16],26:[2,16],49:[2,16],54:[2,16],57:[2,16],73:[2,16],78:[2,16],86:[2,16],91:[2,16],93:[2,16],102:[2,16],104:[2,16],105:[2,16],106:[2,16],110:[2,16],118:[2,16],126:[2,16],128:[2,16],129:[2,16],132:[2,16],133:[2,16],134:[2,16],135:[2,16],136:[2,16],137:[2,16]},{1:[2,17],6:[2,17],25:[2,17],26:[2,17],49:[2,17],54:[2,17],57:[2,17],73:[2,17],78:[2,17],86:[2,17],91:[2,17],93:[2,17],102:[2,17],104:[2,17],105:[2,17],106:[2,17],110:[2,17],118:[2,17],126:[2,17],128:[2,17],129:[2,17],132:[2,17],133:[2,17],134:[2,17],135:[2,17],136:[2,17],137:[2,17]},{1:[2,18],6:[2,18],25:[2,18],26:[2,18],49:[2,18],54:[2,18],57:[2,18],73:[2,18],78:[2,18],86:[2,18],91:[2,18],93:[2,18],102:[2,18],104:[2,18],105:[2,18],106:[2,18],110:[2,18],118:[2,18],126:[2,18],128:[2,18],129:[2,18],132:[2,18],133:[2,18],134:[2,18],135:[2,18],136:[2,18],137:[2,18]},{1:[2,19],6:[2,19],25:[2,19],26:[2,19],49:[2,19],54:[2,19],57:[2,19],73:[2,19],78:[2,19],86:[2,19],91:[2,19],93:[2,19],102:[2,19],104:[2,19],105:[2,19],106:[2,19],110:[2,19],118:[2,19],126:[2,19],128:[2,19],129:[2,19],132:[2,19],133:[2,19],134:[2,19],135:[2,19],136:[2,19],137:[2,19]},{1:[2,20],6:[2,20],25:[2,20],26:[2,20],49:[2,20],54:[2,20],57:[2,20],73:[2,20],78:[2,20],86:[2,20],91:[2,20],93:[2,20],102:[2,20],104:[2,20],105:[2,20],106:[2,20],110:[2,20],118:[2,20],126:[2,20],128:[2,20],129:[2,20],132:[2,20],133:[2,20],134:[2,20],135:[2,20],136:[2,20],137:[2,20]},{1:[2,21],6:[2,21],25:[2,21],26:[2,21],49:[2,21],54:[2,21],57:[2,21],73:[2,21],78:[2,21],86:[2,21],91:[2,21],93:[2,21],102:[2,21],104:[2,21],105:[2,21],106:[2,21],110:[2,21],118:[2,21],126:[2,21],128:[2,21],129:[2,21],132:[2,21],133:[2,21],134:[2,21],135:[2,21],136:[2,21],137:[2,21]},{1:[2,22],6:[2,22],25:[2,22],26:[2,22],49:[2,22],54:[2,22],57:[2,22],73:[2,22],78:[2,22],86:[2,22],91:[2,22],93:[2,22],102:[2,22],104:[2,22],105:[2,22],106:[2,22],110:[2,22],118:[2,22],126:[2,22],128:[2,22],129:[2,22],132:[2,22],133:[2,22],134:[2,22],135:[2,22],136:[2,22],137:[2,22]},{1:[2,8],6:[2,8],26:[2,8],102:[2,8],104:[2,8],106:[2,8],110:[2,8],126:[2,8]},{1:[2,9],6:[2,9],26:[2,9],102:[2,9],104:[2,9],106:[2,9],110:[2,9],126:[2,9]},{1:[2,10],6:[2,10],26:[2,10],102:[2,10],104:[2,10],106:[2,10],110:[2,10],126:[2,10]},{1:[2,74],6:[2,74],25:[2,74],26:[2,74],40:[1,99],49:[2,74],54:[2,74],57:[2,74],66:[2,74],67:[2,74],68:[2,74],69:[2,74],71:[2,74],73:[2,74],74:[2,74],78:[2,74],84:[2,74],85:[2,74],86:[2,74],91:[2,74],93:[2,74],102:[2,74],104:[2,74],105:[2,74],106:[2,74],110:[2,74],118:[2,74],126:[2,74],128:[2,74],129:[2,74],132:[2,74],133:[2,74],134:[2,74],135:[2,74],136:[2,74],137:[2,74]},{1:[2,75],6:[2,75],25:[2,75],26:[2,75],49:[2,75],54:[2,75],57:[2,75],66:[2,75],67:[2,75],68:[2,75],69:[2,75],71:[2,75],73:[2,75],74:[2,75],78:[2,75],84:[2,75],85:[2,75],86:[2,75],91:[2,75],93:[2,75],102:[2,75],104:[2,75],105:[2,75],106:[2,75],110:[2,75],118:[2,75],126:[2,75],128:[2,75],129:[2,75],132:[2,75],133:[2,75],134:[2,75],135:[2,75],136:[2,75],137:[2,75]},{1:[2,76],6:[2,76],25:[2,76],26:[2,76],49:[2,76],54:[2,76],57:[2,76],66:[2,76],67:[2,76],68:[2,76],69:[2,76],71:[2,76],73:[2,76],74:[2,76],78:[2,76],84:[2,76],85:[2,76],86:[2,76],91:[2,76],93:[2,76],102:[2,76],104:[2,76],105:[2,76],106:[2,76],110:[2,76],118:[2,76],126:[2,76],128:[2,76],129:[2,76],132:[2,76],133:[2,76],134:[2,76],135:[2,76],136:[2,76],137:[2,76]},{1:[2,77],6:[2,77],25:[2,77],26:[2,77],49:[2,77],54:[2,77],57:[2,77],66:[2,77],67:[2,77],68:[2,77],69:[2,77],71:[2,77],73:[2,77],74:[2,77],78:[2,77],84:[2,77],85:[2,77],86:[2,77],91:[2,77],93:[2,77],102:[2,77],104:[2,77],105:[2,77],106:[2,77],110:[2,77],118:[2,77],126:[2,77],128:[2,77],129:[2,77],132:[2,77],133:[2,77],134:[2,77],135:[2,77],136:[2,77],137:[2,77]},{1:[2,78],6:[2,78],25:[2,78],26:[2,78],49:[2,78],54:[2,78],57:[2,78],66:[2,78],67:[2,78],68:[2,78],69:[2,78],71:[2,78],73:[2,78],74:[2,78],78:[2,78],84:[2,78],85:[2,78],86:[2,78],91:[2,78],93:[2,78],102:[2,78],104:[2,78],105:[2,78],106:[2,78],110:[2,78],118:[2,78],126:[2,78],128:[2,78],129:[2,78],132:[2,78],133:[2,78],134:[2,78],135:[2,78],136:[2,78],137:[2,78]},{1:[2,105],6:[2,105],25:[2,105],26:[2,105],49:[2,105],54:[2,105],57:[2,105],66:[2,105],67:[2,105],68:[2,105],69:[2,105],71:[2,105],73:[2,105],74:[2,105],78:[2,105],82:100,84:[2,105],85:[1,101],86:[2,105],91:[2,105],93:[2,105],102:[2,105],104:[2,105],105:[2,105],106:[2,105],110:[2,105],118:[2,105],126:[2,105],128:[2,105],129:[2,105],132:[2,105],133:[2,105],134:[2,105],135:[2,105],136:[2,105],137:[2,105]},{6:[2,54],25:[2,54],27:105,28:[1,71],44:106,48:102,49:[2,54],54:[2,54],55:103,56:104,58:107,59:108,76:[1,68],89:[1,109],90:[1,110]},{24:111,25:[1,112]},{7:113,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:115,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:116,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{12:118,13:119,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:120,44:61,58:45,59:46,61:117,63:23,64:24,65:25,76:[1,68],83:[1,26],88:[1,56],89:[1,57],90:[1,55],101:[1,54]},{12:118,13:119,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:120,44:61,58:45,59:46,61:121,63:23,64:24,65:25,76:[1,68],83:[1,26],88:[1,56],89:[1,57],90:[1,55],101:[1,54]},{1:[2,71],6:[2,71],25:[2,71],26:[2,71],40:[2,71],49:[2,71],54:[2,71],57:[2,71],66:[2,71],67:[2,71],68:[2,71],69:[2,71],71:[2,71],73:[2,71],74:[2,71],78:[2,71],80:[1,125],84:[2,71],85:[2,71],86:[2,71],91:[2,71],93:[2,71],102:[2,71],104:[2,71],105:[2,71],106:[2,71],110:[2,71],118:[2,71],126:[2,71],128:[2,71],129:[2,71],130:[1,122],131:[1,123],132:[2,71],133:[2,71],134:[2,71],135:[2,71],136:[2,71],137:[2,71],138:[1,124]},{1:[2,182],6:[2,182],25:[2,182],26:[2,182],49:[2,182],54:[2,182],57:[2,182],73:[2,182],78:[2,182],86:[2,182],91:[2,182],93:[2,182],102:[2,182],104:[2,182],105:[2,182],106:[2,182],110:[2,182],118:[2,182],121:[1,126],126:[2,182],128:[2,182],129:[2,182],132:[2,182],133:[2,182],134:[2,182],135:[2,182],136:[2,182],137:[2,182]},{24:127,25:[1,112]},{24:128,25:[1,112]},{1:[2,149],6:[2,149],25:[2,149],26:[2,149],49:[2,149],54:[2,149],57:[2,149],73:[2,149],78:[2,149],86:[2,149],91:[2,149],93:[2,149],102:[2,149],104:[2,149],105:[2,149],106:[2,149],110:[2,149],118:[2,149],126:[2,149],128:[2,149],129:[2,149],132:[2,149],133:[2,149],134:[2,149],135:[2,149],136:[2,149],137:[2,149]},{24:129,25:[1,112]},{7:130,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,131],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,95],6:[2,95],12:118,13:119,24:132,25:[1,112],26:[2,95],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:120,44:61,49:[2,95],54:[2,95],57:[2,95],58:45,59:46,61:134,63:23,64:24,65:25,73:[2,95],76:[1,68],78:[2,95],80:[1,133],83:[1,26],86:[2,95],88:[1,56],89:[1,57],90:[1,55],91:[2,95],93:[2,95],101:[1,54],102:[2,95],104:[2,95],105:[2,95],106:[2,95],110:[2,95],118:[2,95],126:[2,95],128:[2,95],129:[2,95],132:[2,95],133:[2,95],134:[2,95],135:[2,95],136:[2,95],137:[2,95]},{7:135,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,46],6:[2,46],7:136,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,26:[2,46],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],102:[2,46],103:37,104:[2,46],106:[2,46],107:38,108:[1,65],109:39,110:[2,46],111:67,119:[1,40],124:35,125:[1,62],126:[2,46],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,47],6:[2,47],25:[2,47],26:[2,47],54:[2,47],78:[2,47],102:[2,47],104:[2,47],106:[2,47],110:[2,47],126:[2,47]},{1:[2,72],6:[2,72],25:[2,72],26:[2,72],40:[2,72],49:[2,72],54:[2,72],57:[2,72],66:[2,72],67:[2,72],68:[2,72],69:[2,72],71:[2,72],73:[2,72],74:[2,72],78:[2,72],84:[2,72],85:[2,72],86:[2,72],91:[2,72],93:[2,72],102:[2,72],104:[2,72],105:[2,72],106:[2,72],110:[2,72],118:[2,72],126:[2,72],128:[2,72],129:[2,72],132:[2,72],133:[2,72],134:[2,72],135:[2,72],136:[2,72],137:[2,72]},{1:[2,73],6:[2,73],25:[2,73],26:[2,73],40:[2,73],49:[2,73],54:[2,73],57:[2,73],66:[2,73],67:[2,73],68:[2,73],69:[2,73],71:[2,73],73:[2,73],74:[2,73],78:[2,73],84:[2,73],85:[2,73],86:[2,73],91:[2,73],93:[2,73],102:[2,73],104:[2,73],105:[2,73],106:[2,73],110:[2,73],118:[2,73],126:[2,73],128:[2,73],129:[2,73],132:[2,73],133:[2,73],134:[2,73],135:[2,73],136:[2,73],137:[2,73]},{1:[2,28],6:[2,28],25:[2,28],26:[2,28],49:[2,28],54:[2,28],57:[2,28],66:[2,28],67:[2,28],68:[2,28],69:[2,28],71:[2,28],73:[2,28],74:[2,28],78:[2,28],84:[2,28],85:[2,28],86:[2,28],91:[2,28],93:[2,28],102:[2,28],104:[2,28],105:[2,28],106:[2,28],110:[2,28],118:[2,28],126:[2,28],128:[2,28],129:[2,28],132:[2,28],133:[2,28],134:[2,28],135:[2,28],136:[2,28],137:[2,28]},{1:[2,29],6:[2,29],25:[2,29],26:[2,29],49:[2,29],54:[2,29],57:[2,29],66:[2,29],67:[2,29],68:[2,29],69:[2,29],71:[2,29],73:[2,29],74:[2,29],78:[2,29],84:[2,29],85:[2,29],86:[2,29],91:[2,29],93:[2,29],102:[2,29],104:[2,29],105:[2,29],106:[2,29],110:[2,29],118:[2,29],126:[2,29],128:[2,29],129:[2,29],132:[2,29],133:[2,29],134:[2,29],135:[2,29],136:[2,29],137:[2,29]},{1:[2,30],6:[2,30],25:[2,30],26:[2,30],49:[2,30],54:[2,30],57:[2,30],66:[2,30],67:[2,30],68:[2,30],69:[2,30],71:[2,30],73:[2,30],74:[2,30],78:[2,30],84:[2,30],85:[2,30],86:[2,30],91:[2,30],93:[2,30],102:[2,30],104:[2,30],105:[2,30],106:[2,30],110:[2,30],118:[2,30],126:[2,30],128:[2,30],129:[2,30],132:[2,30],133:[2,30],134:[2,30],135:[2,30],136:[2,30],137:[2,30]},{1:[2,31],6:[2,31],25:[2,31],26:[2,31],49:[2,31],54:[2,31],57:[2,31],66:[2,31],67:[2,31],68:[2,31],69:[2,31],71:[2,31],73:[2,31],74:[2,31],78:[2,31],84:[2,31],85:[2,31],86:[2,31],91:[2,31],93:[2,31],102:[2,31],104:[2,31],105:[2,31],106:[2,31],110:[2,31],118:[2,31],126:[2,31],128:[2,31],129:[2,31],132:[2,31],133:[2,31],134:[2,31],135:[2,31],136:[2,31],137:[2,31]},{1:[2,32],6:[2,32],25:[2,32],26:[2,32],49:[2,32],54:[2,32],57:[2,32],66:[2,32],67:[2,32],68:[2,32],69:[2,32],71:[2,32],73:[2,32],74:[2,32],78:[2,32],84:[2,32],85:[2,32],86:[2,32],91:[2,32],93:[2,32],102:[2,32],104:[2,32],105:[2,32],106:[2,32],110:[2,32],118:[2,32],126:[2,32],128:[2,32],129:[2,32],132:[2,32],133:[2,32],134:[2,32],135:[2,32],136:[2,32],137:[2,32]},{1:[2,33],6:[2,33],25:[2,33],26:[2,33],49:[2,33],54:[2,33],57:[2,33],66:[2,33],67:[2,33],68:[2,33],69:[2,33],71:[2,33],73:[2,33],74:[2,33],78:[2,33],84:[2,33],85:[2,33],86:[2,33],91:[2,33],93:[2,33],102:[2,33],104:[2,33],105:[2,33],106:[2,33],110:[2,33],118:[2,33],126:[2,33],128:[2,33],129:[2,33],132:[2,33],133:[2,33],134:[2,33],135:[2,33],136:[2,33],137:[2,33]},{1:[2,34],6:[2,34],25:[2,34],26:[2,34],49:[2,34],54:[2,34],57:[2,34],66:[2,34],67:[2,34],68:[2,34],69:[2,34],71:[2,34],73:[2,34],74:[2,34],78:[2,34],84:[2,34],85:[2,34],86:[2,34],91:[2,34],93:[2,34],102:[2,34],104:[2,34],105:[2,34],106:[2,34],110:[2,34],118:[2,34],126:[2,34],128:[2,34],129:[2,34],132:[2,34],133:[2,34],134:[2,34],135:[2,34],136:[2,34],137:[2,34]},{4:137,5:3,7:4,8:5,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,138],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:139,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,143],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,60:144,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],87:141,88:[1,56],89:[1,57],90:[1,55],91:[1,140],94:142,96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,111],6:[2,111],25:[2,111],26:[2,111],49:[2,111],54:[2,111],57:[2,111],66:[2,111],67:[2,111],68:[2,111],69:[2,111],71:[2,111],73:[2,111],74:[2,111],78:[2,111],84:[2,111],85:[2,111],86:[2,111],91:[2,111],93:[2,111],102:[2,111],104:[2,111],105:[2,111],106:[2,111],110:[2,111],118:[2,111],126:[2,111],128:[2,111],129:[2,111],132:[2,111],133:[2,111],134:[2,111],135:[2,111],136:[2,111],137:[2,111]},{1:[2,112],6:[2,112],25:[2,112],26:[2,112],27:145,28:[1,71],49:[2,112],54:[2,112],57:[2,112],66:[2,112],67:[2,112],68:[2,112],69:[2,112],71:[2,112],73:[2,112],74:[2,112],78:[2,112],84:[2,112],85:[2,112],86:[2,112],91:[2,112],93:[2,112],102:[2,112],104:[2,112],105:[2,112],106:[2,112],110:[2,112],118:[2,112],126:[2,112],128:[2,112],129:[2,112],132:[2,112],133:[2,112],134:[2,112],135:[2,112],136:[2,112],137:[2,112]},{25:[2,50]},{25:[2,51]},{1:[2,67],6:[2,67],25:[2,67],26:[2,67],40:[2,67],49:[2,67],54:[2,67],57:[2,67],66:[2,67],67:[2,67],68:[2,67],69:[2,67],71:[2,67],73:[2,67],74:[2,67],78:[2,67],80:[2,67],84:[2,67],85:[2,67],86:[2,67],91:[2,67],93:[2,67],102:[2,67],104:[2,67],105:[2,67],106:[2,67],110:[2,67],118:[2,67],126:[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],136:[2,67],137:[2,67],138:[2,67]},{1:[2,70],6:[2,70],25:[2,70],26:[2,70],40:[2,70],49:[2,70],54:[2,70],57:[2,70],66:[2,70],67:[2,70],68:[2,70],69:[2,70],71:[2,70],73:[2,70],74:[2,70],78:[2,70],80:[2,70],84:[2,70],85:[2,70],86:[2,70],91:[2,70],93:[2,70],102:[2,70],104:[2,70],105:[2,70],106:[2,70],110:[2,70],118:[2,70],126:[2,70],128:[2,70],129:[2,70],130:[2,70],131:[2,70],132:[2,70],133:[2,70],134:[2,70],135:[2,70],136:[2,70],137:[2,70],138:[2,70]},{7:146,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:147,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:148,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:150,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:149,25:[1,112],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{27:155,28:[1,71],44:156,58:157,59:158,64:151,76:[1,68],89:[1,109],90:[1,55],113:152,114:[1,153],115:154},{112:159,116:[1,160],117:[1,161]},{6:[2,90],10:165,25:[2,90],27:166,28:[1,71],29:167,30:[1,69],31:[1,70],41:163,42:164,44:168,46:[1,44],54:[2,90],77:162,78:[2,90],89:[1,109]},{1:[2,26],6:[2,26],25:[2,26],26:[2,26],43:[2,26],49:[2,26],54:[2,26],57:[2,26],66:[2,26],67:[2,26],68:[2,26],69:[2,26],71:[2,26],73:[2,26],74:[2,26],78:[2,26],84:[2,26],85:[2,26],86:[2,26],91:[2,26],93:[2,26],102:[2,26],104:[2,26],105:[2,26],106:[2,26],110:[2,26],118:[2,26],126:[2,26],128:[2,26],129:[2,26],132:[2,26],133:[2,26],134:[2,26],135:[2,26],136:[2,26],137:[2,26]},{1:[2,27],6:[2,27],25:[2,27],26:[2,27],43:[2,27],49:[2,27],54:[2,27],57:[2,27],66:[2,27],67:[2,27],68:[2,27],69:[2,27],71:[2,27],73:[2,27],74:[2,27],78:[2,27],84:[2,27],85:[2,27],86:[2,27],91:[2,27],93:[2,27],102:[2,27],104:[2,27],105:[2,27],106:[2,27],110:[2,27],118:[2,27],126:[2,27],128:[2,27],129:[2,27],132:[2,27],133:[2,27],134:[2,27],135:[2,27],136:[2,27],137:[2,27]},{1:[2,25],6:[2,25],25:[2,25],26:[2,25],40:[2,25],43:[2,25],49:[2,25],54:[2,25],57:[2,25],66:[2,25],67:[2,25],68:[2,25],69:[2,25],71:[2,25],73:[2,25],74:[2,25],78:[2,25],80:[2,25],84:[2,25],85:[2,25],86:[2,25],91:[2,25],93:[2,25],102:[2,25],104:[2,25],105:[2,25],106:[2,25],110:[2,25],116:[2,25],117:[2,25],118:[2,25],126:[2,25],128:[2,25],129:[2,25],130:[2,25],131:[2,25],132:[2,25],133:[2,25],134:[2,25],135:[2,25],136:[2,25],137:[2,25],138:[2,25]},{1:[2,5],5:169,6:[2,5],7:4,8:5,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,26:[2,5],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],102:[2,5],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,193],6:[2,193],25:[2,193],26:[2,193],49:[2,193],54:[2,193],57:[2,193],73:[2,193],78:[2,193],86:[2,193],91:[2,193],93:[2,193],102:[2,193],104:[2,193],105:[2,193],106:[2,193],110:[2,193],118:[2,193],126:[2,193],128:[2,193],129:[2,193],132:[2,193],133:[2,193],134:[2,193],135:[2,193],136:[2,193],137:[2,193]},{7:170,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:171,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:172,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:173,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:174,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:175,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:176,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:177,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,148],6:[2,148],25:[2,148],26:[2,148],49:[2,148],54:[2,148],57:[2,148],73:[2,148],78:[2,148],86:[2,148],91:[2,148],93:[2,148],102:[2,148],104:[2,148],105:[2,148],106:[2,148],110:[2,148],118:[2,148],126:[2,148],128:[2,148],129:[2,148],132:[2,148],133:[2,148],134:[2,148],135:[2,148],136:[2,148],137:[2,148]},{1:[2,153],6:[2,153],25:[2,153],26:[2,153],49:[2,153],54:[2,153],57:[2,153],73:[2,153],78:[2,153],86:[2,153],91:[2,153],93:[2,153],102:[2,153],104:[2,153],105:[2,153],106:[2,153],110:[2,153],118:[2,153],126:[2,153],128:[2,153],129:[2,153],132:[2,153],133:[2,153],134:[2,153],135:[2,153],136:[2,153],137:[2,153]},{7:178,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,147],6:[2,147],25:[2,147],26:[2,147],49:[2,147],54:[2,147],57:[2,147],73:[2,147],78:[2,147],86:[2,147],91:[2,147],93:[2,147],102:[2,147],104:[2,147],105:[2,147],106:[2,147],110:[2,147],118:[2,147],126:[2,147],128:[2,147],129:[2,147],132:[2,147],133:[2,147],134:[2,147],135:[2,147],136:[2,147],137:[2,147]},{1:[2,152],6:[2,152],25:[2,152],26:[2,152],49:[2,152],54:[2,152],57:[2,152],73:[2,152],78:[2,152],86:[2,152],91:[2,152],93:[2,152],102:[2,152],104:[2,152],105:[2,152],106:[2,152],110:[2,152],118:[2,152],126:[2,152],128:[2,152],129:[2,152],132:[2,152],133:[2,152],134:[2,152],135:[2,152],136:[2,152],137:[2,152]},{82:179,85:[1,101]},{1:[2,68],6:[2,68],25:[2,68],26:[2,68],40:[2,68],49:[2,68],54:[2,68],57:[2,68],66:[2,68],67:[2,68],68:[2,68],69:[2,68],71:[2,68],73:[2,68],74:[2,68],78:[2,68],80:[2,68],84:[2,68],85:[2,68],86:[2,68],91:[2,68],93:[2,68],102:[2,68],104:[2,68],105:[2,68],106:[2,68],110:[2,68],118:[2,68],126:[2,68],128:[2,68],129:[2,68],130:[2,68],131:[2,68],132:[2,68],133:[2,68],134:[2,68],135:[2,68],136:[2,68],137:[2,68],138:[2,68]},{85:[2,108]},{27:180,28:[1,71]},{27:181,28:[1,71]},{1:[2,83],6:[2,83],25:[2,83],26:[2,83],27:182,28:[1,71],40:[2,83],49:[2,83],54:[2,83],57:[2,83],66:[2,83],67:[2,83],68:[2,83],69:[2,83],71:[2,83],73:[2,83],74:[2,83],78:[2,83],80:[2,83],84:[2,83],85:[2,83],86:[2,83],91:[2,83],93:[2,83],102:[2,83],104:[2,83],105:[2,83],106:[2,83],110:[2,83],118:[2,83],126:[2,83],128:[2,83],129:[2,83],130:[2,83],131:[2,83],132:[2,83],133:[2,83],134:[2,83],135:[2,83],136:[2,83],137:[2,83],138:[2,83]},{27:183,28:[1,71]},{1:[2,84],6:[2,84],25:[2,84],26:[2,84],40:[2,84],49:[2,84],54:[2,84],57:[2,84],66:[2,84],67:[2,84],68:[2,84],69:[2,84],71:[2,84],73:[2,84],74:[2,84],78:[2,84],80:[2,84],84:[2,84],85:[2,84],86:[2,84],91:[2,84],93:[2,84],102:[2,84],104:[2,84],105:[2,84],106:[2,84],110:[2,84],118:[2,84],126:[2,84],128:[2,84],129:[2,84],130:[2,84],131:[2,84],132:[2,84],133:[2,84],134:[2,84],135:[2,84],136:[2,84],137:[2,84],138:[2,84]},{7:185,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],57:[1,189],58:45,59:46,61:34,63:23,64:24,65:25,72:184,75:186,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],92:187,93:[1,188],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{70:190,71:[1,95],74:[1,96]},{82:191,85:[1,101]},{1:[2,69],6:[2,69],25:[2,69],26:[2,69],40:[2,69],49:[2,69],54:[2,69],57:[2,69],66:[2,69],67:[2,69],68:[2,69],69:[2,69],71:[2,69],73:[2,69],74:[2,69],78:[2,69],80:[2,69],84:[2,69],85:[2,69],86:[2,69],91:[2,69],93:[2,69],102:[2,69],104:[2,69],105:[2,69],106:[2,69],110:[2,69],118:[2,69],126:[2,69],128:[2,69],129:[2,69],130:[2,69],131:[2,69],132:[2,69],133:[2,69],134:[2,69],135:[2,69],136:[2,69],137:[2,69],138:[2,69]},{6:[1,193],7:192,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,194],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,106],6:[2,106],25:[2,106],26:[2,106],49:[2,106],54:[2,106],57:[2,106],66:[2,106],67:[2,106],68:[2,106],69:[2,106],71:[2,106],73:[2,106],74:[2,106],78:[2,106],84:[2,106],85:[2,106],86:[2,106],91:[2,106],93:[2,106],102:[2,106],104:[2,106],105:[2,106],106:[2,106],110:[2,106],118:[2,106],126:[2,106],128:[2,106],129:[2,106],132:[2,106],133:[2,106],134:[2,106],135:[2,106],136:[2,106],137:[2,106]},{7:197,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,143],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,60:144,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],86:[1,195],87:196,88:[1,56],89:[1,57],90:[1,55],94:142,96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{6:[2,52],25:[2,52],49:[1,198],53:200,54:[1,199]},{6:[2,55],25:[2,55],26:[2,55],49:[2,55],54:[2,55]},{6:[2,59],25:[2,59],26:[2,59],40:[1,202],49:[2,59],54:[2,59],57:[1,201]},{6:[2,62],25:[2,62],26:[2,62],40:[2,62],49:[2,62],54:[2,62],57:[2,62]},{6:[2,63],25:[2,63],26:[2,63],40:[2,63],49:[2,63],54:[2,63],57:[2,63]},{6:[2,64],25:[2,64],26:[2,64],40:[2,64],49:[2,64],54:[2,64],57:[2,64]},{6:[2,65],25:[2,65],26:[2,65],40:[2,65],49:[2,65],54:[2,65],57:[2,65]},{27:145,28:[1,71]},{7:197,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,143],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,60:144,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],87:141,88:[1,56],89:[1,57],90:[1,55],91:[1,140],94:142,96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,49],6:[2,49],25:[2,49],26:[2,49],49:[2,49],54:[2,49],57:[2,49],73:[2,49],78:[2,49],86:[2,49],91:[2,49],93:[2,49],102:[2,49],104:[2,49],105:[2,49],106:[2,49],110:[2,49],118:[2,49],126:[2,49],128:[2,49],129:[2,49],132:[2,49],133:[2,49],134:[2,49],135:[2,49],136:[2,49],137:[2,49]},{4:204,5:3,7:4,8:5,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,26:[1,203],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,186],6:[2,186],25:[2,186],26:[2,186],49:[2,186],54:[2,186],57:[2,186],73:[2,186],78:[2,186],86:[2,186],91:[2,186],93:[2,186],102:[2,186],103:82,104:[2,186],105:[2,186],106:[2,186],109:83,110:[2,186],111:67,118:[2,186],126:[2,186],128:[2,186],129:[2,186],132:[1,73],133:[2,186],134:[2,186],135:[2,186],136:[2,186],137:[2,186]},{103:85,104:[1,63],106:[1,64],109:86,110:[1,66],111:67,126:[1,84]},{1:[2,187],6:[2,187],25:[2,187],26:[2,187],49:[2,187],54:[2,187],57:[2,187],73:[2,187],78:[2,187],86:[2,187],91:[2,187],93:[2,187],102:[2,187],103:82,104:[2,187],105:[2,187],106:[2,187],109:83,110:[2,187],111:67,118:[2,187],126:[2,187],128:[2,187],129:[2,187],132:[1,73],133:[2,187],134:[2,187],135:[2,187],136:[2,187],137:[2,187]},{1:[2,188],6:[2,188],25:[2,188],26:[2,188],49:[2,188],54:[2,188],57:[2,188],73:[2,188],78:[2,188],86:[2,188],91:[2,188],93:[2,188],102:[2,188],103:82,104:[2,188],105:[2,188],106:[2,188],109:83,110:[2,188],111:67,118:[2,188],126:[2,188],128:[2,188],129:[2,188],132:[1,73],133:[2,188],134:[2,188],135:[2,188],136:[2,188],137:[2,188]},{1:[2,189],6:[2,189],25:[2,189],26:[2,189],49:[2,189],54:[2,189],57:[2,189],66:[2,71],67:[2,71],68:[2,71],69:[2,71],71:[2,71],73:[2,189],74:[2,71],78:[2,189],84:[2,71],85:[2,71],86:[2,189],91:[2,189],93:[2,189],102:[2,189],104:[2,189],105:[2,189],106:[2,189],110:[2,189],118:[2,189],126:[2,189],128:[2,189],129:[2,189],132:[2,189],133:[2,189],134:[2,189],135:[2,189],136:[2,189],137:[2,189]},{62:88,66:[1,90],67:[1,91],68:[1,92],69:[1,93],70:94,71:[1,95],74:[1,96],81:87,84:[1,89],85:[2,107]},{62:98,66:[1,90],67:[1,91],68:[1,92],69:[1,93],70:94,71:[1,95],74:[1,96],81:97,84:[1,89],85:[2,107]},{66:[2,74],67:[2,74],68:[2,74],69:[2,74],71:[2,74],74:[2,74],84:[2,74],85:[2,74]},{1:[2,190],6:[2,190],25:[2,190],26:[2,190],49:[2,190],54:[2,190],57:[2,190],66:[2,71],67:[2,71],68:[2,71],69:[2,71],71:[2,71],73:[2,190],74:[2,71],78:[2,190],84:[2,71],85:[2,71],86:[2,190],91:[2,190],93:[2,190],102:[2,190],104:[2,190],105:[2,190],106:[2,190],110:[2,190],118:[2,190],126:[2,190],128:[2,190],129:[2,190],132:[2,190],133:[2,190],134:[2,190],135:[2,190],136:[2,190],137:[2,190]},{1:[2,191],6:[2,191],25:[2,191],26:[2,191],49:[2,191],54:[2,191],57:[2,191],73:[2,191],78:[2,191],86:[2,191],91:[2,191],93:[2,191],102:[2,191],104:[2,191],105:[2,191],106:[2,191],110:[2,191],118:[2,191],126:[2,191],128:[2,191],129:[2,191],132:[2,191],133:[2,191],134:[2,191],135:[2,191],136:[2,191],137:[2,191]},{1:[2,192],6:[2,192],25:[2,192],26:[2,192],49:[2,192],54:[2,192],57:[2,192],73:[2,192],78:[2,192],86:[2,192],91:[2,192],93:[2,192],102:[2,192],104:[2,192],105:[2,192],106:[2,192],110:[2,192],118:[2,192],126:[2,192],128:[2,192],129:[2,192],132:[2,192],133:[2,192],134:[2,192],135:[2,192],136:[2,192],137:[2,192]},{6:[1,207],7:205,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,206],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:208,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{24:209,25:[1,112],125:[1,210]},{1:[2,132],6:[2,132],25:[2,132],26:[2,132],49:[2,132],54:[2,132],57:[2,132],73:[2,132],78:[2,132],86:[2,132],91:[2,132],93:[2,132],97:211,98:[1,212],99:[1,213],102:[2,132],104:[2,132],105:[2,132],106:[2,132],110:[2,132],118:[2,132],126:[2,132],128:[2,132],129:[2,132],132:[2,132],133:[2,132],134:[2,132],135:[2,132],136:[2,132],137:[2,132]},{1:[2,146],6:[2,146],25:[2,146],26:[2,146],49:[2,146],54:[2,146],57:[2,146],73:[2,146],78:[2,146],86:[2,146],91:[2,146],93:[2,146],102:[2,146],104:[2,146],105:[2,146],106:[2,146],110:[2,146],118:[2,146],126:[2,146],128:[2,146],129:[2,146],132:[2,146],133:[2,146],134:[2,146],135:[2,146],136:[2,146],137:[2,146]},{1:[2,154],6:[2,154],25:[2,154],26:[2,154],49:[2,154],54:[2,154],57:[2,154],73:[2,154],78:[2,154],86:[2,154],91:[2,154],93:[2,154],102:[2,154],104:[2,154],105:[2,154],106:[2,154],110:[2,154],118:[2,154],126:[2,154],128:[2,154],129:[2,154],132:[2,154],133:[2,154],134:[2,154],135:[2,154],136:[2,154],137:[2,154]},{25:[1,214],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{120:215,122:216,123:[1,217]},{1:[2,96],6:[2,96],25:[2,96],26:[2,96],49:[2,96],54:[2,96],57:[2,96],73:[2,96],78:[2,96],86:[2,96],91:[2,96],93:[2,96],102:[2,96],104:[2,96],105:[2,96],106:[2,96],110:[2,96],118:[2,96],126:[2,96],128:[2,96],129:[2,96],132:[2,96],133:[2,96],134:[2,96],135:[2,96],136:[2,96],137:[2,96]},{7:218,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,99],6:[2,99],24:219,25:[1,112],26:[2,99],49:[2,99],54:[2,99],57:[2,99],66:[2,71],67:[2,71],68:[2,71],69:[2,71],71:[2,71],73:[2,99],74:[2,71],78:[2,99],80:[1,220],84:[2,71],85:[2,71],86:[2,99],91:[2,99],93:[2,99],102:[2,99],104:[2,99],105:[2,99],106:[2,99],110:[2,99],118:[2,99],126:[2,99],128:[2,99],129:[2,99],132:[2,99],133:[2,99],134:[2,99],135:[2,99],136:[2,99],137:[2,99]},{1:[2,139],6:[2,139],25:[2,139],26:[2,139],49:[2,139],54:[2,139],57:[2,139],73:[2,139],78:[2,139],86:[2,139],91:[2,139],93:[2,139],102:[2,139],103:82,104:[2,139],105:[2,139],106:[2,139],109:83,110:[2,139],111:67,118:[2,139],126:[2,139],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,45],6:[2,45],26:[2,45],102:[2,45],103:82,104:[2,45],106:[2,45],109:83,110:[2,45],111:67,126:[2,45],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{6:[1,72],102:[1,221]},{4:222,5:3,7:4,8:5,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{6:[2,128],25:[2,128],54:[2,128],57:[1,224],91:[2,128],92:223,93:[1,188],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,114],6:[2,114],25:[2,114],26:[2,114],40:[2,114],49:[2,114],54:[2,114],57:[2,114],66:[2,114],67:[2,114],68:[2,114],69:[2,114],71:[2,114],73:[2,114],74:[2,114],78:[2,114],84:[2,114],85:[2,114],86:[2,114],91:[2,114],93:[2,114],102:[2,114],104:[2,114],105:[2,114],106:[2,114],110:[2,114],116:[2,114],117:[2,114],118:[2,114],126:[2,114],128:[2,114],129:[2,114],132:[2,114],133:[2,114],134:[2,114],135:[2,114],136:[2,114],137:[2,114]},{6:[2,52],25:[2,52],53:225,54:[1,226],91:[2,52]},{6:[2,123],25:[2,123],26:[2,123],54:[2,123],86:[2,123],91:[2,123]},{7:197,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,143],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,60:144,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],87:227,88:[1,56],89:[1,57],90:[1,55],94:142,96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{6:[2,129],25:[2,129],26:[2,129],54:[2,129],86:[2,129],91:[2,129]},{1:[2,113],6:[2,113],25:[2,113],26:[2,113],40:[2,113],43:[2,113],49:[2,113],54:[2,113],57:[2,113],66:[2,113],67:[2,113],68:[2,113],69:[2,113],71:[2,113],73:[2,113],74:[2,113],78:[2,113],80:[2,113],84:[2,113],85:[2,113],86:[2,113],91:[2,113],93:[2,113],102:[2,113],104:[2,113],105:[2,113],106:[2,113],110:[2,113],116:[2,113],117:[2,113],118:[2,113],126:[2,113],128:[2,113],129:[2,113],130:[2,113],131:[2,113],132:[2,113],133:[2,113],134:[2,113],135:[2,113],136:[2,113],137:[2,113],138:[2,113]},{24:228,25:[1,112],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,142],6:[2,142],25:[2,142],26:[2,142],49:[2,142],54:[2,142],57:[2,142],73:[2,142],78:[2,142],86:[2,142],91:[2,142],93:[2,142],102:[2,142],103:82,104:[1,63],105:[1,229],106:[1,64],109:83,110:[1,66],111:67,118:[2,142],126:[2,142],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,144],6:[2,144],25:[2,144],26:[2,144],49:[2,144],54:[2,144],57:[2,144],73:[2,144],78:[2,144],86:[2,144],91:[2,144],93:[2,144],102:[2,144],103:82,104:[1,63],105:[1,230],106:[1,64],109:83,110:[1,66],111:67,118:[2,144],126:[2,144],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,150],6:[2,150],25:[2,150],26:[2,150],49:[2,150],54:[2,150],57:[2,150],73:[2,150],78:[2,150],86:[2,150],91:[2,150],93:[2,150],102:[2,150],104:[2,150],105:[2,150],106:[2,150],110:[2,150],118:[2,150],126:[2,150],128:[2,150],129:[2,150],132:[2,150],133:[2,150],134:[2,150],135:[2,150],136:[2,150],137:[2,150]},{1:[2,151],6:[2,151],25:[2,151],26:[2,151],49:[2,151],54:[2,151],57:[2,151],73:[2,151],78:[2,151],86:[2,151],91:[2,151],93:[2,151],102:[2,151],103:82,104:[1,63],105:[2,151],106:[1,64],109:83,110:[1,66],111:67,118:[2,151],126:[2,151],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,155],6:[2,155],25:[2,155],26:[2,155],49:[2,155],54:[2,155],57:[2,155],73:[2,155],78:[2,155],86:[2,155],91:[2,155],93:[2,155],102:[2,155],104:[2,155],105:[2,155],106:[2,155],110:[2,155],118:[2,155],126:[2,155],128:[2,155],129:[2,155],132:[2,155],133:[2,155],134:[2,155],135:[2,155],136:[2,155],137:[2,155]},{116:[2,157],117:[2,157]},{27:155,28:[1,71],44:156,58:157,59:158,76:[1,68],89:[1,109],90:[1,110],113:231,115:154},{54:[1,232],116:[2,163],117:[2,163]},{54:[2,159],116:[2,159],117:[2,159]},{54:[2,160],116:[2,160],117:[2,160]},{54:[2,161],116:[2,161],117:[2,161]},{54:[2,162],116:[2,162],117:[2,162]},{1:[2,156],6:[2,156],25:[2,156],26:[2,156],49:[2,156],54:[2,156],57:[2,156],73:[2,156],78:[2,156],86:[2,156],91:[2,156],93:[2,156],102:[2,156],104:[2,156],105:[2,156],106:[2,156],110:[2,156],118:[2,156],126:[2,156],128:[2,156],129:[2,156],132:[2,156],133:[2,156],134:[2,156],135:[2,156],136:[2,156],137:[2,156]},{7:233,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:234,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{6:[2,52],25:[2,52],53:235,54:[1,236],78:[2,52]},{6:[2,91],25:[2,91],26:[2,91],54:[2,91],78:[2,91]},{6:[2,38],25:[2,38],26:[2,38],43:[1,237],54:[2,38],78:[2,38]},{6:[2,41],25:[2,41],26:[2,41],54:[2,41],78:[2,41]},{6:[2,42],25:[2,42],26:[2,42],43:[2,42],54:[2,42],78:[2,42]},{6:[2,43],25:[2,43],26:[2,43],43:[2,43],54:[2,43],78:[2,43]},{6:[2,44],25:[2,44],26:[2,44],43:[2,44],54:[2,44],78:[2,44]},{1:[2,4],6:[2,4],26:[2,4],102:[2,4]},{1:[2,194],6:[2,194],25:[2,194],26:[2,194],49:[2,194],54:[2,194],57:[2,194],73:[2,194],78:[2,194],86:[2,194],91:[2,194],93:[2,194],102:[2,194],103:82,104:[2,194],105:[2,194],106:[2,194],109:83,110:[2,194],111:67,118:[2,194],126:[2,194],128:[2,194],129:[2,194],132:[1,73],133:[1,76],134:[2,194],135:[2,194],136:[2,194],137:[2,194]},{1:[2,195],6:[2,195],25:[2,195],26:[2,195],49:[2,195],54:[2,195],57:[2,195],73:[2,195],78:[2,195],86:[2,195],91:[2,195],93:[2,195],102:[2,195],103:82,104:[2,195],105:[2,195],106:[2,195],109:83,110:[2,195],111:67,118:[2,195],126:[2,195],128:[2,195],129:[2,195],132:[1,73],133:[1,76],134:[2,195],135:[2,195],136:[2,195],137:[2,195]},{1:[2,196],6:[2,196],25:[2,196],26:[2,196],49:[2,196],54:[2,196],57:[2,196],73:[2,196],78:[2,196],86:[2,196],91:[2,196],93:[2,196],102:[2,196],103:82,104:[2,196],105:[2,196],106:[2,196],109:83,110:[2,196],111:67,118:[2,196],126:[2,196],128:[2,196],129:[2,196],132:[1,73],133:[2,196],134:[2,196],135:[2,196],136:[2,196],137:[2,196]},{1:[2,197],6:[2,197],25:[2,197],26:[2,197],49:[2,197],54:[2,197],57:[2,197],73:[2,197],78:[2,197],86:[2,197],91:[2,197],93:[2,197],102:[2,197],103:82,104:[2,197],105:[2,197],106:[2,197],109:83,110:[2,197],111:67,118:[2,197],126:[2,197],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[2,197],135:[2,197],136:[2,197],137:[2,197]},{1:[2,198],6:[2,198],25:[2,198],26:[2,198],49:[2,198],54:[2,198],57:[2,198],73:[2,198],78:[2,198],86:[2,198],91:[2,198],93:[2,198],102:[2,198],103:82,104:[2,198],105:[2,198],106:[2,198],109:83,110:[2,198],111:67,118:[2,198],126:[2,198],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[2,198],136:[2,198],137:[1,80]},{1:[2,199],6:[2,199],25:[2,199],26:[2,199],49:[2,199],54:[2,199],57:[2,199],73:[2,199],78:[2,199],86:[2,199],91:[2,199],93:[2,199],102:[2,199],103:82,104:[2,199],105:[2,199],106:[2,199],109:83,110:[2,199],111:67,118:[2,199],126:[2,199],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[2,199],137:[1,80]},{1:[2,200],6:[2,200],25:[2,200],26:[2,200],49:[2,200],54:[2,200],57:[2,200],73:[2,200],78:[2,200],86:[2,200],91:[2,200],93:[2,200],102:[2,200],103:82,104:[2,200],105:[2,200],106:[2,200],109:83,110:[2,200],111:67,118:[2,200],126:[2,200],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[2,200],136:[2,200],137:[2,200]},{1:[2,185],6:[2,185],25:[2,185],26:[2,185],49:[2,185],54:[2,185],57:[2,185],73:[2,185],78:[2,185],86:[2,185],91:[2,185],93:[2,185],102:[2,185],103:82,104:[1,63],105:[2,185],106:[1,64],109:83,110:[1,66],111:67,118:[2,185],126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,184],6:[2,184],25:[2,184],26:[2,184],49:[2,184],54:[2,184],57:[2,184],73:[2,184],78:[2,184],86:[2,184],91:[2,184],93:[2,184],102:[2,184],103:82,104:[1,63],105:[2,184],106:[1,64],109:83,110:[1,66],111:67,118:[2,184],126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,103],6:[2,103],25:[2,103],26:[2,103],49:[2,103],54:[2,103],57:[2,103],66:[2,103],67:[2,103],68:[2,103],69:[2,103],71:[2,103],73:[2,103],74:[2,103],78:[2,103],84:[2,103],85:[2,103],86:[2,103],91:[2,103],93:[2,103],102:[2,103],104:[2,103],105:[2,103],106:[2,103],110:[2,103],118:[2,103],126:[2,103],128:[2,103],129:[2,103],132:[2,103],133:[2,103],134:[2,103],135:[2,103],136:[2,103],137:[2,103]},{1:[2,79],6:[2,79],25:[2,79],26:[2,79],40:[2,79],49:[2,79],54:[2,79],57:[2,79],66:[2,79],67:[2,79],68:[2,79],69:[2,79],71:[2,79],73:[2,79],74:[2,79],78:[2,79],80:[2,79],84:[2,79],85:[2,79],86:[2,79],91:[2,79],93:[2,79],102:[2,79],104:[2,79],105:[2,79],106:[2,79],110:[2,79],118:[2,79],126:[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],136:[2,79],137:[2,79],138:[2,79]},{1:[2,80],6:[2,80],25:[2,80],26:[2,80],40:[2,80],49:[2,80],54:[2,80],57:[2,80],66:[2,80],67:[2,80],68:[2,80],69:[2,80],71:[2,80],73:[2,80],74:[2,80],78:[2,80],80:[2,80],84:[2,80],85:[2,80],86:[2,80],91:[2,80],93:[2,80],102:[2,80],104:[2,80],105:[2,80],106:[2,80],110:[2,80],118:[2,80],126:[2,80],128:[2,80],129:[2,80],130:[2,80],131:[2,80],132:[2,80],133:[2,80],134:[2,80],135:[2,80],136:[2,80],137:[2,80],138:[2,80]},{1:[2,81],6:[2,81],25:[2,81],26:[2,81],40:[2,81],49:[2,81],54:[2,81],57:[2,81],66:[2,81],67:[2,81],68:[2,81],69:[2,81],71:[2,81],73:[2,81],74:[2,81],78:[2,81],80:[2,81],84:[2,81],85:[2,81],86:[2,81],91:[2,81],93:[2,81],102:[2,81],104:[2,81],105:[2,81],106:[2,81],110:[2,81],118:[2,81],126:[2,81],128:[2,81],129:[2,81],130:[2,81],131:[2,81],132:[2,81],133:[2,81],134:[2,81],135:[2,81],136:[2,81],137:[2,81],138:[2,81]},{1:[2,82],6:[2,82],25:[2,82],26:[2,82],40:[2,82],49:[2,82],54:[2,82],57:[2,82],66:[2,82],67:[2,82],68:[2,82],69:[2,82],71:[2,82],73:[2,82],74:[2,82],78:[2,82],80:[2,82],84:[2,82],85:[2,82],86:[2,82],91:[2,82],93:[2,82],102:[2,82],104:[2,82],105:[2,82],106:[2,82],110:[2,82],118:[2,82],126:[2,82],128:[2,82],129:[2,82],130:[2,82],131:[2,82],132:[2,82],133:[2,82],134:[2,82],135:[2,82],136:[2,82],137:[2,82],138:[2,82]},{73:[1,238]},{57:[1,189],73:[2,87],92:239,93:[1,188],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{73:[2,88]},{7:240,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,73:[2,122],76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{11:[2,116],28:[2,116],30:[2,116],31:[2,116],33:[2,116],34:[2,116],35:[2,116],36:[2,116],37:[2,116],38:[2,116],45:[2,116],46:[2,116],47:[2,116],51:[2,116],52:[2,116],73:[2,116],76:[2,116],79:[2,116],83:[2,116],88:[2,116],89:[2,116],90:[2,116],96:[2,116],100:[2,116],101:[2,116],104:[2,116],106:[2,116],108:[2,116],110:[2,116],119:[2,116],125:[2,116],127:[2,116],128:[2,116],129:[2,116],130:[2,116],131:[2,116]},{11:[2,117],28:[2,117],30:[2,117],31:[2,117],33:[2,117],34:[2,117],35:[2,117],36:[2,117],37:[2,117],38:[2,117],45:[2,117],46:[2,117],47:[2,117],51:[2,117],52:[2,117],73:[2,117],76:[2,117],79:[2,117],83:[2,117],88:[2,117],89:[2,117],90:[2,117],96:[2,117],100:[2,117],101:[2,117],104:[2,117],106:[2,117],108:[2,117],110:[2,117],119:[2,117],125:[2,117],127:[2,117],128:[2,117],129:[2,117],130:[2,117],131:[2,117]},{1:[2,86],6:[2,86],25:[2,86],26:[2,86],40:[2,86],49:[2,86],54:[2,86],57:[2,86],66:[2,86],67:[2,86],68:[2,86],69:[2,86],71:[2,86],73:[2,86],74:[2,86],78:[2,86],80:[2,86],84:[2,86],85:[2,86],86:[2,86],91:[2,86],93:[2,86],102:[2,86],104:[2,86],105:[2,86],106:[2,86],110:[2,86],118:[2,86],126:[2,86],128:[2,86],129:[2,86],130:[2,86],131:[2,86],132:[2,86],133:[2,86],134:[2,86],135:[2,86],136:[2,86],137:[2,86],138:[2,86]},{1:[2,104],6:[2,104],25:[2,104],26:[2,104],49:[2,104],54:[2,104],57:[2,104],66:[2,104],67:[2,104],68:[2,104],69:[2,104],71:[2,104],73:[2,104],74:[2,104],78:[2,104],84:[2,104],85:[2,104],86:[2,104],91:[2,104],93:[2,104],102:[2,104],104:[2,104],105:[2,104],106:[2,104],110:[2,104],118:[2,104],126:[2,104],128:[2,104],129:[2,104],132:[2,104],133:[2,104],134:[2,104],135:[2,104],136:[2,104],137:[2,104]},{1:[2,35],6:[2,35],25:[2,35],26:[2,35],49:[2,35],54:[2,35],57:[2,35],73:[2,35],78:[2,35],86:[2,35],91:[2,35],93:[2,35],102:[2,35],103:82,104:[2,35],105:[2,35],106:[2,35],109:83,110:[2,35],111:67,118:[2,35],126:[2,35],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{7:241,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:242,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,109],6:[2,109],25:[2,109],26:[2,109],49:[2,109],54:[2,109],57:[2,109],66:[2,109],67:[2,109],68:[2,109],69:[2,109],71:[2,109],73:[2,109],74:[2,109],78:[2,109],84:[2,109],85:[2,109],86:[2,109],91:[2,109],93:[2,109],102:[2,109],104:[2,109],105:[2,109],106:[2,109],110:[2,109],118:[2,109],126:[2,109],128:[2,109],129:[2,109],132:[2,109],133:[2,109],134:[2,109],135:[2,109],136:[2,109],137:[2,109]},{6:[2,52],25:[2,52],53:243,54:[1,226],86:[2,52]},{6:[2,128],25:[2,128],26:[2,128],54:[2,128],57:[1,244],86:[2,128],91:[2,128],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{50:245,51:[1,58],52:[1,59]},{6:[2,53],25:[2,53],26:[2,53],27:105,28:[1,71],44:106,55:246,56:104,58:107,59:108,76:[1,68],89:[1,109],90:[1,110]},{6:[1,247],25:[1,248]},{6:[2,60],25:[2,60],26:[2,60],49:[2,60],54:[2,60]},{7:249,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,23],6:[2,23],25:[2,23],26:[2,23],49:[2,23],54:[2,23],57:[2,23],73:[2,23],78:[2,23],86:[2,23],91:[2,23],93:[2,23],98:[2,23],99:[2,23],102:[2,23],104:[2,23],105:[2,23],106:[2,23],110:[2,23],118:[2,23],121:[2,23],123:[2,23],126:[2,23],128:[2,23],129:[2,23],132:[2,23],133:[2,23],134:[2,23],135:[2,23],136:[2,23],137:[2,23]},{6:[1,72],26:[1,250]},{1:[2,201],6:[2,201],25:[2,201],26:[2,201],49:[2,201],54:[2,201],57:[2,201],73:[2,201],78:[2,201],86:[2,201],91:[2,201],93:[2,201],102:[2,201],103:82,104:[2,201],105:[2,201],106:[2,201],109:83,110:[2,201],111:67,118:[2,201],126:[2,201],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{7:251,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:252,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,204],6:[2,204],25:[2,204],26:[2,204],49:[2,204],54:[2,204],57:[2,204],73:[2,204],78:[2,204],86:[2,204],91:[2,204],93:[2,204],102:[2,204],103:82,104:[2,204],105:[2,204],106:[2,204],109:83,110:[2,204],111:67,118:[2,204],126:[2,204],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,183],6:[2,183],25:[2,183],26:[2,183],49:[2,183],54:[2,183],57:[2,183],73:[2,183],78:[2,183],86:[2,183],91:[2,183],93:[2,183],102:[2,183],104:[2,183],105:[2,183],106:[2,183],110:[2,183],118:[2,183],126:[2,183],128:[2,183],129:[2,183],132:[2,183],133:[2,183],134:[2,183],135:[2,183],136:[2,183],137:[2,183]},{7:253,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,133],6:[2,133],25:[2,133],26:[2,133],49:[2,133],54:[2,133],57:[2,133],73:[2,133],78:[2,133],86:[2,133],91:[2,133],93:[2,133],98:[1,254],102:[2,133],104:[2,133],105:[2,133],106:[2,133],110:[2,133],118:[2,133],126:[2,133],128:[2,133],129:[2,133],132:[2,133],133:[2,133],134:[2,133],135:[2,133],136:[2,133],137:[2,133]},{24:255,25:[1,112]},{24:258,25:[1,112],27:256,28:[1,71],59:257,76:[1,68]},{120:259,122:216,123:[1,217]},{26:[1,260],121:[1,261],122:262,123:[1,217]},{26:[2,176],121:[2,176],123:[2,176]},{7:264,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],95:263,96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,97],6:[2,97],24:265,25:[1,112],26:[2,97],49:[2,97],54:[2,97],57:[2,97],73:[2,97],78:[2,97],86:[2,97],91:[2,97],93:[2,97],102:[2,97],103:82,104:[1,63],105:[2,97],106:[1,64],109:83,110:[1,66],111:67,118:[2,97],126:[2,97],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,100],6:[2,100],25:[2,100],26:[2,100],49:[2,100],54:[2,100],57:[2,100],73:[2,100],78:[2,100],86:[2,100],91:[2,100],93:[2,100],102:[2,100],104:[2,100],105:[2,100],106:[2,100],110:[2,100],118:[2,100],126:[2,100],128:[2,100],129:[2,100],132:[2,100],133:[2,100],134:[2,100],135:[2,100],136:[2,100],137:[2,100]},{7:266,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,140],6:[2,140],25:[2,140],26:[2,140],49:[2,140],54:[2,140],57:[2,140],66:[2,140],67:[2,140],68:[2,140],69:[2,140],71:[2,140],73:[2,140],74:[2,140],78:[2,140],84:[2,140],85:[2,140],86:[2,140],91:[2,140],93:[2,140],102:[2,140],104:[2,140],105:[2,140],106:[2,140],110:[2,140],118:[2,140],126:[2,140],128:[2,140],129:[2,140],132:[2,140],133:[2,140],134:[2,140],135:[2,140],136:[2,140],137:[2,140]},{6:[1,72],26:[1,267]},{7:268,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{6:[2,66],11:[2,117],25:[2,66],28:[2,117],30:[2,117],31:[2,117],33:[2,117],34:[2,117],35:[2,117],36:[2,117],37:[2,117],38:[2,117],45:[2,117],46:[2,117],47:[2,117],51:[2,117],52:[2,117],54:[2,66],76:[2,117],79:[2,117],83:[2,117],88:[2,117],89:[2,117],90:[2,117],91:[2,66],96:[2,117],100:[2,117],101:[2,117],104:[2,117],106:[2,117],108:[2,117],110:[2,117],119:[2,117],125:[2,117],127:[2,117],128:[2,117],129:[2,117],130:[2,117],131:[2,117]},{6:[1,270],25:[1,271],91:[1,269]},{6:[2,53],7:197,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[2,53],26:[2,53],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,60:144,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],86:[2,53],88:[1,56],89:[1,57],90:[1,55],91:[2,53],94:272,96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{6:[2,52],25:[2,52],26:[2,52],53:273,54:[1,226]},{1:[2,180],6:[2,180],25:[2,180],26:[2,180],49:[2,180],54:[2,180],57:[2,180],73:[2,180],78:[2,180],86:[2,180],91:[2,180],93:[2,180],102:[2,180],104:[2,180],105:[2,180],106:[2,180],110:[2,180],118:[2,180],121:[2,180],126:[2,180],128:[2,180],129:[2,180],132:[2,180],133:[2,180],134:[2,180],135:[2,180],136:[2,180],137:[2,180]},{7:274,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:275,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{116:[2,158],117:[2,158]},{27:155,28:[1,71],44:156,58:157,59:158,76:[1,68],89:[1,109],90:[1,110],115:276},{1:[2,165],6:[2,165],25:[2,165],26:[2,165],49:[2,165],54:[2,165],57:[2,165],73:[2,165],78:[2,165],86:[2,165],91:[2,165],93:[2,165],102:[2,165],103:82,104:[2,165],105:[1,277],106:[2,165],109:83,110:[2,165],111:67,118:[1,278],126:[2,165],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,166],6:[2,166],25:[2,166],26:[2,166],49:[2,166],54:[2,166],57:[2,166],73:[2,166],78:[2,166],86:[2,166],91:[2,166],93:[2,166],102:[2,166],103:82,104:[2,166],105:[1,279],106:[2,166],109:83,110:[2,166],111:67,118:[2,166],126:[2,166],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{6:[1,281],25:[1,282],78:[1,280]},{6:[2,53],10:165,25:[2,53],26:[2,53],27:166,28:[1,71],29:167,30:[1,69],31:[1,70],41:283,42:164,44:168,46:[1,44],78:[2,53],89:[1,109]},{7:284,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,285],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,85],6:[2,85],25:[2,85],26:[2,85],40:[2,85],49:[2,85],54:[2,85],57:[2,85],66:[2,85],67:[2,85],68:[2,85],69:[2,85],71:[2,85],73:[2,85],74:[2,85],78:[2,85],80:[2,85],84:[2,85],85:[2,85],86:[2,85],91:[2,85],93:[2,85],102:[2,85],104:[2,85],105:[2,85],106:[2,85],110:[2,85],118:[2,85],126:[2,85],128:[2,85],129:[2,85],130:[2,85],131:[2,85],132:[2,85],133:[2,85],134:[2,85],135:[2,85],136:[2,85],137:[2,85],138:[2,85]},{7:286,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,73:[2,120],76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{73:[2,121],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,36],6:[2,36],25:[2,36],26:[2,36],49:[2,36],54:[2,36],57:[2,36],73:[2,36],78:[2,36],86:[2,36],91:[2,36],93:[2,36],102:[2,36],103:82,104:[2,36],105:[2,36],106:[2,36],109:83,110:[2,36],111:67,118:[2,36],126:[2,36],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{26:[1,287],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{6:[1,270],25:[1,271],86:[1,288]},{6:[2,66],25:[2,66],26:[2,66],54:[2,66],86:[2,66],91:[2,66]},{24:289,25:[1,112]},{6:[2,56],25:[2,56],26:[2,56],49:[2,56],54:[2,56]},{27:105,28:[1,71],44:106,55:290,56:104,58:107,59:108,76:[1,68],89:[1,109],90:[1,110]},{6:[2,54],25:[2,54],26:[2,54],27:105,28:[1,71],44:106,48:291,54:[2,54],55:103,56:104,58:107,59:108,76:[1,68],89:[1,109],90:[1,110]},{6:[2,61],25:[2,61],26:[2,61],49:[2,61],54:[2,61],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,24],6:[2,24],25:[2,24],26:[2,24],49:[2,24],54:[2,24],57:[2,24],73:[2,24],78:[2,24],86:[2,24],91:[2,24],93:[2,24],98:[2,24],99:[2,24],102:[2,24],104:[2,24],105:[2,24],106:[2,24],110:[2,24],118:[2,24],121:[2,24],123:[2,24],126:[2,24],128:[2,24],129:[2,24],132:[2,24],133:[2,24],134:[2,24],135:[2,24],136:[2,24],137:[2,24]},{26:[1,292],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,203],6:[2,203],25:[2,203],26:[2,203],49:[2,203],54:[2,203],57:[2,203],73:[2,203],78:[2,203],86:[2,203],91:[2,203],93:[2,203],102:[2,203],103:82,104:[2,203],105:[2,203],106:[2,203],109:83,110:[2,203],111:67,118:[2,203],126:[2,203],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{24:293,25:[1,112],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{24:294,25:[1,112]},{1:[2,134],6:[2,134],25:[2,134],26:[2,134],49:[2,134],54:[2,134],57:[2,134],73:[2,134],78:[2,134],86:[2,134],91:[2,134],93:[2,134],102:[2,134],104:[2,134],105:[2,134],106:[2,134],110:[2,134],118:[2,134],126:[2,134],128:[2,134],129:[2,134],132:[2,134],133:[2,134],134:[2,134],135:[2,134],136:[2,134],137:[2,134]},{24:295,25:[1,112]},{24:296,25:[1,112]},{1:[2,138],6:[2,138],25:[2,138],26:[2,138],49:[2,138],54:[2,138],57:[2,138],73:[2,138],78:[2,138],86:[2,138],91:[2,138],93:[2,138],98:[2,138],102:[2,138],104:[2,138],105:[2,138],106:[2,138],110:[2,138],118:[2,138],126:[2,138],128:[2,138],129:[2,138],132:[2,138],133:[2,138],134:[2,138],135:[2,138],136:[2,138],137:[2,138]},{26:[1,297],121:[1,298],122:262,123:[1,217]},{1:[2,174],6:[2,174],25:[2,174],26:[2,174],49:[2,174],54:[2,174],57:[2,174],73:[2,174],78:[2,174],86:[2,174],91:[2,174],93:[2,174],102:[2,174],104:[2,174],105:[2,174],106:[2,174],110:[2,174],118:[2,174],126:[2,174],128:[2,174],129:[2,174],132:[2,174],133:[2,174],134:[2,174],135:[2,174],136:[2,174],137:[2,174]},{24:299,25:[1,112]},{26:[2,177],121:[2,177],123:[2,177]},{24:300,25:[1,112],54:[1,301]},{25:[2,130],54:[2,130],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,98],6:[2,98],25:[2,98],26:[2,98],49:[2,98],54:[2,98],57:[2,98],73:[2,98],78:[2,98],86:[2,98],91:[2,98],93:[2,98],102:[2,98],104:[2,98],105:[2,98],106:[2,98],110:[2,98],118:[2,98],126:[2,98],128:[2,98],129:[2,98],132:[2,98],133:[2,98],134:[2,98],135:[2,98],136:[2,98],137:[2,98]},{1:[2,101],6:[2,101],24:302,25:[1,112],26:[2,101],49:[2,101],54:[2,101],57:[2,101],73:[2,101],78:[2,101],86:[2,101],91:[2,101],93:[2,101],102:[2,101],103:82,104:[1,63],105:[2,101],106:[1,64],109:83,110:[1,66],111:67,118:[2,101],126:[2,101],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{102:[1,303]},{91:[1,304],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,115],6:[2,115],25:[2,115],26:[2,115],40:[2,115],49:[2,115],54:[2,115],57:[2,115],66:[2,115],67:[2,115],68:[2,115],69:[2,115],71:[2,115],73:[2,115],74:[2,115],78:[2,115],84:[2,115],85:[2,115],86:[2,115],91:[2,115],93:[2,115],102:[2,115],104:[2,115],105:[2,115],106:[2,115],110:[2,115],116:[2,115],117:[2,115],118:[2,115],126:[2,115],128:[2,115],129:[2,115],132:[2,115],133:[2,115],134:[2,115],135:[2,115],136:[2,115],137:[2,115]},{7:197,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,60:144,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],94:305,96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:197,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,143],27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,60:144,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],87:306,88:[1,56],89:[1,57],90:[1,55],94:142,96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{6:[2,124],25:[2,124],26:[2,124],54:[2,124],86:[2,124],91:[2,124]},{6:[1,270],25:[1,271],26:[1,307]},{1:[2,143],6:[2,143],25:[2,143],26:[2,143],49:[2,143],54:[2,143],57:[2,143],73:[2,143],78:[2,143],86:[2,143],91:[2,143],93:[2,143],102:[2,143],103:82,104:[1,63],105:[2,143],106:[1,64],109:83,110:[1,66],111:67,118:[2,143],126:[2,143],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,145],6:[2,145],25:[2,145],26:[2,145],49:[2,145],54:[2,145],57:[2,145],73:[2,145],78:[2,145],86:[2,145],91:[2,145],93:[2,145],102:[2,145],103:82,104:[1,63],105:[2,145],106:[1,64],109:83,110:[1,66],111:67,118:[2,145],126:[2,145],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{116:[2,164],117:[2,164]},{7:308,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:309,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:310,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,89],6:[2,89],25:[2,89],26:[2,89],40:[2,89],49:[2,89],54:[2,89],57:[2,89],66:[2,89],67:[2,89],68:[2,89],69:[2,89],71:[2,89],73:[2,89],74:[2,89],78:[2,89],84:[2,89],85:[2,89],86:[2,89],91:[2,89],93:[2,89],102:[2,89],104:[2,89],105:[2,89],106:[2,89],110:[2,89],116:[2,89],117:[2,89],118:[2,89],126:[2,89],128:[2,89],129:[2,89],132:[2,89],133:[2,89],134:[2,89],135:[2,89],136:[2,89],137:[2,89]},{10:165,27:166,28:[1,71],29:167,30:[1,69],31:[1,70],41:311,42:164,44:168,46:[1,44],89:[1,109]},{6:[2,90],10:165,25:[2,90],26:[2,90],27:166,28:[1,71],29:167,30:[1,69],31:[1,70],41:163,42:164,44:168,46:[1,44],54:[2,90],77:312,89:[1,109]},{6:[2,92],25:[2,92],26:[2,92],54:[2,92],78:[2,92]},{6:[2,39],25:[2,39],26:[2,39],54:[2,39],78:[2,39],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{7:313,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{73:[2,119],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,37],6:[2,37],25:[2,37],26:[2,37],49:[2,37],54:[2,37],57:[2,37],73:[2,37],78:[2,37],86:[2,37],91:[2,37],93:[2,37],102:[2,37],104:[2,37],105:[2,37],106:[2,37],110:[2,37],118:[2,37],126:[2,37],128:[2,37],129:[2,37],132:[2,37],133:[2,37],134:[2,37],135:[2,37],136:[2,37],137:[2,37]},{1:[2,110],6:[2,110],25:[2,110],26:[2,110],49:[2,110],54:[2,110],57:[2,110],66:[2,110],67:[2,110],68:[2,110],69:[2,110],71:[2,110],73:[2,110],74:[2,110],78:[2,110],84:[2,110],85:[2,110],86:[2,110],91:[2,110],93:[2,110],102:[2,110],104:[2,110],105:[2,110],106:[2,110],110:[2,110],118:[2,110],126:[2,110],128:[2,110],129:[2,110],132:[2,110],133:[2,110],134:[2,110],135:[2,110],136:[2,110],137:[2,110]},{1:[2,48],6:[2,48],25:[2,48],26:[2,48],49:[2,48],54:[2,48],57:[2,48],73:[2,48],78:[2,48],86:[2,48],91:[2,48],93:[2,48],102:[2,48],104:[2,48],105:[2,48],106:[2,48],110:[2,48],118:[2,48],126:[2,48],128:[2,48],129:[2,48],132:[2,48],133:[2,48],134:[2,48],135:[2,48],136:[2,48],137:[2,48]},{6:[2,57],25:[2,57],26:[2,57],49:[2,57],54:[2,57]},{6:[2,52],25:[2,52],26:[2,52],53:314,54:[1,199]},{1:[2,202],6:[2,202],25:[2,202],26:[2,202],49:[2,202],54:[2,202],57:[2,202],73:[2,202],78:[2,202],86:[2,202],91:[2,202],93:[2,202],102:[2,202],104:[2,202],105:[2,202],106:[2,202],110:[2,202],118:[2,202],126:[2,202],128:[2,202],129:[2,202],132:[2,202],133:[2,202],134:[2,202],135:[2,202],136:[2,202],137:[2,202]},{1:[2,181],6:[2,181],25:[2,181],26:[2,181],49:[2,181],54:[2,181],57:[2,181],73:[2,181],78:[2,181],86:[2,181],91:[2,181],93:[2,181],102:[2,181],104:[2,181],105:[2,181],106:[2,181],110:[2,181],118:[2,181],121:[2,181],126:[2,181],128:[2,181],129:[2,181],132:[2,181],133:[2,181],134:[2,181],135:[2,181],136:[2,181],137:[2,181]},{1:[2,135],6:[2,135],25:[2,135],26:[2,135],49:[2,135],54:[2,135],57:[2,135],73:[2,135],78:[2,135],86:[2,135],91:[2,135],93:[2,135],102:[2,135],104:[2,135],105:[2,135],106:[2,135],110:[2,135],118:[2,135],126:[2,135],128:[2,135],129:[2,135],132:[2,135],133:[2,135],134:[2,135],135:[2,135],136:[2,135],137:[2,135]},{1:[2,136],6:[2,136],25:[2,136],26:[2,136],49:[2,136],54:[2,136],57:[2,136],73:[2,136],78:[2,136],86:[2,136],91:[2,136],93:[2,136],98:[2,136],102:[2,136],104:[2,136],105:[2,136],106:[2,136],110:[2,136],118:[2,136],126:[2,136],128:[2,136],129:[2,136],132:[2,136],133:[2,136],134:[2,136],135:[2,136],136:[2,136],137:[2,136]},{1:[2,137],6:[2,137],25:[2,137],26:[2,137],49:[2,137],54:[2,137],57:[2,137],73:[2,137],78:[2,137],86:[2,137],91:[2,137],93:[2,137],98:[2,137],102:[2,137],104:[2,137],105:[2,137],106:[2,137],110:[2,137],118:[2,137],126:[2,137],128:[2,137],129:[2,137],132:[2,137],133:[2,137],134:[2,137],135:[2,137],136:[2,137],137:[2,137]},{1:[2,172],6:[2,172],25:[2,172],26:[2,172],49:[2,172],54:[2,172],57:[2,172],73:[2,172],78:[2,172],86:[2,172],91:[2,172],93:[2,172],102:[2,172],104:[2,172],105:[2,172],106:[2,172],110:[2,172],118:[2,172],126:[2,172],128:[2,172],129:[2,172],132:[2,172],133:[2,172],134:[2,172],135:[2,172],136:[2,172],137:[2,172]},{24:315,25:[1,112]},{26:[1,316]},{6:[1,317],26:[2,178],121:[2,178],123:[2,178]},{7:318,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{1:[2,102],6:[2,102],25:[2,102],26:[2,102],49:[2,102],54:[2,102],57:[2,102],73:[2,102],78:[2,102],86:[2,102],91:[2,102],93:[2,102],102:[2,102],104:[2,102],105:[2,102],106:[2,102],110:[2,102],118:[2,102],126:[2,102],128:[2,102],129:[2,102],132:[2,102],133:[2,102],134:[2,102],135:[2,102],136:[2,102],137:[2,102]},{1:[2,141],6:[2,141],25:[2,141],26:[2,141],49:[2,141],54:[2,141],57:[2,141],66:[2,141],67:[2,141],68:[2,141],69:[2,141],71:[2,141],73:[2,141],74:[2,141],78:[2,141],84:[2,141],85:[2,141],86:[2,141],91:[2,141],93:[2,141],102:[2,141],104:[2,141],105:[2,141],106:[2,141],110:[2,141],118:[2,141],126:[2,141],128:[2,141],129:[2,141],132:[2,141],133:[2,141],134:[2,141],135:[2,141],136:[2,141],137:[2,141]},{1:[2,118],6:[2,118],25:[2,118],26:[2,118],49:[2,118],54:[2,118],57:[2,118],66:[2,118],67:[2,118],68:[2,118],69:[2,118],71:[2,118],73:[2,118],74:[2,118],78:[2,118],84:[2,118],85:[2,118],86:[2,118],91:[2,118],93:[2,118],102:[2,118],104:[2,118],105:[2,118],106:[2,118],110:[2,118],118:[2,118],126:[2,118],128:[2,118],129:[2,118],132:[2,118],133:[2,118],134:[2,118],135:[2,118],136:[2,118],137:[2,118]},{6:[2,125],25:[2,125],26:[2,125],54:[2,125],86:[2,125],91:[2,125]},{6:[2,52],25:[2,52],26:[2,52],53:319,54:[1,226]},{6:[2,126],25:[2,126],26:[2,126],54:[2,126],86:[2,126],91:[2,126]},{1:[2,167],6:[2,167],25:[2,167],26:[2,167],49:[2,167],54:[2,167],57:[2,167],73:[2,167],78:[2,167],86:[2,167],91:[2,167],93:[2,167],102:[2,167],103:82,104:[2,167],105:[2,167],106:[2,167],109:83,110:[2,167],111:67,118:[1,320],126:[2,167],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,169],6:[2,169],25:[2,169],26:[2,169],49:[2,169],54:[2,169],57:[2,169],73:[2,169],78:[2,169],86:[2,169],91:[2,169],93:[2,169],102:[2,169],103:82,104:[2,169],105:[1,321],106:[2,169],109:83,110:[2,169],111:67,118:[2,169],126:[2,169],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,168],6:[2,168],25:[2,168],26:[2,168],49:[2,168],54:[2,168],57:[2,168],73:[2,168],78:[2,168],86:[2,168],91:[2,168],93:[2,168],102:[2,168],103:82,104:[2,168],105:[2,168],106:[2,168],109:83,110:[2,168],111:67,118:[2,168],126:[2,168],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{6:[2,93],25:[2,93],26:[2,93],54:[2,93],78:[2,93]},{6:[2,52],25:[2,52],26:[2,52],53:322,54:[1,236]},{26:[1,323],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{6:[1,247],25:[1,248],26:[1,324]},{26:[1,325]},{1:[2,175],6:[2,175],25:[2,175],26:[2,175],49:[2,175],54:[2,175],57:[2,175],73:[2,175],78:[2,175],86:[2,175],91:[2,175],93:[2,175],102:[2,175],104:[2,175],105:[2,175],106:[2,175],110:[2,175],118:[2,175],126:[2,175],128:[2,175],129:[2,175],132:[2,175],133:[2,175],134:[2,175],135:[2,175],136:[2,175],137:[2,175]},{26:[2,179],121:[2,179],123:[2,179]},{25:[2,131],54:[2,131],103:82,104:[1,63],106:[1,64],109:83,110:[1,66],111:67,126:[1,81],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{6:[1,270],25:[1,271],26:[1,326]},{7:327,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{7:328,8:114,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:60,28:[1,71],29:47,30:[1,69],31:[1,70],32:22,33:[1,48],34:[1,49],35:[1,50],36:[1,51],37:[1,52],38:[1,53],39:21,44:61,45:[1,43],46:[1,44],47:[1,27],50:28,51:[1,58],52:[1,59],58:45,59:46,61:34,63:23,64:24,65:25,76:[1,68],79:[1,41],83:[1,26],88:[1,56],89:[1,57],90:[1,55],96:[1,36],100:[1,42],101:[1,54],103:37,104:[1,63],106:[1,64],107:38,108:[1,65],109:39,110:[1,66],111:67,119:[1,40],124:35,125:[1,62],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33]},{6:[1,281],25:[1,282],26:[1,329]},{6:[2,40],25:[2,40],26:[2,40],54:[2,40],78:[2,40]},{6:[2,58],25:[2,58],26:[2,58],49:[2,58],54:[2,58]},{1:[2,173],6:[2,173],25:[2,173],26:[2,173],49:[2,173],54:[2,173],57:[2,173],73:[2,173],78:[2,173],86:[2,173],91:[2,173],93:[2,173],102:[2,173],104:[2,173],105:[2,173],106:[2,173],110:[2,173],118:[2,173],126:[2,173],128:[2,173],129:[2,173],132:[2,173],133:[2,173],134:[2,173],135:[2,173],136:[2,173],137:[2,173]},{6:[2,127],25:[2,127],26:[2,127],54:[2,127],86:[2,127],91:[2,127]},{1:[2,170],6:[2,170],25:[2,170],26:[2,170],49:[2,170],54:[2,170],57:[2,170],73:[2,170],78:[2,170],86:[2,170],91:[2,170],93:[2,170],102:[2,170],103:82,104:[2,170],105:[2,170],106:[2,170],109:83,110:[2,170],111:67,118:[2,170],126:[2,170],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{1:[2,171],6:[2,171],25:[2,171],26:[2,171],49:[2,171],54:[2,171],57:[2,171],73:[2,171],78:[2,171],86:[2,171],91:[2,171],93:[2,171],102:[2,171],103:82,104:[2,171],105:[2,171],106:[2,171],109:83,110:[2,171],111:67,118:[2,171],126:[2,171],128:[1,75],129:[1,74],132:[1,73],133:[1,76],134:[1,77],135:[1,78],136:[1,79],137:[1,80]},{6:[2,94],25:[2,94],26:[2,94],54:[2,94],78:[2,94]}], -defaultActions: {58:[2,50],59:[2,51],89:[2,108],186:[2,88]}, +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) { - if (hash.recoverable) { - this.trace(str); - } else { - // ace_mod - var e = new Error(str) - e.location = hash.loc - throw e; - } + 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; + 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; - this.yy.parser = this; - if (typeof this.lexer.yylloc == 'undefined') { + if (typeof this.lexer.yylloc == "undefined") this.lexer.yylloc = {}; - } var yyloc = this.lexer.yylloc; lstack.push(yyloc); - var ranges = this.lexer.options && this.lexer.options.ranges; - if (typeof this.yy.parseError === 'function') { + if (typeof this.yy.parseError === "function") this.parseError = this.yy.parseError; - } else { - this.parseError = Object.getPrototypeOf(this).parseError; - } function popStack(n) { stack.length = stack.length - 2 * n; vstack.length = vstack.length - n; @@ -613,8 +516,8 @@ parse: function parse(input) { } function lex() { var token; - token = self.lexer.lex() || EOF; - if (typeof token !== 'number') { + token = self.lexer.lex() || 1; + if (typeof token !== "number") { token = self.symbols_[token] || token; } return token; @@ -625,36 +528,28 @@ parse: function parse(input) { if (this.defaultActions[state]) { action = this.defaultActions[state]; } else { - if (symbol === null || typeof symbol == 'undefined') { + if (symbol == null) symbol = lex(); - } action = table[state] && table[state][symbol]; } - if (typeof action === 'undefined' || !action.length || !action[0]) { - var errStr = ''; + if (typeof action === "undefined" || !action.length || !action[0]) { + if (!recovering) { expected = []; - for (p in table[state]) { - if (this.terminals_[p] && p > TERROR) { - expected.push('\'' + this.terminals_[p] + '\''); + for (p in table[state]) + if (this.terminals_[p] && p > 2) { + expected.push("'" + this.terminals_[p] + "'"); } - } + var errStr = ""; if (this.lexer.showPosition) { - errStr = 'Expecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; + errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + this.terminals_[symbol] + "'"; } else { - errStr = 'Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); + errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1?"end of input":"'" + (this.terminals_[symbol] || symbol) + "'"); } - // ace_mod - if (this.lexer.yylloc.first_line !== yyloc.first_line) yyloc = this.lexer.yylloc; - this.parseError(errStr, { - text: this.lexer.match, - token: this.terminals_[symbol] || symbol, - line: this.lexer.yylineno, - loc: yyloc, - expected: expected - }); + 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); + throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol); } switch (action[0]) { case 1: @@ -668,9 +563,8 @@ parse: function parse(input) { yytext = this.lexer.yytext; yylineno = this.lexer.yylineno; yyloc = this.lexer.yylloc; - if (recovering > 0) { + if (recovering > 0) recovering--; - } } else { symbol = preErrorSymbol; preErrorSymbol = null; @@ -679,20 +573,9 @@ parse: function parse(input) { 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 - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; - } + yyval._$ = {first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column}; r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack); - if (typeof r !== 'undefined') { + if (typeof r !== "undefined") { return r; } if (len) { @@ -711,14 +594,10 @@ parse: function parse(input) { } } return true; -}}; -undefined -function Parser () { - this.yy = {}; } -Parser.prototype = parser;parser.Parser = Parser; +}; -module.exports = new Parser; +module.exports = parser; -}); \ No newline at end of file +}); diff --git a/lib/ace/mode/coffee/parser_test.js b/lib/ace/mode/coffee/parser_test.js index 001262b6..d7f70397 100644 --- a/lib/ace/mode/coffee/parser_test.js +++ b/lib/ace/mode/coffee/parser_test.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -38,46 +45,19 @@ define(function(require, exports, module) { var assert = require("../../test/assertions"); var coffee = require("../coffee/coffee-script"); -function assertLocation(e, sl, sc, el, ec) { - assert.equal(e.location.first_line, sl); - assert.equal(e.location.first_column, sc); - assert.equal(e.location.last_line, el); - assert.equal(e.location.last_column, ec); -} - -function parse(str) { - try { - coffee.parse(str).compile(); - } catch (e) { - return e; - } -} module.exports = { + "test parse valid coffee script": function() { coffee.parse("square = (x) -> x * x"); }, "test parse invalid coffee script": function() { - var e = parse("a = 12 f"); - assert.equal(e.message, "Unexpected 'IDENTIFIER'"); - assertLocation(e, 0, 4, 0, 5); - }, - - "test parse missing bracket": function() { - var e = parse("a = 12 f {\n\n"); - assert.equal(e.message, "missing }"); - assertLocation(e, 0, 10, 0, 10); - }, - "test unexpected indent": function() { - var e = parse("a\n a\n"); - assert.equal(e.message, "Unexpected 'INDENT'"); - assertLocation(e, 1, 0, 1, 1); - }, - "test invalid destructuring": function() { - var e = parse("\n{b: 5} = {}"); - assert.equal(e.message, '"5" cannot be assigned'); - assertLocation(e, 1, 4, 1, 4); + try { + coffee.parse("a = 12 f"); + } catch (e) { + assert.ok((e + "").indexOf("Parse error on line 1: Unexpected 'IDENTIFIER'") >= 0); + } } }; diff --git a/lib/ace/mode/coffee/rewriter.js b/lib/ace/mode/coffee/rewriter.js index acb5c420..b8e7a6a6 100644 --- a/lib/ace/mode/coffee/rewriter.js +++ b/lib/ace/mode/coffee/rewriter.js @@ -1,5 +1,5 @@ -/** - * Copyright (c) 2009-2013 Jeremy Ashkenas +/* + * Copyright (c) 2011 Jeremy Ashkenas * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -21,35 +21,31 @@ * 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. - * */ define(function(require, exports, module) { -// Generated by CoffeeScript 1.6.3 +// Generated by CoffeeScript 1.2.1-pre - var BALANCED_PAIRS, CALL_CLOSERS, EXPRESSION_CLOSE, EXPRESSION_END, EXPRESSION_START, IMPLICIT_CALL, IMPLICIT_END, IMPLICIT_FUNC, IMPLICIT_UNSPACED_CALL, INVERSES, LINEBREAKS, SINGLE_CLOSERS, SINGLE_LINERS, generate, left, rite, _i, _len, _ref, + 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; - generate = function(tag, value) { - var tok; - tok = [tag, value]; - tok.generated = true; - return tok; - }; - 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.normalizeLines(); + this.addImplicitIndentation(); this.tagPostfixConditionals(); - this.addImplicitBracesAndParens(); - this.addLocationDataToGeneratedTokens(); + this.addImplicitBraces(); + this.addImplicitParentheses(); return this.tokens; }; @@ -71,9 +67,7 @@ define(function(require, exports, module) { 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 (!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) { @@ -89,13 +83,20 @@ define(function(require, exports, module) { _ref = this.tokens; for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) { tag = _ref[i][0]; - if (tag !== 'TERMINATOR') { - break; + 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; } - } - if (i) { - return this.tokens.splice(0, i); - } + tokens.splice(i, 1); + return 0; + }); }; Rewriter.prototype.closeOpenCalls = function() { @@ -108,9 +109,7 @@ define(function(require, exports, module) { 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); - } + if (token[0] === 'CALL_START') this.detectEnd(i + 1, condition, action); return 1; }); }; @@ -125,304 +124,137 @@ define(function(require, exports, module) { return token[0] = 'INDEX_END'; }; return this.scanTokens(function(token, i) { - if (token[0] === 'INDEX_START') { - this.detectEnd(i + 1, condition, action); - } + if (token[0] === 'INDEX_START') this.detectEnd(i + 1, condition, action); return 1; }); }; - Rewriter.prototype.matchTags = function() { - var fuzz, i, j, pattern, _i, _ref, _ref1; - i = arguments[0], pattern = 2 <= arguments.length ? __slice.call(arguments, 1) : []; - fuzz = 0; - for (j = _i = 0, _ref = pattern.length; 0 <= _ref ? _i < _ref : _i > _ref; j = 0 <= _ref ? ++_i : --_i) { - while (this.tag(i + j + fuzz) === 'HERECOMMENT') { - fuzz += 2; - } - if (pattern[j] == null) { - continue; - } - if (typeof pattern[j] === 'string') { - pattern[j] = [pattern[j]]; - } - if (_ref1 = this.tag(i + j + fuzz), __indexOf.call(pattern[j], _ref1) < 0) { - return false; - } - } - return true; - }; - - Rewriter.prototype.looksObjectish = function(j) { - return this.matchTags(j, '@', null, ':') || this.matchTags(j, null, ':'); - }; - - Rewriter.prototype.findTagsBackwards = function(i, tags) { - var backStack, _ref, _ref1, _ref2, _ref3, _ref4, _ref5; - backStack = []; - while (i >= 0 && (backStack.length || (_ref2 = this.tag(i), __indexOf.call(tags, _ref2) < 0) && ((_ref3 = this.tag(i), __indexOf.call(EXPRESSION_START, _ref3) < 0) || this.tokens[i].generated) && (_ref4 = this.tag(i), __indexOf.call(LINEBREAKS, _ref4) < 0))) { - if (_ref = this.tag(i), __indexOf.call(EXPRESSION_END, _ref) >= 0) { - backStack.push(this.tag(i)); - } - if ((_ref1 = this.tag(i), __indexOf.call(EXPRESSION_START, _ref1) >= 0) && backStack.length) { - backStack.pop(); - } - i -= 1; - } - return _ref5 = this.tag(i), __indexOf.call(tags, _ref5) >= 0; - }; - - Rewriter.prototype.addImplicitBracesAndParens = function() { - var stack; + Rewriter.prototype.addImplicitBraces = function() { + var action, condition, sameLine, stack, start, startIndent, startsLine; stack = []; - return this.scanTokens(function(token, i, tokens) { - var endAllImplicitCalls, endImplicitCall, endImplicitObject, forward, inImplicit, inImplicitCall, inImplicitControl, inImplicitObject, nextTag, offset, prevTag, prevToken, s, sameLine, stackIdx, stackTag, stackTop, startIdx, startImplicitCall, startImplicitObject, startsLine, tag, _ref, _ref1, _ref2, _ref3, _ref4, _ref5; + 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]; - prevTag = (prevToken = i > 0 ? tokens[i - 1] : [])[0]; - nextTag = (i < tokens.length - 1 ? tokens[i + 1] : [])[0]; - stackTop = function() { - return stack[stack.length - 1]; - }; - startIdx = i; - forward = function(n) { - return i - startIdx + n; - }; - inImplicit = function() { - var _ref, _ref1; - return (_ref = stackTop()) != null ? (_ref1 = _ref[2]) != null ? _ref1.ours : void 0 : void 0; - }; - inImplicitCall = function() { - var _ref; - return inImplicit() && ((_ref = stackTop()) != null ? _ref[0] : void 0) === '('; - }; - inImplicitObject = function() { - var _ref; - return inImplicit() && ((_ref = stackTop()) != null ? _ref[0] : void 0) === '{'; - }; - inImplicitControl = function() { - var _ref; - return inImplicit && ((_ref = stackTop()) != null ? _ref[0] : void 0) === 'CONTROL'; - }; - startImplicitCall = function(j) { - var idx; - idx = j != null ? j : i; - stack.push([ - '(', idx, { - ours: true - } - ]); - tokens.splice(idx, 0, generate('CALL_START', '(')); - if (j == null) { - return i += 1; - } - }; - endImplicitCall = function() { - stack.pop(); - tokens.splice(i, 0, generate('CALL_END', ')')); - return i += 1; - }; - endAllImplicitCalls = function() { - while (inImplicitCall()) { - endImplicitCall(); - } - }; - startImplicitObject = function(j, startsLine) { - var idx; - if (startsLine == null) { - startsLine = true; - } - idx = j != null ? j : i; - stack.push([ - '{', idx, { - sameLine: true, - startsLine: startsLine, - ours: true - } - ]); - tokens.splice(idx, 0, generate('{', generate(new String('{')))); - if (j == null) { - return i += 1; - } - }; - endImplicitObject = function(j) { - j = j != null ? j : i; - stack.pop(); - tokens.splice(j, 0, generate('}', '}')); - return i += 1; - }; - if (inImplicitCall() && (tag === 'IF' || tag === 'TRY' || tag === 'FINALLY' || tag === 'CATCH' || tag === 'CLASS' || tag === 'SWITCH')) { - stack.push([ - 'CONTROL', i, { - ours: true - } - ]); - return forward(1); - } - if (tag === 'INDENT' && inImplicit()) { - if (prevTag !== '=>' && prevTag !== '->' && prevTag !== '[' && prevTag !== '(' && prevTag !== ',' && prevTag !== '{' && prevTag !== 'TRY' && prevTag !== 'ELSE' && prevTag !== '=') { - while (inImplicitCall()) { - endImplicitCall(); - } - } - if (inImplicitControl()) { - stack.pop(); - } - stack.push([tag, i]); - return forward(1); - } - if (__indexOf.call(EXPRESSION_START, tag) >= 0) { - stack.push([tag, i]); - return forward(1); + 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) { - while (inImplicit()) { - if (inImplicitCall()) { - endImplicitCall(); - } else if (inImplicitObject()) { - endImplicitObject(); - } else { - stack.pop(); - } - } - stack.pop(); + start = stack.pop(); + return 1; } - if ((__indexOf.call(IMPLICIT_FUNC, tag) >= 0 && token.spaced && !token.stringEnd || tag === '?' && i > 0 && !tokens[i - 1].spaced) && (__indexOf.call(IMPLICIT_CALL, nextTag) >= 0 || __indexOf.call(IMPLICIT_UNSPACED_CALL, nextTag) >= 0 && !((_ref = tokens[i + 1]) != null ? _ref.spaced : void 0) && !((_ref1 = tokens[i + 1]) != null ? _ref1.newLine : void 0))) { - if (tag === '?') { - tag = token[0] = 'FUNC_EXIST'; - } - startImplicitCall(i + 1); - return forward(2); + if (!(tag === ':' && ((ago = this.tag(i - 2)) === ':' || ((_ref1 = stack[stack.length - 1]) != null ? _ref1[0] : void 0) !== '{'))) { + return 1; } - if (__indexOf.call(IMPLICIT_FUNC, tag) >= 0 && this.matchTags(i + 1, 'INDENT', null, ':') && !this.findTagsBackwards(i, ['CLASS', 'EXTENDS', 'IF', 'CATCH', 'SWITCH', 'LEADING_WHEN', 'FOR', 'WHILE', 'UNTIL'])) { - startImplicitCall(i + 1); - stack.push(['INDENT', i + 2]); - return forward(3); + sameLine = true; + stack.push(['{']); + idx = ago === '@' ? i - 2 : i - 1; + while (this.tag(idx - 2) === 'HERECOMMENT') { + idx -= 2; } - if (tag === ':') { - if (this.tag(i - 2) === '@') { - s = i - 2; - } else { - s = i - 1; - } - while (this.tag(s - 2) === 'HERECOMMENT') { - s -= 2; - } - startsLine = s === 0 || (_ref2 = this.tag(s - 1), __indexOf.call(LINEBREAKS, _ref2) >= 0) || tokens[s - 1].newLine; - if (stackTop()) { - _ref3 = stackTop(), stackTag = _ref3[0], stackIdx = _ref3[1]; - if ((stackTag === '{' || stackTag === 'INDENT' && this.tag(stackIdx - 1) === '{') && (startsLine || this.tag(s - 1) === ',' || this.tag(s - 1) === '{')) { - return forward(1); - } - } - startImplicitObject(s, !!startsLine); - return forward(2); - } - if (inImplicitCall() && __indexOf.call(CALL_CLOSERS, tag) >= 0) { - if (prevTag === 'OUTDENT') { - endImplicitCall(); - return forward(1); - } - if (prevToken.newLine) { - endAllImplicitCalls(); - return forward(1); - } - } - if (inImplicitObject() && __indexOf.call(LINEBREAKS, tag) >= 0) { - stackTop()[2].sameLine = false; - } - if (__indexOf.call(IMPLICIT_END, tag) >= 0) { - while (inImplicit()) { - _ref4 = stackTop(), stackTag = _ref4[0], stackIdx = _ref4[1], (_ref5 = _ref4[2], sameLine = _ref5.sameLine, startsLine = _ref5.startsLine); - if (inImplicitCall() && prevTag !== ',') { - endImplicitCall(); - } else if (inImplicitObject() && sameLine && !startsLine) { - endImplicitObject(); - } else if (inImplicitObject() && tag === 'TERMINATOR' && prevTag !== ',' && !(startsLine && this.looksObjectish(i + 1))) { - endImplicitObject(); - } else { - break; - } - } - } - if (tag === ',' && !this.looksObjectish(i + 1) && inImplicitObject() && (nextTag !== 'TERMINATOR' || !this.looksObjectish(i + 2))) { - offset = nextTag === 'OUTDENT' ? 1 : 0; - while (inImplicitObject()) { - endImplicitObject(i + offset); - } - } - return forward(1); + 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.addLocationDataToGeneratedTokens = function() { + 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 column, line, nextLocation, prevLocation, _ref, _ref1; - if (token[2]) { + 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; } - if (!(token.generated || token.explicit)) { - return 1; - } - if (token[0] === '{' && (nextLocation = (_ref = tokens[i + 1]) != null ? _ref[2] : void 0)) { - line = nextLocation.first_line, column = nextLocation.first_column; - } else if (prevLocation = (_ref1 = tokens[i - 1]) != null ? _ref1[2] : void 0) { - line = prevLocation.last_line, column = prevLocation.last_column; - } else { - line = column = 0; - } - token[2] = { - first_line: line, - first_column: column, - last_line: line, - last_column: column - }; - 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.normalizeLines = function() { + Rewriter.prototype.addImplicitIndentation = function() { var action, condition, indent, outdent, starter; starter = indent = outdent = null; condition = function(token, i) { - var _ref, _ref1, _ref2, _ref3; - return token[1] !== ';' && (_ref = token[0], __indexOf.call(SINGLE_CLOSERS, _ref) >= 0) && !(token[0] === 'TERMINATOR' && (_ref1 = this.tag(i + 1), __indexOf.call(EXPRESSION_CLOSE, _ref1) >= 0)) && !(token[0] === 'ELSE' && starter !== 'THEN') && !(((_ref2 = token[0]) === 'CATCH' || _ref2 === 'FINALLY') && (starter === '->' || starter === '=>')) || (_ref3 = token[0], __indexOf.call(CALL_CLOSERS, _ref3) >= 0) && this.tokens[i - 1].newLine; + 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 j, tag, _i, _ref, _ref1, _ref2; + var tag, _ref, _ref1; tag = token[0]; - if (tag === 'TERMINATOR') { - if (this.tag(i + 1) === 'ELSE' && this.tag(i - 1) !== 'OUTDENT') { - tokens.splice.apply(tokens, [i, 1].concat(__slice.call(this.indentation()))); - return 1; - } - if (_ref = this.tag(i + 1), __indexOf.call(EXPRESSION_CLOSE, _ref) >= 0) { - tokens.splice(i, 1); - return 0; - } + if (tag === 'TERMINATOR' && this.tag(i + 1) === 'THEN') { + tokens.splice(i, 1); + return 0; } - if (tag === 'CATCH') { - for (j = _i = 1; _i <= 2; j = ++_i) { - if (!((_ref1 = this.tag(i + j)) === 'OUTDENT' || _ref1 === 'TERMINATOR' || _ref1 === 'FINALLY')) { - continue; - } - tokens.splice.apply(tokens, [i + j, 0].concat(__slice.call(this.indentation()))); - return 2 + j; - } + 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; - _ref2 = this.indentation(true), indent = _ref2[0], outdent = _ref2[1]; - if (starter === 'THEN') { - indent.fromThen = true; - } + _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); - } + if (tag === 'THEN') tokens.splice(i, 1); return 1; } return 1; @@ -433,10 +265,8 @@ define(function(require, exports, module) { var action, condition, original; original = null; condition = function(token, i) { - var prevTag, tag; - tag = token[0]; - prevTag = this.tokens[i - 1][0]; - return tag === 'TERMINATOR' || (tag === 'INDENT' && __indexOf.call(SINGLE_LINERS, prevTag) < 0); + var _ref; + return (_ref = token[0]) === 'TERMINATOR' || _ref === 'INDENT'; }; action = function(token, i) { if (token[0] !== 'INDENT' || (token.generated && !token.fromThen)) { @@ -444,32 +274,28 @@ define(function(require, exports, module) { } }; return this.scanTokens(function(token, i) { - if (token[0] !== 'IF') { - return 1; - } + if (token[0] !== 'IF') return 1; original = token; this.detectEnd(i + 1, condition, action); return 1; }); }; - Rewriter.prototype.indentation = function(implicit) { + Rewriter.prototype.indentation = function(token, implicit) { var indent, outdent; - if (implicit == null) { - implicit = false; - } - indent = ['INDENT', 2]; - outdent = ['OUTDENT', 2]; - if (implicit) { - indent.generated = outdent.generated = true; - } - if (!implicit) { - indent.explicit = outdent.explicit = true; - } + 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 = generate; + 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; @@ -494,14 +320,16 @@ define(function(require, exports, module) { EXPRESSION_END.push(INVERSES[left] = rite); } - EXPRESSION_CLOSE = ['CATCH', 'THEN', 'ELSE', 'FINALLY'].concat(EXPRESSION_END); + EXPRESSION_CLOSE = ['CATCH', 'WHEN', 'ELSE', 'FINALLY'].concat(EXPRESSION_END); IMPLICIT_FUNC = ['IDENTIFIER', 'SUPER', ')', 'CALL_END', ']', 'INDEX_END', '@', 'THIS']; - IMPLICIT_CALL = ['IDENTIFIER', 'NUMBER', 'STRING', 'JS', 'REGEX', 'NEW', 'PARAM_START', 'CLASS', 'IF', 'TRY', 'SWITCH', 'THIS', 'BOOL', 'NULL', 'UNDEFINED', 'UNARY', 'SUPER', 'THROW', '@', '->', '=>', '[', '(', '{', '--', '++']; + 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']; @@ -510,7 +338,5 @@ define(function(require, exports, module) { LINEBREAKS = ['TERMINATOR', 'INDENT', 'OUTDENT']; - CALL_CLOSERS = ['.', '?.', '::', '?::']; - -}); \ No newline at end of file +}); diff --git a/lib/ace/mode/coffee/scope.js b/lib/ace/mode/coffee/scope.js index 5834963b..cf1cd9f3 100644 --- a/lib/ace/mode/coffee/scope.js +++ b/lib/ace/mode/coffee/scope.js @@ -1,5 +1,5 @@ -/** - * Copyright (c) 2009-2013 Jeremy Ashkenas +/* + * Copyright (c) 2011 Jeremy Ashkenas * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -21,17 +21,19 @@ * 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. - * */ define(function(require, exports, module) { -// Generated by CoffeeScript 1.6.3 +// 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) { @@ -45,15 +47,11 @@ define(function(require, exports, module) { } ]; this.positions = {}; - if (!this.parent) { - Scope.root = this; - } + 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 (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 { @@ -64,32 +62,22 @@ define(function(require, exports, module) { } }; - Scope.prototype.namedMethod = function() { - var _ref1; - if (((_ref1 = this.method) != null ? _ref1.name : void 0) || !this.parent) { - return this.method; - } - return this.parent.namedMethod(); - }; - - Scope.prototype.find = function(name) { - if (this.check(name)) { - return true; - } + 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; - } + if (this.shared && this.parent.check(name, true)) return; return this.add(name, 'param'); }; - Scope.prototype.check = function(name) { - var _ref1; - return !!(this.type(name) || ((_ref1 = this.parent) != null ? _ref1.check(name) : void 0)); + Scope.prototype.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) { @@ -105,25 +93,19 @@ define(function(require, exports, module) { _ref1 = this.variables; for (_i = 0, _len = _ref1.length; _i < _len; _i++) { v = _ref1[_i]; - if (v.name === name) { - return v.type; - } + if (v.name === name) return v.type; } return null; }; Scope.prototype.freeVariable = function(name, reserve) { var index, temp; - if (reserve == null) { - reserve = true; - } + if (reserve == null) reserve = true; index = 0; while (this.check((temp = this.temporary(name, index)))) { index++; } - if (reserve) { - this.add(temp, 'var', true); - } + if (reserve) this.add(temp, 'var', true); return temp; }; @@ -159,9 +141,7 @@ define(function(require, exports, module) { _results = []; for (_i = 0, _len = _ref1.length; _i < _len; _i++) { v = _ref1[_i]; - if (v.type.assigned) { - _results.push("" + v.name + " = " + v.type.value); - } + if (v.type.assigned) _results.push("" + v.name + " = " + v.type.value); } return _results; }; @@ -171,4 +151,4 @@ define(function(require, exports, module) { })(); -}); \ No newline at end of file +}); diff --git a/lib/ace/mode/coffee_highlight_rules.js b/lib/ace/mode/coffee_highlight_rules.js index 94c9476f..d3fe7884 100644 --- a/lib/ace/mode/coffee_highlight_rules.js +++ b/lib/ace/mode/coffee_highlight_rules.js @@ -1,199 +1,159 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. * - * 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. + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Satoshi Murakami + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ define(function(require, exports, module) { "use strict"; + var lang = require("../lib/lang"); 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 keywords = ( - "this|throw|then|try|typeof|super|switch|return|break|by|continue|" + - "catch|class|in|instanceof|is|isnt|if|else|extends|for|own|" + - "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|NaN|Infinity" - ); - - var illegal = ( - "case|const|default|function|var|void|with|enum|export|implements|" + - "interface|let|package|private|protected|public|static|yield|" + - "__hasProp|slice|bind|indexOf" - ); - - var supportClass = ( - "Array|Boolean|Date|Function|Number|Object|RegExp|ReferenceError|String|" + - "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + - "SyntaxError|TypeError|URIError|" + - "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" + - "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray" - ); - - var supportFunction = ( - "Math|JSON|isNaN|isFinite|parseInt|parseFloat|encodeURI|" + - "encodeURIComponent|decodeURI|decodeURIComponent|String|" - ); - - var variableLanguage = ( - "window|arguments|prototype|document" - ); - - var keywordMapper = this.createKeywordMapper({ - "keyword": keywords, - "constant.language": langConstant, - "invalid.illegal": illegal, - "language.support.class": supportClass, - "language.support.function": supportFunction, - "variable.language": variableLanguage - }, "identifier"); - - var functionRule = { - token: ["paren.lparen", "variable.parameter", "paren.rparen", "text", "storage.type"], - regex: /(?:(\()((?:"[^")]*?"|'[^')]*?'|\/[^\/)]*?\/|[^()\"'\/])*?)(\))(\s*))?([\-=]>)/.source + var stringfill = { + token : "string", + merge : true, + regex : ".+" }; - var stringEscape = /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)/; + var keywords = lang.arrayToMap(( + "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").split("|") + ); + + var langConstant = lang.arrayToMap(( + "true|false|null|undefined").split("|") + ); + + var illegal = lang.arrayToMap(( + "case|const|default|function|var|void|with|enum|export|implements|" + + "interface|let|package|private|protected|public|static|yield|" + + "__hasProp|extends|slice|bind|indexOf").split("|") + ); + + var supportClass = lang.arrayToMap(( + "Array|Boolean|Date|Function|Number|Object|RegExp|ReferenceError|" + + "RangeError|String|SyntaxError|Error|EvalError|TypeError|URIError").split("|") + ); + + var supportFunction = lang.arrayToMap(( + "Math|JSON|isNaN|isFinite|parseInt|parseFloat|encodeURI|" + + "encodeURIComponent|decodeURI|decodeURIComponent|RangeError|String|" + + "SyntaxError|Error|EvalError|TypeError|URIError").split("|") + ); this.$rules = { start : [ { + token : "identifier", + regex : "(?:(?:\\.|::)\\s*)" + identifier + }, { + token : "variable", + regex : "@(?:" + identifier + ")?" + }, { + token: function(value) { + if (keywords.hasOwnProperty(value)) + return "keyword"; + else if (langConstant.hasOwnProperty(value)) + return "constant.language"; + else if (illegal.hasOwnProperty(value)) + return "invalid.illegal"; + else if (supportClass.hasOwnProperty(value)) + return "language.support.class"; + else if (supportFunction.hasOwnProperty(value)) + return "language.support.function"; + else + return "identifier"; + }, + regex : identifier + }, { token : "constant.numeric", regex : "(?:0x[\\da-fA-F]+|(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[eE][+-]?\\d+)?)" }, { - stateName: "qdoc", - token : "string", regex : "'''", next : [ - {token : "string", regex : "'''", next : "start"}, - {token : "constant.language.escape", regex : stringEscape}, - {defaultToken: "string"} - ] - }, { - stateName: "qqdoc", token : "string", + merge : true, + regex : "'''", + next : "qdoc" + }, { + token : "string", + merge : true, regex : '"""', - next : [ - {token : "string", regex : '"""', next : "start"}, - {token : "paren.string", regex : '#{', push : "start"}, - {token : "constant.language.escape", regex : stringEscape}, - {defaultToken: "string"} - ] + next : "qqdoc" }, { - stateName: "qstring", - token : "string", regex : "'", next : [ - {token : "string", regex : "'", next : "start"}, - {token : "constant.language.escape", regex : stringEscape}, - {defaultToken: "string"} - ] + token : "string", + merge : true, + regex : "'", + next : "qstring" }, { - stateName: "qqstring", - token : "string.start", regex : '"', next : [ - {token : "string.end", regex : '"', next : "start"}, - {token : "paren.string", regex : '#{', push : "start"}, - {token : "constant.language.escape", regex : stringEscape}, - {defaultToken: "string"} - ] + token : "string", + merge : true, + regex : '"', + next : "qqstring" }, { - stateName: "js", - token : "string", regex : "`", next : [ - {token : "string", regex : "`", next : "start"}, - {token : "constant.language.escape", regex : stringEscape}, - {defaultToken: "string"} - ] - }, { - regex: "[{}]", onMatch: function(val, state, stack) { - this.next = ""; - if (val == "{" && stack.length) { - stack.unshift("start", state); - return "paren"; - } - if (val == "}" && stack.length) { - stack.shift(); - this.next = stack.shift() || ""; - if (this.next.indexOf("string") != -1) - return "paren.string"; - } - return "paren"; - } + token : "string", + merge : true, + regex : "`", + next : "js" }, { token : "string.regex", + merge : true, regex : "///", next : "heregex" }, { token : "string.regex", - regex : /(?:\/(?![\s=])[^[\/\n\\]*(?:(?:\\[\s\S]|\[[^\]\n\\]*(?:\\[\s\S][^\]\n\\]*)*])[^[\/\n\\]*)*\/)(?:[imgy]{0,4})(?!\w)/ + regex : "/(?!\\s)[^[/\\n\\\\]*(?: (?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[/\\n\\\\]*)*/[imgy]{0,4}(?!\\w)" }, { token : "comment", + merge : true, regex : "###(?!#)", next : "comment" }, { token : "comment", regex : "#.*" - }, { - token : ["punctuation.operator", "text", "identifier"], - regex : "(\\.)(\\s*)(" + illegal + ")" }, { token : "punctuation.operator", - regex : "\\." - }, { - //class A extends B - token : ["keyword", "text", "language.support.class", - "text", "keyword", "text", "language.support.class"], - regex : "(class)(\\s+)(" + identifier + ")(?:(\\s+)(extends)(\\s+)(" + identifier + "))?" - }, { - //play = (...) -> - token : ["entity.name.function", "text", "keyword.operator", "text"].concat(functionRule.token), - regex : "(" + identifier + ")(\\s*)([=:])(\\s*)" + functionRule.regex - }, - functionRule, - { - token : "variable", - regex : "@(?:" + identifier + ")?" - }, { - token: keywordMapper, - regex : identifier - }, { - token : "punctuation.operator", - regex : "\\,|\\." - }, { - token : "storage.type", - regex : "[\\-=]>" + regex : "\\?|\\:|\\,|\\." }, { token : "keyword.operator", - regex : "(?:[-+*/%<>&|^!?=]=|>>>=?|\\-\\-|\\+\\+|::|&&=|\\|\\|=|<<=|>>=|\\?\\.|\\.{2,3}|[!*+-=><])" + regex : "(?:[\\-=]>|[-+*/%<>&|^!?=]=|>>>=?|\\-\\-|\\+\\+|::|&&=|\\|\\|=|<<=|>>=|\\?\\.|\\.{2,3}|[!*+-=><])" }, { token : "paren.lparen", regex : "[({[]" @@ -204,8 +164,40 @@ define(function(require, exports, module) { 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}', @@ -215,18 +207,20 @@ define(function(require, exports, module) { regex : "\\s+(?:#.*)?" }, { token : "string.regex", + merge : true, regex : "\\S+" }], - + comment : [{ token : "comment", - regex : '###', + regex : '.*?###', next : "start" }, { - defaultToken : "comment" + token : "comment", + merge : true, + regex : ".+" }] }; - this.normalizeRules(); } exports.CoffeeHighlightRules = CoffeeHighlightRules; diff --git a/lib/ace/mode/coffee_highlight_rules_test.js b/lib/ace/mode/coffee_highlight_rules_test.js new file mode 100644 index 00000000..0393e659 --- /dev/null +++ b/lib/ace/mode/coffee_highlight_rules_test.js @@ -0,0 +1,72 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +if (typeof process !== "undefined") { + require("amd-loader"); +} + +define(function(require, exports, module) { +"use strict"; + +var Mode = require("./coffee").Mode; +var assert = require("../test/assertions"); + +module.exports = { + setUp : function() { + this.tokenizer = new Mode().getTokenizer(); + }, + + "test: tokenize keyword": function() { + var tokens = this.tokenizer.getLineTokens("for", "start").tokens; + assert.equal(tokens.length, 1); + assert.equal(tokens[0].type, "keyword"); + }, + + // TODO: disable. not yet implemented + "!test tokenize string with interpolation": function() { + var tokens = this.tokenizer.getLineTokens('"#{ 22 / 7 } is a decent approximation of π"', "start").tokens; + console.log(tokens); + assert.equal(tokens.length, 12); + //assert.equal(tokens[0].type, "keyword"); + } +}; + +}); + +if (typeof module !== "undefined" && module === require.main) { + require("asyncjs").test.testcase(module.exports).exec(); +} diff --git a/lib/ace/mode/coffee_worker.js b/lib/ace/mode/coffee_worker.js index d68f1296..6268f192 100644 --- a/lib/ace/mode/coffee_worker.js +++ b/lib/ace/mode/coffee_worker.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -40,7 +47,7 @@ window.addEventListener = function() {}; var Worker = exports.Worker = function(sender) { Mirror.call(this, sender); - this.setTimeout(250); + this.setTimeout(200); }; oop.inherits(Worker, Mirror); @@ -49,23 +56,35 @@ oop.inherits(Worker, Mirror); this.onUpdate = function() { var value = this.doc.getValue(); - var errors = []; + try { - coffee.parse(value).compile(); + coffee.parse(value); } catch(e) { - var loc = e.location; - if (loc) { - errors.push({ - row: loc.first_line, - column: loc.first_column, - endRow: loc.last_line, - endColumn: loc.last_column, - text: e.message, + 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("annotate", errors); + this.sender.emit("ok"); }; }).call(Worker.prototype); diff --git a/lib/ace/mode/coldfusion.js b/lib/ace/mode/coldfusion.js index 0b4ea449..8d5d2c07 100644 --- a/lib/ace/mode/coldfusion.js +++ b/lib/ace/mode/coldfusion.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,29 +39,32 @@ define(function(require, exports, module) { "use strict"; var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var HtmlMode = require("./html").Mode; +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 voidElements = "cfabort|cfapplication|cfargument|cfassociate|cfbreak|cfcache|cfcollection|cfcookie|cfdbinfo|cfdirectory|cfdump|cfelse|cfelseif|cferror|cfexchangecalendar|cfexchangeconnection|cfexchangecontact|cfexchangefilter|cfexchangetask|cfexit|cffeed|cffile|cfflush|cfftp|cfheader|cfhtmlhead|cfhttpparam|cfimage|cfimport|cfinclude|cfindex|cfinsert|cfinvokeargument|cflocation|cflog|cfmailparam|cfNTauthenticate|cfobject|cfobjectcache|cfparam|cfpdfformparam|cfprint|cfprocparam|cfprocresult|cfproperty|cfqueryparam|cfregistry|cfreportparam|cfrethrow|cfreturn|cfschedule|cfsearch|cfset|cfsetting|cfthrow|cfzipparam)".split("|"); - var Mode = function() { - HtmlMode.call(this); + XmlMode.call(this); - this.HighlightRules = ColdfusionHighlightRules; + var highlighter = new ColdfusionHighlightRules(); + this.$tokenizer = new Tokenizer(highlighter.getRules()); + + this.$embeds = highlighter.getEmbeds(); + this.createModeDelegates({ + "js-": JavaScriptMode, + "css-": CssMode + }); }; -oop.inherits(Mode, HtmlMode); +oop.inherits(Mode, XmlMode); (function() { - // mix with html void elements - this.voidElements = oop.mixin(lang.arrayToMap(voidElements), this.voidElements); - this.getNextLineIndent = function(state, line, tab) { return this.$getIndent(line); }; - this.$id = "ace/mode/coldfusion"; }).call(Mode.prototype); exports.Mode = Mode; diff --git a/lib/ace/mode/coldfusion_highlight_rules.js b/lib/ace/mode/coldfusion_highlight_rules.js index 5feff6d6..71d792e2 100644 --- a/lib/ace/mode/coldfusion_highlight_rules.js +++ b/lib/ace/mode/coldfusion_highlight_rules.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,18 +39,97 @@ define(function(require, exports, module) { "use strict"; var oop = require("../lib/oop"); +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; +var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; +var xml_util = require("./xml_util"); var ColdfusionHighlightRules = function() { - HtmlHighlightRules.call(this); - this.embedTagRules(JavaScriptHighlightRules, "cfjs-", "cfscript"); + // regexp must not have capturing parentheses + // regexps are ordered -> the first match is used - this.normalizeRules(); + 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, HtmlHighlightRules); +oop.inherits(ColdfusionHighlightRules, TextHighlightRules); exports.ColdfusionHighlightRules = ColdfusionHighlightRules; }); diff --git a/lib/ace/mode/coldfusion_test.js b/lib/ace/mode/coldfusion_test.js index b55fb1c5..18323d54 100644 --- a/lib/ace/mode/coldfusion_test.js +++ b/lib/ace/mode/coldfusion_test.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -45,12 +52,12 @@ module.exports = { this.mode = new ColdfusionMode(); }, - "test: toggle comment lines" : function() { - var session = new EditSession([" abc", " cde", "fg"]); + "test: toggle comment lines should not do anything" : function() { + var session = new EditSession([" abc", "cde", "fg"]); var range = new Range(0, 3, 1, 1); var comment = this.mode.toggleCommentLines("start", session, 0, 1); - assert.equal([" ", " ", "fg"].join("\n"), session.toString()); + assert.equal([" abc", "cde", "fg"].join("\n"), session.toString()); }, "test: next line indent should be the same as the current line indent" : function() { diff --git a/lib/ace/mode/csharp.js b/lib/ace/mode/csharp.js index a3b2964f..25586b80 100644 --- a/lib/ace/mode/csharp.js +++ b/lib/ace/mode/csharp.js @@ -3,13 +3,14 @@ define(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/csharp").FoldMode; +var CStyleFoldMode = require("./folding/cstyle").FoldMode; var Mode = function() { - this.HighlightRules = CSharpHighlightRules; + this.$tokenizer = new Tokenizer(new CSharpHighlightRules().getRules()); this.$outdent = new MatchingBraceOutdent(); this.$behaviour = new CstyleBehaviour(); this.foldingRules = new CStyleFoldMode(); @@ -18,13 +19,10 @@ oop.inherits(Mode, TextMode); (function() { - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - this.getNextLineIndent = function(state, line, tab) { var indent = this.$getIndent(line); - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokenizedLine = this.$tokenizer.getLineTokens(line, state); var tokens = tokenizedLine.tokens; if (tokens.length && tokens[tokens.length-1].type == "comment") { @@ -54,7 +52,6 @@ oop.inherits(Mode, TextMode); return null; }; - this.$id = "ace/mode/csharp"; }).call(Mode.prototype); exports.Mode = Mode; diff --git a/lib/ace/mode/csharp_highlight_rules.js b/lib/ace/mode/csharp_highlight_rules.js index 6e7ba5d4..7713e40b 100644 --- a/lib/ace/mode/csharp_highlight_rules.js +++ b/lib/ace/mode/csharp_highlight_rules.js @@ -2,15 +2,20 @@ define(function(require, exports, module) { "use strict"; 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 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"); + + var keywords = lang.arrayToMap( + ("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").split("|") + ); + + var buildinConstants = lang.arrayToMap( + ("null|true|false").split("|") + ); + // regexp must not have capturing parentheses. Use (?:) instead. // regexps are ordered -> the first match is used @@ -25,19 +30,17 @@ var CSharpHighlightRules = function() { { token : "comment", // multi line comment regex : "\\/\\*", + merge : true, next : "comment" }, { - token : "string", // character - regex : /'(?:.|\\(:?u[\da-fA-F]+|x[\da-fA-F]+|[tbrf'"n]))'/ + token : "string.regexp", + regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" }, { - token : "string", start : '"', end : '"|$', next: [ - {token: "constant.language.escape", regex: /\\(:?u[\da-fA-F]+|x[\da-fA-F]+|[tbrf'"n])/}, - {token: "invalid", regex: /\\./} - ] + token : "string", // single line + regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' }, { - token : "string", start : '@"', end : '"', next:[ - {token: "constant.language.escape", regex: '""'} - ] + token : "string", // single line + regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" }, { token : "constant.numeric", // hex regex : "0[xX][0-9a-fA-F]+\\b" @@ -48,14 +51,22 @@ var CSharpHighlightRules = function() { token : "constant.language.boolean", regex : "(?:true|false)\\b" }, { - token : keywordMapper, + token : function(value) { + if (value == "this") + return "variable.language"; + else if (keywords.hasOwnProperty(value)) + return "keyword"; + else if (buildinConstants.hasOwnProperty(value)) + return "constant.language"; + else + 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 : "keyword", - regex : "^\\s*#(if|else|elif|endif|define|undef|warning|error|line|region|endregion|pragma)" }, { token : "punctuation.operator", regex : "\\?|\\:|\\,|\\;|\\." @@ -77,14 +88,14 @@ var CSharpHighlightRules = function() { next : "start" }, { token : "comment", // comment spanning whole line + merge : true, regex : ".+" } ] }; - + this.embedRules(DocCommentHighlightRules, "doc-", [ DocCommentHighlightRules.getEndRule("start") ]); - this.normalizeRules(); }; oop.inherits(CSharpHighlightRules, TextHighlightRules); diff --git a/lib/ace/mode/css.js b/lib/ace/mode/css.js index 6fef5ccd..be7ff475 100644 --- a/lib/ace/mode/css.js +++ b/lib/ace/mode/css.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -33,16 +40,15 @@ define(function(require, exports, module) { var oop = require("../lib/oop"); var TextMode = require("./text").Mode; +var Tokenizer = require("../tokenizer").Tokenizer; var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; var WorkerClient = require("../worker/worker_client").WorkerClient; -var CssBehaviour = require("./behaviour/css").CssBehaviour; var CStyleFoldMode = require("./folding/cstyle").FoldMode; var Mode = function() { - this.HighlightRules = CssHighlightRules; + this.$tokenizer = new Tokenizer(new CssHighlightRules().getRules(), "i"); this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CssBehaviour(); this.foldingRules = new CStyleFoldMode(); }; oop.inherits(Mode, TextMode); @@ -50,13 +56,12 @@ oop.inherits(Mode, TextMode); (function() { this.foldingRules = "cStyle"; - this.blockComment = {start: "/*", end: "*/"}; this.getNextLineIndent = function(state, line, tab) { var indent = this.$getIndent(line); // ignore braces in comments - var tokens = this.getTokenizer().getLineTokens(line, state).tokens; + var tokens = this.$tokenizer.getLineTokens(line, state).tokens; if (tokens.length && tokens[tokens.length-1].type == "comment") { return indent; } @@ -76,23 +81,28 @@ oop.inherits(Mode, TextMode); 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("annotate", function(e) { - session.setAnnotations(e.data); + + 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); }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - return worker; }; - this.$id = "ace/mode/css"; }).call(Mode.prototype); exports.Mode = Mode; diff --git a/lib/ace/mode/css/csslint.js b/lib/ace/mode/css/csslint.js index c3c79a80..4830dda4 100644 --- a/lib/ace/mode/css/csslint.js +++ b/lib/ace/mode/css/csslint.js @@ -1,10 +1,10 @@ define(function(require, exports, module) { /*! CSSLint -Copyright (c) 2014 Nicole Sullivan and Nicholas C. Zakas. All rights reserved. +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 +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 @@ -13,7 +13,7 @@ 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 +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 @@ -22,7 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* Build: v0.10.0 22-July-2014 01:17:52 */ +/* Build time: 2-March-2012 02:47:11 */ + /*! Parser-Lib Copyright (c) 2009-2011 Nicholas C. Zakas. All rights reserved. @@ -46,10 +47,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* Version v0.2.5, Build time: 7-May-2014 03:37:38 */ +/* 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. @@ -64,7 +66,7 @@ function EventTarget(){ * @property _listeners * @private */ - this._listeners = {}; + this._listeners = {}; } EventTarget.prototype = { @@ -86,14 +88,14 @@ EventTarget.prototype = { 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 }; @@ -101,19 +103,19 @@ EventTarget.prototype = { 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); } - } + } }, /** @@ -132,9 +134,9 @@ EventTarget.prototype = { break; } } - - - } + + + } } }; /** @@ -498,16 +500,16 @@ 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.text; + return this.toString(); }, - + /** * Returns the text representation of the unit. * @return {String} The text representation of the unit. @@ -525,7 +527,7 @@ SyntaxUnit.prototype = { * @class TokenStreamBase * @namespace parserlib.util * @constructor - * @param {String|StringReader} input The text to tokenize or a reader from + * @param {String|StringReader} input The text to tokenize or a reader from * which to read the input. */ function TokenStreamBase(input, tokenData){ @@ -537,15 +539,15 @@ function TokenStreamBase(input, tokenData){ * @private */ this._reader = input ? new StringReader(input.toString()) : null; - + /** * Token object for the last consumed token. * @type Token * @property _token * @private */ - this._token = null; - + this._token = null; + /** * The array of token information. * @type Array @@ -553,7 +555,7 @@ function TokenStreamBase(input, tokenData){ * @private */ this._tokenData = tokenData; - + /** * Lookahead token buffer. * @type Array @@ -561,7 +563,7 @@ function TokenStreamBase(input, tokenData){ * @private */ this._lt = []; - + /** * Lookahead token buffer index. * @type int @@ -569,7 +571,7 @@ function TokenStreamBase(input, tokenData){ * @private */ this._ltIndex = 0; - + this._ltIndexCache = []; } @@ -589,7 +591,7 @@ TokenStreamBase.createTokenData = function(tokens){ tokenData = tokens.concat([]), i = 0, len = tokenData.length+1; - + tokenData.UNKNOWN = -1; tokenData.unshift({name:"EOF"}); @@ -600,27 +602,27 @@ TokenStreamBase.createTokenData = function(tokens){ 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, - + 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 @@ -636,27 +638,27 @@ TokenStreamBase.prototype = { * @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. @@ -667,7 +669,7 @@ TokenStreamBase.prototype = { * provided, reads from the default (unnamed) channel. * @return {void} * @method mustMatch - */ + */ mustMatch: function(tokenTypes, channel){ var token; @@ -677,17 +679,17 @@ TokenStreamBase.prototype = { tokenTypes = [tokenTypes]; } - if (!this.match.apply(this, arguments)){ + if (!this.match.apply(this, arguments)){ token = this.LT(1); - throw new SyntaxError("Expected " + this._tokenData[tokenTypes[0]].name + + 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. @@ -700,21 +702,21 @@ TokenStreamBase.prototype = { * @method advance */ advance: function(tokenTypes, channel){ - + while(this.LA(0) !== 0 && !this.match(tokenTypes, channel)){ this.get(); } - return this.LA(0); + return this.LA(0); }, - + /** - * Consumes the next token from the token stream. + * 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, @@ -723,14 +725,14 @@ TokenStreamBase.prototype = { found = false, token, info; - + //check the lookahead buffer first - if (this._lt.length && this._ltIndex >= 0 && this._ltIndex < this._lt.length){ - + 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){ @@ -738,7 +740,7 @@ TokenStreamBase.prototype = { info = tokenInfo[this._token.type]; i++; } - + //here be dragons if ((info.channel === undefined || channel === info.channel) && this._ltIndex <= this._lt.length){ @@ -746,45 +748,45 @@ TokenStreamBase.prototype = { 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); - + this._ltIndexCache.push(this._lt.length - this._ltIndex + i); + //keep the buffer under 5 items if (this._lt.length > 5){ - this._lt.shift(); + 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 || + if (info && + (info.hide || (info.channel !== undefined && channel !== info.channel))){ return this.get(channel); } else { @@ -792,7 +794,7 @@ TokenStreamBase.prototype = { 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 @@ -811,34 +813,34 @@ TokenStreamBase.prototype = { if (index > 5){ throw new Error("Too much lookahead."); } - + //get all those tokens while(total){ - tt = this.get(); - 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 @@ -848,18 +850,18 @@ TokenStreamBase.prototype = { * 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]; + return this._lt[this._ltIndex+index-1]; }, - + /** - * Returns the token type for the next token in the stream without + * 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 @@ -867,7 +869,7 @@ TokenStreamBase.prototype = { 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. @@ -876,7 +878,7 @@ TokenStreamBase.prototype = { 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. @@ -891,22 +893,22 @@ TokenStreamBase.prototype = { 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){ @@ -920,6 +922,8 @@ TokenStreamBase.prototype = { }; + + parserlib.util = { StringReader: StringReader, SyntaxError : SyntaxError, @@ -928,7 +932,9 @@ EventTarget : EventTarget, TokenStreamBase : TokenStreamBase }; })(); -/* + + +/* Parser-Lib Copyright (c) 2009-2011 Nicholas C. Zakas. All rights reserved. @@ -951,7 +957,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* Version v0.2.5, Build time: 7-May-2014 03:37:38 */ +/* Version v0.1.6, Build time: 2-March-2012 02:44:32 */ (function(){ var EventTarget = parserlib.util.EventTarget, TokenStreamBase = parserlib.util.TokenStreamBase, @@ -959,6 +965,7 @@ StringReader = parserlib.util.StringReader, SyntaxError = parserlib.util.SyntaxError, SyntaxUnit = parserlib.util.SyntaxUnit; + var Colors = { aliceblue :"#f0f8ff", antiquewhite :"#faebd7", @@ -985,7 +992,6 @@ var Colors = { darkcyan :"#008b8b", darkgoldenrod :"#b8860b", darkgray :"#a9a9a9", - darkgrey :"#a9a9a9", darkgreen :"#006400", darkkhaki :"#bdb76b", darkmagenta :"#8b008b", @@ -997,13 +1003,11 @@ var Colors = { darkseagreen :"#8fbc8f", darkslateblue :"#483d8b", darkslategray :"#2f4f4f", - darkslategrey :"#2f4f4f", darkturquoise :"#00ced1", darkviolet :"#9400d3", deeppink :"#ff1493", deepskyblue :"#00bfff", dimgray :"#696969", - dimgrey :"#696969", dodgerblue :"#1e90ff", firebrick :"#b22222", floralwhite :"#fffaf0", @@ -1014,7 +1018,6 @@ var Colors = { gold :"#ffd700", goldenrod :"#daa520", gray :"#808080", - grey :"#808080", green :"#008000", greenyellow :"#adff2f", honeydew :"#f0fff0", @@ -1032,14 +1035,12 @@ var Colors = { lightcyan :"#e0ffff", lightgoldenrodyellow :"#fafad2", lightgray :"#d3d3d3", - lightgrey :"#d3d3d3", lightgreen :"#90ee90", lightpink :"#ffb6c1", lightsalmon :"#ffa07a", lightseagreen :"#20b2aa", lightskyblue :"#87cefa", lightslategray :"#778899", - lightslategrey :"#778899", lightsteelblue :"#b0c4de", lightyellow :"#ffffe0", lime :"#00ff00", @@ -1092,7 +1093,6 @@ var Colors = { skyblue :"#87ceeb", slateblue :"#6a5acd", slategray :"#708090", - slategrey :"#708090", snow :"#fffafa", springgreen :"#00ff7f", steelblue :"#4682b4", @@ -1106,37 +1106,7 @@ var Colors = { white :"#ffffff", whitesmoke :"#f5f5f5", yellow :"#ffff00", - yellowgreen :"#9acd32", - //CSS2 system colors http://www.w3.org/TR/css3-color/#css2-system - activeBorder :"Active window border.", - activecaption :"Active window caption.", - appworkspace :"Background color of multiple document interface.", - background :"Desktop background.", - buttonface :"The face background color for 3-D elements that appear 3-D due to one layer of surrounding border.", - buttonhighlight :"The color of the border facing the light source for 3-D elements that appear 3-D due to one layer of surrounding border.", - buttonshadow :"The color of the border away from the light source for 3-D elements that appear 3-D due to one layer of surrounding border.", - buttontext :"Text on push buttons.", - captiontext :"Text in caption, size box, and scrollbar arrow box.", - graytext :"Grayed (disabled) text. This color is set to #000 if the current display driver does not support a solid gray color.", - greytext :"Greyed (disabled) text. This color is set to #000 if the current display driver does not support a solid grey color.", - highlight :"Item(s) selected in a control.", - highlighttext :"Text of item(s) selected in a control.", - inactiveborder :"Inactive window border.", - inactivecaption :"Inactive window caption.", - inactivecaptiontext :"Color of text in an inactive caption.", - infobackground :"Background color for tooltip controls.", - infotext :"Text color for tooltip controls.", - menu :"Menu background.", - menutext :"Text in menus.", - scrollbar :"Scroll bar gray area.", - threeddarkshadow :"The color of the darker (generally outer) of the two borders away from the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.", - threedface :"The face background color for 3-D elements that appear 3-D due to two concentric layers of surrounding border.", - threedhighlight :"The color of the lighter (generally outer) of the two borders facing the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.", - threedlightshadow :"The color of the darker (generally inner) of the two borders facing the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.", - threedshadow :"The color of the lighter (generally inner) of the two borders away from the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.", - window :"Window background.", - windowframe :"Window frame.", - windowtext :"Text in windows." + yellowgreen :"#9acd32" }; /*global SyntaxUnit, Parser*/ /** @@ -1145,12 +1115,12 @@ var Colors = { * @class Combinator * @extends parserlib.util.SyntaxUnit * @constructor - * @param {String} text The text representation of the unit. + * @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); /** @@ -1159,7 +1129,7 @@ function Combinator(text, line, col){ * @property type */ this.type = "unknown"; - + //pretty simple if (/^\s+$/.test(text)){ this.type = "descendant"; @@ -1176,6 +1146,7 @@ function Combinator(text, line, col){ Combinator.prototype = new SyntaxUnit(); Combinator.prototype.constructor = Combinator; + /*global SyntaxUnit, Parser*/ /** * Represents a media feature, such as max-width:500. @@ -1187,7 +1158,7 @@ Combinator.prototype.constructor = Combinator; * @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); /** @@ -1208,6 +1179,7 @@ function MediaFeature(name, value){ MediaFeature.prototype = new SyntaxUnit(); MediaFeature.prototype.constructor = MediaFeature; + /*global SyntaxUnit, Parser*/ /** * Represents an individual media query. @@ -1222,8 +1194,8 @@ MediaFeature.prototype.constructor = MediaFeature; * @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 : "") + (mediaType && features.length > 0 ? " and " : "") + features.join(" and "), line, col, Parser.MEDIA_QUERY_TYPE); + + SyntaxUnit.call(this, (modifier ? modifier + " ": "") + (mediaType ? mediaType + " " : "") + features.join(" and "), line, col, Parser.MEDIA_QUERY_TYPE); /** * The media modifier ("not" or "only") @@ -1237,8 +1209,8 @@ function MediaQuery(modifier, mediaType, features, line, col){ * @type String * @property mediaType */ - this.mediaType = mediaType; - + this.mediaType = mediaType; + /** * The parts that make up the selector. * @type Array @@ -1251,6 +1223,7 @@ function MediaQuery(modifier, mediaType, features, line, col){ MediaQuery.prototype = new SyntaxUnit(); MediaQuery.prototype.constructor = MediaQuery; + /*global Tokens, TokenStream, SyntaxError, Properties, Validation, ValidationError, SyntaxUnit, PropertyValue, PropertyValuePart, SelectorPart, SelectorSubPart, Selector, PropertyName, Combinator, MediaFeature, MediaQuery, EventTarget */ @@ -1295,10 +1268,10 @@ Parser.prototype = function(){ var proto = new EventTarget(), //new prototype prop, additions = { - + //restore constructor constructor: Parser, - + //instance constants - yuck DEFAULT_TYPE : 0, COMBINATOR_TYPE : 1, @@ -1309,14 +1282,14 @@ Parser.prototype = function(){ PROPERTY_VALUE_PART_TYPE : 6, SELECTOR_TYPE : 7, SELECTOR_PART_TYPE : 8, - SELECTOR_SUB_PART_TYPE : 9, - + SELECTOR_SUB_PART_TYPE : 9, + //----------------------------------------------------------------- // Grammar //----------------------------------------------------------------- - + _stylesheet: function(){ - + /* * stylesheet * : [ CHARSET_SYM S* STRING S* ';' ]? @@ -1324,19 +1297,19 @@ Parser.prototype = function(){ * [ 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 @@ -1344,46 +1317,42 @@ Parser.prototype = function(){ 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._page(); this._skipCruft(); - break; + break; case Tokens.FONT_FACE_SYM: - this._font_face(); + this._font_face(); this._skipCruft(); - break; + break; case Tokens.KEYFRAMES_SYM: - this._keyframes(); + this._keyframes(); this._skipCruft(); - break; - case Tokens.VIEWPORT_SYM: - this._viewport(); - this._skipCruft(); - break; + break; case Tokens.UNKNOWN_SYM: //unknown @ rule tokenStream.get(); if (!this.options.strict){ - + //fire error event this.fire({ type: "error", @@ -1391,30 +1360,30 @@ Parser.prototype = function(){ 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: + default: if(!this._ruleset()){ - + //error handling for known issues switch(tt){ case Tokens.CHARSET_SYM: @@ -1433,7 +1402,7 @@ Parser.prototype = function(){ tokenStream.get(); //get the last token this._unexpectedToken(tokenStream.token()); } - + } } } catch(ex) { @@ -1444,84 +1413,84 @@ Parser.prototype = function(){ 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({ + 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"); + 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", @@ -1531,47 +1500,47 @@ Parser.prototype = function(){ 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]); /*if (!tokenStream.match(Tokens.STRING)){ tokenStream.mustMatch(Tokens.URI); }*/ - + //grab the URI value - uri = tokenStream.token().value.replace(/(?:url\()?["']([^"']+)["']\)?/, "$1"); + 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", @@ -1581,9 +1550,9 @@ Parser.prototype = function(){ col: col }); } - - }, - + + }, + _media: function(){ /* * media @@ -1594,49 +1563,45 @@ Parser.prototype = function(){ line, col, mediaList;// = []; - + //look for @media tokenStream.mustMatch(Tokens.MEDIA_SYM); line = tokenStream.token().startLine; col = tokenStream.token().startCol; - - this._readWhitespace(); + + 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 (tokenStream.peek() == Tokens.FONT_FACE_SYM){ - this._font_face(); - } else if (tokenStream.peek() == Tokens.VIEWPORT_SYM){ - this._viewport(); } 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(){ @@ -1647,26 +1612,26 @@ Parser.prototype = function(){ */ var tokenStream = this._tokenStream, mediaList = []; - - + + this._readWhitespace(); - + if (tokenStream.peek() == Tokens.IDENT || tokenStream.peek() == Tokens.LPAREN){ mediaList.push(this._media_query()); } - + while(tokenStream.match(Tokens.COMMA)){ this._readWhitespace(); mediaList.push(this._media_query()); } - + return mediaList; }, - + /* * Note: "expression" in the grammar maps to the _media_expression * method. - + */ _media_query: function(){ /* @@ -1680,10 +1645,10 @@ Parser.prototype = function(){ 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(); @@ -1692,9 +1657,9 @@ Parser.prototype = function(){ token = tokenStream.token(); } } - + this._readWhitespace(); - + if (tokenStream.peek() == Tokens.IDENT){ type = this._media_type(); if (token === null){ @@ -1705,17 +1670,17 @@ Parser.prototype = function(){ token = tokenStream.LT(1); } expressions.push(this._media_expression()); - } - + } + if (type === null && expressions.length === 0){ return null; - } else { + } 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()); } @@ -1731,7 +1696,7 @@ Parser.prototype = function(){ * : IDENT * ; */ - return this._media_feature(); + return this._media_feature(); }, /** @@ -1752,22 +1717,22 @@ Parser.prototype = function(){ 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)); + return new MediaFeature(feature, (expression ? new SyntaxUnit(expression, token.startLine, token.startCol) : null)); }, //CSS3 Media Queries @@ -1778,33 +1743,33 @@ Parser.prototype = function(){ * ; */ var tokenStream = this._tokenStream; - + tokenStream.mustMatch(Tokens.IDENT); - - return SyntaxUnit.fromToken(tokenStream.token()); + + return SyntaxUnit.fromToken(tokenStream.token()); }, - + //CSS3 Paged Media _page: function(){ /* * page: - * PAGE_SYM S* IDENT? pseudo_page? S* + * 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; @@ -1812,35 +1777,35 @@ Parser.prototype = function(){ 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._readDeclarations(true, true); + this.fire({ type: "endpage", id: identifier, pseudo: pseudoPage, line: line, col: col - }); - + }); + }, - + //CSS3 Paged Media _margin: function(){ /* @@ -1856,14 +1821,14 @@ Parser.prototype = function(){ 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({ @@ -1871,7 +1836,7 @@ Parser.prototype = function(){ margin: marginSym, line: line, col: col - }); + }); return true; } else { return false; @@ -1880,17 +1845,17 @@ Parser.prototype = function(){ //CSS3 Paged Media _margin_sym: function(){ - + /* * margin_sym : - * TOPLEFTCORNER_SYM | - * TOPLEFT_SYM | - * TOPCENTER_SYM | - * TOPRIGHT_SYM | + * TOPLEFTCORNER_SYM | + * TOPLEFT_SYM | + * TOPCENTER_SYM | + * TOPRIGHT_SYM | * TOPRIGHTCORNER_SYM | - * BOTTOMLEFTCORNER_SYM | - * BOTTOMLEFT_SYM | - * BOTTOMCENTER_SYM | + * BOTTOMLEFTCORNER_SYM | + * BOTTOMLEFT_SYM | + * BOTTOMCENTER_SYM | * BOTTOMRIGHT_SYM | * BOTTOMRIGHTCORNER_SYM | * LEFTTOP_SYM | @@ -1898,178 +1863,142 @@ Parser.prototype = function(){ * LEFTBOTTOM_SYM | * RIGHTTOP_SYM | * RIGHTMIDDLE_SYM | - * RIGHTBOTTOM_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.BOTTOMLEFTCORNER_SYM, Tokens.BOTTOMLEFT_SYM, Tokens.BOTTOMCENTER_SYM, Tokens.BOTTOMRIGHT_SYM, - Tokens.BOTTOMRIGHTCORNER_SYM, Tokens.LEFTTOP_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()); + 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* + * : 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 - }); + }); }, - _viewport: function(){ + _operator: function(){ + /* - * viewport - * : VIEWPORT_SYM S* - * '{' S* declaration? [ ';' S* declaration? ]* '}' S* - * ; - */ - var tokenStream = this._tokenStream, - line, - col; - - tokenStream.mustMatch(Tokens.VIEWPORT_SYM); - line = tokenStream.token().startLine; - col = tokenStream.token().startCol; - - this._readWhitespace(); - - this.fire({ - type: "startviewport", - line: line, - col: col - }); - - this._readDeclarations(true); - - this.fire({ - type: "endviewport", - line: line, - col: col - }); - - }, - - _operator: function(inFunction){ - - /* - * operator (outside function) + * operator * : '/' S* | ',' S* | /( empty )/ - * operator (inside function) - * : '/' S* | '+' S* | '*' S* | '-' S* /( empty )/ * ; - */ - + */ + var tokenStream = this._tokenStream, token = null; - - if (tokenStream.match([Tokens.SLASH, Tokens.COMMA]) || - (inFunction && tokenStream.match([Tokens.PLUS, Tokens.STAR, Tokens.MINUS]))){ + + 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])){ + + 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, @@ -2077,7 +2006,7 @@ Parser.prototype = function(){ token, line, col; - + //check for star hack - throws error if not allowed if (tokenStream.peek() == Tokens.STAR && this.options.starHack){ tokenStream.get(); @@ -2086,33 +2015,33 @@ Parser.prototype = function(){ 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; @@ -2126,7 +2055,7 @@ Parser.prototype = function(){ selectors = this._selectors_group(); } catch (ex){ if (ex instanceof SyntaxError && !this.options.strict){ - + //fire error event this.fire({ type: "error", @@ -2134,8 +2063,8 @@ Parser.prototype = function(){ message: ex.message, line: ex.line, col: ex.col - }); - + }); + //skip over everything until closing brace tt = tokenStream.advance([Tokens.RBRACE]); if (tt == Tokens.RBRACE){ @@ -2143,57 +2072,57 @@ Parser.prototype = function(){ } 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){ - + if (selectors){ + this.fire({ type: "startrule", selectors: selectors, line: selectors[0].line, col: selectors[0].col - }); - - this._readDeclarations(true); - + }); + + 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(); @@ -2208,83 +2137,83 @@ Parser.prototype = function(){ 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(tokenStream.LT(1)); + 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()){ - + 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 (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(){ /* @@ -2294,13 +2223,13 @@ Parser.prototype = function(){ * | [ HASH | class | attrib | pseudo | negation ]+ * ; */ - + var tokenStream = this._tokenStream, - + //parts of a simple selector elementName = null, modifiers = [], - + //complete selector text selectorText= "", @@ -2323,35 +2252,35 @@ Parser.prototype = function(){ 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; @@ -2361,17 +2290,17 @@ Parser.prototype = function(){ } else { i = 0; modifiers.push(component); - selectorText += component.toString(); + selectorText += component.toString(); component = null; } } - + return selectorText !== "" ? new SelectorPart(elementName, modifiers, selectorText, line, col) : null; - }, - + }, + //CSS3 Selectors _type_selector: function(){ /* @@ -2379,12 +2308,12 @@ Parser.prototype = function(){ * : [ namespace_prefix ]? element_name * ; */ - + var tokenStream = this._tokenStream, ns = this._namespace_prefix(), elementName = this._element_name(); - - if (!elementName){ + + if (!elementName){ /* * Need to back out the namespace that was read due to both * type_selector and universal reading namespace_prefix @@ -2397,9 +2326,9 @@ Parser.prototype = function(){ tokenStream.unget(); } } - + return null; - } else { + } else { if (ns){ elementName.text = ns + elementName.text; elementName.col -= ns.length; @@ -2407,97 +2336,97 @@ Parser.prototype = function(){ return elementName; } }, - + //CSS3 Selectors _class: function(){ /* * class * : '.' IDENT * ; - */ - + */ + var tokenStream = this._tokenStream, token; - + if (tokenStream.match(Tokens.DOT)){ - tokenStream.mustMatch(Tokens.IDENT); + tokenStream.mustMatch(Tokens.IDENT); token = tokenStream.token(); - return new SelectorSubPart("." + token.value, "class", token.startLine, token.startCol - 1); + 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); - + 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; + + 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(){ /* @@ -2510,69 +2439,69 @@ Parser.prototype = function(){ * 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 += 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 += tokenStream.token().value; value += this._readWhitespace(); - + tokenStream.mustMatch([Tokens.IDENT, Tokens.STRING]); - value += tokenStream.token().value; + 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; @@ -2582,26 +2511,26 @@ Parser.prototype = function(){ 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(); @@ -2609,10 +2538,10 @@ Parser.prototype = function(){ tokenStream.mustMatch(Tokens.RPAREN); value += ")"; } - + return value; }, - + //CSS3 Selectors _expression: function(){ /* @@ -2620,26 +2549,26 @@ Parser.prototype = function(){ * : [ [ 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, Tokens.SLASH])){ - + Tokens.RESOLUTION])){ + value += tokenStream.token().value; - value += this._readWhitespace(); + value += this._readWhitespace(); } - + return value.length ? value : null; - + }, //CSS3 Selectors _negation: function(){ - /* + /* * negation * : NOT S* negation_arg S* ')' * ; @@ -2651,7 +2580,7 @@ Parser.prototype = function(){ value = "", arg, subpart = null; - + if (tokenStream.match(Tokens.NOT)){ value = tokenStream.token().value; line = tokenStream.token().startLine; @@ -2662,22 +2591,22 @@ Parser.prototype = function(){ 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: function(){ /* * negation_arg * : type_selector | universal | HASH | class | attrib | pseudo - * ; - */ - + * ; + */ + var tokenStream = this._tokenStream, args = [ this._type_selector, @@ -2685,11 +2614,11 @@ Parser.prototype = function(){ function(){ return tokenStream.match(Tokens.HASH) ? new SelectorSubPart(tokenStream.token().value, "id", tokenStream.token().startLine, tokenStream.token().startCol) : - null; + null; }, this._class, this._attrib, - this._pseudo + this._pseudo ], arg = null, i = 0, @@ -2698,81 +2627,68 @@ Parser.prototype = function(){ 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; + + return part; }, - + _declaration: function(){ - + /* * declaration * : property ':' S* expr prio? * | /( empty )/ - * ; - */ - + * ; + */ + var tokenStream = this._tokenStream, property = null, expr = null, prio = null, error = null, - invalid = null, - propertyName= ""; - + 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(); - - /* - * If hacks should be allowed, then only check the root - * property. If hacks should not be allowed, treat - * _property or *property as invalid properties. - */ - propertyName = property.toString(); - if (this.options.starHack && property.hack == "*" || - this.options.underscoreHack && property.hack == "_") { - - propertyName = property.text; - } - + try { - this._validateProperty(propertyName, expr); + this._validateProperty(property, expr); } catch (ex) { invalid = ex; } - + this.fire({ type: "property", property: property, @@ -2781,49 +2697,49 @@ Parser.prototype = function(){ 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(inFunction){ + + _expr: function(){ /* * expr * : term [ operator term ]* * ; */ - + var tokenStream = this._tokenStream, values = [], //valueParts = [], value = null, operator = null; - - value = this._term(inFunction); + + value = this._term(); if (value !== null){ - + values.push(value); - + do { - operator = this._operator(inFunction); - + operator = this._operator(); + //if there's an operator, keep building up the value parts if (operator){ values.push(operator); @@ -2832,9 +2748,9 @@ Parser.prototype = function(){ values.push(new PropertyValue(valueParts, valueParts[0].line, valueParts[0].col)); valueParts = []; }*/ - - value = this._term(inFunction); - + + value = this._term(); + if (value === null){ break; } else { @@ -2842,17 +2758,17 @@ Parser.prototype = function(){ } } 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(inFunction){ - + + _term: function(){ + /* * term * : unary_operator? @@ -2860,51 +2776,36 @@ Parser.prototype = function(){ * TIME S* | FREQ S* | function | ie_function ] * | STRING S* | IDENT S* | URI S* | UNICODERANGE S* | hexcolor * ; - */ - + */ + var tokenStream = this._tokenStream, unary = null, value = null, - endChar = 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 it's a simple block - } else if (inFunction && tokenStream.match([Tokens.LPAREN, Tokens.LBRACE, Tokens.LBRACKET])){ - - token = tokenStream.token(); - endChar = token.endChar; - value = token.value + this._expr(inFunction).text; - if (unary === null){ - line = tokenStream.token().startLine; - col = tokenStream.token().startCol; - } - tokenStream.mustMatch(Tokens.type(endChar)); - value += endChar; - this._readWhitespace(); - + //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; @@ -2912,20 +2813,20 @@ Parser.prototype = function(){ } 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. @@ -2941,61 +2842,61 @@ Parser.prototype = function(){ 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(true); + 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){ @@ -3007,49 +2908,49 @@ Parser.prototype = function(){ } //END: Horrible Hack - - tokenStream.match(Tokens.RPAREN); + + 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){ @@ -3057,16 +2958,16 @@ Parser.prototype = function(){ functionText += tokenStream.token().value; lt = tokenStream.peek(); } - } while(tokenStream.match([Tokens.COMMA, Tokens.S])); - - tokenStream.match(Tokens.RPAREN); + } 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 @@ -3077,15 +2978,15 @@ Parser.prototype = function(){ * : 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)){ @@ -3093,16 +2994,16 @@ Parser.prototype = function(){ } this._readWhitespace(); } - + return token; }, - + //----------------------------------------------------------------- // Animations methods //----------------------------------------------------------------- - + _keyframes: function(){ - + /* * keyframes: * : KEYFRAMES_SYM S* keyframe_name S* '{' S* keyframe_rule* '}' { @@ -3111,54 +3012,46 @@ Parser.prototype = function(){ var tokenStream = this._tokenStream, token, tt, - name, - prefix = ""; - + name; + tokenStream.mustMatch(Tokens.KEYFRAMES_SYM); - token = tokenStream.token(); - if (/^@\-([^\-]+)\-/.test(token.value)) { - prefix = RegExp.$1; - } - this._readWhitespace(); name = this._keyframe_name(); - + this._readWhitespace(); tokenStream.mustMatch(Tokens.LBRACE); - + this.fire({ type: "startkeyframes", name: name, - prefix: prefix, - line: token.startLine, - col: token.startCol - }); - + 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, - prefix: prefix, - line: token.startLine, - col: token.startCol - }); - + line: name.line, + col: name.col + }); + this._readWhitespace(); - tokenStream.mustMatch(Tokens.RBRACE); - + tokenStream.mustMatch(Tokens.RBRACE); + }, - + _keyframe_name: function(){ - + /* * keyframe_name: * : IDENT @@ -3169,41 +3062,41 @@ Parser.prototype = function(){ token; tokenStream.mustMatch([Tokens.IDENT, Tokens.STRING]); - return SyntaxUnit.fromToken(tokenStream.token()); + return SyntaxUnit.fromToken(tokenStream.token()); }, - + _keyframe_rule: function(){ - + /* * keyframe_rule: - * : key_list S* + * : 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._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]* @@ -3213,12 +3106,12 @@ Parser.prototype = function(){ 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()); @@ -3227,7 +3120,7 @@ Parser.prototype = function(){ return keyList; }, - + _key: function(){ /* * There is a restriction that IDENT can be only "from" or "to". @@ -3237,30 +3130,30 @@ Parser.prototype = function(){ * | 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(); - + 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. @@ -3293,25 +3186,25 @@ Parser.prototype = function(){ * 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 declaration is there's another declaration - * or margin afterwards. + * 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); + tokenStream.mustMatch(Tokens.LBRACE); } - + this._readWhitespace(); try { - + while(true){ - + if (tokenStream.match(Tokens.SEMICOLON) || (readMargins && this._margin())){ //noop } else if (this._declaration()){ @@ -3321,19 +3214,19 @@ Parser.prototype = function(){ } 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", @@ -3341,27 +3234,27 @@ Parser.prototype = function(){ 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); + 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 @@ -3372,17 +3265,17 @@ Parser.prototype = function(){ * @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. @@ -3394,7 +3287,7 @@ Parser.prototype = function(){ _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} @@ -3404,64 +3297,64 @@ Parser.prototype = function(){ _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){ + + 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; + 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. @@ -3471,22 +3364,22 @@ Parser.prototype = function(){ */ 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; + return result; }, - + /** * Parses a single CSS selector (no comma) * @param {String} input The text to parse as a CSS selector. @@ -3495,29 +3388,29 @@ Parser.prototype = function(){ * @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 + * 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} + * @return {void} * @method parseStyleAttribute */ parseStyleAttribute: function(input){ @@ -3526,14 +3419,14 @@ Parser.prototype = function(){ this._readDeclarations(); } }; - + //copy over onto prototype for (prop in additions){ if (additions.hasOwnProperty(prop)){ proto[prop] = additions[prop]; } - } - + } + return proto; }(); @@ -3548,24 +3441,17 @@ nth var Properties = { //A - "align-items" : "flex-start | flex-end | center | baseline | stretch", - "align-content" : "flex-start | flex-end | center | space-between | space-around | stretch", - "align-self" : "auto | flex-start | flex-end | center | baseline | stretch", - "-webkit-align-items" : "flex-start | flex-end | center | baseline | stretch", - "-webkit-align-content" : "flex-start | flex-end | center | space-between | space-around | stretch", - "-webkit-align-self" : "auto | flex-start | flex-end | center | baseline | stretch", "alignment-adjust" : "auto | baseline | before-edge | text-before-edge | middle | central | after-edge | text-after-edge | ideographic | alphabetic | hanging | mathematical | | ", "alignment-baseline" : "baseline | use-script | before-edge | text-before-edge | after-edge | text-after-edge | central | middle | ideographic | alphabetic | hanging | mathematical", "animation" : 1, "animation-delay" : { multi: "
                                                                                                                                                                                                                                                                                                                                                                                                                                                            • element - tree.insertElement(name, attributes); - tree.framesetOk = false; - }; - - modes.inBody.startTagPlaintext = function(name, attributes) { - if (tree.openElements.inButtonScope('p')) - this.endTagP('p'); - tree.insertElement(name, attributes); - tree.tokenizer.setState(Tokenizer.PLAINTEXT); - }; - - modes.inBody.startTagHeading = function(name, attributes) { - if (tree.openElements.inButtonScope('p')) - this.endTagP('p'); - if (tree.currentStackItem().isNumberedHeader()) { - tree.parseError('unexpected-start-tag', {name: name}); - tree.popElement(); - } - tree.insertElement(name, attributes); - }; - - modes.inBody.startTagA = function(name, attributes) { - var activeA = tree.elementInActiveFormattingElements('a'); - if (activeA) { - tree.parseError("unexpected-start-tag-implies-end-tag", {startName: "a", endName: "a"}); - tree.adoptionAgencyEndTag('a'); - if (tree.openElements.contains(activeA)) - tree.openElements.remove(activeA); - tree.removeElementFromActiveFormattingElements(activeA); - } - tree.reconstructActiveFormattingElements(); - tree.insertFormattingElement(name, attributes); - }; - - modes.inBody.startTagFormatting = function(name, attributes) { - tree.reconstructActiveFormattingElements(); - tree.insertFormattingElement(name, attributes); - }; - - modes.inBody.startTagNobr = function(name, attributes) { - tree.reconstructActiveFormattingElements(); - if (tree.openElements.inScope('nobr')) { - tree.parseError("unexpected-start-tag-implies-end-tag", {startName: 'nobr', endName: 'nobr'}); - this.processEndTag('nobr'); - // XXX Need tests that trigger the following - tree.reconstructActiveFormattingElements(); - } - tree.insertFormattingElement(name, attributes); - }; - - modes.inBody.startTagButton = function(name, attributes) { - if (tree.openElements.inScope('button')) { - tree.parseError('unexpected-start-tag-implies-end-tag', {startName: 'button', endName: 'button'}); - this.processEndTag('button'); - tree.insertionMode.processStartTag(name, attributes); - } else { - tree.framesetOk = false; - tree.reconstructActiveFormattingElements(); - tree.insertElement(name, attributes); - } - }; - - modes.inBody.startTagAppletMarqueeObject = function(name, attributes) { - tree.reconstructActiveFormattingElements(); - tree.insertElement(name, attributes); - tree.activeFormattingElements.push(Marker); - tree.framesetOk = false; - }; - - modes.inBody.endTagAppletMarqueeObject = function(name) { - if (!tree.openElements.inScope(name)) { - tree.parseError("unexpected-end-tag", {name: name}); - } else { - tree.generateImpliedEndTags(); - if (tree.currentStackItem().localName != name) { - tree.parseError('end-tag-too-early', {name: name}); - } - tree.openElements.popUntilPopped(name); - tree.clearActiveFormattingElements(); - } - }; - - modes.inBody.startTagXmp = function(name, attributes) { - if (tree.openElements.inButtonScope('p')) - this.processEndTag('p'); - tree.reconstructActiveFormattingElements(); - tree.processGenericRawTextStartTag(name, attributes); - tree.framesetOk = false; - }; - - modes.inBody.startTagTable = function(name, attributes) { - if (tree.compatMode !== "quirks") - if (tree.openElements.inButtonScope('p')) - this.processEndTag('p'); - tree.insertElement(name, attributes); - tree.setInsertionMode('inTable'); - tree.framesetOk = false; - }; - - modes.inBody.startTagVoidFormatting = function(name, attributes) { - tree.reconstructActiveFormattingElements(); - tree.insertSelfClosingElement(name, attributes); - tree.framesetOk = false; - }; - - modes.inBody.startTagParamSourceTrack = function(name, attributes) { - tree.insertSelfClosingElement(name, attributes); - }; - - modes.inBody.startTagHr = function(name, attributes) { - if (tree.openElements.inButtonScope('p')) - this.endTagP('p'); - tree.insertSelfClosingElement(name, attributes); - tree.framesetOk = false; - }; - - modes.inBody.startTagImage = function(name, attributes) { - // No, really... - tree.parseError('unexpected-start-tag-treated-as', {originalName: 'image', newName: 'img'}); - this.processStartTag('img', attributes); - }; - - modes.inBody.startTagInput = function(name, attributes) { - var currentFramesetOk = tree.framesetOk; - this.startTagVoidFormatting(name, attributes); - for (var key in attributes) { - // input type=hidden doesn't change framesetOk - if (attributes[key].nodeName == 'type') { - if (attributes[key].nodeValue.toLowerCase() == 'hidden') - tree.framesetOk = currentFramesetOk; - break; - } - } - }; - - modes.inBody.startTagIsindex = function(name, attributes) { - tree.parseError('deprecated-tag', {name: 'isindex'}); - tree.selfClosingFlagAcknowledged = true; - if (tree.form) - return; - var formAttributes = []; - var inputAttributes = []; - var prompt = "This is a searchable index. Enter search keywords: "; - for (var key in attributes) { - switch (attributes[key].nodeName) { - case 'action': - formAttributes.push({nodeName: 'action', - nodeValue: attributes[key].nodeValue}); - break; - case 'prompt': - prompt = attributes[key].nodeValue; - break; - case 'name': - break; - default: - inputAttributes.push({nodeName: attributes[key].nodeName, - nodeValue: attributes[key].nodeValue}); - } - } - inputAttributes.push({nodeName: 'name', nodeValue: 'isindex'}); - this.processStartTag('form', formAttributes); - this.processStartTag('hr'); - this.processStartTag('label'); - this.processCharacters(new CharacterBuffer(prompt)); - this.processStartTag('input', inputAttributes); - this.processEndTag('label'); - this.processStartTag('hr'); - this.processEndTag('form'); - }; - - modes.inBody.startTagTextarea = function(name, attributes) { - // XXX Form element pointer checking here as well... - tree.insertElement(name, attributes); - tree.tokenizer.setState(Tokenizer.RCDATA); - tree.originalInsertionMode = tree.insertionModeName; - tree.shouldSkipLeadingNewline = true; - tree.framesetOk = false; - tree.setInsertionMode('text'); - }; - - modes.inBody.startTagIFrame = function(name, attributes) { - tree.framesetOk = false; - this.startTagRawText(name, attributes); - }; - - modes.inBody.startTagRawText = function(name, attributes) { - tree.processGenericRawTextStartTag(name, attributes); - }; - - modes.inBody.startTagSelect = function(name, attributes) { - tree.reconstructActiveFormattingElements(); - tree.insertElement(name, attributes); - tree.framesetOk = false; - var insertionModeName = tree.insertionModeName; - if (insertionModeName == 'inTable' || - insertionModeName == 'inCaption' || - insertionModeName == 'inColumnGroup' || - insertionModeName == 'inTableBody' || - insertionModeName == 'inRow' || - insertionModeName == 'inCell') { - tree.setInsertionMode('inSelectInTable'); - } else { - tree.setInsertionMode('inSelect'); - } - }; - - modes.inBody.startTagMisplaced = function(name, attributes) { - tree.parseError('unexpected-start-tag-ignored', {name: name}); - }; - - modes.inBody.endTagMisplaced = function(name) { - // This handles elements with end tags in other insertion modes. - tree.parseError("unexpected-end-tag", {name: name}); - }; - - modes.inBody.endTagBr = function(name) { - tree.parseError("unexpected-end-tag-treated-as", {originalName: "br", newName: "br element"}); - tree.reconstructActiveFormattingElements(); - tree.insertElement(name, []); - tree.popElement(); - }; - - modes.inBody.startTagOptionOptgroup = function(name, attributes) { - if (tree.currentStackItem().localName == 'option') - tree.popElement(); - tree.reconstructActiveFormattingElements(); - tree.insertElement(name, attributes); - }; - - modes.inBody.startTagOther = function(name, attributes) { - tree.reconstructActiveFormattingElements(); - tree.insertElement(name, attributes); - }; - - modes.inBody.endTagOther = function(name) { - var node; - for (var i = tree.openElements.length - 1; i > 0; i--) { - node = tree.openElements.item(i); - if (node.localName == name) { - tree.generateImpliedEndTags(name); - if (tree.currentStackItem().localName != name) - tree.parseError('unexpected-end-tag', {name: name}); - // todo optimize - tree.openElements.remove_openElements_until(function(x) {return x === node;}); - break; - } - if (node.isSpecial()) { - tree.parseError('unexpected-end-tag', {name: name}); - break; - } - } - }; - - modes.inBody.startTagMath = function(name, attributes, selfClosing) { - tree.reconstructActiveFormattingElements(); - attributes = tree.adjustMathMLAttributes(attributes); - attributes = tree.adjustForeignAttributes(attributes); - tree.insertForeignElement(name, attributes, "http://www.w3.org/1998/Math/MathML", selfClosing); - // Need to get the parse error right for the case where the token - // has a namespace not equal to the xmlns attribute - }; - - modes.inBody.startTagSVG = function(name, attributes, selfClosing) { - tree.reconstructActiveFormattingElements(); - attributes = tree.adjustSVGAttributes(attributes); - attributes = tree.adjustForeignAttributes(attributes); - tree.insertForeignElement(name, attributes, "http://www.w3.org/2000/svg", selfClosing); - // Need to get the parse error right for the case where the token - // has a namespace not equal to the xmlns attribute - }; - - modes.inBody.endTagP = function(name) { - if (!tree.openElements.inButtonScope('p')) { - tree.parseError('unexpected-end-tag', {name: 'p'}); - this.startTagCloseP('p', []); - this.endTagP('p'); - } else { - tree.generateImpliedEndTags('p'); - if (tree.currentStackItem().localName != 'p') - tree.parseError('unexpected-implied-end-tag', {name: 'p'}); - tree.openElements.popUntilPopped(name); - } - }; - - modes.inBody.endTagBody = function(name) { - if (!tree.openElements.inScope('body')) { - tree.parseError('unexpected-end-tag', {name: name}); - return; - } - - /// @todo Emit parse error on end tags other than the ones listed in http://www.w3.org/TR/html5/tree-construction.html#parsing-main-inbody - // ['dd', 'dt', 'li', 'optgroup', 'option', 'p', 'rp', 'rt', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'body', 'html'] - if (tree.currentStackItem().localName != 'body') { - tree.parseError('expected-one-end-tag-but-got-another', { - expectedName: tree.currentStackItem().localName, - gotName: name - }); - } - tree.setInsertionMode('afterBody'); - }; - - modes.inBody.endTagHtml = function(name) { - if (!tree.openElements.inScope('body')) { - tree.parseError('unexpected-end-tag', {name: name}); - return; - } - - /// @todo Emit parse error on end tags other than the ones listed in http://www.w3.org/TR/html5/tree-construction.html#parsing-main-inbody - // ['dd', 'dt', 'li', 'optgroup', 'option', 'p', 'rp', 'rt', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'body', 'html'] - if (tree.currentStackItem().localName != 'body') { - tree.parseError('expected-one-end-tag-but-got-another', { - expectedName: tree.currentStackItem().localName, - gotName: name - }); - } - tree.setInsertionMode('afterBody'); - tree.insertionMode.processEndTag(name); - }; - - modes.inBody.endTagBlock = function(name) { - if (!tree.openElements.inScope(name)) { - tree.parseError('unexpected-end-tag', {name: name}); - } else { - tree.generateImpliedEndTags(); - if (tree.currentStackItem().localName != name) { - tree.parseError('end-tag-too-early', {name: name}); - } - tree.openElements.popUntilPopped(name); - } - }; - - modes.inBody.endTagForm = function(name) { - var node = tree.form; - tree.form = null; - if (!node || !tree.openElements.inScope(name)) { - tree.parseError('unexpected-end-tag', {name: name}); - } else { - tree.generateImpliedEndTags(); - if (tree.currentStackItem() != node) { - tree.parseError('end-tag-too-early-ignored', {name: 'form'}); - } - tree.openElements.remove(node); - } - }; - - modes.inBody.endTagListItem = function(name) { - if (!tree.openElements.inListItemScope(name)) { - tree.parseError('unexpected-end-tag', {name: name}); - } else { - tree.generateImpliedEndTags(name); - if (tree.currentStackItem().localName != name) - tree.parseError('end-tag-too-early', {name: name}); - tree.openElements.popUntilPopped(name); - } - }; - - modes.inBody.endTagHeading = function(name) { - if (!tree.openElements.hasNumberedHeaderElementInScope()) { - tree.parseError('unexpected-end-tag', {name: name}); - return; - } - tree.generateImpliedEndTags(); - if (tree.currentStackItem().localName != name) - tree.parseError('end-tag-too-early', {name: name}); - - tree.openElements.remove_openElements_until(function(e) { - return e.isNumberedHeader(); - }); - }; - - modes.inBody.endTagFormatting = function(name, attributes) { - if (!tree.adoptionAgencyEndTag(name)) - this.endTagOther(name, attributes); - }; - - modes.inCaption = Object.create(modes.base); - - modes.inCaption.start_tag_handlers = { - html: 'startTagHtml', - caption: 'startTagTableElement', - col: 'startTagTableElement', - colgroup: 'startTagTableElement', - tbody: 'startTagTableElement', - td: 'startTagTableElement', - tfoot: 'startTagTableElement', - thead: 'startTagTableElement', - tr: 'startTagTableElement', - '-default': 'startTagOther' - }; - - modes.inCaption.end_tag_handlers = { - caption: 'endTagCaption', - table: 'endTagTable', - body: 'endTagIgnore', - col: 'endTagIgnore', - colgroup: 'endTagIgnore', - html: 'endTagIgnore', - tbody: 'endTagIgnore', - td: 'endTagIgnore', - tfood: 'endTagIgnore', - thead: 'endTagIgnore', - tr: 'endTagIgnore', - '-default': 'endTagOther' - }; - - modes.inCaption.processCharacters = function(data) { - modes.inBody.processCharacters(data); - }; - - modes.inCaption.startTagTableElement = function(name, attributes) { - tree.parseError('unexpected-end-tag', {name: name}); - var ignoreEndTag = !tree.openElements.inTableScope('caption'); - tree.insertionMode.processEndTag('caption'); - if (!ignoreEndTag) tree.insertionMode.processStartTag(name, attributes); - }; - - modes.inCaption.startTagOther = function(name, attributes, selfClosing) { - modes.inBody.processStartTag(name, attributes, selfClosing); - }; - - modes.inCaption.endTagCaption = function(name) { - if (!tree.openElements.inTableScope('caption')) { - // context case - assert.ok(tree.context); - tree.parseError('unexpected-end-tag', {name: name}); - } else { - // AT this code is quite similar to endTagTable in inTable - tree.generateImpliedEndTags(); - if (tree.currentStackItem().localName != 'caption') { - // @todo this is confusing for implied end tag - tree.parseError('expected-one-end-tag-but-got-another', { - gotName: "caption", - expectedName: tree.currentStackItem().localName - }); - } - tree.openElements.popUntilPopped('caption'); - tree.clearActiveFormattingElements(); - tree.setInsertionMode('inTable'); - } - }; - - modes.inCaption.endTagTable = function(name) { - tree.parseError("unexpected-end-table-in-caption"); - var ignoreEndTag = !tree.openElements.inTableScope('caption'); - tree.insertionMode.processEndTag('caption'); - if (!ignoreEndTag) tree.insertionMode.processEndTag(name); - }; - - modes.inCaption.endTagIgnore = function(name) { - tree.parseError('unexpected-end-tag', {name: name}); - }; - - modes.inCaption.endTagOther = function(name) { - modes.inBody.processEndTag(name); - }; - - modes.inCell = Object.create(modes.base); - - modes.inCell.start_tag_handlers = { - html: 'startTagHtml', - caption: 'startTagTableOther', - col: 'startTagTableOther', - colgroup: 'startTagTableOther', - tbody: 'startTagTableOther', - td: 'startTagTableOther', - tfoot: 'startTagTableOther', - th: 'startTagTableOther', - thead: 'startTagTableOther', - tr: 'startTagTableOther', - '-default': 'startTagOther' - }; - - modes.inCell.end_tag_handlers = { - td: 'endTagTableCell', - th: 'endTagTableCell', - body: 'endTagIgnore', - caption: 'endTagIgnore', - col: 'endTagIgnore', - colgroup: 'endTagIgnore', - html: 'endTagIgnore', - table: 'endTagImply', - tbody: 'endTagImply', - tfoot: 'endTagImply', - thead: 'endTagImply', - tr: 'endTagImply', - '-default': 'endTagOther' - }; - - modes.inCell.processCharacters = function(data) { - modes.inBody.processCharacters(data); - }; - - modes.inCell.startTagTableOther = function(name, attributes, selfClosing) { - if (tree.openElements.inTableScope('td') || tree.openElements.inTableScope('th')) { - this.closeCell(); - tree.insertionMode.processStartTag(name, attributes, selfClosing); - } else { - // context case - tree.parseError('unexpected-start-tag', {name: name}); - } - }; - - modes.inCell.startTagOther = function(name, attributes, selfClosing) { - modes.inBody.processStartTag(name, attributes, selfClosing); - }; - - modes.inCell.endTagTableCell = function(name) { - if (tree.openElements.inTableScope(name)) { - tree.generateImpliedEndTags(name); - if (tree.currentStackItem().localName != name.toLowerCase()) { - tree.parseError('unexpected-cell-end-tag', {name: name}); - tree.openElements.popUntilPopped(name); - } else { - tree.popElement(); - } - tree.clearActiveFormattingElements(); - tree.setInsertionMode('inRow'); - } else { - tree.parseError('unexpected-end-tag', {name: name}); - } - }; - - modes.inCell.endTagIgnore = function(name) { - tree.parseError('unexpected-end-tag', {name: name}); - }; - - modes.inCell.endTagImply = function(name) { - if (tree.openElements.inTableScope(name)) { - this.closeCell(); - tree.insertionMode.processEndTag(name); - } else { - // sometimes context case - tree.parseError('unexpected-end-tag', {name: name}); - } - }; - - modes.inCell.endTagOther = function(name) { - modes.inBody.processEndTag(name); - }; - - modes.inCell.closeCell = function() { - if (tree.openElements.inTableScope('td')) { - this.endTagTableCell('td'); - } else if (tree.openElements.inTableScope('th')) { - this.endTagTableCell('th'); - } - }; - - - modes.inColumnGroup = Object.create(modes.base); - - modes.inColumnGroup.start_tag_handlers = { - html: 'startTagHtml', - col: 'startTagCol', - '-default': 'startTagOther' - }; - - modes.inColumnGroup.end_tag_handlers = { - colgroup: 'endTagColgroup', - col: 'endTagCol', - '-default': 'endTagOther' - }; - - modes.inColumnGroup.ignoreEndTagColgroup = function() { - return tree.currentStackItem().localName == 'html'; - }; - - modes.inColumnGroup.processCharacters = function(buffer) { - var leadingWhitespace = buffer.takeLeadingWhitespace(); - if (leadingWhitespace) - tree.insertText(leadingWhitespace); - if (!buffer.length) - return; - var ignoreEndTag = this.ignoreEndTagColgroup(); - this.endTagColgroup('colgroup'); - if (!ignoreEndTag) tree.insertionMode.processCharacters(buffer); - }; - - modes.inColumnGroup.startTagCol = function(name, attributes) { - tree.insertSelfClosingElement(name, attributes); - }; - - modes.inColumnGroup.startTagOther = function(name, attributes, selfClosing) { - var ignoreEndTag = this.ignoreEndTagColgroup(); - this.endTagColgroup('colgroup'); - if (!ignoreEndTag) tree.insertionMode.processStartTag(name, attributes, selfClosing); - }; - - modes.inColumnGroup.endTagColgroup = function(name) { - if (this.ignoreEndTagColgroup()) { - // context case - assert.ok(tree.context); - tree.parseError('unexpected-end-tag', {name: name}); - } else { - tree.popElement(); - tree.setInsertionMode('inTable'); - } - }; - - modes.inColumnGroup.endTagCol = function(name) { - tree.parseError("no-end-tag", {name: 'col'}); - }; - - modes.inColumnGroup.endTagOther = function(name) { - var ignoreEndTag = this.ignoreEndTagColgroup(); - this.endTagColgroup('colgroup'); - if (!ignoreEndTag) tree.insertionMode.processEndTag(name) ; - }; - - modes.inForeignContent = Object.create(modes.base); - - modes.inForeignContent.processStartTag = function(name, attributes, selfClosing) { - if (['b', 'big', 'blockquote', 'body', 'br', 'center', 'code', 'dd', 'div', 'dl', 'dt', 'em', 'embed', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'hr', 'i', 'img', 'li', 'listing', 'menu', 'meta', 'nobr', 'ol', 'p', 'pre', 'ruby', 's', 'small', 'span', 'strong', 'strike', 'sub', 'sup', 'table', 'tt', 'u', 'ul', 'var'].indexOf(name) != -1 - || (name == 'font' && attributes.some(function(attr){ return ['color', 'face', 'size'].indexOf(attr.nodeName) >= 0 }))) { - tree.parseError('unexpected-html-element-in-foreign-content', {name: name}); - while (tree.currentStackItem().isForeign() - && !tree.currentStackItem().isHtmlIntegrationPoint() - && !tree.currentStackItem().isMathMLTextIntegrationPoint()) { - tree.openElements.pop(); - } - tree.insertionMode.processStartTag(name, attributes, selfClosing); - return; - } - if (tree.currentStackItem().namespaceURI == "http://www.w3.org/1998/Math/MathML") { - attributes = tree.adjustMathMLAttributes(attributes); - } - if (tree.currentStackItem().namespaceURI == "http://www.w3.org/2000/svg") { - name = tree.adjustSVGTagNameCase(name); - attributes = tree.adjustSVGAttributes(attributes); - } - attributes = tree.adjustForeignAttributes(attributes); - tree.insertForeignElement(name, attributes, tree.currentStackItem().namespaceURI, selfClosing); - }; - - modes.inForeignContent.processEndTag = function(name) { - var node = tree.currentStackItem(); - var index = tree.openElements.length - 1; - if (node.localName.toLowerCase() != name) - tree.parseError("unexpected-end-tag", {name: name}); - - while (true) { - if (index === 0) - break; - if (node.localName.toLowerCase() == name) { - while (tree.openElements.pop() != node); - break; - } - index -= 1; - node = tree.openElements.item(index); - if (node.isForeign()) { - continue; - } else { - tree.insertionMode.processEndTag(name); - break; - } - } - }; - - modes.inForeignContent.processCharacters = function(buffer) { - var characters = buffer.takeRemaining(); - characters = characters.replace(/\u0000/g, function(match, index){ - // @todo position - tree.parseError('invalid-codepoint'); - return '\uFFFD'; - }); - if (tree.framesetOk && !isAllWhitespaceOrReplacementCharacters(characters)) - tree.framesetOk = false; - tree.insertText(characters); - }; - - modes.inHeadNoscript = Object.create(modes.base); - - modes.inHeadNoscript.start_tag_handlers = { - html: 'startTagHtml', - basefont: 'startTagBasefontBgsoundLinkMetaNoframesStyle', - bgsound: 'startTagBasefontBgsoundLinkMetaNoframesStyle', - link: 'startTagBasefontBgsoundLinkMetaNoframesStyle', - meta: 'startTagBasefontBgsoundLinkMetaNoframesStyle', - noframes: 'startTagBasefontBgsoundLinkMetaNoframesStyle', - style: 'startTagBasefontBgsoundLinkMetaNoframesStyle', - head: 'startTagHeadNoscript', - noscript: 'startTagHeadNoscript', - "-default": 'startTagOther' - }; - - modes.inHeadNoscript.end_tag_handlers = { - noscript: 'endTagNoscript', - br: 'endTagBr', - '-default': 'endTagOther' - }; - - modes.inHeadNoscript.processCharacters = function(buffer) { - var leadingWhitespace = buffer.takeLeadingWhitespace(); - if (leadingWhitespace) - tree.insertText(leadingWhitespace); - if (!buffer.length) - return; - // FIXME error message - tree.parseError("unexpected-char-in-frameset"); - this.anythingElse(); - tree.insertionMode.processCharacters(buffer); - }; - - modes.inHeadNoscript.processComment = function(data) { - modes.inHead.processComment(data); - }; - - modes.inHeadNoscript.startTagBasefontBgsoundLinkMetaNoframesStyle = function(name, attributes) { - modes.inHead.processStartTag(name, attributes); - }; - - modes.inHeadNoscript.startTagHeadNoscript = function(name, attributes) { - // FIXME error message - tree.parseError("unexpected-start-tag-in-frameset", {name: name}); - }; - - modes.inHeadNoscript.startTagOther = function(name, attributes) { - // FIXME error message - tree.parseError("unexpected-start-tag-in-frameset", {name: name}); - this.anythingElse(); - tree.insertionMode.processStartTag(name, attributes); - }; - - modes.inHeadNoscript.endTagBr = function(name, attributes) { - // FIXME error message - tree.parseError("unexpected-end-tag-in-frameset", {name: name}); - this.anythingElse(); - tree.insertionMode.processEndTag(name, attributes); - }; - - modes.inHeadNoscript.endTagNoscript = function(name, attributes) { - tree.popElement(); - tree.setInsertionMode('inHead'); - }; - - modes.inHeadNoscript.endTagOther = function(name, attributes) { - // FIXME error message - tree.parseError("unexpected-end-tag-in-frameset", {name: name}); - }; - - modes.inHeadNoscript.anythingElse = function() { - tree.popElement(); - tree.setInsertionMode('inHead'); - }; - - - modes.inFrameset = Object.create(modes.base); - - modes.inFrameset.start_tag_handlers = { - html: 'startTagHtml', - frameset: 'startTagFrameset', - frame: 'startTagFrame', - noframes: 'startTagNoframes', - "-default": 'startTagOther' - }; - - modes.inFrameset.end_tag_handlers = { - frameset: 'endTagFrameset', - noframes: 'endTagNoframes', - '-default': 'endTagOther' - }; - - modes.inFrameset.processCharacters = function(data) { - tree.parseError("unexpected-char-in-frameset"); - }; - - modes.inFrameset.startTagFrameset = function(name, attributes) { - tree.insertElement(name, attributes); - }; - - modes.inFrameset.startTagFrame = function(name, attributes) { - tree.insertSelfClosingElement(name, attributes); - }; - - modes.inFrameset.startTagNoframes = function(name, attributes) { - modes.inBody.processStartTag(name, attributes); - }; - - modes.inFrameset.startTagOther = function(name, attributes) { - tree.parseError("unexpected-start-tag-in-frameset", {name: name}); - }; - - modes.inFrameset.endTagFrameset = function(name, attributes) { - if (tree.currentStackItem().localName == 'html') { - // context case - tree.parseError("unexpected-frameset-in-frameset-innerhtml"); - } else { - tree.popElement(); - } - - if (!tree.context && tree.currentStackItem().localName != 'frameset') { - // If we're not in context mode an the current node is not a "frameset" element (anymore) then switch - tree.setInsertionMode('afterFrameset'); - } - }; - - modes.inFrameset.endTagNoframes = function(name) { - modes.inBody.processEndTag(name); - }; - - modes.inFrameset.endTagOther = function(name) { - tree.parseError("unexpected-end-tag-in-frameset", {name: name}); - }; - - modes.inTable = Object.create(modes.base); - - modes.inTable.start_tag_handlers = { - html: 'startTagHtml', - caption: 'startTagCaption', - colgroup: 'startTagColgroup', - col: 'startTagCol', - table: 'startTagTable', - tbody: 'startTagRowGroup', - tfoot: 'startTagRowGroup', - thead: 'startTagRowGroup', - td: 'startTagImplyTbody', - th: 'startTagImplyTbody', - tr: 'startTagImplyTbody', - style: 'startTagStyleScript', - script: 'startTagStyleScript', - input: 'startTagInput', - form: 'startTagForm', - '-default': 'startTagOther' - }; - - modes.inTable.end_tag_handlers = { - table: 'endTagTable', - body: 'endTagIgnore', - caption: 'endTagIgnore', - col: 'endTagIgnore', - colgroup: 'endTagIgnore', - html: 'endTagIgnore', - tbody: 'endTagIgnore', - td: 'endTagIgnore', - tfoot: 'endTagIgnore', - th: 'endTagIgnore', - thead: 'endTagIgnore', - tr: 'endTagIgnore', - '-default': 'endTagOther' - }; - - modes.inTable.processCharacters = function(data) { - if (tree.currentStackItem().isFosterParenting()) { - var originalInsertionMode = tree.insertionModeName; - tree.setInsertionMode('inTableText'); - tree.originalInsertionMode = originalInsertionMode; - tree.insertionMode.processCharacters(data); - } else { - tree.redirectAttachToFosterParent = true; - modes.inBody.processCharacters(data); - tree.redirectAttachToFosterParent = false; - } - }; - - modes.inTable.startTagCaption = function(name, attributes) { - tree.openElements.popUntilTableScopeMarker(); - tree.activeFormattingElements.push(Marker); - tree.insertElement(name, attributes); - tree.setInsertionMode('inCaption'); - }; - - modes.inTable.startTagColgroup = function(name, attributes) { - tree.openElements.popUntilTableScopeMarker(); - tree.insertElement(name, attributes); - tree.setInsertionMode('inColumnGroup'); - }; - - modes.inTable.startTagCol = function(name, attributes) { - this.startTagColgroup('colgroup', []); - tree.insertionMode.processStartTag(name, attributes); - }; - - modes.inTable.startTagRowGroup = function(name, attributes) { - tree.openElements.popUntilTableScopeMarker(); - tree.insertElement(name, attributes); - tree.setInsertionMode('inTableBody'); - }; - - modes.inTable.startTagImplyTbody = function(name, attributes) { - this.startTagRowGroup('tbody', []); - tree.insertionMode.processStartTag(name, attributes); - }; - - modes.inTable.startTagTable = function(name, attributes) { - tree.parseError("unexpected-start-tag-implies-end-tag", - {startName: "table", endName: "table"}); - tree.insertionMode.processEndTag('table'); - if (!tree.context) tree.insertionMode.processStartTag(name, attributes); - }; - - modes.inTable.startTagStyleScript = function(name, attributes) { - modes.inHead.processStartTag(name, attributes); - }; - - modes.inTable.startTagInput = function(name, attributes) { - for (var key in attributes) { - if (attributes[key].nodeName.toLowerCase() == 'type') { - if (attributes[key].nodeValue.toLowerCase() == 'hidden') { - tree.parseError("unexpected-hidden-input-in-table"); - tree.insertElement(name, attributes); - // XXX associate with form - tree.openElements.pop(); - return; - } - break; - } - } - this.startTagOther(name, attributes); - }; - - modes.inTable.startTagForm = function(name, attributes) { - tree.parseError("unexpected-form-in-table"); - if (!tree.form) { - tree.insertElement(name, attributes); - tree.form = tree.currentStackItem(); - tree.openElements.pop(); - } - }; - - modes.inTable.startTagOther = function(name, attributes, selfClosing) { - tree.parseError("unexpected-start-tag-implies-table-voodoo", {name: name}); - tree.redirectAttachToFosterParent = true; - modes.inBody.processStartTag(name, attributes, selfClosing); - tree.redirectAttachToFosterParent = false; - }; - - modes.inTable.endTagTable = function(name) { - if (tree.openElements.inTableScope(name)) { - tree.generateImpliedEndTags(); - if (tree.currentStackItem().localName != name) { - tree.parseError("end-tag-too-early-named", {gotName: 'table', expectedName: tree.currentStackItem().localName}); - } - - tree.openElements.popUntilPopped('table'); - tree.resetInsertionMode(); - } else { - assert.ok(tree.context); - tree.parseError('unexpected-end-tag', {name: name}); - } - }; - - modes.inTable.endTagIgnore = function(name) { - tree.parseError("unexpected-end-tag", {name: name}); - }; - - modes.inTable.endTagOther = function(name) { - tree.parseError("unexpected-end-tag-implies-table-voodoo", {name: name}); - // Make all the special element rearranging voodoo kick in - tree.redirectAttachToFosterParent = true; - // Process the end tag in the "in body" mode - modes.inBody.processEndTag(name); - tree.redirectAttachToFosterParent = false; - }; - - modes.inTableText = Object.create(modes.base); - - modes.inTableText.flushCharacters = function() { - var characters = tree.pendingTableCharacters.join(''); - if (!isAllWhitespace(characters)) { - tree.redirectAttachToFosterParent = true; - tree.reconstructActiveFormattingElements(); - tree.insertText(characters); - tree.framesetOk = false; - tree.redirectAttachToFosterParent = false; - } else { - tree.insertText(characters); - } - tree.pendingTableCharacters = []; - }; - - modes.inTableText.processComment = function(data) { - this.flushCharacters(); - tree.setInsertionMode(tree.originalInsertionMode); - tree.insertionMode.processComment(data); - }; - - modes.inTableText.processEOF = function(data) { - this.flushCharacters(); - tree.setInsertionMode(tree.originalInsertionMode); - tree.insertionMode.processEOF(); - }; - - modes.inTableText.processCharacters = function(buffer) { - var characters = buffer.takeRemaining(); - characters = characters.replace(/\u0000/g, function(match, index){ - // @todo position - tree.parseError("invalid-codepoint"); - return ''; - }); - if (!characters) - return; - tree.pendingTableCharacters.push(characters); - }; - - modes.inTableText.processStartTag = function(name, attributes, selfClosing) { - this.flushCharacters(); - tree.setInsertionMode(tree.originalInsertionMode); - tree.insertionMode.processStartTag(name, attributes, selfClosing); - }; - - modes.inTableText.processEndTag = function(name, attributes) { - this.flushCharacters(); - tree.setInsertionMode(tree.originalInsertionMode); - tree.insertionMode.processEndTag(name, attributes); - }; - - modes.inTableBody = Object.create(modes.base); - - modes.inTableBody.start_tag_handlers = { - html: 'startTagHtml', - tr: 'startTagTr', - td: 'startTagTableCell', - th: 'startTagTableCell', - caption: 'startTagTableOther', - col: 'startTagTableOther', - colgroup: 'startTagTableOther', - tbody: 'startTagTableOther', - tfoot: 'startTagTableOther', - thead: 'startTagTableOther', - '-default': 'startTagOther' - }; - - modes.inTableBody.end_tag_handlers = { - table: 'endTagTable', - tbody: 'endTagTableRowGroup', - tfoot: 'endTagTableRowGroup', - thead: 'endTagTableRowGroup', - body: 'endTagIgnore', - caption: 'endTagIgnore', - col: 'endTagIgnore', - colgroup: 'endTagIgnore', - html: 'endTagIgnore', - td: 'endTagIgnore', - th: 'endTagIgnore', - tr: 'endTagIgnore', - '-default': 'endTagOther' - }; - - modes.inTableBody.processCharacters = function(data) { - modes.inTable.processCharacters(data); - }; - - modes.inTableBody.startTagTr = function(name, attributes) { - tree.openElements.popUntilTableBodyScopeMarker(); - tree.insertElement(name, attributes); - tree.setInsertionMode('inRow'); - }; - - modes.inTableBody.startTagTableCell = function(name, attributes) { - tree.parseError("unexpected-cell-in-table-body", {name: name}); - this.startTagTr('tr', []); - tree.insertionMode.processStartTag(name, attributes); - }; - - modes.inTableBody.startTagTableOther = function(name, attributes) { - // XXX any ideas on how to share this with endTagTable - if (tree.openElements.inTableScope('tbody') || tree.openElements.inTableScope('thead') || tree.openElements.inTableScope('tfoot')) { - tree.openElements.popUntilTableBodyScopeMarker(); - this.endTagTableRowGroup(tree.currentStackItem().localName); - tree.insertionMode.processStartTag(name, attributes); - } else { - // context case - tree.parseError('unexpected-start-tag', {name: name}); - } - }; - - modes.inTableBody.startTagOther = function(name, attributes) { - modes.inTable.processStartTag(name, attributes); - }; - - modes.inTableBody.endTagTableRowGroup = function(name) { - if (tree.openElements.inTableScope(name)) { - tree.openElements.popUntilTableBodyScopeMarker(); - tree.popElement(); - tree.setInsertionMode('inTable'); - } else { - tree.parseError('unexpected-end-tag-in-table-body', {name: name}); - } - }; - - modes.inTableBody.endTagTable = function(name) { - if (tree.openElements.inTableScope('tbody') || tree.openElements.inTableScope('thead') || tree.openElements.inTableScope('tfoot')) { - tree.openElements.popUntilTableBodyScopeMarker(); - this.endTagTableRowGroup(tree.currentStackItem().localName); - tree.insertionMode.processEndTag(name); - } else { - // context case - tree.parseError('unexpected-end-tag', {name: name}); - } - }; - - modes.inTableBody.endTagIgnore = function(name) { - tree.parseError("unexpected-end-tag-in-table-body", {name: name}); - }; - - modes.inTableBody.endTagOther = function(name) { - modes.inTable.processEndTag(name); - }; - - modes.inSelect = Object.create(modes.base); - - modes.inSelect.start_tag_handlers = { - html: 'startTagHtml', - option: 'startTagOption', - optgroup: 'startTagOptgroup', - select: 'startTagSelect', - input: 'startTagInput', - keygen: 'startTagInput', - textarea: 'startTagInput', - script: 'startTagScript', - '-default': 'startTagOther' - }; - - modes.inSelect.end_tag_handlers = { - option: 'endTagOption', - optgroup: 'endTagOptgroup', - select: 'endTagSelect', - caption: 'endTagTableElements', - table: 'endTagTableElements', - tbody: 'endTagTableElements', - tfoot: 'endTagTableElements', - thead: 'endTagTableElements', - tr: 'endTagTableElements', - td: 'endTagTableElements', - th: 'endTagTableElements', - '-default': 'endTagOther' - }; - - modes.inSelect.processCharacters = function(buffer) { - var data = buffer.takeRemaining(); - data = data.replace(/\u0000/g, function(match, index){ - // @todo position - tree.parseError("invalid-codepoint"); - return ''; - }); - if (!data) - return; - tree.insertText(data); - }; - - modes.inSelect.startTagOption = function(name, attributes) { - // we need to imply if ", + state: [ "tag_qqstring", "start" ], + tokens: [ { + type: "string", + value: "def\"" + }, { + type: "meta.tag", + value: ">" + } + ] + }], + + "test: tokenize multiline attribute value with single quotes": [{ + text: "", + state: [ "tag_qstring", "start" ], + tokens: [ { + type: "string", + value: "def\"'" + }, { + type: "meta.tag", + value: ">" + } + ] + }] +}; + +function generateTest(exampleData) { + return function testTokenizer() { + for (var i = 0; i < exampleData.length; i++) { + var s = exampleData[i]; + var lineTokens = tokenizer.getLineTokens(s.text, s.state[0]); + + assert.equal( + JSON.stringify(lineTokens, null, 4), + JSON.stringify({tokens:s.tokens, state: s.state[1]}, null, 4) + ); + } + } +} + +var tokenizer; +module.exports = { + setUp : function() { + tokenizer = new HtmlMode().getTokenizer(); + } +} + +for (var i in testData) { + module.exports[i] = generateTest(testData[i]) +} + +}); + +if (typeof module !== "undefined" && module === require.main) { + require("asyncjs").test.testcase(module.exports).exec(); +} diff --git a/lib/ace/mode/html_ruby.js b/lib/ace/mode/html_ruby.js deleted file mode 100644 index ab9aa083..00000000 --- a/lib/ace/mode/html_ruby.js +++ /dev/null @@ -1,59 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var HtmlRubyHighlightRules = require("./html_ruby_highlight_rules").HtmlRubyHighlightRules; -var HtmlMode = require("./html").Mode; -var JavaScriptMode = require("./javascript").Mode; -var CssMode = require("./css").Mode; -var RubyMode = require("./ruby").Mode; - -var Mode = function() { - HtmlMode.call(this); - this.HighlightRules = HtmlRubyHighlightRules; - this.createModeDelegates({ - "js-": JavaScriptMode, - "css-": CssMode, - "ruby-": RubyMode - }); -}; -oop.inherits(Mode, HtmlMode); - -(function() { - - this.$id = "ace/mode/html_ruby"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); \ No newline at end of file diff --git a/lib/ace/mode/html_ruby_highlight_rules.js b/lib/ace/mode/html_ruby_highlight_rules.js deleted file mode 100644 index 47f113cf..00000000 --- a/lib/ace/mode/html_ruby_highlight_rules.js +++ /dev/null @@ -1,84 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - "use strict"; - - var oop = require("../lib/oop"); - var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; - var RubyHighlightRules = require("./ruby_highlight_rules").RubyHighlightRules; - - var HtmlRubyHighlightRules = function() { - HtmlHighlightRules.call(this); - - var startRules = [ - { - regex: "<%%|%%>", - token: "constant.language.escape" - }, { - token : "comment.start.erb", - regex : "<%#", - push : [{ - token : "comment.end.erb", - regex: "%>", - next: "pop", - defaultToken:"comment" - }] - }, { - token : "support.ruby_tag", - regex : "<%+(?!>)[-=]?", - push : "ruby-start" - } - ]; - - var endRules = [ - { - token : "support.ruby_tag", - regex : "%>", - next : "pop" - }, { - token: "comment", - regex: "#(?:[^%]|%[^>])*" - } - ]; - - for (var key in this.$rules) - this.$rules[key].unshift.apply(this.$rules[key], startRules); - - this.embedRules(RubyHighlightRules, "ruby-", endRules, ["start"]); - - this.normalizeRules(); - }; - - - oop.inherits(HtmlRubyHighlightRules, HtmlHighlightRules); - - exports.HtmlRubyHighlightRules = HtmlRubyHighlightRules; -}); \ No newline at end of file diff --git a/lib/ace/mode/html_test.js b/lib/ace/mode/html_test.js index 1649d014..6b5549e8 100644 --- a/lib/ace/mode/html_test.js +++ b/lib/ace/mode/html_test.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -45,12 +52,12 @@ module.exports = { this.mode = new HtmlMode(); }, - "test: toggle comment lines" : function() { - var session = new EditSession([" abc", "", "fg"]); + "test: toggle comment lines should not do anything" : function() { + var session = new EditSession([" abc", "cde", "fg"]); var range = new Range(0, 3, 1, 1); var comment = this.mode.toggleCommentLines("start", session, 0, 1); - assert.equal([" ", "", "fg"].join("\n"), session.toString()); + assert.equal([" abc", "cde", "fg"].join("\n"), session.toString()); }, "test: next line indent should be the same as the current line indent" : function() { diff --git a/lib/ace/mode/html_worker.js b/lib/ace/mode/html_worker.js deleted file mode 100644 index 742c1045..00000000 --- a/lib/ace/mode/html_worker.js +++ /dev/null @@ -1,92 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var Mirror = require("../worker/mirror").Mirror; -var SAXParser = require("./html/saxparser").SAXParser; - -var errorTypes = { - "expected-doctype-but-got-start-tag": "info", - "expected-doctype-but-got-chars": "info", - "non-html-root": "info", -} - -var Worker = exports.Worker = function(sender) { - Mirror.call(this, sender); - this.setTimeout(400); - this.context = null; -}; - -oop.inherits(Worker, Mirror); - -(function() { - - this.setOptions = function(options) { - this.context = options.context; - }; - - this.onUpdate = function() { - var value = this.doc.getValue(); - if (!value) - return; - var parser = new SAXParser(); - var errors = []; - var noop = function(){}; - parser.contentHandler = { - startDocument: noop, - endDocument: noop, - startElement: noop, - endElement: noop, - characters: noop - }; - parser.errorHandler = { - error: function(message, location, code) { - errors.push({ - row: location.line, - column: location.column, - text: message, - type: errorTypes[code] || "error" - }); - } - }; - if (this.context) - parser.parseFragment(value, this.context); - else - parser.parse(value); - this.sender.emit("error", errors); - }; - -}).call(Worker.prototype); - -}); diff --git a/lib/ace/mode/ini.js b/lib/ace/mode/ini.js deleted file mode 100644 index 196405f5..00000000 --- a/lib/ace/mode/ini.js +++ /dev/null @@ -1,53 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var IniHighlightRules = require("./ini_highlight_rules").IniHighlightRules; -// TODO: pick appropriate fold mode -var FoldMode = require("./folding/ini").FoldMode; - -var Mode = function() { - this.HighlightRules = IniHighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = ";"; - this.blockComment = {start: "/*", end: "*/"}; - this.$id = "ace/mode/ini"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); \ No newline at end of file diff --git a/lib/ace/mode/ini_highlight_rules.js b/lib/ace/mode/ini_highlight_rules.js deleted file mode 100644 index 8ce3d949..00000000 --- a/lib/ace/mode/ini_highlight_rules.js +++ /dev/null @@ -1,112 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -/* This file was autogenerated from tool\tm bundles\ini.tmbundle\Syntaxes\Ini.plist (uuid: ) */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var escapeRe = "\\\\(?:[\\\\0abtrn;#=:]|x[a-fA-F\\d]{4})"; - -var IniHighlightRules = function() { - this.$rules = { - start: [{ - token: 'punctuation.definition.comment.ini', - regex: '#.*', - push_: [{ - token: 'comment.line.number-sign.ini', - regex: '$|^', - next: 'pop' - }, { - defaultToken: 'comment.line.number-sign.ini' - }] - }, { - token: 'punctuation.definition.comment.ini', - regex: ';.*', - push_: [{ - token: 'comment.line.semicolon.ini', - regex: '$|^', - next: 'pop' - }, { - defaultToken: 'comment.line.semicolon.ini' - }] - }, { - token: ['keyword.other.definition.ini', 'text', 'punctuation.separator.key-value.ini'], - regex: '\\b([a-zA-Z0-9_.-]+)\\b(\\s*)(=)' - }, { - token: ['punctuation.definition.entity.ini', 'constant.section.group-title.ini', 'punctuation.definition.entity.ini'], - regex: '^(\\[)(.*?)(\\])' - }, { - token: 'punctuation.definition.string.begin.ini', - regex: "'", - push: [{ - token: 'punctuation.definition.string.end.ini', - regex: "'", - next: 'pop' - }, { - token: "constant.language.escape", - regex: escapeRe - }, { - defaultToken: 'string.quoted.single.ini' - }] - }, { - token: 'punctuation.definition.string.begin.ini', - regex: '"', - push: [{ - token: "constant.language.escape", - regex: escapeRe - }, { - token: 'punctuation.definition.string.end.ini', - regex: '"', - next: 'pop' - }, { - defaultToken: 'string.quoted.double.ini' - }] - }] - }; - - this.normalizeRules(); -}; - -IniHighlightRules.metaData = { - fileTypes: ['ini', 'conf'], - keyEquivalent: '^~I', - name: 'Ini', - scopeName: 'source.ini' -}; - - -oop.inherits(IniHighlightRules, TextHighlightRules); - -exports.IniHighlightRules = IniHighlightRules; -}); \ No newline at end of file diff --git a/lib/ace/mode/io.js b/lib/ace/mode/io.js deleted file mode 100644 index f3cd4cf0..00000000 --- a/lib/ace/mode/io.js +++ /dev/null @@ -1,58 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -/* - THIS FILE WAS AUTOGENERATED BY mode.tmpl.js -*/ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var Tokenizer = require("../tokenizer").Tokenizer; -var IoHighlightRules = require("./io_highlight_rules").IoHighlightRules; -var FoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = IoHighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - // Extra logic goes here. - this.$id = "ace/mode/io" -}).call(Mode.prototype); - -exports.Mode = Mode; -}); \ No newline at end of file diff --git a/lib/ace/mode/io_highlight_rules.js b/lib/ace/mode/io_highlight_rules.js deleted file mode 100644 index 99bc4cda..00000000 --- a/lib/ace/mode/io_highlight_rules.js +++ /dev/null @@ -1,120 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -/* This file was autogenerated from tm bundles\io.tmbundle/Syntaxes/io.plist (uuid: ) */ -/**************************************************************************************** - * IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. * - * fileTypes * - ****************************************************************************************/ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var IoHighlightRules = function() { - // regexp must not have capturing parentheses. Use (?:) instead. - // regexps are ordered -> the first match is used - - this.$rules = { start: - [ { token: [ 'text', 'meta.empty-parenthesis.io' ], - regex: '(\\()(\\))', - comment: 'we match this to overload return inside () --Allan; scoping rules for what gets the scope have changed, so we now group the ) instead of the ( -- Rob' }, - { token: [ 'text', 'meta.comma-parenthesis.io' ], - regex: '(\\,)(\\))', - comment: 'We want to do the same for ,) -- Seckar; same as above -- Rob' }, - { token: 'keyword.control.io', - regex: '\\b(?:if|ifTrue|ifFalse|ifTrueIfFalse|for|loop|reverseForeach|foreach|map|continue|break|while|do|return)\\b' }, - { token: 'punctuation.definition.comment.io', - regex: '/\\*', - push: - [ { token: 'punctuation.definition.comment.io', - regex: '\\*/', - next: 'pop' }, - { defaultToken: 'comment.block.io' } ] }, - { token: 'punctuation.definition.comment.io', - regex: '//', - push: - [ { token: 'comment.line.double-slash.io', - regex: '$', - next: 'pop' }, - { defaultToken: 'comment.line.double-slash.io' } ] }, - { token: 'punctuation.definition.comment.io', - regex: '#', - push: - [ { token: 'comment.line.number-sign.io', regex: '$', next: 'pop' }, - { defaultToken: 'comment.line.number-sign.io' } ] }, - { token: 'variable.language.io', - regex: '\\b(?:self|sender|target|proto|protos|parent)\\b', - comment: 'I wonder if some of this isn\'t variable.other.language? --Allan; scoping this as variable.language to match Objective-C\'s handling of \'self\', which is inconsistent with C++\'s handling of \'this\' but perhaps intentionally so -- Rob' }, - { token: 'keyword.operator.io', - regex: '<=|>=|=|:=|\\*|\\||\\|\\||\\+|-|/|&|&&|>|<|\\?|@|@@|\\b(?:and|or)\\b' }, - { token: 'constant.other.io', regex: '\\bGL[\\w_]+\\b' }, - { token: 'support.class.io', regex: '\\b[A-Z](?:\\w+)?\\b' }, - { token: 'support.function.io', - regex: '\\b(?:clone|call|init|method|list|vector|block|\\w+(?=\\s*\\())\\b' }, - { token: 'support.function.open-gl.io', - regex: '\\bgl(?:u|ut)?[A-Z]\\w+\\b' }, - { token: 'punctuation.definition.string.begin.io', - regex: '"""', - push: - [ { token: 'punctuation.definition.string.end.io', - regex: '"""', - next: 'pop' }, - { token: 'constant.character.escape.io', regex: '\\\\.' }, - { defaultToken: 'string.quoted.triple.io' } ] }, - { token: 'punctuation.definition.string.begin.io', - regex: '"', - push: - [ { token: 'punctuation.definition.string.end.io', - regex: '"', - next: 'pop' }, - { token: 'constant.character.escape.io', regex: '\\\\.' }, - { defaultToken: 'string.quoted.double.io' } ] }, - { token: 'constant.numeric.io', - regex: '\\b(?:0(?:x|X)[0-9a-fA-F]*|(?:[0-9]+\\.?[0-9]*|\\.[0-9]+)(?:(?:e|E)(?:\\+|-)?[0-9]+)?)(?:L|l|UL|ul|u|U|F|f)?\\b' }, - { token: 'variable.other.global.io', regex: 'Lobby\\b' }, - { token: 'constant.language.io', - regex: '\\b(?:TRUE|true|FALSE|false|NULL|null|Null|Nil|nil|YES|NO)\\b' } ] } - - this.normalizeRules(); -}; - -IoHighlightRules.metaData = { fileTypes: [ 'io' ], - keyEquivalent: '^~I', - name: 'Io', - scopeName: 'source.io' } - - -oop.inherits(IoHighlightRules, TextHighlightRules); - -exports.IoHighlightRules = IoHighlightRules; -}); \ No newline at end of file diff --git a/lib/ace/mode/jack.js b/lib/ace/mode/jack.js deleted file mode 100644 index 73267c4b..00000000 --- a/lib/ace/mode/jack.js +++ /dev/null @@ -1,79 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var HighlightRules = require("./jack_highlight_rules").JackHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = HighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "--"; - - 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.$id = "ace/mode/jack"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); diff --git a/lib/ace/mode/jack_highlight_rules.js b/lib/ace/mode/jack_highlight_rules.js deleted file mode 100644 index edf7c856..00000000 --- a/lib/ace/mode/jack_highlight_rules.js +++ /dev/null @@ -1,142 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var JackHighlightRules = function() { - - // regexp must not have capturing parentheses. Use (?:) instead. - // regexps are ordered -> the first match is used - this.$rules = { - "start" : [ - { - token : "string", - regex : '"', - next : "string2" - }, { - token : "string", - regex : "'", - next : "string1" - }, { - token : "constant.numeric", // hex - regex: "-?0[xX][0-9a-fA-F]+\\b" - }, { - token : "constant.numeric", // float - regex : "(?:0|[-+]?[1-9][0-9]*)\\b" - }, { - token : "constant.binary", - regex : "<[0-9A-Fa-f][0-9A-Fa-f](\\s+[0-9A-Fa-f][0-9A-Fa-f])*>" - }, { - token : "constant.language.boolean", - regex : "(?:true|false)\\b" - }, { - token : "constant.language.null", - regex : "null\\b" - }, { - token : "storage.type", - regex: "(?:Integer|Boolean|Null|String|Buffer|Tuple|List|Object|Function|Coroutine|Form)\\b" - }, { - token : "keyword", - regex : "(?:return|abort|vars|for|delete|in|is|escape|exec|split|and|if|elif|else|while)\\b" - }, { - token : "language.builtin", - regex : "(?:lines|source|parse|read-stream|interval|substr|parseint|write|print|range|rand|inspect|bind|i-values|i-pairs|i-map|i-filter|i-chunk|i-all\\?|i-any\\?|i-collect|i-zip|i-merge|i-each)\\b" - }, { - token : "comment", - regex : "--.*$" - }, { - token : "paren.lparen", - regex : "[[({]" - }, { - token : "paren.rparen", - regex : "[\\])}]" - }, { - token : "storage.form", - regex : "@[a-z]+" - }, { - token : "constant.other.symbol", - regex : ':+[a-zA-Z_]([-]?[a-zA-Z0-9_])*[?!]?' - }, { - token : "variable", - regex : '[a-zA-Z_]([-]?[a-zA-Z0-9_])*[?!]?' - }, { - token : "keyword.operator", - regex : "\\|\\||\\^\\^|&&|!=|==|<=|<|>=|>|\\+|-|\\*|\\/|\\^|\\%|\\#|\\!" - }, { - token : "text", - regex : "\\s+" - } - ], - "string1" : [ - { - token : "constant.language.escape", - regex : /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|['"\\\/bfnrt])/ - }, { - token : "string", - regex : "[^'\\\\]+" - }, { - token : "string", - regex : "'", - next : "start" - }, { - token : "string", - regex : "", - next : "start" - } - ], - "string2" : [ - { - token : "constant.language.escape", - regex : /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|['"\\\/bfnrt])/ - }, { - token : "string", - regex : '[^"\\\\]+' - }, { - token : "string", - regex : '"', - next : "start" - }, { - token : "string", - regex : "", - next : "start" - } - ] - }; - -}; - -oop.inherits(JackHighlightRules, TextHighlightRules); - -exports.JackHighlightRules = JackHighlightRules; -}); diff --git a/lib/ace/mode/jade.js b/lib/ace/mode/jade.js deleted file mode 100644 index d298dac4..00000000 --- a/lib/ace/mode/jade.js +++ /dev/null @@ -1,57 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * Garen J. Torikian - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var JadeHighlightRules = require("./jade_highlight_rules").JadeHighlightRules; -var FoldMode = require("./folding/coffee").FoldMode; - -var Mode = function() { - this.HighlightRules = JadeHighlightRules; - - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "//"; - this.$id = "ace/mode/jade"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); \ No newline at end of file diff --git a/lib/ace/mode/jade_highlight_rules.js b/lib/ace/mode/jade_highlight_rules.js deleted file mode 100644 index c46c0be7..00000000 --- a/lib/ace/mode/jade_highlight_rules.js +++ /dev/null @@ -1,341 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * Garen J. Torikian - * - * ***** END LICENSE BLOCK ***** */ - -/* - THIS FILE WAS AUTOGENERATED BY mode_highlight_rules.tmpl.js (UUID: C5B73B98-5F2A-42E3-9F0E-028A74A9FE4B) -*/ - -define(function(require, exports, module) { -"use strict"; - -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)(?:.*$)" - }, - { - onMatch: function(value, currentState, stack) { - stack.unshift(this.next, value.length - 2, currentState); - return "comment"; - }, - regex: /^\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-start" - }, - /*{ - 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", - 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": [ - {regex: /^\s*/, onMatch: function(value, currentState, stack) { - if (value.length <= stack[1]) { - stack.shift(); - stack.shift(); - this.next = stack.shift(); - return "text"; - } else { - this.next = ""; - return "comment"; - } - }, next: "start"}, - {defaultToken: "comment"} - ], - /* - - "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: "entity.other.attribute-name.class.jade", - regex: "\\.[\\w-]+" - }, - { - token: "entity.other.attribute-name.id.jade", - regex: "#[\\w-]+" - }, - { - token: ["text", "punctuation"], - regex: "($)|((?!\\.|#|=|-))", - next: "start" - } - ], - "tag_attributes": [ - { - token : "string", - regex : "'(?=.)", - next : "qstring" - }, - { - token : "string", - regex : '"(?=.)', - next : "qqstring" - }, - { - token: "entity.other.attribute-name.jade", - regex: "\\b[a-zA-Z\\-:]+" - }, - { - 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 : '[^"\\\\]+' - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "tag_attributes" - } - ], - "qstring" : [ - { - token : "constant.language.escape", - regex : escapedRe - }, { - token : "string", - regex : "[^'\\\\]+" - }, { - token : "string", - regex : "\\\\$", - next : "qstring" - }, { - token : "string", - regex : "'|$", - next : "tag_attributes" - } - ] -}; - - this.embedRules(JavaScriptHighlightRules, "js-", [{ - token: "text", - regex: ".$", - next: "start" - }]); -/* - this.embedRules(MarkdownHighlightRules, "markdown-", [{ - token : "support.function", - regex : "^\\1\\s+", - captures: "1", - next : "start" - }]); - - this.embedRules(SassHighlightRules, "sass-", [{ - token : "support.function", - regex : "^(?!\\1\\s+)", - captures: "1", - next : "start" - }]); - - this.embedRules(LessHighlightRules, "less-", [{ - token : "support.function", - regex : "^(?!\\1\\s+)", - captures: "1", - next : "start" - }]); - - this.embedRules(CoffeeHighlightRules, "coffee-", [{ - token : "support.function", - regex : "^(?!\\1\\s+)", - captures: "1", - next : "start" - }]); - - this.embedRules(JavaScriptHighlightRules, "js-", [{ - token : "support.function", - regex : "$", - captures: "1", - next : "start" - }]); */ -}; - -oop.inherits(JadeHighlightRules, TextHighlightRules); - -exports.JadeHighlightRules = JadeHighlightRules; -}); diff --git a/lib/ace/mode/java.js b/lib/ace/mode/java.js index 58df0c96..1b7045ea 100644 --- a/lib/ace/mode/java.js +++ b/lib/ace/mode/java.js @@ -3,11 +3,13 @@ define(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.HighlightRules = JavaHighlightRules; + + this.$tokenizer = new Tokenizer(new JavaHighlightRules().getRules()); }; oop.inherits(Mode, JavaScriptMode); @@ -17,7 +19,6 @@ oop.inherits(Mode, JavaScriptMode); return null; }; - this.$id = "ace/mode/java"; }).call(Mode.prototype); exports.Mode = Mode; diff --git a/lib/ace/mode/java_highlight_rules.js b/lib/ace/mode/java_highlight_rules.js index d39d9aad..77efd672 100644 --- a/lib/ace/mode/java_highlight_rules.js +++ b/lib/ace/mode/java_highlight_rules.js @@ -2,14 +2,15 @@ define(function(require, exports, module) { "use strict"; 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 JavaHighlightRules = function() { // taken from http://download.oracle.com/javase/tutorial/java/nutsandbolts/_keywords.html - var keywords = ( - "abstract|continue|for|new|switch|" + + var keywords = lang.arrayToMap( + ("abstract|continue|for|new|switch|" + "assert|default|goto|package|synchronized|" + "boolean|do|if|private|this|" + "break|double|implements|protected|throw|" + @@ -18,14 +19,15 @@ var JavaHighlightRules = function() { "catch|extends|int|short|try|" + "char|final|interface|static|void|" + "class|finally|long|strictfp|volatile|" + - "const|float|native|super|while" + "const|float|native|super|while").split("|") ); - var buildinConstants = ("null|Infinity|NaN|undefined"); + var buildinConstants = lang.arrayToMap( + ("null|Infinity|NaN|undefined").split("|") + ); - - var langClasses = ( - "AbstractMethodError|AssertionError|ClassCircularityError|"+ + var langClasses = lang.arrayToMap( + ("AbstractMethodError|AssertionError|ClassCircularityError|"+ "ClassFormatError|Deprecated|EnumConstantNotPresentException|"+ "ExceptionInInitializerError|IllegalAccessError|"+ "IllegalThreadStateException|InstantiationError|InternalError|"+ @@ -48,16 +50,12 @@ var JavaHighlightRules = function() { "ArrayStoreException|ClassCastException|LinkageError|"+ "NoClassDefFoundError|ClassNotFoundException|RuntimeException|"+ "Exception|ThreadDeath|Error|Throwable|System|ClassLoader|"+ - "Cloneable|Class|CharSequence|Comparable|String|Object" + "Cloneable|Class|CharSequence|Comparable|String|Object").split("|") + ); + + var importClasses = lang.arrayToMap( + ("").split("|") ); - - 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 @@ -70,8 +68,12 @@ var JavaHighlightRules = function() { 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 : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' @@ -88,7 +90,20 @@ var JavaHighlightRules = function() { token : "constant.language.boolean", regex : "(?:true|false)\\b" }, { - token : keywordMapper, + token : function(value) { + if (value == "this") + return "variable.language"; + else if (keywords.hasOwnProperty(value)) + return "keyword"; + else if (langClasses.hasOwnProperty(value)) + return "support.function"; + else if (importClasses.hasOwnProperty(value)) + return "support.function"; + else if (buildinConstants.hasOwnProperty(value)) + return "constant.language"; + else + return "identifier"; + }, // TODO: Unicode escape sequences // TODO: Unicode identifiers regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" @@ -113,11 +128,12 @@ var JavaHighlightRules = function() { next : "start" }, { token : "comment", // comment spanning whole line + merge : true, regex : ".+" } ] }; - + this.embedRules(DocCommentHighlightRules, "doc-", [ DocCommentHighlightRules.getEndRule("start") ]); }; diff --git a/lib/ace/mode/javascript.js b/lib/ace/mode/javascript.js index b6ebe5a0..6cc58265 100644 --- a/lib/ace/mode/javascript.js +++ b/lib/ace/mode/javascript.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. * - * 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. + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -33,6 +40,7 @@ define(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; @@ -41,8 +49,7 @@ var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; var CStyleFoldMode = require("./folding/cstyle").FoldMode; var Mode = function() { - this.HighlightRules = JavaScriptHighlightRules; - + this.$tokenizer = new Tokenizer(new JavaScriptHighlightRules().getRules()); this.$outdent = new MatchingBraceOutdent(); this.$behaviour = new CstyleBehaviour(); this.foldingRules = new CStyleFoldMode(); @@ -51,27 +58,53 @@ oop.inherits(Mode, TextMode); (function() { - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; + + 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.getTokenizer().getLineTokens(line, state); + 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 == "no_regex") { + + 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" || endState == "no_regex") { + if (endState == "start" || state == "regex_allowed") { return ""; } var match = line.match(/^\s*(\/?)\*/); @@ -93,23 +126,38 @@ oop.inherits(Mode, TextMode); 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("annotate", function(results) { - session.setAnnotations(results.data); + + worker.on("jslint", function(results) { + var errors = []; + for (var i=0; i= 65 && i <= 90 || // A-Z - i === 95 || // _ - i >= 97 && i <= 122; // a-z -} - -var identifierPartTable = []; - -for (var i = 0; i < 128; i++) { - identifierPartTable[i] = - identifierStartTable[i] || // $, _, A-Z, a-z - i >= 48 && i <= 57; // 0-9 -} - -module.exports = { - asciiIdentifierStartTable: identifierStartTable, - asciiIdentifierPartTable: identifierPartTable -}; - -}, -{}], -2:[function(_dereq_,module,exports){ -// Underscore.js 1.8.2 -// http://underscorejs.org -// (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors -// Underscore may be freely distributed under the MIT license. - -(function() { - - // Baseline setup - // -------------- - - // Establish the root object, `window` in the browser, or `exports` on the server. - var root = this; - - // Save the previous value of the `_` variable. - var previousUnderscore = root._; - - // Save bytes in the minified (but not gzipped) version: - var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; - - // Create quick reference variables for speed access to core prototypes. - var - push = ArrayProto.push, - slice = ArrayProto.slice, - toString = ObjProto.toString, - hasOwnProperty = ObjProto.hasOwnProperty; - - // All **ECMAScript 5** native function implementations that we hope to use - // are declared here. - var - nativeIsArray = Array.isArray, - nativeKeys = Object.keys, - nativeBind = FuncProto.bind, - nativeCreate = Object.create; - - // Naked function reference for surrogate-prototype-swapping. - var Ctor = function(){}; - - // Create a safe reference to the Underscore object for use below. - var _ = function(obj) { - if (obj instanceof _) return obj; - if (!(this instanceof _)) return new _(obj); - this._wrapped = obj; - }; - - // Export the Underscore object for **Node.js**, with - // backwards-compatibility for the old `require()` API. If we're in - // the browser, add `_` as a global object. - if (typeof exports !== 'undefined') { - if (typeof module !== 'undefined' && module.exports) { - exports = module.exports = _; - } - exports._ = _; - } else { - root._ = _; - } - - // Current version. - _.VERSION = '1.8.2'; - - // Internal function that returns an efficient (for current engines) version - // of the passed-in callback, to be repeatedly applied in other Underscore - // functions. - var optimizeCb = function(func, context, argCount) { - if (context === void 0) return func; - switch (argCount == null ? 3 : argCount) { - case 1: return function(value) { - return func.call(context, value); - }; - case 2: return function(value, other) { - return func.call(context, value, other); - }; - case 3: return function(value, index, collection) { - return func.call(context, value, index, collection); - }; - case 4: return function(accumulator, value, index, collection) { - return func.call(context, accumulator, value, index, collection); - }; - } - return function() { - return func.apply(context, arguments); - }; - }; - - // A mostly-internal function to generate callbacks that can be applied - // to each element in a collection, returning the desired result — either - // identity, an arbitrary callback, a property matcher, or a property accessor. - var cb = function(value, context, argCount) { - if (value == null) return _.identity; - if (_.isFunction(value)) return optimizeCb(value, context, argCount); - if (_.isObject(value)) return _.matcher(value); - return _.property(value); - }; - _.iteratee = function(value, context) { - return cb(value, context, Infinity); - }; - - // An internal function for creating assigner functions. - var createAssigner = function(keysFunc, undefinedOnly) { - return function(obj) { - var length = arguments.length; - if (length < 2 || obj == null) return obj; - for (var index = 1; index < length; index++) { - var source = arguments[index], - keys = keysFunc(source), - l = keys.length; - for (var i = 0; i < l; i++) { - var key = keys[i]; - if (!undefinedOnly || obj[key] === void 0) obj[key] = source[key]; - } - } - return obj; - }; - }; - - // An internal function for creating a new object that inherits from another. - var baseCreate = function(prototype) { - if (!_.isObject(prototype)) return {}; - if (nativeCreate) return nativeCreate(prototype); - Ctor.prototype = prototype; - var result = new Ctor; - Ctor.prototype = null; - return result; - }; - - // Helper for collection methods to determine whether a collection - // should be iterated as an array or as an object - // Related: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength - var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1; - var isArrayLike = function(collection) { - var length = collection && collection.length; - return typeof length == 'number' && length >= 0 && length <= MAX_ARRAY_INDEX; - }; - - // Collection Functions - // -------------------- - - // The cornerstone, an `each` implementation, aka `forEach`. - // Handles raw objects in addition to array-likes. Treats all - // sparse array-likes as if they were dense. - _.each = _.forEach = function(obj, iteratee, context) { - iteratee = optimizeCb(iteratee, context); - var i, length; - if (isArrayLike(obj)) { - for (i = 0, length = obj.length; i < length; i++) { - iteratee(obj[i], i, obj); - } - } else { - var keys = _.keys(obj); - for (i = 0, length = keys.length; i < length; i++) { - iteratee(obj[keys[i]], keys[i], obj); - } - } - return obj; - }; - - // Return the results of applying the iteratee to each element. - _.map = _.collect = function(obj, iteratee, context) { - iteratee = cb(iteratee, context); - var keys = !isArrayLike(obj) && _.keys(obj), - length = (keys || obj).length, - results = Array(length); - for (var index = 0; index < length; index++) { - var currentKey = keys ? keys[index] : index; - results[index] = iteratee(obj[currentKey], currentKey, obj); - } - return results; - }; - - // Create a reducing function iterating left or right. - function createReduce(dir) { - // Optimized iterator function as using arguments.length - // in the main function will deoptimize the, see #1991. - function iterator(obj, iteratee, memo, keys, index, length) { - for (; index >= 0 && index < length; index += dir) { - var currentKey = keys ? keys[index] : index; - memo = iteratee(memo, obj[currentKey], currentKey, obj); - } - return memo; - } - - return function(obj, iteratee, memo, context) { - iteratee = optimizeCb(iteratee, context, 4); - var keys = !isArrayLike(obj) && _.keys(obj), - length = (keys || obj).length, - index = dir > 0 ? 0 : length - 1; - // Determine the initial value if none is provided. - if (arguments.length < 3) { - memo = obj[keys ? keys[index] : index]; - index += dir; - } - return iterator(obj, iteratee, memo, keys, index, length); - }; - } - - // **Reduce** builds up a single result from a list of values, aka `inject`, - // or `foldl`. - _.reduce = _.foldl = _.inject = createReduce(1); - - // The right-associative version of reduce, also known as `foldr`. - _.reduceRight = _.foldr = createReduce(-1); - - // Return the first value which passes a truth test. Aliased as `detect`. - _.find = _.detect = function(obj, predicate, context) { - var key; - if (isArrayLike(obj)) { - key = _.findIndex(obj, predicate, context); - } else { - key = _.findKey(obj, predicate, context); - } - if (key !== void 0 && key !== -1) return obj[key]; - }; - - // Return all the elements that pass a truth test. - // Aliased as `select`. - _.filter = _.select = function(obj, predicate, context) { - var results = []; - predicate = cb(predicate, context); - _.each(obj, function(value, index, list) { - if (predicate(value, index, list)) results.push(value); - }); - return results; - }; - - // Return all the elements for which a truth test fails. - _.reject = function(obj, predicate, context) { - return _.filter(obj, _.negate(cb(predicate)), context); - }; - - // Determine whether all of the elements match a truth test. - // Aliased as `all`. - _.every = _.all = function(obj, predicate, context) { - predicate = cb(predicate, context); - var keys = !isArrayLike(obj) && _.keys(obj), - length = (keys || obj).length; - for (var index = 0; index < length; index++) { - var currentKey = keys ? keys[index] : index; - if (!predicate(obj[currentKey], currentKey, obj)) return false; - } - return true; - }; - - // Determine if at least one element in the object matches a truth test. - // Aliased as `any`. - _.some = _.any = function(obj, predicate, context) { - predicate = cb(predicate, context); - var keys = !isArrayLike(obj) && _.keys(obj), - length = (keys || obj).length; - for (var index = 0; index < length; index++) { - var currentKey = keys ? keys[index] : index; - if (predicate(obj[currentKey], currentKey, obj)) return true; - } - return false; - }; - - // Determine if the array or object contains a given value (using `===`). - // Aliased as `includes` and `include`. - _.contains = _.includes = _.include = function(obj, target, fromIndex) { - if (!isArrayLike(obj)) obj = _.values(obj); - return _.indexOf(obj, target, typeof fromIndex == 'number' && fromIndex) >= 0; - }; - - // Invoke a method (with arguments) on every item in a collection. - _.invoke = function(obj, method) { - var args = slice.call(arguments, 2); - var isFunc = _.isFunction(method); - return _.map(obj, function(value) { - var func = isFunc ? method : value[method]; - return func == null ? func : func.apply(value, args); - }); - }; - - // Convenience version of a common use case of `map`: fetching a property. - _.pluck = function(obj, key) { - return _.map(obj, _.property(key)); - }; - - // Convenience version of a common use case of `filter`: selecting only objects - // containing specific `key:value` pairs. - _.where = function(obj, attrs) { - return _.filter(obj, _.matcher(attrs)); - }; - - // Convenience version of a common use case of `find`: getting the first object - // containing specific `key:value` pairs. - _.findWhere = function(obj, attrs) { - return _.find(obj, _.matcher(attrs)); - }; - - // Return the maximum element (or element-based computation). - _.max = function(obj, iteratee, context) { - var result = -Infinity, lastComputed = -Infinity, - value, computed; - if (iteratee == null && obj != null) { - obj = isArrayLike(obj) ? obj : _.values(obj); - for (var i = 0, length = obj.length; i < length; i++) { - value = obj[i]; - if (value > result) { - result = value; - } - } - } else { - iteratee = cb(iteratee, context); - _.each(obj, function(value, index, list) { - computed = iteratee(value, index, list); - if (computed > lastComputed || computed === -Infinity && result === -Infinity) { - result = value; - lastComputed = computed; - } - }); - } - return result; - }; - - // Return the minimum element (or element-based computation). - _.min = function(obj, iteratee, context) { - var result = Infinity, lastComputed = Infinity, - value, computed; - if (iteratee == null && obj != null) { - obj = isArrayLike(obj) ? obj : _.values(obj); - for (var i = 0, length = obj.length; i < length; i++) { - value = obj[i]; - if (value < result) { - result = value; - } - } - } else { - iteratee = cb(iteratee, context); - _.each(obj, function(value, index, list) { - computed = iteratee(value, index, list); - if (computed < lastComputed || computed === Infinity && result === Infinity) { - result = value; - lastComputed = computed; - } - }); - } - return result; - }; - - // Shuffle a collection, using the modern version of the - // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle). - _.shuffle = function(obj) { - var set = isArrayLike(obj) ? obj : _.values(obj); - var length = set.length; - var shuffled = Array(length); - for (var index = 0, rand; index < length; index++) { - rand = _.random(0, index); - if (rand !== index) shuffled[index] = shuffled[rand]; - shuffled[rand] = set[index]; - } - return shuffled; - }; - - // Sample **n** random values from a collection. - // If **n** is not specified, returns a single random element. - // The internal `guard` argument allows it to work with `map`. - _.sample = function(obj, n, guard) { - if (n == null || guard) { - if (!isArrayLike(obj)) obj = _.values(obj); - return obj[_.random(obj.length - 1)]; - } - return _.shuffle(obj).slice(0, Math.max(0, n)); - }; - - // Sort the object's values by a criterion produced by an iteratee. - _.sortBy = function(obj, iteratee, context) { - iteratee = cb(iteratee, context); - return _.pluck(_.map(obj, function(value, index, list) { - return { - value: value, - index: index, - criteria: iteratee(value, index, list) - }; - }).sort(function(left, right) { - var a = left.criteria; - var b = right.criteria; - if (a !== b) { - if (a > b || a === void 0) return 1; - if (a < b || b === void 0) return -1; - } - return left.index - right.index; - }), 'value'); - }; - - // An internal function used for aggregate "group by" operations. - var group = function(behavior) { - return function(obj, iteratee, context) { - var result = {}; - iteratee = cb(iteratee, context); - _.each(obj, function(value, index) { - var key = iteratee(value, index, obj); - behavior(result, value, key); - }); - return result; - }; - }; - - // Groups the object's values by a criterion. Pass either a string attribute - // to group by, or a function that returns the criterion. - _.groupBy = group(function(result, value, key) { - if (_.has(result, key)) result[key].push(value); else result[key] = [value]; - }); - - // Indexes the object's values by a criterion, similar to `groupBy`, but for - // when you know that your index values will be unique. - _.indexBy = group(function(result, value, key) { - result[key] = value; - }); - - // Counts instances of an object that group by a certain criterion. Pass - // either a string attribute to count by, or a function that returns the - // criterion. - _.countBy = group(function(result, value, key) { - if (_.has(result, key)) result[key]++; else result[key] = 1; - }); - - // Safely create a real, live array from anything iterable. - _.toArray = function(obj) { - if (!obj) return []; - if (_.isArray(obj)) return slice.call(obj); - if (isArrayLike(obj)) return _.map(obj, _.identity); - return _.values(obj); - }; - - // Return the number of elements in an object. - _.size = function(obj) { - if (obj == null) return 0; - return isArrayLike(obj) ? obj.length : _.keys(obj).length; - }; - - // Split a collection into two arrays: one whose elements all satisfy the given - // predicate, and one whose elements all do not satisfy the predicate. - _.partition = function(obj, predicate, context) { - predicate = cb(predicate, context); - var pass = [], fail = []; - _.each(obj, function(value, key, obj) { - (predicate(value, key, obj) ? pass : fail).push(value); - }); - return [pass, fail]; - }; - - // Array Functions - // --------------- - - // Get the first element of an array. Passing **n** will return the first N - // values in the array. Aliased as `head` and `take`. The **guard** check - // allows it to work with `_.map`. - _.first = _.head = _.take = function(array, n, guard) { - if (array == null) return void 0; - if (n == null || guard) return array[0]; - return _.initial(array, array.length - n); - }; - - // Returns everything but the last entry of the array. Especially useful on - // the arguments object. Passing **n** will return all the values in - // the array, excluding the last N. - _.initial = function(array, n, guard) { - return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); - }; - - // Get the last element of an array. Passing **n** will return the last N - // values in the array. - _.last = function(array, n, guard) { - if (array == null) return void 0; - if (n == null || guard) return array[array.length - 1]; - return _.rest(array, Math.max(0, array.length - n)); - }; - - // Returns everything but the first entry of the array. Aliased as `tail` and `drop`. - // Especially useful on the arguments object. Passing an **n** will return - // the rest N values in the array. - _.rest = _.tail = _.drop = function(array, n, guard) { - return slice.call(array, n == null || guard ? 1 : n); - }; - - // Trim out all falsy values from an array. - _.compact = function(array) { - return _.filter(array, _.identity); - }; - - // Internal implementation of a recursive `flatten` function. - var flatten = function(input, shallow, strict, startIndex) { - var output = [], idx = 0; - for (var i = startIndex || 0, length = input && input.length; i < length; i++) { - var value = input[i]; - if (isArrayLike(value) && (_.isArray(value) || _.isArguments(value))) { - //flatten current level of array or arguments object - if (!shallow) value = flatten(value, shallow, strict); - var j = 0, len = value.length; - output.length += len; - while (j < len) { - output[idx++] = value[j++]; - } - } else if (!strict) { - output[idx++] = value; - } - } - return output; - }; - - // Flatten out an array, either recursively (by default), or just one level. - _.flatten = function(array, shallow) { - return flatten(array, shallow, false); - }; - - // Return a version of the array that does not contain the specified value(s). - _.without = function(array) { - return _.difference(array, slice.call(arguments, 1)); - }; - - // Produce a duplicate-free version of the array. If the array has already - // been sorted, you have the option of using a faster algorithm. - // Aliased as `unique`. - _.uniq = _.unique = function(array, isSorted, iteratee, context) { - if (array == null) return []; - if (!_.isBoolean(isSorted)) { - context = iteratee; - iteratee = isSorted; - isSorted = false; - } - if (iteratee != null) iteratee = cb(iteratee, context); - var result = []; - var seen = []; - for (var i = 0, length = array.length; i < length; i++) { - var value = array[i], - computed = iteratee ? iteratee(value, i, array) : value; - if (isSorted) { - if (!i || seen !== computed) result.push(value); - seen = computed; - } else if (iteratee) { - if (!_.contains(seen, computed)) { - seen.push(computed); - result.push(value); - } - } else if (!_.contains(result, value)) { - result.push(value); - } - } - return result; - }; - - // Produce an array that contains the union: each distinct element from all of - // the passed-in arrays. - _.union = function() { - return _.uniq(flatten(arguments, true, true)); - }; - - // Produce an array that contains every item shared between all the - // passed-in arrays. - _.intersection = function(array) { - if (array == null) return []; - var result = []; - var argsLength = arguments.length; - for (var i = 0, length = array.length; i < length; i++) { - var item = array[i]; - if (_.contains(result, item)) continue; - for (var j = 1; j < argsLength; j++) { - if (!_.contains(arguments[j], item)) break; - } - if (j === argsLength) result.push(item); - } - return result; - }; - - // Take the difference between one array and a number of other arrays. - // Only the elements present in just the first array will remain. - _.difference = function(array) { - var rest = flatten(arguments, true, true, 1); - return _.filter(array, function(value){ - return !_.contains(rest, value); - }); - }; - - // Zip together multiple lists into a single array -- elements that share - // an index go together. - _.zip = function() { - return _.unzip(arguments); - }; - - // Complement of _.zip. Unzip accepts an array of arrays and groups - // each array's elements on shared indices - _.unzip = function(array) { - var length = array && _.max(array, 'length').length || 0; - var result = Array(length); - - for (var index = 0; index < length; index++) { - result[index] = _.pluck(array, index); - } - return result; - }; - - // Converts lists into objects. Pass either a single array of `[key, value]` - // pairs, or two parallel arrays of the same length -- one of keys, and one of - // the corresponding values. - _.object = function(list, values) { - var result = {}; - for (var i = 0, length = list && list.length; i < length; i++) { - if (values) { - result[list[i]] = values[i]; - } else { - result[list[i][0]] = list[i][1]; - } - } - return result; - }; - - // Return the position of the first occurrence of an item in an array, - // or -1 if the item is not included in the array. - // If the array is large and already in sort order, pass `true` - // for **isSorted** to use binary search. - _.indexOf = function(array, item, isSorted) { - var i = 0, length = array && array.length; - if (typeof isSorted == 'number') { - i = isSorted < 0 ? Math.max(0, length + isSorted) : isSorted; - } else if (isSorted && length) { - i = _.sortedIndex(array, item); - return array[i] === item ? i : -1; - } - if (item !== item) { - return _.findIndex(slice.call(array, i), _.isNaN); - } - for (; i < length; i++) if (array[i] === item) return i; - return -1; - }; - - _.lastIndexOf = function(array, item, from) { - var idx = array ? array.length : 0; - if (typeof from == 'number') { - idx = from < 0 ? idx + from + 1 : Math.min(idx, from + 1); - } - if (item !== item) { - return _.findLastIndex(slice.call(array, 0, idx), _.isNaN); - } - while (--idx >= 0) if (array[idx] === item) return idx; - return -1; - }; - - // Generator function to create the findIndex and findLastIndex functions - function createIndexFinder(dir) { - return function(array, predicate, context) { - predicate = cb(predicate, context); - var length = array != null && array.length; - var index = dir > 0 ? 0 : length - 1; - for (; index >= 0 && index < length; index += dir) { - if (predicate(array[index], index, array)) return index; - } - return -1; - }; - } - - // Returns the first index on an array-like that passes a predicate test - _.findIndex = createIndexFinder(1); - - _.findLastIndex = createIndexFinder(-1); - - // Use a comparator function to figure out the smallest index at which - // an object should be inserted so as to maintain order. Uses binary search. - _.sortedIndex = function(array, obj, iteratee, context) { - iteratee = cb(iteratee, context, 1); - var value = iteratee(obj); - var low = 0, high = array.length; - while (low < high) { - var mid = Math.floor((low + high) / 2); - if (iteratee(array[mid]) < value) low = mid + 1; else high = mid; - } - return low; - }; - - // Generate an integer Array containing an arithmetic progression. A port of - // the native Python `range()` function. See - // [the Python documentation](http://docs.python.org/library/functions.html#range). - _.range = function(start, stop, step) { - if (arguments.length <= 1) { - stop = start || 0; - start = 0; - } - step = step || 1; - - var length = Math.max(Math.ceil((stop - start) / step), 0); - var range = Array(length); - - for (var idx = 0; idx < length; idx++, start += step) { - range[idx] = start; - } - - return range; - }; - - // Function (ahem) Functions - // ------------------ - - // Determines whether to execute a function as a constructor - // or a normal function with the provided arguments - var executeBound = function(sourceFunc, boundFunc, context, callingContext, args) { - if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args); - var self = baseCreate(sourceFunc.prototype); - var result = sourceFunc.apply(self, args); - if (_.isObject(result)) return result; - return self; - }; - - // Create a function bound to a given object (assigning `this`, and arguments, - // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if - // available. - _.bind = function(func, context) { - if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); - if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function'); - var args = slice.call(arguments, 2); - var bound = function() { - return executeBound(func, bound, context, this, args.concat(slice.call(arguments))); - }; - return bound; - }; - - // Partially apply a function by creating a version that has had some of its - // arguments pre-filled, without changing its dynamic `this` context. _ acts - // as a placeholder, allowing any combination of arguments to be pre-filled. - _.partial = function(func) { - var boundArgs = slice.call(arguments, 1); - var bound = function() { - var position = 0, length = boundArgs.length; - var args = Array(length); - for (var i = 0; i < length; i++) { - args[i] = boundArgs[i] === _ ? arguments[position++] : boundArgs[i]; - } - while (position < arguments.length) args.push(arguments[position++]); - return executeBound(func, bound, this, this, args); - }; - return bound; - }; - - // Bind a number of an object's methods to that object. Remaining arguments - // are the method names to be bound. Useful for ensuring that all callbacks - // defined on an object belong to it. - _.bindAll = function(obj) { - var i, length = arguments.length, key; - if (length <= 1) throw new Error('bindAll must be passed function names'); - for (i = 1; i < length; i++) { - key = arguments[i]; - obj[key] = _.bind(obj[key], obj); - } - return obj; - }; - - // Memoize an expensive function by storing its results. - _.memoize = function(func, hasher) { - var memoize = function(key) { - var cache = memoize.cache; - var address = '' + (hasher ? hasher.apply(this, arguments) : key); - if (!_.has(cache, address)) cache[address] = func.apply(this, arguments); - return cache[address]; - }; - memoize.cache = {}; - return memoize; - }; - - // Delays a function for the given number of milliseconds, and then calls - // it with the arguments supplied. - _.delay = function(func, wait) { - var args = slice.call(arguments, 2); - return setTimeout(function(){ - return func.apply(null, args); - }, wait); - }; - - // Defers a function, scheduling it to run after the current call stack has - // cleared. - _.defer = _.partial(_.delay, _, 1); - - // Returns a function, that, when invoked, will only be triggered at most once - // during a given window of time. Normally, the throttled function will run - // as much as it can, without ever going more than once per `wait` duration; - // but if you'd like to disable the execution on the leading edge, pass - // `{leading: false}`. To disable execution on the trailing edge, ditto. - _.throttle = function(func, wait, options) { - var context, args, result; - var timeout = null; - var previous = 0; - if (!options) options = {}; - var later = function() { - previous = options.leading === false ? 0 : _.now(); - timeout = null; - result = func.apply(context, args); - if (!timeout) context = args = null; - }; - return function() { - var now = _.now(); - if (!previous && options.leading === false) previous = now; - var remaining = wait - (now - previous); - context = this; - args = arguments; - if (remaining <= 0 || remaining > wait) { - if (timeout) { - clearTimeout(timeout); - timeout = null; - } - previous = now; - result = func.apply(context, args); - if (!timeout) context = args = null; - } else if (!timeout && options.trailing !== false) { - timeout = setTimeout(later, remaining); - } - return result; - }; - }; - - // Returns a function, that, as long as it continues to be invoked, will not - // be triggered. The function will be called after it stops being called for - // N milliseconds. If `immediate` is passed, trigger the function on the - // leading edge, instead of the trailing. - _.debounce = function(func, wait, immediate) { - var timeout, args, context, timestamp, result; - - var later = function() { - var last = _.now() - timestamp; - - if (last < wait && last >= 0) { - timeout = setTimeout(later, wait - last); - } else { - timeout = null; - if (!immediate) { - result = func.apply(context, args); - if (!timeout) context = args = null; - } - } - }; - - return function() { - context = this; - args = arguments; - timestamp = _.now(); - var callNow = immediate && !timeout; - if (!timeout) timeout = setTimeout(later, wait); - if (callNow) { - result = func.apply(context, args); - context = args = null; - } - - return result; - }; - }; - - // Returns the first function passed as an argument to the second, - // allowing you to adjust arguments, run code before and after, and - // conditionally execute the original function. - _.wrap = function(func, wrapper) { - return _.partial(wrapper, func); - }; - - // Returns a negated version of the passed-in predicate. - _.negate = function(predicate) { - return function() { - return !predicate.apply(this, arguments); - }; - }; - - // Returns a function that is the composition of a list of functions, each - // consuming the return value of the function that follows. - _.compose = function() { - var args = arguments; - var start = args.length - 1; - return function() { - var i = start; - var result = args[start].apply(this, arguments); - while (i--) result = args[i].call(this, result); - return result; - }; - }; - - // Returns a function that will only be executed on and after the Nth call. - _.after = function(times, func) { - return function() { - if (--times < 1) { - return func.apply(this, arguments); - } - }; - }; - - // Returns a function that will only be executed up to (but not including) the Nth call. - _.before = function(times, func) { - var memo; - return function() { - if (--times > 0) { - memo = func.apply(this, arguments); - } - if (times <= 1) func = null; - return memo; - }; - }; - - // Returns a function that will be executed at most one time, no matter how - // often you call it. Useful for lazy initialization. - _.once = _.partial(_.before, 2); - - // Object Functions - // ---------------- - - // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed. - var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString'); - var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString', - 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString']; - - function collectNonEnumProps(obj, keys) { - var nonEnumIdx = nonEnumerableProps.length; - var constructor = obj.constructor; - var proto = (_.isFunction(constructor) && constructor.prototype) || ObjProto; - - // Constructor is a special case. - var prop = 'constructor'; - if (_.has(obj, prop) && !_.contains(keys, prop)) keys.push(prop); - - while (nonEnumIdx--) { - prop = nonEnumerableProps[nonEnumIdx]; - if (prop in obj && obj[prop] !== proto[prop] && !_.contains(keys, prop)) { - keys.push(prop); - } - } - } - - // Retrieve the names of an object's own properties. - // Delegates to **ECMAScript 5**'s native `Object.keys` - _.keys = function(obj) { - if (!_.isObject(obj)) return []; - if (nativeKeys) return nativeKeys(obj); - var keys = []; - for (var key in obj) if (_.has(obj, key)) keys.push(key); - // Ahem, IE < 9. - if (hasEnumBug) collectNonEnumProps(obj, keys); - return keys; - }; - - // Retrieve all the property names of an object. - _.allKeys = function(obj) { - if (!_.isObject(obj)) return []; - var keys = []; - for (var key in obj) keys.push(key); - // Ahem, IE < 9. - if (hasEnumBug) collectNonEnumProps(obj, keys); - return keys; - }; - - // Retrieve the values of an object's properties. - _.values = function(obj) { - var keys = _.keys(obj); - var length = keys.length; - var values = Array(length); - for (var i = 0; i < length; i++) { - values[i] = obj[keys[i]]; - } - return values; - }; - - // Returns the results of applying the iteratee to each element of the object - // In contrast to _.map it returns an object - _.mapObject = function(obj, iteratee, context) { - iteratee = cb(iteratee, context); - var keys = _.keys(obj), - length = keys.length, - results = {}, - currentKey; - for (var index = 0; index < length; index++) { - currentKey = keys[index]; - results[currentKey] = iteratee(obj[currentKey], currentKey, obj); - } - return results; - }; - - // Convert an object into a list of `[key, value]` pairs. - _.pairs = function(obj) { - var keys = _.keys(obj); - var length = keys.length; - var pairs = Array(length); - for (var i = 0; i < length; i++) { - pairs[i] = [keys[i], obj[keys[i]]]; - } - return pairs; - }; - - // Invert the keys and values of an object. The values must be serializable. - _.invert = function(obj) { - var result = {}; - var keys = _.keys(obj); - for (var i = 0, length = keys.length; i < length; i++) { - result[obj[keys[i]]] = keys[i]; - } - return result; - }; - - // Return a sorted list of the function names available on the object. - // Aliased as `methods` - _.functions = _.methods = function(obj) { - var names = []; - for (var key in obj) { - if (_.isFunction(obj[key])) names.push(key); - } - return names.sort(); - }; - - // Extend a given object with all the properties in passed-in object(s). - _.extend = createAssigner(_.allKeys); - - // Assigns a given object with all the own properties in the passed-in object(s) - // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) - _.extendOwn = _.assign = createAssigner(_.keys); - - // Returns the first key on an object that passes a predicate test - _.findKey = function(obj, predicate, context) { - predicate = cb(predicate, context); - var keys = _.keys(obj), key; - for (var i = 0, length = keys.length; i < length; i++) { - key = keys[i]; - if (predicate(obj[key], key, obj)) return key; - } - }; - - // Return a copy of the object only containing the whitelisted properties. - _.pick = function(object, oiteratee, context) { - var result = {}, obj = object, iteratee, keys; - if (obj == null) return result; - if (_.isFunction(oiteratee)) { - keys = _.allKeys(obj); - iteratee = optimizeCb(oiteratee, context); - } else { - keys = flatten(arguments, false, false, 1); - iteratee = function(value, key, obj) { return key in obj; }; - obj = Object(obj); - } - for (var i = 0, length = keys.length; i < length; i++) { - var key = keys[i]; - var value = obj[key]; - if (iteratee(value, key, obj)) result[key] = value; - } - return result; - }; - - // Return a copy of the object without the blacklisted properties. - _.omit = function(obj, iteratee, context) { - if (_.isFunction(iteratee)) { - iteratee = _.negate(iteratee); - } else { - var keys = _.map(flatten(arguments, false, false, 1), String); - iteratee = function(value, key) { - return !_.contains(keys, key); - }; - } - return _.pick(obj, iteratee, context); - }; - - // Fill in a given object with default properties. - _.defaults = createAssigner(_.allKeys, true); - - // Create a (shallow-cloned) duplicate of an object. - _.clone = function(obj) { - if (!_.isObject(obj)) return obj; - return _.isArray(obj) ? obj.slice() : _.extend({}, obj); - }; - - // Invokes interceptor with the obj, and then returns obj. - // The primary purpose of this method is to "tap into" a method chain, in - // order to perform operations on intermediate results within the chain. - _.tap = function(obj, interceptor) { - interceptor(obj); - return obj; - }; - - // Returns whether an object has a given set of `key:value` pairs. - _.isMatch = function(object, attrs) { - var keys = _.keys(attrs), length = keys.length; - if (object == null) return !length; - var obj = Object(object); - for (var i = 0; i < length; i++) { - var key = keys[i]; - if (attrs[key] !== obj[key] || !(key in obj)) return false; - } - return true; - }; - - - // Internal recursive comparison function for `isEqual`. - var eq = function(a, b, aStack, bStack) { - // Identical objects are equal. `0 === -0`, but they aren't identical. - // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). - if (a === b) return a !== 0 || 1 / a === 1 / b; - // A strict comparison is necessary because `null == undefined`. - if (a == null || b == null) return a === b; - // Unwrap any wrapped objects. - if (a instanceof _) a = a._wrapped; - if (b instanceof _) b = b._wrapped; - // Compare `[[Class]]` names. - var className = toString.call(a); - if (className !== toString.call(b)) return false; - switch (className) { - // Strings, numbers, regular expressions, dates, and booleans are compared by value. - case '[object RegExp]': - // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') - case '[object String]': - // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is - // equivalent to `new String("5")`. - return '' + a === '' + b; - case '[object Number]': - // `NaN`s are equivalent, but non-reflexive. - // Object(NaN) is equivalent to NaN - if (+a !== +a) return +b !== +b; - // An `egal` comparison is performed for other numeric values. - return +a === 0 ? 1 / +a === 1 / b : +a === +b; - case '[object Date]': - case '[object Boolean]': - // Coerce dates and booleans to numeric primitive values. Dates are compared by their - // millisecond representations. Note that invalid dates with millisecond representations - // of `NaN` are not equivalent. - return +a === +b; - } - - var areArrays = className === '[object Array]'; - if (!areArrays) { - if (typeof a != 'object' || typeof b != 'object') return false; - - // Objects with different constructors are not equivalent, but `Object`s or `Array`s - // from different frames are. - var aCtor = a.constructor, bCtor = b.constructor; - if (aCtor !== bCtor && !(_.isFunction(aCtor) && aCtor instanceof aCtor && - _.isFunction(bCtor) && bCtor instanceof bCtor) - && ('constructor' in a && 'constructor' in b)) { - return false; - } - } - // Assume equality for cyclic structures. The algorithm for detecting cyclic - // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. - - // Initializing stack of traversed objects. - // It's done here since we only need them for objects and arrays comparison. - aStack = aStack || []; - bStack = bStack || []; - var length = aStack.length; - while (length--) { - // Linear search. Performance is inversely proportional to the number of - // unique nested structures. - if (aStack[length] === a) return bStack[length] === b; - } - - // Add the first object to the stack of traversed objects. - aStack.push(a); - bStack.push(b); - - // Recursively compare objects and arrays. - if (areArrays) { - // Compare array lengths to determine if a deep comparison is necessary. - length = a.length; - if (length !== b.length) return false; - // Deep compare the contents, ignoring non-numeric properties. - while (length--) { - if (!eq(a[length], b[length], aStack, bStack)) return false; - } - } else { - // Deep compare objects. - var keys = _.keys(a), key; - length = keys.length; - // Ensure that both objects contain the same number of properties before comparing deep equality. - if (_.keys(b).length !== length) return false; - while (length--) { - // Deep compare each member - key = keys[length]; - if (!(_.has(b, key) && eq(a[key], b[key], aStack, bStack))) return false; - } - } - // Remove the first object from the stack of traversed objects. - aStack.pop(); - bStack.pop(); - return true; - }; - - // Perform a deep comparison to check if two objects are equal. - _.isEqual = function(a, b) { - return eq(a, b); - }; - - // Is a given array, string, or object empty? - // An "empty" object has no enumerable own-properties. - _.isEmpty = function(obj) { - if (obj == null) return true; - if (isArrayLike(obj) && (_.isArray(obj) || _.isString(obj) || _.isArguments(obj))) return obj.length === 0; - return _.keys(obj).length === 0; - }; - - // Is a given value a DOM element? - _.isElement = function(obj) { - return !!(obj && obj.nodeType === 1); - }; - - // Is a given value an array? - // Delegates to ECMA5's native Array.isArray - _.isArray = nativeIsArray || function(obj) { - return toString.call(obj) === '[object Array]'; - }; - - // Is a given variable an object? - _.isObject = function(obj) { - var type = typeof obj; - return type === 'function' || type === 'object' && !!obj; - }; - - // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError. - _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error'], function(name) { - _['is' + name] = function(obj) { - return toString.call(obj) === '[object ' + name + ']'; - }; - }); - - // Define a fallback version of the method in browsers (ahem, IE < 9), where - // there isn't any inspectable "Arguments" type. - if (!_.isArguments(arguments)) { - _.isArguments = function(obj) { - return _.has(obj, 'callee'); - }; - } - - // Optimize `isFunction` if appropriate. Work around some typeof bugs in old v8, - // IE 11 (#1621), and in Safari 8 (#1929). - if (typeof /./ != 'function' && typeof Int8Array != 'object') { - _.isFunction = function(obj) { - return typeof obj == 'function' || false; - }; - } - - // Is a given object a finite number? - _.isFinite = function(obj) { - return isFinite(obj) && !isNaN(parseFloat(obj)); - }; - - // Is the given value `NaN`? (NaN is the only number which does not equal itself). - _.isNaN = function(obj) { - return _.isNumber(obj) && obj !== +obj; - }; - - // Is a given value a boolean? - _.isBoolean = function(obj) { - return obj === true || obj === false || toString.call(obj) === '[object Boolean]'; - }; - - // Is a given value equal to null? - _.isNull = function(obj) { - return obj === null; - }; - - // Is a given variable undefined? - _.isUndefined = function(obj) { - return obj === void 0; - }; - - // Shortcut function for checking if an object has a given property directly - // on itself (in other words, not on a prototype). - _.has = function(obj, key) { - return obj != null && hasOwnProperty.call(obj, key); - }; - - // Utility Functions - // ----------------- - - // Run Underscore.js in *noConflict* mode, returning the `_` variable to its - // previous owner. Returns a reference to the Underscore object. - _.noConflict = function() { - root._ = previousUnderscore; - return this; - }; - - // Keep the identity function around for default iteratees. - _.identity = function(value) { - return value; - }; - - // Predicate-generating functions. Often useful outside of Underscore. - _.constant = function(value) { - return function() { - return value; - }; - }; - - _.noop = function(){}; - - _.property = function(key) { - return function(obj) { - return obj == null ? void 0 : obj[key]; - }; - }; - - // Generates a function for a given object that returns a given property. - _.propertyOf = function(obj) { - return obj == null ? function(){} : function(key) { - return obj[key]; - }; - }; - - // Returns a predicate for checking whether an object has a given set of - // `key:value` pairs. - _.matcher = _.matches = function(attrs) { - attrs = _.extendOwn({}, attrs); - return function(obj) { - return _.isMatch(obj, attrs); - }; - }; - - // Run a function **n** times. - _.times = function(n, iteratee, context) { - var accum = Array(Math.max(0, n)); - iteratee = optimizeCb(iteratee, context, 1); - for (var i = 0; i < n; i++) accum[i] = iteratee(i); - return accum; - }; - - // Return a random integer between min and max (inclusive). - _.random = function(min, max) { - if (max == null) { - max = min; - min = 0; - } - return min + Math.floor(Math.random() * (max - min + 1)); - }; - - // A (possibly faster) way to get the current timestamp as an integer. - _.now = Date.now || function() { - return new Date().getTime(); - }; - - // List of HTML entities for escaping. - var escapeMap = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '`': '`' - }; - var unescapeMap = _.invert(escapeMap); - - // Functions for escaping and unescaping strings to/from HTML interpolation. - var createEscaper = function(map) { - var escaper = function(match) { - return map[match]; - }; - // Regexes for identifying a key that needs to be escaped - var source = '(?:' + _.keys(map).join('|') + ')'; - var testRegexp = RegExp(source); - var replaceRegexp = RegExp(source, 'g'); - return function(string) { - string = string == null ? '' : '' + string; - return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; - }; - }; - _.escape = createEscaper(escapeMap); - _.unescape = createEscaper(unescapeMap); - - // If the value of the named `property` is a function then invoke it with the - // `object` as context; otherwise, return it. - _.result = function(object, property, fallback) { - var value = object == null ? void 0 : object[property]; - if (value === void 0) { - value = fallback; - } - return _.isFunction(value) ? value.call(object) : value; - }; - - // Generate a unique integer id (unique within the entire client session). - // Useful for temporary DOM ids. - var idCounter = 0; - _.uniqueId = function(prefix) { - var id = ++idCounter + ''; - return prefix ? prefix + id : id; - }; - - // By default, Underscore uses ERB-style template delimiters, change the - // following template settings to use alternative delimiters. - _.templateSettings = { - evaluate : /<%([\s\S]+?)%>/g, - interpolate : /<%=([\s\S]+?)%>/g, - escape : /<%-([\s\S]+?)%>/g - }; - - // When customizing `templateSettings`, if you don't want to define an - // interpolation, evaluation or escaping regex, we need one that is - // guaranteed not to match. - var noMatch = /(.)^/; - - // Certain characters need to be escaped so that they can be put into a - // string literal. - var escapes = { - "'": "'", - '\\': '\\', - '\r': 'r', - '\n': 'n', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; - - var escaper = /\\|'|\r|\n|\u2028|\u2029/g; - - var escapeChar = function(match) { - return '\\' + escapes[match]; - }; - - // JavaScript micro-templating, similar to John Resig's implementation. - // Underscore templating handles arbitrary delimiters, preserves whitespace, - // and correctly escapes quotes within interpolated code. - // NB: `oldSettings` only exists for backwards compatibility. - _.template = function(text, settings, oldSettings) { - if (!settings && oldSettings) settings = oldSettings; - settings = _.defaults({}, settings, _.templateSettings); - - // Combine delimiters into one regular expression via alternation. - var matcher = RegExp([ - (settings.escape || noMatch).source, - (settings.interpolate || noMatch).source, - (settings.evaluate || noMatch).source - ].join('|') + '|$', 'g'); - - // Compile the template source, escaping string literals appropriately. - var index = 0; - var source = "__p+='"; - text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { - source += text.slice(index, offset).replace(escaper, escapeChar); - index = offset + match.length; - - if (escape) { - source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; - } else if (interpolate) { - source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; - } else if (evaluate) { - source += "';\n" + evaluate + "\n__p+='"; - } - - // Adobe VMs need the match returned to produce the correct offest. - return match; - }); - source += "';\n"; - - // If a variable is not specified, place data values in local scope. - if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; - - source = "var __t,__p='',__j=Array.prototype.join," + - "print=function(){__p+=__j.call(arguments,'');};\n" + - source + 'return __p;\n'; - - try { - var render = new Function(settings.variable || 'obj', '_', source); - } catch (e) { - e.source = source; - throw e; - } - - var template = function(data) { - return render.call(this, data, _); - }; - - // Provide the compiled source as a convenience for precompilation. - var argument = settings.variable || 'obj'; - template.source = 'function(' + argument + '){\n' + source + '}'; - - return template; - }; - - // Add a "chain" function. Start chaining a wrapped Underscore object. - _.chain = function(obj) { - var instance = _(obj); - instance._chain = true; - return instance; - }; - - // OOP - // --------------- - // If Underscore is called as a function, it returns a wrapped object that - // can be used OO-style. This wrapper holds altered versions of all the - // underscore functions. Wrapped objects may be chained. - - // Helper function to continue chaining intermediate results. - var result = function(instance, obj) { - return instance._chain ? _(obj).chain() : obj; - }; - - // Add your own custom functions to the Underscore object. - _.mixin = function(obj) { - _.each(_.functions(obj), function(name) { - var func = _[name] = obj[name]; - _.prototype[name] = function() { - var args = [this._wrapped]; - push.apply(args, arguments); - return result(this, func.apply(_, args)); - }; - }); - }; - - // Add all of the Underscore functions to the wrapper object. - _.mixin(_); - - // Add all mutator Array functions to the wrapper. - _.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - var obj = this._wrapped; - method.apply(obj, arguments); - if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0]; - return result(this, obj); - }; - }); - - // Add all accessor Array functions to the wrapper. - _.each(['concat', 'join', 'slice'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - return result(this, method.apply(this._wrapped, arguments)); - }; - }); - - // Extracts the result from a wrapped and chained object. - _.prototype.value = function() { - return this._wrapped; - }; - - // Provide unwrapping proxy for some methods used in engine operations - // such as arithmetic and JSON stringification. - _.prototype.valueOf = _.prototype.toJSON = _.prototype.value; - - _.prototype.toString = function() { - return '' + this._wrapped; - }; - - // AMD registration happens at the end for compatibility with AMD loaders - // that may not enforce next-turn semantics on modules. Even though general - // practice for AMD registration is to be anonymous, underscore registers - // as a named module because, like jQuery, it is a base library that is - // popular enough to be bundled in a third party lib, but not be part of - // an AMD load request. Those cases could generate an error when an - // anonymous define() is called outside of a loader request. - if (typeof define === 'function' && define.amd) { - define('underscore', [], function() { - return _; - }); - } -}.call(this)); - -}, -{}], -3:[function(_dereq_,module,exports){ -/*! - * JSHint, by JSHint Community. - * - * This file (and this file only) is licensed under the same slightly modified - * MIT license that JSLint is. It stops evil-doers everywhere: - * - * 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 quotmark:double */ -/*global console:true */ -/*exported console */ - -var _ = _dereq_("underscore"); -var events = _dereq_("events"); -var vars = _dereq_("./vars.js"); -var messages = _dereq_("./messages.js"); -var Lexer = _dereq_("./lex.js").Lexer; -var reg = _dereq_("./reg.js"); -var state = _dereq_("./state.js").state; -var style = _dereq_("./style.js"); -var options = _dereq_("./options.js"); - -// We build the application inside a function so that we produce only a singleton -// variable. That function will be invoked immediately, and its return value is -// the JSHINT function itself. - -var JSHINT = (function() { - "use strict"; - - var api, // Extension API - - // 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 - }, - - declared, // Globals that were declared using /*global ... */ syntax. - exported, // Variables that are used outside of the current file. - - functionicity = [ - "closure", "exception", "global", "label", - "outer", "unused", "var" - ], - - funct, // The current function - functions, // All of the functions - - global, // The global scope - implied, // Implied globals - inblock, - indent, - lookahead, - lex, - member, - membersOnly, - predefined, // Global variables defined by option - - scope, // The current scope - stack, - unuseds, - urls, - - extraModules = [], - emitter = new events.EventEmitter(); - - function checkOption(name, t) { - name = name.trim(); - - if (/^[+-]W\d{3}$/g.test(name)) { - return true; - } - - if (options.validNames.indexOf(name) === -1) { - if (t.type !== "jslint" && !_.has(options.removed, name)) { - error("E001", t, name); - return false; - } - } - - return true; - } - - function isString(obj) { - return Object.prototype.toString.call(obj) === "[object String]"; - } - - function isIdentifier(tkn, value) { - if (!tkn) - return false; - - if (!tkn.identifier || tkn.value !== value) - return false; - - return true; - } - - function isReserved(token) { - if (!token.reserved) { - return false; - } - var meta = token.meta; - - if (meta && meta.isFutureReservedWord && state.option.inES5()) { - // ES3 FutureReservedWord in an ES5 environment. - if (!meta.es5) { - return false; - } - - // Some ES5 FutureReservedWord identifiers are active only - // within a strict mode environment. - if (meta.strictOnly) { - if (!state.option.strict && !state.directive["use strict"]) { - return false; - } - } - - if (token.isProperty) { - return false; - } - } - - return true; - } - - function supplant(str, data) { - return str.replace(/\{([^{}]*)\}/g, function(a, b) { - var r = data[b]; - return typeof r === "string" || typeof r === "number" ? r : a; - }); - } - - function combine(dest, src) { - Object.keys(src).forEach(function(name) { - if (_.has(JSHINT.blacklist, name)) return; - dest[name] = src[name]; - }); - } - - function processenforceall() { - if (state.option.enforceall) { - for (var enforceopt in options.bool.enforcing) { - if (state.option[enforceopt] === undefined) { - state.option[enforceopt] = true; - } - } - for (var relaxopt in options.bool.relaxing) { - if (state.option[relaxopt] === undefined) { - state.option[relaxopt] = false; - } - } - } - } - - function assume() { - processenforceall(); - - if (!state.option.es3) { - combine(predefined, vars.ecmaIdentifiers[5]); - } - - if (state.option.esnext) { - combine(predefined, vars.ecmaIdentifiers[6]); - } - - if (state.option.couch) { - combine(predefined, vars.couch); - } - - if (state.option.qunit) { - combine(predefined, vars.qunit); - } - - if (state.option.rhino) { - combine(predefined, vars.rhino); - } - - if (state.option.shelljs) { - combine(predefined, vars.shelljs); - combine(predefined, vars.node); - } - if (state.option.typed) { - combine(predefined, vars.typed); - } - - if (state.option.phantom) { - combine(predefined, vars.phantom); - } - - if (state.option.prototypejs) { - combine(predefined, vars.prototypejs); - } - - if (state.option.node) { - combine(predefined, vars.node); - combine(predefined, vars.typed); - } - - if (state.option.devel) { - combine(predefined, vars.devel); - } - - if (state.option.dojo) { - combine(predefined, vars.dojo); - } - - if (state.option.browser) { - combine(predefined, vars.browser); - combine(predefined, vars.typed); - } - - if (state.option.browserify) { - combine(predefined, vars.browser); - combine(predefined, vars.typed); - combine(predefined, vars.browserify); - } - - if (state.option.nonstandard) { - combine(predefined, vars.nonstandard); - } - - if (state.option.jasmine) { - combine(predefined, vars.jasmine); - } - - if (state.option.jquery) { - combine(predefined, vars.jquery); - } - - if (state.option.mootools) { - combine(predefined, vars.mootools); - } - - if (state.option.worker) { - combine(predefined, vars.worker); - } - - if (state.option.wsh) { - combine(predefined, vars.wsh); - } - - if (state.option.globalstrict && state.option.strict !== false) { - state.option.strict = true; - } - - if (state.option.yui) { - combine(predefined, vars.yui); - } - - if (state.option.mocha) { - combine(predefined, vars.mocha); - } - - // Let's assume that chronologically ES3 < ES5 < ES6/ESNext < Moz - - state.option.inMoz = function(strict) { - return state.option.moz; - }; - - state.option.inESNext = function(strict) { - return state.option.moz || state.option.esnext; - }; - - state.option.inES5 = function(/* strict */) { - return !state.option.es3; - }; - - state.option.inES3 = function(strict) { - if (strict) { - return !state.option.moz && !state.option.esnext && state.option.es3; - } - return state.option.es3; - }; - } - - // Produce an error warning. - function quit(code, line, chr) { - var percentage = Math.floor((line / state.lines.length) * 100); - var message = messages.errors[code].desc; - - throw { - name: "JSHintError", - line: line, - character: chr, - message: message + " (" + percentage + "% scanned).", - raw: message, - code: code - }; - } - - function isundef(scope, code, token, a) { - if (!state.ignored[code] && state.option.undef !== false) { - JSHINT.undefs.push([scope, code, token, a]); - } - } - - function removeIgnoredMessages() { - var ignored = state.ignoredLines; - - if (_.isEmpty(ignored)) return; - JSHINT.errors = _.reject(JSHINT.errors, function(err) { return ignored[err.line] }); - } - - function warning(code, t, a, b, c, d) { - var ch, l, w, msg; - - if (/^W\d{3}$/.test(code)) { - if (state.ignored[code]) - return; - - msg = messages.warnings[code]; - } else if (/E\d{3}/.test(code)) { - msg = messages.errors[code]; - } else if (/I\d{3}/.test(code)) { - msg = messages.info[code]; - } - - t = t || state.tokens.next; - if (t.id === "(end)") { // `~ - t = state.tokens.curr; - } - - l = t.line || 0; - ch = t.from || 0; - - w = { - id: "(error)", - raw: msg.desc, - code: msg.code, - evidence: state.lines[l - 1] || "", - line: l, - character: ch, - scope: JSHINT.scope, - a: a, - b: b, - c: c, - d: d - }; - - w.reason = supplant(msg.desc, w); - JSHINT.errors.push(w); - - removeIgnoredMessages(); - - if (JSHINT.errors.length >= state.option.maxerr) - quit("E043", 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) { - 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); - } - - // Tracking of "internal" scripts, like eval containing a static string - function addInternalSrc(elem, src) { - var i; - i = { - id: "(internal)", - elem: elem, - value: src - }; - JSHINT.internals.push(i); - return i; - } - - // name: string - // opts: { type: string, token: token, islet: bool } - function addlabel(name, opts) { - opts = opts || {}; - - var type = opts.type; - var token = opts.token; - var islet = opts.islet; - - // Define label in the current function in the current scope. - if (type === "exception") { - if (_.has(funct["(context)"], name)) { - if (funct[name] !== true && !state.option.node) { - warning("W002", state.tokens.next, name); - } - } - } - - if (_.has(funct, name) && !funct["(global)"]) { - if (funct[name] === true) { - if (state.option.latedef) { - if ((state.option.latedef === true && _.contains([funct[name], type], "unction")) || - !_.contains([funct[name], type], "unction")) { - warning("W003", state.tokens.next, name); - } - } - } else { - if ((!state.option.shadow || _.contains([ "inner", "outer" ], state.option.shadow)) && - type !== "exception" || funct["(blockscope)"].getlabel(name)) { - warning("W004", state.tokens.next, name); - } - } - } - - if (funct["(context)"] && _.has(funct["(context)"], name) && type !== "function") { - if (state.option.shadow === "outer") { - warning("W123", state.tokens.next, name); - } - } - - // if the identifier is from a let, adds it only to the current blockscope - if (islet) { - funct["(blockscope)"].current.add(name, type, state.tokens.curr); - if (funct["(blockscope)"].atTop() && exported[name]) { - state.tokens.curr.exported = true; - } - } else { - funct["(blockscope)"].shadow(name); - funct[name] = type; - - if (token) { - funct["(tokens)"][name] = token; - } - - setprop(funct, name, { unused: opts.unused || false }); - - if (funct["(global)"]) { - global[name] = funct; - if (_.has(implied, name)) { - if (state.option.latedef) { - if ((state.option.latedef === true && _.contains([funct[name], type], "unction")) || - !_.contains([funct[name], type], "unction")) { - warning("W003", state.tokens.next, name); - } - } - - delete implied[name]; - } - } else { - scope[name] = funct; - } - } - } - - function doOption() { - var nt = state.tokens.next; - var body = nt.body.match(/(-\s+)?[^\s,:]+(?:\s*:\s*(-\s+)?[^\s,]+)?/g) || []; - var predef = {}; - - if (nt.type === "globals") { - body.forEach(function(g) { - g = g.split(":"); - var key = (g[0] || "").trim(); - var val = (g[1] || "").trim(); - - if (key.charAt(0) === "-") { - key = key.slice(1); - val = false; - - JSHINT.blacklist[key] = key; - delete predefined[key]; - } else { - predef[key] = (val === "true"); - } - }); - - combine(predefined, predef); - - for (var key in predef) { - if (_.has(predef, key)) { - declared[key] = nt; - } - } - } - - if (nt.type === "exported") { - body.forEach(function(e) { - exported[e] = true; - }); - } - - if (nt.type === "members") { - membersOnly = membersOnly || {}; - - body.forEach(function(m) { - var ch1 = m.charAt(0); - var ch2 = m.charAt(m.length - 1); - - if (ch1 === ch2 && (ch1 === "\"" || ch1 === "'")) { - m = m - .substr(1, m.length - 2) - .replace("\\\"", "\""); - } - - membersOnly[m] = false; - }); - } - - var numvals = [ - "maxstatements", - "maxparams", - "maxdepth", - "maxcomplexity", - "maxerr", - "maxlen", - "indent" - ]; - - if (nt.type === "jshint" || nt.type === "jslint") { - body.forEach(function(g) { - g = g.split(":"); - var key = (g[0] || "").trim(); - var val = (g[1] || "").trim(); - - if (!checkOption(key, nt)) { - return; - } - - if (numvals.indexOf(key) >= 0) { - // GH988 - numeric options can be disabled by setting them to `false` - if (val !== "false") { - val = +val; - - if (typeof val !== "number" || !isFinite(val) || val <= 0 || Math.floor(val) !== val) { - error("E032", nt, g[1].trim()); - return; - } - - state.option[key] = val; - } else { - state.option[key] = key === "indent" ? 4 : false; - } - - return; - } - - if (key === "validthis") { - // `validthis` is valid only within a function scope. - - if (funct["(global)"]) - return void error("E009"); - - if (val !== "true" && val !== "false") - return void error("E002", nt); - - state.option.validthis = (val === "true"); - return; - } - - if (key === "quotmark") { - switch (val) { - case "true": - case "false": - state.option.quotmark = (val === "true"); - break; - case "double": - case "single": - state.option.quotmark = val; - break; - default: - error("E002", nt); - } - return; - } - - if (key === "shadow") { - switch (val) { - case "true": - state.option.shadow = true; - break; - case "outer": - state.option.shadow = "outer"; - break; - case "false": - case "inner": - state.option.shadow = "inner"; - break; - default: - error("E002", nt); - } - return; - } - - if (key === "unused") { - switch (val) { - case "true": - state.option.unused = true; - break; - case "false": - state.option.unused = false; - break; - case "vars": - case "strict": - state.option.unused = val; - break; - default: - error("E002", nt); - } - return; - } - - if (key === "latedef") { - switch (val) { - case "true": - state.option.latedef = true; - break; - case "false": - state.option.latedef = false; - break; - case "nofunc": - state.option.latedef = "nofunc"; - break; - default: - error("E002", nt); - } - return; - } - - if (key === "ignore") { - switch (val) { - case "start": - state.ignoreLinterErrors = true; - break; - case "end": - state.ignoreLinterErrors = false; - break; - case "line": - state.ignoredLines[nt.line] = true; - removeIgnoredMessages(); - break; - default: - error("E002", nt); - } - return; - } - - var match = /^([+-])(W\d{3})$/g.exec(key); - if (match) { - // ignore for -W..., unignore for +W... - state.ignored[match[2]] = (match[1] === "-"); - return; - } - - var tn; - if (val === "true" || val === "false") { - if (nt.type === "jslint") { - tn = options.renamed[key] || key; - state.option[tn] = (val === "true"); - - if (options.inverted[tn] !== undefined) { - state.option[tn] = !state.option[tn]; - } - } else { - state.option[key] = (val === "true"); - } - - if (key === "newcap") { - state.option["(explicitNewcap)"] = true; - } - return; - } - - error("E002", nt); - }); - - 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; - } - - function peekIgnoreEOL() { - var i = 0; - var t; - do { - t = peek(i++); - } while (t.id === "(endline)"); - return t; - } - - // Produce the next token. It looks for programming errors. - - function advance(id, t) { - - switch (state.tokens.curr.id) { - case "(number)": - if (state.tokens.next.id === ".") { - warning("W005", state.tokens.curr); - } - break; - case "-": - if (state.tokens.next.id === "-" || state.tokens.next.id === "--") { - warning("W006"); - } - break; - case "+": - if (state.tokens.next.id === "+" || state.tokens.next.id === "++") { - warning("W007"); - } - break; - } - - if (id && state.tokens.next.id !== id) { - if (t) { - if (state.tokens.next.id === "(end)") { - error("E019", t, t.id); - } else { - error("E020", state.tokens.next, id, t.id, t.line, state.tokens.next.value); - } - } else if (state.tokens.next.type !== "(identifier)" || state.tokens.next.value !== id) { - warning("W116", state.tokens.next, id, state.tokens.next.value); - } - } - - state.tokens.prev = state.tokens.curr; - state.tokens.curr = state.tokens.next; - for (;;) { - state.tokens.next = lookahead.shift() || lex.token(); - - if (!state.tokens.next) { // No more tokens left, give up - quit("E041", state.tokens.curr.line); - } - - if (state.tokens.next.id === "(end)" || state.tokens.next.id === "(error)") { - return; - } - - if (state.tokens.next.check) { - state.tokens.next.check(); - } - - if (state.tokens.next.isSpecial) { - doOption(); - } else { - if (state.tokens.next.id !== "(endline)") { - break; - } - } - } - } - - function isInfix(token) { - return token.infix || (!token.identifier && !token.template && !!token.led); - } - - function isEndOfExpr() { - var curr = state.tokens.curr; - var next = state.tokens.next; - if (next.id === ";" || next.id === "}" || next.id === ":") { - return true; - } - if (isInfix(next) === isInfix(curr) || (curr.id === "yield" && state.option.inMoz(true))) { - return curr.line !== startLine(next); - } - return false; - } - - function isBeginOfExpr(prev) { - return !prev.left && prev.arity !== "unary"; - } - - // 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, isLetExpr = false; - - state.nameStack.push(); - - // if current expression is a let expression - if (!initial && state.tokens.next.value === "let" && peek(0).value === "(") { - if (!state.option.inMoz(true)) { - warning("W118", state.tokens.next, "let expressions"); - } - isLetExpr = true; - // create a new block scope we use only for the current expression - funct["(blockscope)"].stack(); - advance("let"); - advance("("); - state.tokens.prev.fud(); - advance(")"); - } - - if (state.tokens.next.id === "(end)") - error("E006", state.tokens.curr); - - var isDangerous = - state.option.asi && - state.tokens.prev.line !== startLine(state.tokens.curr) && - _.contains(["]", ")"], state.tokens.prev.id) && - _.contains(["[", "("], state.tokens.curr.id); - - if (isDangerous) - warning("W014", state.tokens.curr, state.tokens.curr.id); - - advance(); - - if (initial) { - funct["(verb)"] = state.tokens.curr.value; - state.tokens.curr.beginsStmt = true; - } - - if (initial === true && state.tokens.curr.fud) { - left = state.tokens.curr.fud(); - } else { - if (state.tokens.curr.nud) { - left = state.tokens.curr.nud(); - } else { - error("E030", state.tokens.curr, state.tokens.curr.id); - } - - // TODO: use pratt mechanics rather than special casing template tokens - while ((rbp < state.tokens.next.lbp || state.tokens.next.type === "(template)") && - !isEndOfExpr()) { - isArray = state.tokens.curr.value === "Array"; - isObject = state.tokens.curr.value === "Object"; - - // #527, new Foo.Array(), Foo.Array(), new Foo.Object(), Foo.Object() - // Line breaks in IfStatement heads exist to satisfy the checkJSHint - // "Line too long." error. - if (left && (left.value || (left.first && left.first.value))) { - // If the left.value is not "new", or the left.first.value is a "." - // then safely assume that this is not "new Array()" and possibly - // not "new Object()"... - if (left.value !== "new" || - (left.first && left.first.value && left.first.value === ".")) { - isArray = false; - // ...In the case of Object, if the left.value and state.tokens.curr.value - // are not equal, then safely assume that this not "new Object()" - if (left.value !== state.tokens.curr.value) { - isObject = false; - } - } - } - - advance(); - - if (isArray && state.tokens.curr.id === "(" && state.tokens.next.id === ")") { - warning("W009", state.tokens.curr); - } - - if (isObject && state.tokens.curr.id === "(" && state.tokens.next.id === ")") { - warning("W010", state.tokens.curr); - } - - if (left && state.tokens.curr.led) { - left = state.tokens.curr.led(left); - } else { - error("E033", state.tokens.curr, state.tokens.curr.id); - } - } - } - if (isLetExpr) { - funct["(blockscope)"].unstack(); - } - - state.nameStack.pop(); - - return left; - } - - - // Functions for conformance of style. - - function startLine(token) { - return token.startLine || token.line; - } - - function nobreaknonadjacent(left, right) { - left = left || state.tokens.curr; - right = right || state.tokens.next; - if (!state.option.laxbreak && left.line !== startLine(right)) { - warning("W014", right, right.value); - } - } - - function nolinebreak(t) { - t = t || state.tokens.curr; - if (t.line !== startLine(state.tokens.next)) { - warning("E022", t, t.value); - } - } - - function nobreakcomma(left, right) { - if (left.line !== startLine(right)) { - if (!state.option.laxcomma) { - if (comma.first) { - warning("I001"); - comma.first = false; - } - warning("W014", left, right.value); - } - } - } - - function comma(opts) { - opts = opts || {}; - - if (!opts.peek) { - nobreakcomma(state.tokens.curr, state.tokens.next); - advance(","); - } else { - nobreakcomma(state.tokens.prev, state.tokens.curr); - } - - if (state.tokens.next.identifier && !(opts.property && state.option.inES5())) { - // Keywords that cannot follow a comma operator. - switch (state.tokens.next.value) { - case "break": - case "case": - case "catch": - case "continue": - case "default": - case "do": - case "else": - case "finally": - case "for": - case "if": - case "in": - case "instanceof": - case "return": - case "switch": - case "throw": - case "try": - case "var": - case "let": - case "while": - case "with": - error("E024", state.tokens.next, state.tokens.next.value); - return false; - } - } - - if (state.tokens.next.type === "(punctuator)") { - switch (state.tokens.next.value) { - case "}": - case "]": - case ",": - if (opts.allowTrailing) { - return true; - } - - /* falls through */ - case ")": - error("E024", state.tokens.next, state.tokens.next.value); - return false; - } - } - return true; - } - - // Functional constructors for making the symbols that will be inherited by - // tokens. - - function symbol(s, p) { - var x = state.syntax[s]; - if (!x || typeof x !== "object") { - state.syntax[s] = x = { - id: s, - lbp: p, - value: s - }; - } - return x; - } - - function delim(s) { - var x = symbol(s, 0); - x.delim = true; - return x; - } - - 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.arity = "unary"; - this.right = expression(150); - - if (this.id === "++" || this.id === "--") { - if (state.option.plusplus) { - warning("W016", this, this.id); - } else if (this.right && (!this.right.identifier || isReserved(this.right)) && - this.right.id !== "." && this.right.id !== "[") { - warning("W017", this); - } - } - - return this; - }; - - return x; - } - - function type(s, f) { - var x = delim(s); - x.type = s; - x.nud = f; - return x; - } - - function reserve(name, func) { - var x = type(name, func); - x.identifier = true; - x.reserved = true; - return x; - } - - function FutureReservedWord(name, meta) { - var x = type(name, (meta && meta.nud) || function() { - return this; - }); - - meta = meta || {}; - meta.isFutureReservedWord = true; - - x.value = name; - x.identifier = true; - x.reserved = true; - x.meta = meta; - - 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.infix = true; - x.led = function(left) { - if (!w) { - nobreaknonadjacent(state.tokens.prev, state.tokens.curr); - } - if (s === "in" && left.id === "!") { - warning("W018", left, "!"); - } - if (typeof f === "function") { - return f(left, this); - } else { - this.left = left; - this.right = expression(p); - return this; - } - }; - return x; - } - - - function application(s) { - var x = symbol(s, 42); - - x.led = function(left) { - nobreaknonadjacent(state.tokens.prev, state.tokens.curr); - - this.left = left; - this.right = doFunction({ type: "arrow", loneArg: left }); - return this; - }; - return x; - } - - function relation(s, f) { - var x = symbol(s, 100); - - x.led = function(left) { - nobreaknonadjacent(state.tokens.prev, state.tokens.curr); - var right = expression(100); - - if (isIdentifier(left, "NaN") || isIdentifier(right, "NaN")) { - warning("W019", this); - } else if (f) { - f.apply(this, [left, right]); - } - - if (!left || !right) { - quit("E041", state.tokens.curr.line); - } - - if (left.id === "!") { - warning("W018", left, "!"); - } - - if (right.id === "!") { - warning("W018", 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" && !state.option.eqnull) || - node.type === "true" || - node.type === "false" || - node.type === "undefined"); - } - - // Checks whether the 'typeof' operator is used with the correct - // value. For docs on 'typeof' see: - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof - - function isTypoTypeof(left, right) { - if (state.option.notypeof) - return false; - - if (!left || !right) - return false; - - var values = [ - "undefined", "object", "boolean", "number", - "string", "function", "xml", "object", "unknown", "symbol" - ]; - - if (right.type === "(identifier)" && right.value === "typeof" && left.type === "(string)") - return !_.contains(values, left.value); - - return false; - } - - function isGlobalEval(left, state, funct) { - var isGlobal = false; - - // permit methods to refer to an "eval" key in their own context - if (left.type === "this" && funct["(context)"] === null) { - isGlobal = true; - } - // permit use of "eval" members of objects - else if (left.type === "(identifier)") { - if (state.option.node && left.value === "global") { - isGlobal = true; - } - - else if (state.option.browser && (left.value === "window" || left.value === "document")) { - isGlobal = true; - } - } - - return isGlobal; - } - - function findNativePrototype(left) { - var natives = [ - "Array", "ArrayBuffer", "Boolean", "Collator", "DataView", "Date", - "DateTimeFormat", "Error", "EvalError", "Float32Array", "Float64Array", - "Function", "Infinity", "Intl", "Int16Array", "Int32Array", "Int8Array", - "Iterator", "Number", "NumberFormat", "Object", "RangeError", - "ReferenceError", "RegExp", "StopIteration", "String", "SyntaxError", - "TypeError", "Uint16Array", "Uint32Array", "Uint8Array", "Uint8ClampedArray", - "URIError" - ]; - - function walkPrototype(obj) { - if (typeof obj !== "object") return; - return obj.right === "prototype" ? obj : walkPrototype(obj.left); - } - - function walkNative(obj) { - while (!obj.identifier && typeof obj.left === "object") - obj = obj.left; - - if (obj.identifier && natives.indexOf(obj.value) >= 0) - return obj.value; - } - - var prototype = walkPrototype(left); - if (prototype) return walkNative(prototype); - } - - function assignop(s, f, p) { - var x = infix(s, typeof f === "function" ? f : function(left, that) { - that.left = left; - - if (left) { - if (state.option.freeze) { - var nativeObject = findNativePrototype(left); - if (nativeObject) - warning("W121", left, nativeObject); - } - - if (predefined[left.value] === false && - scope[left.value]["(global)"] === true) { - warning("W020", left); - } else if (left["function"]) { - warning("W021", left, left.value); - } - - if (funct[left.value] === "const") { - error("E013", left, left.value); - } - - if (left.id === ".") { - if (!left.left) { - warning("E031", that); - } else if (left.left.value === "arguments" && !state.directive["use strict"]) { - warning("E031", that); - } - - state.nameStack.set(state.tokens.prev); - that.right = expression(10); - return that; - } else if (left.id === "[") { - if (state.tokens.curr.left.first) { - state.tokens.curr.left.first.forEach(function(t) { - if (t && funct[t.value] === "const") { - error("E013", t, t.value); - } - }); - } else if (!left.left) { - warning("E031", that); - } else if (left.left.value === "arguments" && !state.directive["use strict"]) { - warning("E031", that); - } - - state.nameStack.set(left.right); - - that.right = expression(10); - return that; - } else if (left.identifier && !isReserved(left)) { - if (funct[left.value] === "exception") { - warning("W022", left); - } - state.nameStack.set(left); - that.right = expression(10); - return that; - } - - if (left === state.syntax["function"]) { - warning("W023", state.tokens.curr); - } - } - - error("E031", that); - }, p); - - x.exps = true; - x.assign = true; - return x; - } - - - function bitwise(s, f, p) { - var x = symbol(s, p); - reserveName(x); - x.led = (typeof f === "function") ? f : function(left) { - if (state.option.bitwise) { - warning("W016", this, this.id); - } - this.left = left; - this.right = expression(p); - return this; - }; - return x; - } - - - function bitwiseassignop(s) { - return assignop(s, function(left, that) { - if (state.option.bitwise) { - warning("W016", that, that.id); - } - - if (left) { - if (left.id === "." || left.id === "[" || - (left.identifier && !isReserved(left))) { - expression(10); - return that; - } - if (left === state.syntax["function"]) { - warning("W023", state.tokens.curr); - } - return that; - } - error("E031", that); - }, 20); - } - - - function suffix(s) { - var x = symbol(s, 150); - - x.led = function(left) { - if (state.option.plusplus) { - warning("W016", this, this.id); - } else if ((!left.identifier || isReserved(left)) && left.id !== "." && left.id !== "[") { - warning("W017", this); - } - - this.left = left; - return this; - }; - return x; - } - - // fnparam means that this identifier is being defined as a function - // argument (see identifier()) - // prop means that this identifier is that of an object property - - function optionalidentifier(fnparam, prop, preserve) { - if (!state.tokens.next.identifier) { - return; - } - - if (!preserve) { - advance(); - } - - var curr = state.tokens.curr; - var val = state.tokens.curr.value; - - if (!isReserved(curr)) { - return val; - } - - if (prop) { - if (state.option.inES5()) { - return val; - } - } - - if (fnparam && val === "undefined") { - return val; - } - - warning("W024", state.tokens.curr, state.tokens.curr.id); - return val; - } - - // fnparam means that this identifier is being defined as a function - // argument - // prop means that this identifier is that of an object property - function identifier(fnparam, prop) { - var i = optionalidentifier(fnparam, prop, false); - if (i) { - return i; - } - - // parameter destructuring with rest operator - if (state.tokens.next.value === "...") { - if (!state.option.esnext) { - warning("W119", state.tokens.next, "spread/rest operator"); - } - advance(); - - if (checkPunctuators(state.tokens.next, ["..."])) { - warning("E024", state.tokens.next, "..."); - while (checkPunctuators(state.tokens.next, ["..."])) { - advance(); - } - } - - if (!state.tokens.next.identifier) { - warning("E024", state.tokens.curr, "..."); - return; - } - - return identifier(fnparam, prop); - } else { - error("E030", state.tokens.next, state.tokens.next.value); - - // The token should be consumed after a warning is issued so the parser - // can continue as though an identifier were found. The semicolon token - // should not be consumed in this way so that the parser interprets it as - // a statement delimeter; - if (state.tokens.next.id !== ";") { - advance(); - } - } - } - - - function reachable(controlToken) { - var i = 0, t; - if (state.tokens.next.id !== ";" || controlToken.inBracelessBlock) { - return; - } - for (;;) { - do { - t = peek(i); - i += 1; - } while (t.id != "(end)" && t.id === "(comment)"); - - if (t.reach) { - return; - } - if (t.id !== "(endline)") { - if (t.id === "function") { - if (state.option.latedef === true) { - warning("W026", t); - } - break; - } - - warning("W027", t, t.value, controlToken.value); - break; - } - } - } - - function parseFinalSemicolon() { - if (state.tokens.next.id !== ";") { - // don't complain about unclosed templates / strings - if (state.tokens.next.isUnclosed) return advance(); - if (!state.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 (!state.option.lastsemic || state.tokens.next.id !== "}" || - startLine(state.tokens.next) !== state.tokens.curr.line) { - warningAt("W033", state.tokens.curr.line, state.tokens.curr.character); - } - } - } else { - advance(";"); - } - } - - function statement() { - var i = indent, r, s = scope, t = state.tokens.next; - - if (t.id === ";") { - advance(";"); - return; - } - - // Is this a labelled statement? - var res = isReserved(t); - - // We're being more tolerant here: if someone uses - // a FutureReservedWord as a label, we warn but proceed - // anyway. - - if (res && t.meta && t.meta.isFutureReservedWord && peek().id === ":") { - warning("W024", t, t.id); - res = false; - } - - // detect a module import declaration - if (t.value === "module" && t.type === "(identifier)") { - if (peek().type === "(identifier)") { - if (!state.option.inESNext()) { - warning("W119", state.tokens.curr, "module"); - } - - advance("module"); - var name = identifier(); - addlabel(name, { type: "unused", token: state.tokens.curr }); - advance("from"); - advance("(string)"); - parseFinalSemicolon(); - return; - } - } - - if (t.identifier && !res && peek().id === ":") { - advance(); - advance(":"); - scope = Object.create(s); - addlabel(t.value, { type: "label" }); - - if (!state.tokens.next.labelled && state.tokens.next.value !== "{") { - warning("W028", state.tokens.next, t.value, state.tokens.next.value); - } - - state.tokens.next.label = t.value; - t = state.tokens.next; - } - - // Is it a lonely block? - - if (t.id === "{") { - // Is it a switch case block? - // - // switch (foo) { - // case bar: { <= here. - // ... - // } - // } - var iscase = (funct["(verb)"] === "case" && state.tokens.curr.value === ":"); - block(true, true, false, false, iscase); - return; - } - - // Parse the statement. - - r = expression(0, true); - - if (r && (!r.identifier || r.value !== "function") && (r.type !== "(punctuator)")) { - if (!state.directive["use strict"] && - state.option.globalstrict && - state.option.strict) { - warning("E007"); - } - } - - // Look for the final semicolon. - - if (!t.block) { - if (!state.option.expr && (!r || !r.exps)) { - warning("W030", state.tokens.curr); - } else if (state.option.nonew && r && r.left && r.id === "(" && r.left.id === "new") { - warning("W031", t); - } - parseFinalSemicolon(); - } - - - // Restore the indentation. - - indent = i; - scope = s; - return r; - } - - - function statements() { - var a = [], p; - - while (!state.tokens.next.reach && state.tokens.next.id !== "(end)") { - if (state.tokens.next.id === ";") { - p = peek(); - - if (!p || (p.id !== "(" && p.id !== "[")) { - warning("W032"); - } - - advance(";"); - } else { - a.push(statement()); - } - } - return a; - } - - - /* - * read all directives - * recognizes a simple form of asi, but always - * warns, if it is used - */ - function directives() { - var i, p, pn; - - while (state.tokens.next.id === "(string)") { - p = peek(0); - if (p.id === "(endline)") { - i = 1; - do { - pn = peek(i++); - } while (pn.id === "(endline)"); - if (pn.id === ";") { - p = pn; - } else if (pn.value === "[" || pn.value === ".") { - // string -> [ | . is a valid production - return; - } else if (!state.option.asi || pn.value === "(") { - // string -> ( is not a valid production - warning("W033", state.tokens.next); - } - } else if (p.id === "." || p.id === "[") { - return; - } else if (p.id !== ";") { - warning("W033", p); - } - - advance(); - if (state.directive[state.tokens.curr.value]) { - warning("W034", state.tokens.curr, state.tokens.curr.value); - } - - if (state.tokens.curr.value === "use strict") { - if (!state.option["(explicitNewcap)"]) { - state.option.newcap = true; - } - state.option.undef = true; - } - - // there's no directive negation, so always set to true - state.directive[state.tokens.curr.value] = true; - - if (p.id === ";") { - advance(";"); - } - } - } - - - /* - * 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 - * isfatarrow - true if its a body of a fat arrow function - * iscase - true if block is a switch case block - */ - function block(ordinary, stmt, isfunc, isfatarrow, iscase) { - var a, - b = inblock, - old_indent = indent, - m, - s = scope, - t, - line, - d; - - inblock = ordinary; - - if (!ordinary || !state.option.funcscope) - scope = Object.create(scope); - - t = state.tokens.next; - - var metrics = funct["(metrics)"]; - metrics.nestedBlockDepth += 1; - metrics.verifyMaxNestedBlockDepthPerFunction(); - - if (state.tokens.next.id === "{") { - advance("{"); - - // create a new block scope - funct["(blockscope)"].stack(); - - line = state.tokens.curr.line; - if (state.tokens.next.id !== "}") { - indent += state.option.indent; - while (!ordinary && state.tokens.next.from > indent) { - indent += state.option.indent; - } - - if (isfunc) { - m = {}; - for (d in state.directive) { - if (_.has(state.directive, d)) { - m[d] = state.directive[d]; - } - } - directives(); - - if (state.option.strict && funct["(context)"]["(global)"]) { - if (!m["use strict"] && !state.directive["use strict"]) { - warning("E007"); - } - } - } - - a = statements(); - - metrics.statementCount += a.length; - - if (isfunc) { - state.directive = m; - } - - indent -= state.option.indent; - } - - advance("}", t); - - funct["(blockscope)"].unstack(); - - indent = old_indent; - } else if (!ordinary) { - if (isfunc) { - m = {}; - if (stmt && !isfatarrow && !state.option.inMoz(true)) { - error("W118", state.tokens.curr, "function closure expressions"); - } - - if (!stmt) { - for (d in state.directive) { - if (_.has(state.directive, d)) { - m[d] = state.directive[d]; - } - } - } - expression(10); - - if (state.option.strict && funct["(context)"]["(global)"]) { - if (!m["use strict"] && !state.directive["use strict"]) { - warning("E007"); - } - } - } else { - error("E021", state.tokens.next, "{", state.tokens.next.value); - } - } else { - - // check to avoid let declaration not within a block - funct["(nolet)"] = true; - - if (!stmt || state.option.curly) { - warning("W116", state.tokens.next, "{", state.tokens.next.value); - } - - state.tokens.next.inBracelessBlock = true; - indent += state.option.indent; - // test indentation only if statement is in new line - a = [statement()]; - indent -= state.option.indent; - - delete funct["(nolet)"]; - } - - // Don't clear and let it propagate out if it is "break", "return" or similar in switch case - switch (funct["(verb)"]) { - case "break": - case "continue": - case "return": - case "throw": - if (iscase) { - break; - } - - /* falls through */ - default: - funct["(verb)"] = null; - } - - if (!ordinary || !state.option.funcscope) scope = s; - inblock = b; - if (ordinary && state.option.noempty && (!a || a.length === 0)) { - warning("W035", state.tokens.prev); - } - metrics.nestedBlockDepth -= 1; - return a; - } - - - function countMember(m) { - if (membersOnly && typeof membersOnly[m] !== "boolean") { - warning("W036", state.tokens.curr, m); - } - if (typeof member[m] === "number") { - member[m] += 1; - } else { - member[m] = 1; - } - } - - - function note_implied(tkn) { - var name = tkn.value; - var desc = Object.getOwnPropertyDescriptor(implied, name); - - if (!desc) - implied[name] = [tkn.line]; - else - desc.value.push(tkn.line); - } - - - // Build the syntax table by declaring the syntactic elements of the language. - - type("(number)", function() { - return this; - }); - - type("(string)", function() { - return this; - }); - - state.syntax["(identifier)"] = { - type: "(identifier)", - lbp: 0, - identifier: true, - - nud: function() { - var v = this.value; - var s = scope[v]; - var f; - var block; - - // If this identifier is the lone parameter to a shorthand "fat arrow" - // function definition, i.e. - // - // x => x; - // - // ...it should not be considered as a variable in the current scope. It - // will be added to the scope of the new function when the next token is - // parsed, so it can be safely ignored for now. - if (state.tokens.next.id === "=>") { - return this; - } - - if (typeof s === "function") { - // Protection against accidental inheritance. - s = undefined; - } else if (!funct["(blockscope)"].current.has(v) && typeof s === "boolean") { - f = funct; - funct = functions[0]; - addlabel(v, { type: "var" }); - s = funct; - funct = f; - } - - block = funct["(blockscope)"].getlabel(v); - - // The name is in scope and defined in the current function. - if (funct === s || block) { - // Change 'unused' to 'var', and reject labels. - // the name is in a block scope. - switch (block ? block[v]["(type)"] : funct[v]) { - case "unused": - if (block) block[v]["(type)"] = "var"; - else funct[v] = "var"; - break; - case "unction": - if (block) block[v]["(type)"] = "function"; - else funct[v] = "function"; - this["function"] = true; - break; - case "const": - setprop(funct, v, { unused: false }); - break; - case "function": - this["function"] = true; - break; - case "label": - warning("W037", state.tokens.curr, v); - break; - } - } 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("W038", state.tokens.curr, v); - break; - case "label": - warning("W037", state.tokens.curr, 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("W039", state.tokens.curr, v); - note_implied(state.tokens.curr); - } else if (typeof s !== "object") { - // if we're in a list comprehension, variables are declared - // locally and used before being defined. So we check - // the presence of the given variable in the comp array - // before declaring it undefined. - - if (!funct["(comparray)"].check(v)) { - isundef(funct, "W117", state.tokens.curr, v); - } - - // Explicitly mark the variable as used within function scopes - if (!funct["(global)"]) { - funct[v] = true; - } - - note_implied(state.tokens.curr); - } 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 "const": - setprop(s, v, { unused: false }); - break; - case "closure": - funct[v] = s["(global)"] ? "global" : "outer"; - break; - case "label": - warning("W037", state.tokens.curr, v); - } - } - } - } - return this; - }, - - led: function() { - error("E033", state.tokens.next, state.tokens.next.value); - } - }; - - var baseTemplateSyntax = { - lbp: 0, - identifier: false, - template: true, - }; - state.syntax["(template)"] = _.extend({ - type: "(template)", - nud: doTemplateLiteral, - led: doTemplateLiteral, - noSubst: false - }, baseTemplateSyntax); - - state.syntax["(template middle)"] = _.extend({ - type: "(template middle)", - middle: true, - noSubst: false - }, baseTemplateSyntax); - - state.syntax["(template tail)"] = _.extend({ - type: "(template tail)", - tail: true, - noSubst: false - }, baseTemplateSyntax); - - state.syntax["(no subst template)"] = _.extend({ - type: "(template)", - nud: doTemplateLiteral, - led: doTemplateLiteral, - noSubst: true, - tail: true // mark as tail, since it's always the last component - }, baseTemplateSyntax); - - type("(regexp)", function() { - return this; - }); - - // ECMAScript parser - - delim("(endline)"); - delim("(begin)"); - delim("(end)").reach = true; - delim("(error)").reach = true; - delim("}").reach = true; - delim(")"); - delim("]"); - delim("\"").reach = true; - delim("'").reach = true; - delim(";"); - delim(":").reach = true; - delim("#"); - - reserve("else"); - reserve("case").reach = true; - reserve("catch"); - reserve("default").reach = true; - reserve("finally"); - reservevar("arguments", function(x) { - if (state.directive["use strict"] && funct["(global)"]) { - warning("E008", x); - } - }); - reservevar("eval"); - reservevar("false"); - reservevar("Infinity"); - reservevar("null"); - reservevar("this", function(x) { - if (state.directive["use strict"] && !isMethod() && - !state.option.validthis && ((funct["(statement)"] && - funct["(name)"].charAt(0) > "Z") || funct["(global)"])) { - warning("W040", x); - } - }); - reservevar("true"); - reservevar("undefined"); - - assignop("=", "assign", 20); - assignop("+=", "assignadd", 20); - assignop("-=", "assignsub", 20); - assignop("*=", "assignmult", 20); - assignop("/=", "assigndiv", 20).nud = function() { - error("E014"); - }; - assignop("%=", "assignmod", 20); - - bitwiseassignop("&="); - bitwiseassignop("|="); - bitwiseassignop("^="); - bitwiseassignop("<<="); - bitwiseassignop(">>="); - bitwiseassignop(">>>="); - infix(",", function(left, that) { - var expr; - that.exprs = [left]; - - if (state.option.nocomma) { - warning("W127"); - } - - if (!comma({ peek: true })) { - return that; - } - while (true) { - if (!(expr = expression(10))) { - break; - } - that.exprs.push(expr); - if (state.tokens.next.value !== "," || !comma()) { - break; - } - } - return that; - }, 10, true); - - infix("?", function(left, that) { - increaseComplexityCount(); - that.left = left; - that.right = expression(10); - advance(":"); - that["else"] = expression(10); - return that; - }, 30); - - var orPrecendence = 40; - infix("||", function(left, that) { - increaseComplexityCount(); - that.left = left; - that.right = expression(orPrecendence); - return that; - }, orPrecendence); - infix("&&", "and", 50); - bitwise("|", "bitor", 70); - bitwise("^", "bitxor", 80); - bitwise("&", "bitand", 90); - relation("==", function(left, right) { - var eqnull = state.option.eqnull && (left.value === "null" || right.value === "null"); - - switch (true) { - case !eqnull && state.option.eqeqeq: - this.from = this.character; - warning("W116", this, "===", "=="); - break; - case isPoorRelation(left): - warning("W041", this, "===", left.value); - break; - case isPoorRelation(right): - warning("W041", this, "===", right.value); - break; - case isTypoTypeof(right, left): - warning("W122", this, right.value); - break; - case isTypoTypeof(left, right): - warning("W122", this, left.value); - break; - } - - return this; - }); - relation("===", function(left, right) { - if (isTypoTypeof(right, left)) { - warning("W122", this, right.value); - } else if (isTypoTypeof(left, right)) { - warning("W122", this, left.value); - } - return this; - }); - relation("!=", function(left, right) { - var eqnull = state.option.eqnull && - (left.value === "null" || right.value === "null"); - - if (!eqnull && state.option.eqeqeq) { - this.from = this.character; - warning("W116", this, "!==", "!="); - } else if (isPoorRelation(left)) { - warning("W041", this, "!==", left.value); - } else if (isPoorRelation(right)) { - warning("W041", this, "!==", right.value); - } else if (isTypoTypeof(right, left)) { - warning("W122", this, right.value); - } else if (isTypoTypeof(left, right)) { - warning("W122", this, left.value); - } - return this; - }); - relation("!==", function(left, right) { - if (isTypoTypeof(right, left)) { - warning("W122", this, right.value); - } else if (isTypoTypeof(left, right)) { - warning("W122", this, left.value); - } - return this; - }); - 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; - that.left = left; - that.right = right = expression(130); - - if (left && right && left.id === "(string)" && right.id === "(string)") { - left.value += right.value; - left.character = right.character; - if (!state.option.scripturl && reg.javascriptURL.test(left.value)) { - warning("W050", left); - } - return left; - } - - return that; - }, 130); - prefix("+", "num"); - prefix("+++", function() { - warning("W007"); - this.arity = "unary"; - this.right = expression(150); - return this; - }); - infix("+++", function(left) { - warning("W007"); - this.left = left; - this.right = expression(130); - return this; - }, 130); - infix("-", "sub", 130); - prefix("-", "neg"); - prefix("---", function() { - warning("W006"); - this.arity = "unary"; - this.right = expression(150); - return this; - }); - infix("---", function(left) { - warning("W006"); - this.left = left; - this.right = expression(130); - return this; - }, 130); - infix("*", "mult", 140); - infix("/", "div", 140); - infix("%", "mod", 140); - - suffix("++"); - prefix("++", "preinc"); - state.syntax["++"].exps = true; - - suffix("--"); - prefix("--", "predec"); - state.syntax["--"].exps = true; - prefix("delete", function() { - var p = expression(10); - if (!p) { - return this; - } - - if (p.id !== "." && p.id !== "[") { - warning("W051"); - } - this.first = p; - - // The `delete` operator accepts unresolvable references when not in strict - // mode, so the operand may be undefined. - if (p.identifier && !state.directive["use strict"]) { - p.forgiveUndef = true; - } - return this; - }).exps = true; - - prefix("~", function() { - if (state.option.bitwise) { - warning("W016", this, "~"); - } - this.arity = "unary"; - expression(150); - return this; - }); - - prefix("...", function() { - if (!state.option.esnext) { - warning("W119", this, "spread/rest operator"); - } - - // TODO: Allow all AssignmentExpression - // once parsing permits. - // - // How to handle eg. number, boolean when the built-in - // prototype of may have an @@iterator definition? - // - // Number.prototype[Symbol.iterator] = function * () { - // yield this.valueOf(); - // }; - // - // var a = [ ...1 ]; - // console.log(a); // [1]; - // - // for (let n of [...10]) { - // console.log(n); - // } - // // 10 - // - // - // Boolean.prototype[Symbol.iterator] = function * () { - // yield this.valueOf(); - // }; - // - // var a = [ ...true ]; - // console.log(a); // [true]; - // - // for (let n of [...false]) { - // console.log(n); - // } - // // false - // - if (!state.tokens.next.identifier && - state.tokens.next.type !== "(string)" && - !checkPunctuators(state.tokens.next, ["[", "("])) { - - error("E030", state.tokens.next, state.tokens.next.value); - } - expression(150); - return this; - }); - - prefix("!", function() { - this.arity = "unary"; - this.right = expression(150); - - if (!this.right) { // '!' followed by nothing? Give up. - quit("E041", this.line || 0); - } - - if (bang[this.right.id] === true) { - warning("W018", this, "!"); - } - return this; - }); - - prefix("typeof", (function() { - var p = expression(150); - this.first = p; - - // The `typeof` operator accepts unresolvable references, so the operand - // may be undefined. - if (p.identifier) { - p.forgiveUndef = true; - } - return this; - })); - 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("W053", state.tokens.prev, c.value); - break; - case "Symbol": - if (state.option.esnext) { - warning("W053", state.tokens.prev, c.value); - } - break; - case "Function": - if (!state.option.evil) { - warning("W054"); - } - break; - case "Date": - case "RegExp": - case "this": - break; - default: - if (c.id !== "function") { - i = c.value.substr(0, 1); - if (state.option.newcap && (i < "A" || i > "Z") && !_.has(global, c.value)) { - warning("W055", state.tokens.curr); - } - } - } - } else { - if (c.id !== "." && c.id !== "[" && c.id !== "(") { - warning("W056", state.tokens.curr); - } - } - } else { - if (!state.option.supernew) - warning("W057", this); - } - if (state.tokens.next.id !== "(" && !state.option.supernew) { - warning("W058", state.tokens.curr, state.tokens.curr.value); - } - this.first = c; - return this; - }); - state.syntax["new"].exps = true; - - prefix("void").exps = true; - - infix(".", function(left, that) { - var m = identifier(false, true); - - if (typeof m === "string") { - countMember(m); - } - - that.left = left; - that.right = m; - - if (m && m === "hasOwnProperty" && state.tokens.next.value === "=") { - warning("W001"); - } - - if (left && left.value === "arguments" && (m === "callee" || m === "caller")) { - if (state.option.noarg) - warning("W059", left, m); - else if (state.directive["use strict"]) - error("E008"); - } else if (!state.option.evil && left && left.value === "document" && - (m === "write" || m === "writeln")) { - warning("W060", left); - } - - if (!state.option.evil && (m === "eval" || m === "execScript")) { - if (isGlobalEval(left, state, funct)) { - warning("W061"); - } - } - - return that; - }, 160, true); - - infix("(", function(left, that) { - if (state.option.immed && left && !left.immed && left.id === "function") { - warning("W062"); - } - - var n = 0; - var p = []; - - if (left) { - if (left.type === "(identifier)") { - if (left.value.match(/^[A-Z]([A-Z0-9_$]*[a-z][A-Za-z0-9_$]*)?$/)) { - if ("Number String Boolean Date Object Error Symbol".indexOf(left.value) === -1) { - if (left.value === "Math") { - warning("W063", left); - } else if (state.option.newcap) { - warning("W064", left); - } - } - } - } - } - - if (state.tokens.next.id !== ")") { - for (;;) { - p[p.length] = expression(10); - n += 1; - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - } - - advance(")"); - - if (typeof left === "object") { - if (state.option.inES3() && left.value === "parseInt" && n === 1) { - warning("W065", state.tokens.curr); - } - if (!state.option.evil) { - if (left.value === "eval" || left.value === "Function" || - left.value === "execScript") { - warning("W061", left); - - if (p[0] && [0].id === "(string)") { - addInternalSrc(left, p[0].value); - } - } else if (p[0] && p[0].id === "(string)" && - (left.value === "setTimeout" || - left.value === "setInterval")) { - warning("W066", left); - addInternalSrc(left, p[0].value); - - // window.setTimeout/setInterval - } else if (p[0] && p[0].id === "(string)" && - left.value === "." && - left.left.value === "window" && - (left.right === "setTimeout" || - left.right === "setInterval")) { - warning("W066", left); - addInternalSrc(left, p[0].value); - } - } - if (!left.identifier && left.id !== "." && left.id !== "[" && - left.id !== "(" && left.id !== "&&" && left.id !== "||" && - left.id !== "?" && !(state.option.esnext && left["(name)"])) { - warning("W067", that); - } - } - - that.left = left; - return that; - }, 155, true).exps = true; - - prefix("(", function() { - var pn = state.tokens.next, pn1, i = -1; - var ret, triggerFnExpr, first, last; - var parens = 1; - var opening = state.tokens.curr; - var preceeding = state.tokens.prev; - var isNecessary = !state.option.singleGroups; - - do { - if (pn.value === "(") { - parens += 1; - } else if (pn.value === ")") { - parens -= 1; - } - - i += 1; - pn1 = pn; - pn = peek(i); - } while (!(parens === 0 && pn1.value === ")") && pn.value !== ";" && pn.type !== "(end)"); - - if (state.tokens.next.id === "function") { - triggerFnExpr = state.tokens.next.immed = true; - } - - // If the balanced grouping operator is followed by a "fat arrow", the - // current token marks the beginning of a "fat arrow" function and parsing - // should proceed accordingly. - if (pn.value === "=>") { - return doFunction({ type: "arrow", parsedOpening: true }); - } - - var exprs = []; - - if (state.tokens.next.id !== ")") { - for (;;) { - exprs.push(expression(10)); - - if (state.tokens.next.id !== ",") { - break; - } - - if (state.option.nocomma) { - warning("W127"); - } - - comma(); - } - } - - advance(")", this); - if (state.option.immed && exprs[0] && exprs[0].id === "function") { - if (state.tokens.next.id !== "(" && - state.tokens.next.id !== "." && state.tokens.next.id !== "[") { - warning("W068", this); - } - } - - if (!exprs.length) { - return; - } - if (exprs.length > 1) { - ret = Object.create(state.syntax[","]); - ret.exprs = exprs; - - first = exprs[0]; - last = exprs[exprs.length - 1]; - - if (!isNecessary) { - isNecessary = preceeding.assign || preceeding.delim; - } - } else { - ret = first = last = exprs[0]; - - if (!isNecessary) { - isNecessary = - // Used to distinguish from an ExpressionStatement which may not - // begin with the `{` and `function` tokens - (opening.beginsStmt && (ret.id === "{" || triggerFnExpr || isFunctor(ret))) || - // Used as the return value of a single-statement arrow function - (ret.id === "{" && preceeding.id === "=>") || - // Used to prevent left-to-right application of adjacent addition - // operators (the order of which effect type) - (first.id === "+" && preceeding.id === "+"); - } - } - - if (ret) { - // The operator may be necessary to override the default binding power of - // neighboring operators (whenever there is an operator in use within the - // first expression *or* the current group contains multiple expressions) - if (!isNecessary && (first.left || ret.exprs)) { - isNecessary = - (!isBeginOfExpr(preceeding) && first.lbp < preceeding.lbp) || - (!isEndOfExpr() && last.lbp < state.tokens.next.lbp); - } - - if (!isNecessary) { - warning("W126", opening); - } - - ret.paren = true; - } - - return ret; - }); - - application("=>"); - - infix("[", function(left, that) { - var e = expression(10), s; - if (e && e.type === "(string)") { - if (!state.option.evil && (e.value === "eval" || e.value === "execScript")) { - if (isGlobalEval(left, state, funct)) { - warning("W061"); - } - } - - countMember(e.value); - if (!state.option.sub && reg.identifier.test(e.value)) { - s = state.syntax[e.value]; - if (!s || !isReserved(s)) { - warning("W069", state.tokens.prev, e.value); - } - } - } - advance("]", that); - - if (e && e.value === "hasOwnProperty" && state.tokens.next.value === "=") { - warning("W001"); - } - - that.left = left; - that.right = e; - return that; - }, 160, true); - - function comprehensiveArrayExpression() { - var res = {}; - res.exps = true; - funct["(comparray)"].stack(); - - // Handle reversed for expressions, used in spidermonkey - var reversed = false; - if (state.tokens.next.value !== "for") { - reversed = true; - if (!state.option.inMoz(true)) { - warning("W116", state.tokens.next, "for", state.tokens.next.value); - } - funct["(comparray)"].setState("use"); - res.right = expression(10); - } - - advance("for"); - if (state.tokens.next.value === "each") { - advance("each"); - if (!state.option.inMoz(true)) { - warning("W118", state.tokens.curr, "for each"); - } - } - advance("("); - funct["(comparray)"].setState("define"); - res.left = expression(130); - if (_.contains(["in", "of"], state.tokens.next.value)) { - advance(); - } else { - error("E045", state.tokens.curr); - } - funct["(comparray)"].setState("generate"); - expression(10); - - advance(")"); - if (state.tokens.next.value === "if") { - advance("if"); - advance("("); - funct["(comparray)"].setState("filter"); - res.filter = expression(10); - advance(")"); - } - - if (!reversed) { - funct["(comparray)"].setState("use"); - res.right = expression(10); - } - - advance("]"); - funct["(comparray)"].unstack(); - return res; - } - - prefix("[", function() { - var blocktype = lookupBlockType(); - if (blocktype.isCompArray) { - if (!state.option.inESNext()) { - warning("W119", state.tokens.curr, "array comprehension"); - } - return comprehensiveArrayExpression(); - } else if (blocktype.isDestAssign && !state.option.inESNext()) { - warning("W104", state.tokens.curr, "destructuring assignment"); - } - var b = state.tokens.curr.line !== startLine(state.tokens.next); - this.first = []; - if (b) { - indent += state.option.indent; - if (state.tokens.next.from === indent + state.option.indent) { - indent += state.option.indent; - } - } - while (state.tokens.next.id !== "(end)") { - while (state.tokens.next.id === ",") { - if (!state.option.elision) { - if (!state.option.inES5()) { - // Maintain compat with old options --- ES5 mode without - // elision=true will warn once per comma - warning("W070"); - } else { - warning("W128"); - do { - advance(","); - } while (state.tokens.next.id === ","); - continue; - } - } - advance(","); - } - - if (state.tokens.next.id === "]") { - break; - } - - this.first.push(expression(10)); - if (state.tokens.next.id === ",") { - comma({ allowTrailing: true }); - if (state.tokens.next.id === "]" && !state.option.inES5(true)) { - warning("W070", state.tokens.curr); - break; - } - } else { - break; - } - } - if (b) { - indent -= state.option.indent; - } - advance("]", this); - return this; - }); - - - function isMethod() { - return funct["(statement)"] && funct["(statement)"].type === "class" || - funct["(context)"] && funct["(context)"]["(verb)"] === "class"; - } - - - function isPropertyName(token) { - return token.identifier || token.id === "(string)" || token.id === "(number)"; - } - - - function propertyName(preserveOrToken) { - var id; - var preserve = true; - if (typeof preserveOrToken === "object") { - id = preserveOrToken; - } else { - preserve = preserveOrToken; - id = optionalidentifier(false, true, preserve); - } - - if (!id) { - if (state.tokens.next.id === "(string)") { - id = state.tokens.next.value; - if (!preserve) { - advance(); - } - } else if (state.tokens.next.id === "(number)") { - id = state.tokens.next.value.toString(); - if (!preserve) { - advance(); - } - } - } else if (typeof id === "object") { - if (id.id === "(string)" || id.id === "(identifier)") id = id.value; - else if (id.id === "(number)") id = id.value.toString(); - } - - if (id === "hasOwnProperty") { - warning("W001"); - } - - return id; - } - - /** - * @param {Object} [options] - * @param {token} [options.loneArg] The argument to the function in cases - * where it was defined using the - * single-argument shorthand. - * @param {bool} [options.parsedOpening] Whether the opening parenthesis has - * already been parsed. - */ - function functionparams(options) { - var next; - var params = []; - var ident; - var tokens = []; - var t; - var pastDefault = false; - var pastRest = false; - var loneArg = options && options.loneArg; - - if (loneArg && loneArg.identifier === true) { - addlabel(loneArg.value, { type: "unused", token: loneArg }); - return [loneArg]; - } - - next = state.tokens.next; - - if (!options || !options.parsedOpening) { - advance("("); - } - - if (state.tokens.next.id === ")") { - advance(")"); - return; - } - - for (;;) { - if (_.contains(["{", "["], state.tokens.next.id)) { - tokens = destructuringExpression(); - for (t in tokens) { - t = tokens[t]; - if (t.id) { - params.push(t.id); - addlabel(t.id, { type: "unused", token: t.token }); - } - } - } else { - if (checkPunctuators(state.tokens.next, ["..."])) pastRest = true; - ident = identifier(true); - if (ident) { - params.push(ident); - addlabel(ident, { type: "unused", token: state.tokens.curr }); - } else { - // Skip invalid parameter. - while (!checkPunctuators(state.tokens.next, [",", ")"])) advance(); - } - } - - // it is a syntax error to have a regular argument after a default argument - if (pastDefault) { - if (state.tokens.next.id !== "=") { - error("E051", state.tokens.current); - } - } - if (state.tokens.next.id === "=") { - if (!state.option.inESNext()) { - warning("W119", state.tokens.next, "default parameters"); - } - advance("="); - pastDefault = true; - expression(10); - } - if (state.tokens.next.id === ",") { - if (pastRest) { - warning("W131", state.tokens.next); - } - comma(); - } else { - advance(")", next); - return params; - } - } - } - - function setprop(funct, name, values) { - if (!funct["(properties)"][name]) { - funct["(properties)"][name] = { unused: false }; - } - - _.extend(funct["(properties)"][name], values); - } - - function getprop(funct, name, prop) { - if (!funct["(properties)"][name]) - return null; - - return funct["(properties)"][name][prop] || null; - } - - function functor(name, token, scope, overwrites) { - var funct = { - "(name)" : name, - "(breakage)" : 0, - "(loopage)" : 0, - "(scope)" : scope, - "(tokens)" : {}, - "(properties)": {}, - - "(catch)" : false, - "(global)" : false, - - "(line)" : null, - "(character)" : null, - "(metrics)" : null, - "(statement)" : null, - "(context)" : null, - "(blockscope)": null, - "(comparray)" : null, - "(generator)" : null, - "(params)" : null - }; - - if (token) { - _.extend(funct, { - "(line)" : token.line, - "(character)": token.character, - "(metrics)" : createMetrics(token) - }); - } - - _.extend(funct, overwrites); - - if (funct["(context)"]) { - funct["(blockscope)"] = funct["(context)"]["(blockscope)"]; - funct["(comparray)"] = funct["(context)"]["(comparray)"]; - } - - return funct; - } - - function isFunctor(token) { - return "(scope)" in token; - } - - function doTemplateLiteral(left) { - // ASSERT: this.type === "(template)" - // jshint validthis: true - var ctx = this.context; - var noSubst = this.noSubst; - var depth = this.depth; - - if (!noSubst) { - while (!end() && state.tokens.next.id !== "(end)") { - if (!state.tokens.next.template || state.tokens.next.depth > depth) { - expression(0); // should probably have different rbp? - } else { - // skip template start / middle - advance(); - } - } - } - - return { - id: "(template)", - type: "(template)", - tag: left - }; - - function end() { - if (state.tokens.curr.template && state.tokens.curr.tail && - state.tokens.curr.context === ctx) return true; - var complete = (state.tokens.next.template && state.tokens.next.tail && - state.tokens.next.context === ctx); - if (complete) advance(); - return complete || state.tokens.next.isUnclosed; - } - } - - /** - * @param {Object} [options] - * @param {token} [options.name] The identifier belonging to the function (if - * any) - * @param {boolean} [options.statement] The statement that triggered creation - * of the current function. - * @param {string} [options.type] If specified, either "generator" or "arrow" - * @param {token} [options.loneArg] The argument to the function in cases - * where it was defined using the - * single-argument shorthand - * @param {bool} [options.parsedOpening] Whether the opening parenthesis has - * already been parsed - * @param {token} [options.classExprBinding] Define a function with this - * identifier in the new function's - * scope, mimicking the bahavior of - * class expression names within - * the body of member functions. - */ - function doFunction(options) { - var f, name, statement, classExprBinding, isGenerator, isArrow; - var oldOption = state.option; - var oldIgnored = state.ignored; - var oldScope = scope; - - if (options) { - name = options.name; - statement = options.statement; - classExprBinding = options.classExprBinding; - isGenerator = options.type === "generator"; - isArrow = options.type === "arrow"; - } - - state.option = Object.create(state.option); - state.ignored = Object.create(state.ignored); - scope = Object.create(scope); - - funct = functor(name || state.nameStack.infer(), state.tokens.next, scope, { - "(statement)": statement, - "(context)": funct, - "(generator)": isGenerator - }); - - f = funct; - state.tokens.curr.funct = funct; - - functions.push(funct); - - if (name) { - addlabel(name, { type: "function" }); - } - - if (classExprBinding) { - addlabel(classExprBinding, { type: "function" }); - } - - funct["(params)"] = functionparams(options); - funct["(metrics)"].verifyMaxParametersPerFunction(funct["(params)"]); - - if (isArrow) { - if (!state.option.esnext) { - warning("W119", state.tokens.curr, "arrow function syntax (=>)"); - } - - if (!options.loneArg) { - advance("=>"); - } - } - - block(false, true, true, isArrow); - - if (!state.option.noyield && isGenerator && - funct["(generator)"] !== "yielded") { - warning("W124", state.tokens.curr); - } - - funct["(metrics)"].verifyMaxStatementsPerFunction(); - funct["(metrics)"].verifyMaxComplexityPerFunction(); - funct["(unusedOption)"] = state.option.unused; - - scope = oldScope; - state.option = oldOption; - state.ignored = oldIgnored; - funct["(last)"] = state.tokens.curr.line; - funct["(lastcharacter)"] = state.tokens.curr.character; - - _.map(Object.keys(funct), function(key) { - if (key[0] === "(") return; - funct["(blockscope)"].unshadow(key); - }); - - funct = funct["(context)"]; - - return f; - } - - function createMetrics(functionStartToken) { - return { - statementCount: 0, - nestedBlockDepth: -1, - ComplexityCount: 1, - - verifyMaxStatementsPerFunction: function() { - if (state.option.maxstatements && - this.statementCount > state.option.maxstatements) { - warning("W071", functionStartToken, this.statementCount); - } - }, - - verifyMaxParametersPerFunction: function(params) { - params = params || []; - - if (state.option.maxparams && params.length > state.option.maxparams) { - warning("W072", functionStartToken, params.length); - } - }, - - verifyMaxNestedBlockDepthPerFunction: function() { - if (state.option.maxdepth && - this.nestedBlockDepth > 0 && - this.nestedBlockDepth === state.option.maxdepth + 1) { - warning("W073", null, this.nestedBlockDepth); - } - }, - - verifyMaxComplexityPerFunction: function() { - var max = state.option.maxcomplexity; - var cc = this.ComplexityCount; - if (max && cc > max) { - warning("W074", functionStartToken, cc); - } - } - }; - } - - function increaseComplexityCount() { - funct["(metrics)"].ComplexityCount += 1; - } - - // Parse assignments that were found instead of conditionals. - // For example: if (a = 1) { ... } - - function checkCondAssignment(expr) { - var id, paren; - if (expr) { - id = expr.id; - paren = expr.paren; - if (id === "," && (expr = expr.exprs[expr.exprs.length - 1])) { - id = expr.id; - paren = paren || expr.paren; - } - } - switch (id) { - case "=": - case "+=": - case "-=": - case "*=": - case "%=": - case "&=": - case "|=": - case "^=": - case "/=": - if (!paren && !state.option.boss) { - warning("W084"); - } - } - } - - /** - * @param {object} props Collection of property descriptors for a given - * object. - */ - function checkProperties(props) { - // Check for lonely setters if in the ES5 mode. - if (state.option.inES5()) { - for (var name in props) { - if (_.has(props, name) && props[name].setterToken && !props[name].getterToken) { - warning("W078", props[name].setterToken); - } - } - } - } - - (function(x) { - x.nud = function() { - var b, f, i, p, t, g, nextVal; - var props = {}; // All properties, including accessors - - b = state.tokens.curr.line !== startLine(state.tokens.next); - if (b) { - indent += state.option.indent; - if (state.tokens.next.from === indent + state.option.indent) { - indent += state.option.indent; - } - } - - for (;;) { - if (state.tokens.next.id === "}") { - break; - } - - nextVal = state.tokens.next.value; - if (peek().id !== ":" && (nextVal === "get" || nextVal === "set")) { - advance(nextVal); - - if (!state.option.inES5()) { - error("E034"); - } - - i = propertyName(); - - // ES6 allows for get() {...} and set() {...} method - // definition shorthand syntax, so we don't produce an error - // if the esnext option is enabled. - if (!i && !state.option.inESNext()) { - error("E035"); - } - - // We don't want to save this getter unless it's an actual getter - // and not an ES6 concise method - if (i) { - saveAccessor(nextVal, props, i, state.tokens.curr); - } - - t = state.tokens.next; - f = doFunction(); - p = f["(params)"]; - - // Don't warn about getter/setter pairs if this is an ES6 concise method - if (nextVal === "get" && i && p) { - warning("W076", t, p[0], i); - } else if (nextVal === "set" && i && (!p || p.length !== 1)) { - warning("W077", t, i); - } - } else { - if (state.tokens.next.value === "*" && state.tokens.next.type === "(punctuator)") { - if (!state.option.inESNext()) { - warning("W104", state.tokens.next, "generator functions"); - } - advance("*"); - g = true; - } - if (state.tokens.next.identifier && - (peekIgnoreEOL().id === "," || peekIgnoreEOL().id === "}")) { - if (!state.option.inESNext()) { - warning("W104", state.tokens.next, "object short notation"); - } - i = propertyName(true); - saveProperty(props, i, state.tokens.next); - - expression(10); - } else { - if (state.tokens.next.id === "[") { - i = computedPropertyName(); - state.nameStack.set(i); - } else { - state.nameStack.set(state.tokens.next); - i = propertyName(); - saveProperty(props, i, state.tokens.next); - - if (typeof i !== "string") { - break; - } - } - - if (state.tokens.next.value === "(") { - if (!state.option.inESNext()) { - warning("W104", state.tokens.curr, "concise methods"); - } - doFunction({ type: g ? "generator" : null }); - } else { - advance(":"); - expression(10); - } - } - } - - countMember(i); - - if (state.tokens.next.id === ",") { - comma({ allowTrailing: true, property: true }); - if (state.tokens.next.id === ",") { - warning("W070", state.tokens.curr); - } else if (state.tokens.next.id === "}" && !state.option.inES5(true)) { - warning("W070", state.tokens.curr); - } - } else { - break; - } - } - if (b) { - indent -= state.option.indent; - } - advance("}", this); - - checkProperties(props); - - return this; - }; - x.fud = function() { - error("E036", state.tokens.curr); - }; - }(delim("{"))); - - function destructuringExpression() { - var id, ids; - var identifiers = []; - if (!state.option.inESNext()) { - warning("W104", state.tokens.curr, "destructuring expression"); - } - var nextInnerDE = function() { - var ident; - if (checkPunctuators(state.tokens.next, ["[", "{"])) { - ids = destructuringExpression(); - for (var id in ids) { - id = ids[id]; - identifiers.push({ id: id.id, token: id.token }); - } - } else if (checkPunctuators(state.tokens.next, [","])) { - identifiers.push({ id: null, token: state.tokens.curr }); - } else if (checkPunctuators(state.tokens.next, ["("])) { - advance("("); - nextInnerDE(); - advance(")"); - } else { - var is_rest = checkPunctuators(state.tokens.next, ["..."]); - ident = identifier(); - if (ident) - identifiers.push({ id: ident, token: state.tokens.curr }); - return is_rest; - } - return false; - }; - if (checkPunctuators(state.tokens.next, ["["])) { - advance("["); - var element_after_rest = false; - if (nextInnerDE() && checkPunctuators(state.tokens.next, [","]) && - !element_after_rest) { - warning("W130", state.tokens.next); - element_after_rest = true; - } - while (!checkPunctuators(state.tokens.next, ["]"])) { - advance(","); - if (checkPunctuators(state.tokens.next, ["]"])) { - // Trailing comma - break; - } - if (nextInnerDE() && checkPunctuators(state.tokens.next, [","]) && - !element_after_rest) { - warning("W130", state.tokens.next); - element_after_rest = true; - } - } - advance("]"); - } else if (checkPunctuators(state.tokens.next, ["{"])) { - advance("{"); - id = identifier(); - if (checkPunctuators(state.tokens.next, [":"])) { - advance(":"); - nextInnerDE(); - } else { - identifiers.push({ id: id, token: state.tokens.curr }); - } - while (!checkPunctuators(state.tokens.next, ["}"])) { - advance(","); - if (checkPunctuators(state.tokens.next, ["}"])) { - // Trailing comma - // ObjectBindingPattern: { BindingPropertyList , } - break; - } - id = identifier(); - if (checkPunctuators(state.tokens.next, [":"])) { - advance(":"); - nextInnerDE(); - } else { - identifiers.push({ id: id, token: state.tokens.curr }); - } - } - advance("}"); - } - return identifiers; - } - - function destructuringExpressionMatch(tokens, value) { - var first = value.first; - - if (!first) - return; - - _.zip(tokens, Array.isArray(first) ? first : [ first ]).forEach(function(val) { - var token = val[0]; - var value = val[1]; - - if (token && value) - token.first = value; - else if (token && token.first && !value) - warning("W080", token.first, token.first.value); - }); - } - - var conststatement = stmt("const", function(context) { - var prefix = context && context.prefix; - var inexport = context && context.inexport; - var tokens; - var value; - var lone; // State variable to know if it is a lone identifier, or a destructuring statement. - - if (!state.option.inESNext()) - warning("W104", state.tokens.curr, "const"); - - this.first = []; - for (;;) { - var names = []; - if (_.contains(["{", "["], state.tokens.next.value)) { - tokens = destructuringExpression(); - lone = false; - } else { - tokens = [ { id: identifier(), token: state.tokens.curr } ]; - lone = true; - if (inexport) { - exported[state.tokens.curr.value] = true; - state.tokens.curr.exported = true; - } - } - for (var t in tokens) { - if (tokens.hasOwnProperty(t)) { - t = tokens[t]; - if (funct[t.id] === "const") { - warning("E011", null, t.id); - } - if (funct["(global)"] && predefined[t.id] === false) { - warning("W079", t.token, t.id); - } - if (t.id) { - addlabel(t.id, { token: t.token, type: "const", unused: true }); - names.push(t.token); - } - } - } - if (prefix) { - break; - } - - this.first = this.first.concat(names); - - if (state.tokens.next.id !== "=") { - warning("E012", state.tokens.curr, state.tokens.curr.value); - } - - if (state.tokens.next.id === "=") { - advance("="); - if (state.tokens.next.id === "undefined") { - warning("W080", state.tokens.prev, state.tokens.prev.value); - } - if (peek(0).id === "=" && state.tokens.next.identifier) { - warning("W120", state.tokens.next, state.tokens.next.value); - } - value = expression(10); - if (lone) { - tokens[0].first = value; - } else { - destructuringExpressionMatch(names, value); - } - } - - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - return this; - }); - - conststatement.exps = true; - var varstatement = stmt("var", function(context) { - // JavaScript does not have block scope. It only has function scope. So, - // declaring a variable in a block can have unexpected consequences. - var prefix = context && context.prefix; - var inexport = context && context.inexport; - var tokens, lone, value; - - this.first = []; - for (;;) { - var names = []; - if (_.contains(["{", "["], state.tokens.next.value)) { - tokens = destructuringExpression(); - lone = false; - } else { - tokens = [ { id: identifier(), token: state.tokens.curr } ]; - lone = true; - if (inexport) { - exported[state.tokens.curr.value] = true; - state.tokens.curr.exported = true; - } - } - for (var t in tokens) { - if (tokens.hasOwnProperty(t)) { - t = tokens[t]; - if (state.option.inESNext() && funct[t.id] === "const") { - warning("E011", null, t.id); - } - if (funct["(global)"]) { - if (predefined[t.id] === false) { - warning("W079", t.token, t.id); - } else if (state.option.futurehostile === false) { - if ((!state.option.inES5() && vars.ecmaIdentifiers[5][t.id] === false) || - (!state.option.inESNext() && vars.ecmaIdentifiers[6][t.id] === false)) { - warning("W129", t.token, t.id); - } - } - } - if (t.id) { - addlabel(t.id, { type: "unused", token: t.token }); - names.push(t.token); - } - } - } - if (prefix) { - break; - } - - this.first = this.first.concat(names); - - if (state.tokens.next.id === "=") { - state.nameStack.set(state.tokens.curr); - advance("="); - if (state.tokens.next.id === "undefined") { - warning("W080", state.tokens.prev, state.tokens.prev.value); - } - if (peek(0).id === "=" && state.tokens.next.identifier) { - if (!funct["(params)"] || funct["(params)"].indexOf(state.tokens.next.value) === -1) { - warning("W120", state.tokens.next, state.tokens.next.value); - } - } - value = expression(10); - if (lone) { - tokens[0].first = value; - } else { - destructuringExpressionMatch(names, value); - } - } - - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - return this; - }); - varstatement.exps = true; - - var letstatement = stmt("let", function(context) { - var prefix = context && context.prefix; - var inexport = context && context.inexport; - var tokens, lone, value, letblock; - - if (!state.option.inESNext()) { - warning("W104", state.tokens.curr, "let"); - } - - if (state.tokens.next.value === "(") { - if (!state.option.inMoz(true)) { - warning("W118", state.tokens.next, "let block"); - } - advance("("); - funct["(blockscope)"].stack(); - letblock = true; - } else if (funct["(nolet)"]) { - error("E048", state.tokens.curr); - } - - this.first = []; - for (;;) { - var names = []; - if (_.contains(["{", "["], state.tokens.next.value)) { - tokens = destructuringExpression(); - lone = false; - } else { - tokens = [ { id: identifier(), token: state.tokens.curr.value } ]; - lone = true; - if (inexport) { - exported[state.tokens.curr.value] = true; - state.tokens.curr.exported = true; - } - } - for (var t in tokens) { - if (tokens.hasOwnProperty(t)) { - t = tokens[t]; - if (state.option.inESNext() && funct[t.id] === "const") { - warning("E011", null, t.id); - } - if (funct["(global)"] && predefined[t.id] === false) { - warning("W079", t.token, t.id); - } - if (t.id && !funct["(nolet)"]) { - addlabel(t.id, { type: "unused", token: t.token, islet: true }); - names.push(t.token); - } - } - } - if (prefix) { - break; - } - - this.first = this.first.concat(names); - - if (state.tokens.next.id === "=") { - advance("="); - if (state.tokens.next.id === "undefined") { - warning("W080", state.tokens.prev, state.tokens.prev.value); - } - if (peek(0).id === "=" && state.tokens.next.identifier) { - warning("W120", state.tokens.next, state.tokens.next.value); - } - value = expression(10); - if (lone) { - tokens[0].first = value; - } else { - destructuringExpressionMatch(names, value); - } - } - - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - if (letblock) { - advance(")"); - block(true, true); - this.block = true; - funct["(blockscope)"].unstack(); - } - - return this; - }); - letstatement.exps = true; - - blockstmt("class", function() { - return classdef.call(this, true); - }); - - function classdef(isStatement) { - - /*jshint validthis:true */ - if (!state.option.inESNext()) { - warning("W104", state.tokens.curr, "class"); - } - if (isStatement) { - // BindingIdentifier - this.name = identifier(); - addlabel(this.name, { type: "unused", token: state.tokens.curr }); - } else if (state.tokens.next.identifier && state.tokens.next.value !== "extends") { - // BindingIdentifier(opt) - this.name = identifier(); - this.namedExpr = true; - } else { - this.name = state.nameStack.infer(); - } - classtail(this); - return this; - } - - function classtail(c) { - var strictness = state.directive["use strict"]; - - // ClassHeritage(opt) - if (state.tokens.next.value === "extends") { - advance("extends"); - c.heritage = expression(10); - } - - // A ClassBody is always strict code. - state.directive["use strict"] = true; - advance("{"); - // ClassBody(opt) - c.body = classbody(c); - advance("}"); - state.directive["use strict"] = strictness; - } - - function classbody(c) { - var name; - var isStatic; - var isGenerator; - var getset; - var props = {}; - var staticProps = {}; - var computed; - for (var i = 0; state.tokens.next.id !== "}"; ++i) { - name = state.tokens.next; - isStatic = false; - isGenerator = false; - getset = null; - if (name.id === "*") { - isGenerator = true; - advance("*"); - name = state.tokens.next; - } - if (name.id === "[") { - name = computedPropertyName(); - } else if (isPropertyName(name)) { - // Non-Computed PropertyName - advance(); - computed = false; - if (name.identifier && name.value === "static") { - if (checkPunctuators(state.tokens.next, ["*"])) { - isGenerator = true; - advance("*"); - } - if (isPropertyName(state.tokens.next) || state.tokens.next.id === "[") { - computed = state.tokens.next.id === "["; - isStatic = true; - name = state.tokens.next; - if (state.tokens.next.id === "[") { - name = computedPropertyName(); - } else advance(); - } - } - - if (name.identifier && (name.value === "get" || name.value === "set")) { - if (isPropertyName(state.tokens.next) || state.tokens.next.id === "[") { - computed = state.tokens.next.id === "["; - getset = name; - name = state.tokens.next; - if (state.tokens.next.id === "[") { - name = computedPropertyName(); - } else advance(); - } - } - } else { - warning("W052", state.tokens.next, state.tokens.next.value || state.tokens.next.type); - advance(); - continue; - } - - if (!checkPunctuators(state.tokens.next, ["("])) { - // error --- class properties must be methods - error("E054", state.tokens.next, state.tokens.next.value); - while (state.tokens.next.id !== "}" && - !checkPunctuators(state.tokens.next, ["("])) { - advance(); - } - if (state.tokens.next.value !== "(") { - doFunction({ statement: c }); - } - } - - if (!computed) { - // We don't know how to determine if we have duplicate computed property names :( - if (getset) { - saveAccessor( - getset.value, isStatic ? staticProps : props, name.value, name, true, isStatic); - } else { - if (name.value === "constructor") { - state.nameStack.set(c); - } else { - state.nameStack.set(name); - } - saveProperty(isStatic ? staticProps : props, name.value, name, true, isStatic); - } - } - - if (getset && name.value === "constructor") { - var propDesc = getset.value === "get" ? "class getter method" : "class setter method"; - error("E049", name, propDesc, "constructor"); - } else if (name.value === "prototype") { - error("E049", name, "class method", "prototype"); - } - - propertyName(name); - - doFunction({ - statement: c, - type: isGenerator ? "generator" : null, - classExprBinding: c.namedExpr ? c.name : null - }); - } - - checkProperties(props); - } - - blockstmt("function", function() { - var generator = false; - if (state.tokens.next.value === "*") { - advance("*"); - if (state.option.inESNext(true)) { - generator = true; - } else { - warning("W119", state.tokens.curr, "function*"); - } - } - if (inblock) { - warning("W082", state.tokens.curr); - - } - var i = optionalidentifier(); - - if (i === undefined) { - warning("W025"); - } - - if (funct[i] === "const") { - warning("E011", null, i); - } - addlabel(i, { type: "unction", token: state.tokens.curr }); - - doFunction({ - name: i, - statement: this, - type: generator ? "generator" : null - }); - if (state.tokens.next.id === "(" && state.tokens.next.line === state.tokens.curr.line) { - error("E039"); - } - return this; - }); - - prefix("function", function() { - var generator = false; - - if (state.tokens.next.value === "*") { - if (!state.option.inESNext()) { - warning("W119", state.tokens.curr, "function*"); - } - advance("*"); - generator = true; - } - - var i = optionalidentifier(); - var fn = doFunction({ name: i, type: generator ? "generator" : null }); - - function isVariable(name) { return name[0] !== "("; } - function isLocal(name) { return fn[name] === "var"; } - - if (!state.option.loopfunc && funct["(loopage)"]) { - // If the function we just parsed accesses any non-local variables - // trigger a warning. Otherwise, the function is safe even within - // a loop. - if (_.some(fn, function(val, name) { return isVariable(name) && !isLocal(name); })) { - warning("W083"); - } - } - return this; - }); - - blockstmt("if", function() { - var t = state.tokens.next; - increaseComplexityCount(); - state.condition = true; - advance("("); - var expr = expression(0); - checkCondAssignment(expr); - - // When the if is within a for-in loop, check if the condition - // starts with a negation operator - var forinifcheck = null; - if (state.option.forin && state.forinifcheckneeded) { - state.forinifcheckneeded = false; // We only need to analyze the first if inside the loop - forinifcheck = state.forinifchecks[state.forinifchecks.length - 1]; - if (expr.type === "(punctuator)" && expr.value === "!") { - forinifcheck.type = "(negative)"; - } else { - forinifcheck.type = "(positive)"; - } - } - - advance(")", t); - state.condition = false; - var s = block(true, true); - - // When the if is within a for-in loop and the condition has a negative form, - // check if the body contains nothing but a continue statement - if (forinifcheck && forinifcheck.type === "(negative)") { - if (s && s.length === 1 && s[0].type === "(identifier)" && s[0].value === "continue") { - forinifcheck.type = "(negative-with-continue)"; - } - } - - if (state.tokens.next.id === "else") { - advance("else"); - if (state.tokens.next.id === "if" || state.tokens.next.id === "switch") { - statement(); - } else { - block(true, true); - } - } - return this; - }); - - blockstmt("try", function() { - var b; - - function doCatch() { - var oldScope = scope; - var e; - - advance("catch"); - advance("("); - - scope = Object.create(oldScope); - - e = state.tokens.next.value; - if (state.tokens.next.type !== "(identifier)") { - e = null; - warning("E030", state.tokens.next, e); - } - - advance(); - - funct = functor("(catch)", state.tokens.next, scope, { - "(context)" : funct, - "(breakage)" : funct["(breakage)"], - "(loopage)" : funct["(loopage)"], - "(statement)": false, - "(catch)" : true - }); - - if (e) { - addlabel(e, { type: "exception" }); - } - - if (state.tokens.next.value === "if") { - if (!state.option.inMoz(true)) { - warning("W118", state.tokens.curr, "catch filter"); - } - advance("if"); - expression(0); - } - - advance(")"); - - state.tokens.curr.funct = funct; - functions.push(funct); - - block(false); - - scope = oldScope; - - funct["(last)"] = state.tokens.curr.line; - funct["(lastcharacter)"] = state.tokens.curr.character; - funct = funct["(context)"]; - } - - block(true); - - while (state.tokens.next.id === "catch") { - increaseComplexityCount(); - if (b && (!state.option.inMoz(true))) { - warning("W118", state.tokens.next, "multiple catch blocks"); - } - doCatch(); - b = true; - } - - if (state.tokens.next.id === "finally") { - advance("finally"); - block(true); - return; - } - - if (!b) { - error("E021", state.tokens.next, "catch", state.tokens.next.value); - } - - return this; - }); - - blockstmt("while", function() { - var t = state.tokens.next; - funct["(breakage)"] += 1; - funct["(loopage)"] += 1; - increaseComplexityCount(); - advance("("); - checkCondAssignment(expression(0)); - advance(")", t); - block(true, true); - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - return this; - }).labelled = true; - - blockstmt("with", function() { - var t = state.tokens.next; - if (state.directive["use strict"]) { - error("E010", state.tokens.curr); - } else if (!state.option.withstmt) { - warning("W085", state.tokens.curr); - } - - advance("("); - expression(0); - advance(")", t); - block(true, true); - - return this; - }); - - blockstmt("switch", function() { - var t = state.tokens.next; - var g = false; - var noindent = false; - - funct["(breakage)"] += 1; - advance("("); - checkCondAssignment(expression(0)); - advance(")", t); - t = state.tokens.next; - advance("{"); - - if (state.tokens.next.from === indent) - noindent = true; - - if (!noindent) - indent += state.option.indent; - - this.cases = []; - - for (;;) { - switch (state.tokens.next.id) { - case "case": - switch (funct["(verb)"]) { - case "yield": - 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 (!reg.fallsThrough.test(state.lines[state.tokens.next.line - 2])) { - warning("W086", state.tokens.curr, "case"); - } - } - - advance("case"); - this.cases.push(expression(0)); - increaseComplexityCount(); - g = true; - advance(":"); - funct["(verb)"] = "case"; - break; - case "default": - switch (funct["(verb)"]) { - case "yield": - case "break": - case "continue": - case "return": - case "throw": - break; - default: - // Do not display a warning if 'default' is the first statement or if - // there is a special /* falls through */ comment. - if (this.cases.length) { - if (!reg.fallsThrough.test(state.lines[state.tokens.next.line - 2])) { - warning("W086", state.tokens.curr, "default"); - } - } - } - - advance("default"); - g = true; - advance(":"); - break; - case "}": - if (!noindent) - indent -= state.option.indent; - - advance("}", t); - funct["(breakage)"] -= 1; - funct["(verb)"] = undefined; - return; - case "(end)": - error("E023", state.tokens.next, "}"); - return; - default: - indent += state.option.indent; - if (g) { - switch (state.tokens.curr.id) { - case ",": - error("E040"); - return; - case ":": - g = false; - statements(); - break; - default: - error("E025", state.tokens.curr); - return; - } - } else { - if (state.tokens.curr.id === ":") { - advance(":"); - error("E024", state.tokens.curr, ":"); - statements(); - } else { - error("E021", state.tokens.next, "case", state.tokens.next.value); - return; - } - } - indent -= state.option.indent; - } - } - }).labelled = true; - - stmt("debugger", function() { - if (!state.option.debug) { - warning("W087", this); - } - return this; - }).exps = true; - - (function() { - var x = stmt("do", function() { - funct["(breakage)"] += 1; - funct["(loopage)"] += 1; - increaseComplexityCount(); - - this.first = block(true, true); - advance("while"); - var t = state.tokens.next; - advance("("); - checkCondAssignment(expression(0)); - advance(")", t); - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - return this; - }); - x.labelled = true; - x.exps = true; - }()); - - blockstmt("for", function() { - var s, t = state.tokens.next; - var letscope = false; - var foreachtok = null; - - if (t.value === "each") { - foreachtok = t; - advance("each"); - if (!state.option.inMoz(true)) { - warning("W118", state.tokens.curr, "for each"); - } - } - - funct["(breakage)"] += 1; - funct["(loopage)"] += 1; - increaseComplexityCount(); - advance("("); - - // what kind of for(…) statement it is? for(…of…)? for(…in…)? for(…;…;…)? - var nextop; // contains the token of the "in" or "of" operator - var i = 0; - var inof = ["in", "of"]; - do { - nextop = peek(i); - ++i; - } while (!_.contains(inof, nextop.value) && nextop.value !== ";" && nextop.type !== "(end)"); - - // if we're in a for (… in|of …) statement - if (_.contains(inof, nextop.value)) { - if (!state.option.inESNext() && nextop.value === "of") { - error("W104", nextop, "for of"); - } - - if (state.tokens.next.id === "var") { - advance("var"); - state.tokens.curr.fud({ prefix: true }); - } else if (state.tokens.next.id === "let") { - advance("let"); - // create a new block scope - letscope = true; - funct["(blockscope)"].stack(); - state.tokens.curr.fud({ prefix: true }); - } else if (!state.tokens.next.identifier) { - error("E030", state.tokens.next, state.tokens.next.type); - advance(); - } else { - switch (funct[state.tokens.next.value]) { - case "unused": - funct[state.tokens.next.value] = "var"; - break; - case "var": - break; - default: - var ident = state.tokens.next.value; - if (!funct["(blockscope)"].getlabel(ident) && - !(scope[ident] || {})[ident]) { - warning("W088", state.tokens.next, state.tokens.next.value); - } - } - advance(); - } - advance(nextop.value); - expression(20); - advance(")", t); - - if (nextop.value === "in" && state.option.forin) { - state.forinifcheckneeded = true; - - if (state.forinifchecks === undefined) { - state.forinifchecks = []; - } - - // Push a new for-in-if check onto the stack. The type will be modified - // when the loop's body is parsed and a suitable if statement exists. - state.forinifchecks.push({ - type: "(none)" - }); - } - - s = block(true, true); - - if (nextop.value === "in" && state.option.forin) { - if (state.forinifchecks && state.forinifchecks.length > 0) { - var check = state.forinifchecks.pop(); - - if (// No if statement or not the first statement in loop body - s && s.length > 0 && (typeof s[0] !== "object" || s[0].value !== "if") || - // Positive if statement is not the only one in loop body - check.type === "(positive)" && s.length > 1 || - // Negative if statement but no continue - check.type === "(negative)") { - warning("W089", this); - } - } - - // Reset the flag in case no if statement was contained in the loop body - state.forinifcheckneeded = false; - } - - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - } else { - if (foreachtok) { - error("E045", foreachtok); - } - if (state.tokens.next.id !== ";") { - if (state.tokens.next.id === "var") { - advance("var"); - state.tokens.curr.fud(); - } else if (state.tokens.next.id === "let") { - advance("let"); - // create a new block scope - letscope = true; - funct["(blockscope)"].stack(); - state.tokens.curr.fud(); - } else { - for (;;) { - expression(0, "for"); - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - } - } - nolinebreak(state.tokens.curr); - advance(";"); - if (state.tokens.next.id !== ";") { - checkCondAssignment(expression(0)); - } - nolinebreak(state.tokens.curr); - advance(";"); - if (state.tokens.next.id === ";") { - error("E021", state.tokens.next, ")", ";"); - } - if (state.tokens.next.id !== ")") { - for (;;) { - expression(0, "for"); - if (state.tokens.next.id !== ",") { - break; - } - comma(); - } - } - advance(")", t); - block(true, true); - funct["(breakage)"] -= 1; - funct["(loopage)"] -= 1; - - } - // unstack loop blockscope - if (letscope) { - funct["(blockscope)"].unstack(); - } - return this; - }).labelled = true; - - - stmt("break", function() { - var v = state.tokens.next.value; - - if (funct["(breakage)"] === 0) - warning("W052", state.tokens.next, this.value); - - if (!state.option.asi) - nolinebreak(this); - - if (state.tokens.next.id !== ";" && !state.tokens.next.reach) { - if (state.tokens.curr.line === startLine(state.tokens.next)) { - if (funct[v] !== "label") { - warning("W090", state.tokens.next, v); - } else if (scope[v] !== funct) { - warning("W091", state.tokens.next, v); - } - this.first = state.tokens.next; - advance(); - } - } - - reachable(this); - - return this; - }).exps = true; - - - stmt("continue", function() { - var v = state.tokens.next.value; - - if (funct["(breakage)"] === 0) - warning("W052", state.tokens.next, this.value); - - if (!state.option.asi) - nolinebreak(this); - - if (state.tokens.next.id !== ";" && !state.tokens.next.reach) { - if (state.tokens.curr.line === startLine(state.tokens.next)) { - if (funct[v] !== "label") { - warning("W090", state.tokens.next, v); - } else if (scope[v] !== funct) { - warning("W091", state.tokens.next, v); - } - this.first = state.tokens.next; - advance(); - } - } else if (!funct["(loopage)"]) { - warning("W052", state.tokens.next, this.value); - } - - reachable(this); - - return this; - }).exps = true; - - - stmt("return", function() { - if (this.line === startLine(state.tokens.next)) { - if (state.tokens.next.id !== ";" && !state.tokens.next.reach) { - this.first = expression(0); - - if (this.first && - this.first.type === "(punctuator)" && this.first.value === "=" && - !this.first.paren && !state.option.boss) { - warningAt("W093", this.first.line, this.first.character); - } - } - } else { - if (state.tokens.next.type === "(punctuator)" && - ["[", "{", "+", "-"].indexOf(state.tokens.next.value) > -1) { - nolinebreak(this); // always warn (Line breaking error) - } - } - - reachable(this); - - return this; - }).exps = true; - - (function(x) { - x.exps = true; - x.lbp = 25; - }(prefix("yield", function() { - var prev = state.tokens.prev; - if (state.option.inESNext(true) && !funct["(generator)"]) { - // If it's a yield within a catch clause inside a generator then that's ok - if (!("(catch)" === funct["(name)"] && funct["(context)"]["(generator)"])) { - error("E046", state.tokens.curr, "yield"); - } - } else if (!state.option.inESNext()) { - warning("W104", state.tokens.curr, "yield"); - } - funct["(generator)"] = "yielded"; - var delegatingYield = false; - - if (state.tokens.next.value === "*") { - delegatingYield = true; - advance("*"); - } - - if (this.line === startLine(state.tokens.next) || !state.option.inMoz(true)) { - if (delegatingYield || - (state.tokens.next.id !== ";" && !state.tokens.next.reach && state.tokens.next.nud)) { - - nobreaknonadjacent(state.tokens.curr, state.tokens.next); - this.first = expression(10); - - if (this.first.type === "(punctuator)" && this.first.value === "=" && - !this.first.paren && !state.option.boss) { - warningAt("W093", this.first.line, this.first.character); - } - } - - if (state.option.inMoz(true) && state.tokens.next.id !== ")" && - (prev.lbp > 30 || (!prev.assign && !isEndOfExpr()) || prev.id === "yield")) { - error("E050", this); - } - } else if (!state.option.asi) { - nolinebreak(this); // always warn (Line breaking error) - } - return this; - }))); - - - stmt("throw", function() { - nolinebreak(this); - this.first = expression(20); - - reachable(this); - - return this; - }).exps = true; - - stmt("import", function() { - if (!state.option.inESNext()) { - warning("W119", state.tokens.curr, "import"); - } - - if (state.tokens.next.type === "(string)") { - // ModuleSpecifier :: StringLiteral - advance("(string)"); - return this; - } - - if (state.tokens.next.identifier) { - // ImportClause :: ImportedDefaultBinding - this.name = identifier(); - addlabel(this.name, { type: "unused", token: state.tokens.curr }); - if (state.tokens.next.value === ",") { - // ImportClause :: ImportedDefaultBinding , NameSpaceImport - // ImportClause :: ImportedDefaultBinding , NamedImports - advance(","); - // At this point, we intentionally fall through to continue matching - // either NameSpaceImport or NamedImports. - // Discussion: - // https://github.com/jshint/jshint/pull/2144#discussion_r23978406 - } else { - advance("from"); - advance("(string)"); - return this; - } - } - - if (state.tokens.next.id === "*") { - // ImportClause :: NameSpaceImport - advance("*"); - advance("as"); - if (state.tokens.next.identifier) { - this.name = identifier(); - addlabel(this.name, { type: "unused", token: state.tokens.curr }); - } - } else { - // ImportClause :: NamedImports - advance("{"); - for (;;) { - if (state.tokens.next.value === "}") { - advance("}"); - break; - } - var importName; - if (state.tokens.next.type === "default") { - importName = "default"; - advance("default"); - } else { - importName = identifier(); - } - if (state.tokens.next.value === "as") { - advance("as"); - importName = identifier(); - } - addlabel(importName, { type: "unused", token: state.tokens.curr }); - - if (state.tokens.next.value === ",") { - advance(","); - } else if (state.tokens.next.value === "}") { - advance("}"); - break; - } else { - error("E024", state.tokens.next, state.tokens.next.value); - break; - } - } - } - - // FromClause - advance("from"); - advance("(string)"); - return this; - }).exps = true; - - stmt("export", function() { - var ok = true; - var token; - var identifier; - - if (!state.option.inESNext()) { - warning("W119", state.tokens.curr, "export"); - ok = false; - } - - if (!funct["(global)"] || !funct["(blockscope)"].atTop()) { - error("E053", state.tokens.curr); - ok = false; - } - - if (state.tokens.next.value === "*") { - // ExportDeclaration :: export * FromClause - advance("*"); - advance("from"); - advance("(string)"); - return this; - } - - if (state.tokens.next.type === "default") { - // ExportDeclaration :: export default HoistableDeclaration - // ExportDeclaration :: export default ClassDeclaration - state.nameStack.set(state.tokens.next); - advance("default"); - if (state.tokens.next.id === "function" || state.tokens.next.id === "class") { - this.block = true; - } - - token = peek(); - - expression(10); - - if (state.tokens.next.id === "class") { - identifier = token.name; - } else { - identifier = token.value; - } - - addlabel(identifier, { - type: "function", token: token - }); - - return this; - } - - if (state.tokens.next.value === "{") { - // ExportDeclaration :: export ExportClause - advance("{"); - var exportedTokens = []; - for (;;) { - if (!state.tokens.next.identifier) { - error("E030", state.tokens.next, state.tokens.next.value); - } - advance(); - - state.tokens.curr.exported = ok; - exportedTokens.push(state.tokens.curr); - - if (state.tokens.next.value === "as") { - advance("as"); - if (!state.tokens.next.identifier) { - error("E030", state.tokens.next, state.tokens.next.value); - } - advance(); - } - - if (state.tokens.next.value === ",") { - advance(","); - } else if (state.tokens.next.value === "}") { - advance("}"); - break; - } else { - error("E024", state.tokens.next, state.tokens.next.value); - break; - } - } - if (state.tokens.next.value === "from") { - // ExportDeclaration :: export ExportClause FromClause - advance("from"); - advance("(string)"); - } else if (ok) { - exportedTokens.forEach(function(token) { - if (!funct[token.value]) { - isundef(funct, "W117", token, token.value); - } - exported[token.value] = true; - funct["(blockscope)"].setExported(token.value); - }); - } - return this; - } - - if (state.tokens.next.id === "var") { - // ExportDeclaration :: export VariableStatement - advance("var"); - state.tokens.curr.fud({ inexport:true }); - } else if (state.tokens.next.id === "let") { - // ExportDeclaration :: export VariableStatement - advance("let"); - state.tokens.curr.fud({ inexport:true }); - } else if (state.tokens.next.id === "const") { - // ExportDeclaration :: export VariableStatement - advance("const"); - state.tokens.curr.fud({ inexport:true }); - } else if (state.tokens.next.id === "function") { - // ExportDeclaration :: export Declaration - this.block = true; - advance("function"); - exported[state.tokens.next.value] = ok; - state.tokens.next.exported = true; - state.syntax["function"].fud(); - } else if (state.tokens.next.id === "class") { - // ExportDeclaration :: export Declaration - this.block = true; - advance("class"); - exported[state.tokens.next.value] = ok; - state.tokens.next.exported = true; - state.syntax["class"].fud(); - } else { - error("E024", state.tokens.next, state.tokens.next.value); - } - - return this; - }).exps = true; - - // Future Reserved Words - - FutureReservedWord("abstract"); - FutureReservedWord("boolean"); - FutureReservedWord("byte"); - FutureReservedWord("char"); - FutureReservedWord("class", { es5: true, nud: classdef }); - FutureReservedWord("double"); - FutureReservedWord("enum", { es5: true }); - FutureReservedWord("export", { es5: true }); - FutureReservedWord("extends", { es5: true }); - FutureReservedWord("final"); - FutureReservedWord("float"); - FutureReservedWord("goto"); - FutureReservedWord("implements", { es5: true, strictOnly: true }); - FutureReservedWord("import", { es5: true }); - FutureReservedWord("int"); - FutureReservedWord("interface", { es5: true, strictOnly: true }); - FutureReservedWord("long"); - FutureReservedWord("native"); - FutureReservedWord("package", { es5: true, strictOnly: true }); - FutureReservedWord("private", { es5: true, strictOnly: true }); - FutureReservedWord("protected", { es5: true, strictOnly: true }); - FutureReservedWord("public", { es5: true, strictOnly: true }); - FutureReservedWord("short"); - FutureReservedWord("static", { es5: true, strictOnly: true }); - FutureReservedWord("super", { es5: true }); - FutureReservedWord("synchronized"); - FutureReservedWord("transient"); - FutureReservedWord("volatile"); - - // this function is used to determine whether a squarebracket or a curlybracket - // expression is a comprehension array, destructuring assignment or a json value. - - var lookupBlockType = function() { - var pn, pn1; - var i = -1; - var bracketStack = 0; - var ret = {}; - if (checkPunctuators(state.tokens.curr, ["[", "{"])) - bracketStack += 1; - do { - pn = (i === -1) ? state.tokens.next : peek(i); - pn1 = peek(i + 1); - i = i + 1; - if (checkPunctuators(pn, ["[", "{"])) { - bracketStack += 1; - } else if (checkPunctuators(pn, ["]", "}"])) { - bracketStack -= 1; - } - if (pn.identifier && pn.value === "for" && bracketStack === 1) { - ret.isCompArray = true; - ret.notJson = true; - break; - } - if (checkPunctuators(pn, ["}", "]"]) && bracketStack === 0) { - if (pn1.value === "=") { - ret.isDestAssign = true; - ret.notJson = true; - break; - } else if (pn1.value === ".") { - ret.notJson = true; - break; - } - } - if (pn.value === ";") { - ret.isBlock = true; - ret.notJson = true; - } - } while (bracketStack > 0 && pn.id !== "(end)"); - return ret; - }; - - function saveProperty(props, name, tkn, isClass, isStatic) { - var msg = ["key", "class method", "static class method"]; - msg = msg[(isClass || false) + (isStatic || false)]; - if (tkn.identifier) { - name = tkn.value; - } - - if (props[name] && _.has(props, name)) { - warning("W075", state.tokens.next, msg, name); - } else { - props[name] = {}; - } - - props[name].basic = true; - props[name].basictkn = tkn; - } - - /** - * @param {string} accessorType - Either "get" or "set" - * @param {object} props - a collection of all properties of the object to - * which the current accessor is being assigned - * @param {object} tkn - the identifier token representing the accessor name - * @param {boolean} isClass - whether the accessor is part of an ES6 Class - * definition - * @param {boolean} isStatic - whether the accessor is a static method - */ - function saveAccessor(accessorType, props, name, tkn, isClass, isStatic) { - var flagName = accessorType === "get" ? "getterToken" : "setterToken"; - var msg = ""; - - if (isClass) { - if (isStatic) { - msg += "static "; - } - msg += accessorType + "ter method"; - } else { - msg = "key"; - } - - state.tokens.curr.accessorType = accessorType; - state.nameStack.set(tkn); - - if (props[name] && _.has(props, name)) { - if (props[name].basic || props[name][flagName]) { - warning("W075", state.tokens.next, msg, name); - } - } else { - props[name] = {}; - } - - props[name][flagName] = tkn; - } - - function computedPropertyName() { - advance("["); - if (!state.option.esnext) { - warning("W119", state.tokens.curr, "computed property names"); - } - var value = expression(10); - advance("]"); - return value; - } - - // Test whether a given token is a punctuator matching one of the specified values - function checkPunctuators(token, values) { - return token.type === "(punctuator)" && _.contains(values, token.value); - } - - // Check whether this function has been reached for a destructuring assign with undeclared values - function destructuringAssignOrJsonValue() { - // lookup for the assignment (esnext only) - // if it has semicolons, it is a block, so go parse it as a block - // or it's not a block, but there are assignments, check for undeclared variables - - var block = lookupBlockType(); - if (block.notJson) { - if (!state.option.inESNext() && block.isDestAssign) { - warning("W104", state.tokens.curr, "destructuring assignment"); - } - statements(); - // otherwise parse json value - } else { - state.option.laxbreak = true; - state.jsonMode = true; - jsonValue(); - } - } - - // array comprehension parsing function - // parses and defines the three states of the list comprehension in order - // to avoid defining global variables, but keeping them to the list comprehension scope - // only. The order of the states are as follows: - // * "use" which will be the returned iterative part of the list comprehension - // * "define" which will define the variables local to the list comprehension - // * "filter" which will help filter out values - - var arrayComprehension = function() { - var CompArray = function() { - this.mode = "use"; - this.variables = []; - }; - var _carrays = []; - var _current; - function declare(v) { - var l = _current.variables.filter(function(elt) { - // if it has, change its undef state - if (elt.value === v) { - elt.undef = false; - return v; - } - }).length; - return l !== 0; - } - function use(v) { - var l = _current.variables.filter(function(elt) { - // and if it has been defined - if (elt.value === v && !elt.undef) { - if (elt.unused === true) { - elt.unused = false; - } - return v; - } - }).length; - // otherwise we warn about it - return (l === 0); - } - return { stack: function() { - _current = new CompArray(); - _carrays.push(_current); - }, - unstack: function() { - _current.variables.filter(function(v) { - if (v.unused) - warning("W098", v.token, v.raw_text || v.value); - if (v.undef) - isundef(v.funct, "W117", v.token, v.value); - }); - _carrays.splice(-1, 1); - _current = _carrays[_carrays.length - 1]; - }, - setState: function(s) { - if (_.contains(["use", "define", "generate", "filter"], s)) - _current.mode = s; - }, - check: function(v) { - if (!_current) { - return; - } - // When we are in "use" state of the list comp, we enqueue that var - if (_current && _current.mode === "use") { - if (use(v)) { - _current.variables.push({ - funct: funct, - token: state.tokens.curr, - value: v, - undef: true, - unused: false - }); - } - return true; - // When we are in "define" state of the list comp, - } else if (_current && _current.mode === "define") { - // check if the variable has been used previously - if (!declare(v)) { - _current.variables.push({ - funct: funct, - token: state.tokens.curr, - value: v, - undef: false, - unused: true - }); - } - return true; - // When we are in the "generate" state of the list comp, - } else if (_current && _current.mode === "generate") { - isundef(funct, "W117", state.tokens.curr, v); - return true; - // When we are in "filter" state, - } else if (_current && _current.mode === "filter") { - // we check whether current variable has been declared - if (use(v)) { - // if not we warn about it - isundef(funct, "W117", state.tokens.curr, v); - } - return true; - } - return false; - } - }; - }; - - - // Parse JSON - - function jsonValue() { - function jsonObject() { - var o = {}, t = state.tokens.next; - advance("{"); - if (state.tokens.next.id !== "}") { - for (;;) { - if (state.tokens.next.id === "(end)") { - error("E026", state.tokens.next, t.line); - } else if (state.tokens.next.id === "}") { - warning("W094", state.tokens.curr); - break; - } else if (state.tokens.next.id === ",") { - error("E028", state.tokens.next); - } else if (state.tokens.next.id !== "(string)") { - warning("W095", state.tokens.next, state.tokens.next.value); - } - if (o[state.tokens.next.value] === true) { - warning("W075", state.tokens.next, "key", state.tokens.next.value); - } else if ((state.tokens.next.value === "__proto__" && - !state.option.proto) || (state.tokens.next.value === "__iterator__" && - !state.option.iterator)) { - warning("W096", state.tokens.next, state.tokens.next.value); - } else { - o[state.tokens.next.value] = true; - } - advance(); - advance(":"); - jsonValue(); - if (state.tokens.next.id !== ",") { - break; - } - advance(","); - } - } - advance("}"); - } - - function jsonArray() { - var t = state.tokens.next; - advance("["); - if (state.tokens.next.id !== "]") { - for (;;) { - if (state.tokens.next.id === "(end)") { - error("E027", state.tokens.next, t.line); - } else if (state.tokens.next.id === "]") { - warning("W094", state.tokens.curr); - break; - } else if (state.tokens.next.id === ",") { - error("E028", state.tokens.next); - } - jsonValue(); - if (state.tokens.next.id !== ",") { - break; - } - advance(","); - } - } - advance("]"); - } - - switch (state.tokens.next.id) { - case "{": - jsonObject(); - break; - case "[": - jsonArray(); - break; - case "true": - case "false": - case "null": - case "(number)": - case "(string)": - advance(); - break; - case "-": - advance("-"); - advance("(number)"); - break; - default: - error("E003", state.tokens.next); - } - } - - var blockScope = function() { - var _current = {}; - var _variables = [_current]; - - function _checkBlockLabels() { - for (var t in _current) { - if (_current[t]["(type)"] === "unused") { - if (state.option.unused) { - var tkn = _current[t]["(token)"]; - // Don't report exported labels as unused - if (tkn.exported) { - continue; - } - var line = tkn.line; - var chr = tkn.character; - warningAt("W098", line, chr, t); - } - } - } - } - - return { - stack: function() { - _current = {}; - _variables.push(_current); - }, - - unstack: function() { - _checkBlockLabels(); - _variables.splice(_variables.length - 1, 1); - _current = _.last(_variables); - }, - - getlabel: function(l) { - for (var i = _variables.length - 1 ; i >= 0; --i) { - if (_.has(_variables[i], l) && !_variables[i][l]["(shadowed)"]) { - return _variables[i]; - } - } - }, - - shadow: function(name) { - for (var i = _variables.length - 1; i >= 0; i--) { - if (_.has(_variables[i], name)) { - _variables[i][name]["(shadowed)"] = true; - } - } - }, - - unshadow: function(name) { - for (var i = _variables.length - 1; i >= 0; i--) { - if (_.has(_variables[i], name)) { - _variables[i][name]["(shadowed)"] = false; - } - } - }, - - atTop: function() { - return _variables.length === 1; - }, - - setExported: function(id) { - if (funct["(blockscope)"].atTop()) { - var item = _current[id]; - if (item && item["(token)"]) { - item["(token)"].exported = true; - } - } - }, - - current: { - has: function(t) { - return _.has(_current, t); - }, - - add: function(t, type, tok) { - _current[t] = { "(type)" : type, "(token)": tok, "(shadowed)": false }; - } - } - }; - }; - - var escapeRegex = function(str) { - return str.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"); - }; - - // The actual JSHINT function itself. - var itself = function(s, o, g) { - var i, k, x, reIgnoreStr, reIgnore; - var optionKeys; - var newOptionObj = {}; - var newIgnoredObj = {}; - - o = _.clone(o); - state.reset(); - - if (o && o.scope) { - JSHINT.scope = o.scope; - } else { - JSHINT.errors = []; - JSHINT.undefs = []; - JSHINT.internals = []; - JSHINT.blacklist = {}; - JSHINT.scope = "(main)"; - } - - predefined = Object.create(null); - combine(predefined, vars.ecmaIdentifiers[3]); - combine(predefined, vars.reservedVars); - - combine(predefined, g || {}); - - declared = Object.create(null); - exported = Object.create(null); - - function each(obj, cb) { - if (!obj) - return; - - if (!Array.isArray(obj) && typeof obj === "object") - obj = Object.keys(obj); - - obj.forEach(cb); - } - - if (o) { - each(o.predef || null, function(item) { - var slice, prop; - - if (item[0] === "-") { - slice = item.slice(1); - JSHINT.blacklist[slice] = slice; - // remove from predefined if there - delete predefined[slice]; - } else { - prop = Object.getOwnPropertyDescriptor(o.predef, item); - predefined[item] = prop ? prop.value : false; - } - }); - - each(o.exported || null, function(item) { - exported[item] = true; - }); - - delete o.predef; - delete o.exported; - - optionKeys = Object.keys(o); - for (x = 0; x < optionKeys.length; x++) { - if (/^-W\d{3}$/g.test(optionKeys[x])) { - newIgnoredObj[optionKeys[x].slice(1)] = true; - } else { - newOptionObj[optionKeys[x]] = o[optionKeys[x]]; - - if (optionKeys[x] === "newcap" && o[optionKeys[x]] === false) - newOptionObj["(explicitNewcap)"] = true; - } - } - } - - state.option = newOptionObj; - state.ignored = newIgnoredObj; - - state.option.indent = state.option.indent || 4; - state.option.maxerr = state.option.maxerr || 50; - - indent = 1; - global = Object.create(predefined); - scope = global; - - funct = functor("(global)", null, scope, { - "(global)" : true, - "(blockscope)": blockScope(), - "(comparray)" : arrayComprehension(), - "(metrics)" : createMetrics(state.tokens.next) - }); - - functions = [funct]; - urls = []; - stack = null; - member = {}; - membersOnly = null; - implied = {}; - inblock = false; - lookahead = []; - unuseds = []; - - if (!isString(s) && !Array.isArray(s)) { - errorAt("E004", 0); - return false; - } - - api = { - get isJSON() { - return state.jsonMode; - }, - - getOption: function(name) { - return state.option[name] || null; - }, - - getCache: function(name) { - return state.cache[name]; - }, - - setCache: function(name, value) { - state.cache[name] = value; - }, - - warn: function(code, data) { - warningAt.apply(null, [ code, data.line, data.char ].concat(data.data)); - }, - - on: function(names, listener) { - names.split(" ").forEach(function(name) { - emitter.on(name, listener); - }.bind(this)); - } - }; - - emitter.removeAllListeners(); - (extraModules || []).forEach(function(func) { - func(api); - }); - - state.tokens.prev = state.tokens.curr = state.tokens.next = state.syntax["(begin)"]; - - if (o && o.ignoreDelimiters) { - - if (!Array.isArray(o.ignoreDelimiters)) { - o.ignoreDelimiters = [o.ignoreDelimiters]; - } - - o.ignoreDelimiters.forEach(function(delimiterPair) { - if (!delimiterPair.start || !delimiterPair.end) - return; - - reIgnoreStr = escapeRegex(delimiterPair.start) + - "[\\s\\S]*?" + - escapeRegex(delimiterPair.end); - - reIgnore = new RegExp(reIgnoreStr, "ig"); - - s = s.replace(reIgnore, function(match) { - return match.replace(/./g, " "); - }); - }); - } - - lex = new Lexer(s); - - lex.on("warning", function(ev) { - warningAt.apply(null, [ ev.code, ev.line, ev.character].concat(ev.data)); - }); - - lex.on("error", function(ev) { - errorAt.apply(null, [ ev.code, ev.line, ev.character ].concat(ev.data)); - }); - - lex.on("fatal", function(ev) { - quit("E041", ev.line, ev.from); - }); - - lex.on("Identifier", function(ev) { - emitter.emit("Identifier", ev); - }); - - lex.on("String", function(ev) { - emitter.emit("String", ev); - }); - - lex.on("Number", function(ev) { - emitter.emit("Number", ev); - }); - - lex.start(); - - // Check options - for (var name in o) { - if (_.has(o, name)) { - checkOption(name, state.tokens.curr); - } - } - - assume(); - - // combine the passed globals after we've assumed all our options - combine(predefined, g || {}); - - //reset values - comma.first = true; - - try { - advance(); - switch (state.tokens.next.id) { - case "{": - case "[": - destructuringAssignOrJsonValue(); - break; - default: - directives(); - - if (state.directive["use strict"]) { - if (!state.option.globalstrict) { - if (!(state.option.node || state.option.phantom || state.option.browserify)) { - warning("W097", state.tokens.prev); - } - } - } - - statements(); - } - advance((state.tokens.next && state.tokens.next.value !== ".") ? "(end)" : undefined); - funct["(blockscope)"].unstack(); - - 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; - }; - - var warnUnused = function(name, tkn, type, unused_opt) { - var line = tkn.line; - var chr = tkn.from; - var raw_name = tkn.raw_text || name; - - if (unused_opt === undefined) { - unused_opt = state.option.unused; - } - - if (unused_opt === true) { - unused_opt = "last-param"; - } - - var warnable_types = { - "vars": ["var"], - "last-param": ["var", "param"], - "strict": ["var", "param", "last-param"] - }; - - if (unused_opt) { - if (warnable_types[unused_opt] && warnable_types[unused_opt].indexOf(type) !== -1) { - if (!tkn.exported) { - warningAt("W098", line, chr, raw_name); - } - } - } - - unuseds.push({ - name: name, - line: line, - character: chr - }); - }; - - var checkUnused = function(func, key) { - var type = func[key]; - var tkn = func["(tokens)"][key]; - - if (key.charAt(0) === "(") - return; - - if (type !== "unused" && type !== "unction" && type !== "const") - return; - - // Params are checked separately from other variables. - if (func["(params)"] && func["(params)"].indexOf(key) !== -1) - return; - - // Variable is in global scope and defined as exported. - if (func["(global)"] && _.has(exported, key)) - return; - - // Is this constant unused? - if (type === "const" && !getprop(func, key, "unused")) - return; - - warnUnused(key, tkn, "var"); - }; - - // 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]) || k[2].forgiveUndef) { - clearImplied(k[2].value, k[2].line); - } else if (state.option.undef) { - warning.apply(warning, k.slice(1)); - } - } - - functions.forEach(function(func) { - if (func["(unusedOption)"] === false) { - return; - } - - for (var key in func) { - if (_.has(func, key)) { - checkUnused(func, key); - } - } - - if (!func["(params)"]) - return; - - var params = func["(params)"].slice(); - var param = params.pop(); - var type, unused_opt; - - while (param) { - type = func[param]; - unused_opt = func["(unusedOption)"] || state.option.unused; - unused_opt = unused_opt === true ? "last-param" : unused_opt; - - // 'undefined' is a special case for (function(window, undefined) { ... })(); - // patterns. - - if (param === "undefined") - return; - - if (type === "unused" || type === "unction") { - warnUnused(param, func["(tokens)"][param], "param", func["(unusedOption)"]); - } else if (unused_opt === "last-param") { - return; - } - - param = params.pop(); - } - }); - - for (var key in declared) { - if (_.has(declared, key) && !_.has(global, key) && !_.has(exported, key)) { - warnUnused(key, declared[key], "var"); - } - } - - } catch (err) { - if (err && err.name === "JSHintError") { - var nt = state.tokens.next || {}; - JSHINT.errors.push({ - scope : "(main)", - raw : err.raw, - code : err.code, - reason : err.message, - line : err.line || nt.line, - character : err.character || nt.from - }, null); - } else { - throw err; - } - } - - // Loop over the listed "internals", and check them as well. - - if (JSHINT.scope === "(main)") { - o = o || {}; - - for (i = 0; i < JSHINT.internals.length; i += 1) { - k = JSHINT.internals[i]; - o.scope = k.elem; - itself(k.value, o, g); - } - } - - return JSHINT.errors.length === 0; - }; - - // Modules. - itself.addModule = function(func) { - extraModules.push(func); - }; - - itself.addModule(style.register); - - // Data summary. - itself.data = function() { - var data = { - functions: [], - options: state.option - }; - - var implieds = []; - var members = []; - var fu, f, i, j, n, globals; - - if (itself.errors.length) { - data.errors = itself.errors; - } - - if (state.jsonMode) { - data.json = true; - } - - for (n in implied) { - if (_.has(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 (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.character = f["(character)"]; - fu.last = f["(last)"]; - fu.lastcharacter = f["(lastcharacter)"]; - - fu.metrics = { - complexity: f["(metrics)"].ComplexityCount, - parameters: (f["(params)"] || []).length, - statements: f["(metrics)"].statementCount - }; - - data.functions.push(fu); - } - - if (unuseds.length > 0) { - data.unused = unuseds; - } - - members = []; - for (n in member) { - if (typeof member[n] === "number") { - data.member = member; - break; - } - } - - return data; - }; - - itself.jshint = itself; - - return itself; -}()); - -// Make JSHINT a Node module, if possible. -if (typeof exports === "object" && exports) { - exports.JSHINT = JSHINT; -} - -}, -{"./lex.js":4,"./messages.js":5,"./options.js":7,"./reg.js":8,"./state.js":9,"./style.js":10,"./vars.js":11,"events":12,"underscore":2}], -4:[function(_dereq_,module,exports){ -/* - * Lexical analysis and token construction. - */ - -"use strict"; - -var _ = _dereq_("underscore"); -var events = _dereq_("events"); -var reg = _dereq_("./reg.js"); -var state = _dereq_("./state.js").state; - -var unicodeData = _dereq_("../data/ascii-identifier-data.js"); -var asciiIdentifierStartTable = unicodeData.asciiIdentifierStartTable; -var asciiIdentifierPartTable = unicodeData.asciiIdentifierPartTable; - -// Some of these token types are from JavaScript Parser API -// while others are specific to JSHint parser. -// JS Parser API: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API - -var Token = { - Identifier: 1, - Punctuator: 2, - NumericLiteral: 3, - StringLiteral: 4, - Comment: 5, - Keyword: 6, - NullLiteral: 7, - BooleanLiteral: 8, - RegExp: 9, - TemplateHead: 10, - TemplateMiddle: 11, - TemplateTail: 12, - NoSubstTemplate: 13 -}; - -var Context = { - Block: 1, - Template: 2 -}; - -// Object that handles postponed lexing verifications that checks the parsed -// environment state. - -function asyncTrigger() { - var _checks = []; - - return { - push: function(fn) { - _checks.push(fn); - }, - - check: function() { - for (var check = 0; check < _checks.length; ++check) { - _checks[check](); - } - - _checks.splice(0, _checks.length); - } - }; -} - -/* - * Lexer for JSHint. - * - * This object does a char-by-char scan of the provided source code - * and produces a sequence of tokens. - * - * var lex = new Lexer("var i = 0;"); - * lex.start(); - * lex.token(); // returns the next token - * - * You have to use the token() method to move the lexer forward - * but you don't have to use its return value to get tokens. In addition - * to token() method returning the next token, the Lexer object also - * emits events. - * - * lex.on("Identifier", function(data) { - * if (data.name.indexOf("_") >= 0) { - * // Produce a warning. - * } - * }); - * - * Note that the token() method returns tokens in a JSLint-compatible - * format while the event emitter uses a slightly modified version of - * Mozilla's JavaScript Parser API. Eventually, we will move away from - * JSLint format. - */ -function Lexer(source) { - var lines = source; - - if (typeof lines === "string") { - lines = lines - .replace(/\r\n/g, "\n") - .replace(/\r/g, "\n") - .split("\n"); - } - - // 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) === "#!") { - if (lines[0].indexOf("node") !== -1) { - state.option.node = true; - } - lines[0] = ""; - } - - this.emitter = new events.EventEmitter(); - this.source = source; - this.setLines(lines); - this.prereg = true; - - this.line = 0; - this.char = 1; - this.from = 1; - this.input = ""; - this.inComment = false; - this.context = []; - this.templateStarts = []; - - for (var i = 0; i < state.option.indent; i += 1) { - state.tab += " "; - } -} - -Lexer.prototype = { - _lines: [], - - inContext: function(ctxType) { - return this.context.length > 0 && this.context[this.context.length - 1].type === ctxType; - }, - - pushContext: function(ctxType) { - this.context.push({ type: ctxType }); - }, - - popContext: function() { - return this.context.pop(); - }, - - isContext: function(context) { - return this.context.length > 0 && this.context[this.context.length - 1] === context; - }, - - currentContext: function() { - return this.context.length > 0 && this.context[this.context.length - 1]; - }, - - getLines: function() { - this._lines = state.lines; - return this._lines; - }, - - setLines: function(val) { - this._lines = val; - state.lines = this._lines; - }, - - /* - * Return the next i character without actually moving the - * char pointer. - */ - peek: function(i) { - return this.input.charAt(i || 0); - }, - - /* - * Move the char pointer forward i times. - */ - skip: function(i) { - i = i || 1; - this.char += i; - this.input = this.input.slice(i); - }, - - /* - * Subscribe to a token event. The API for this method is similar - * Underscore.js i.e. you can subscribe to multiple events with - * one call: - * - * lex.on("Identifier Number", function(data) { - * // ... - * }); - */ - on: function(names, listener) { - names.split(" ").forEach(function(name) { - this.emitter.on(name, listener); - }.bind(this)); - }, - - /* - * Trigger a token event. All arguments will be passed to each - * listener. - */ - trigger: function() { - this.emitter.emit.apply(this.emitter, Array.prototype.slice.call(arguments)); - }, - - /* - * Postpone a token event. the checking condition is set as - * last parameter, and the trigger function is called in a - * stored callback. To be later called using the check() function - * by the parser. This avoids parser's peek() to give the lexer - * a false context. - */ - triggerAsync: function(type, args, checks, fn) { - checks.push(function() { - if (fn()) { - this.trigger(type, args); - } - }.bind(this)); - }, - - /* - * Extract a punctuator out of the next sequence of characters - * or return 'null' if its not possible. - * - * This method's implementation was heavily influenced by the - * scanPunctuator function in the Esprima parser's source code. - */ - scanPunctuator: function() { - var ch1 = this.peek(); - var ch2, ch3, ch4; - - switch (ch1) { - // Most common single-character punctuators - case ".": - if ((/^[0-9]$/).test(this.peek(1))) { - return null; - } - if (this.peek(1) === "." && this.peek(2) === ".") { - return { - type: Token.Punctuator, - value: "..." - }; - } - /* falls through */ - case "(": - case ")": - case ";": - case ",": - case "[": - case "]": - case ":": - case "~": - case "?": - return { - type: Token.Punctuator, - value: ch1 - }; - - // A block/object opener - case "{": - this.pushContext(Context.Block); - return { - type: Token.Punctuator, - value: ch1 - }; - - // A block/object closer - case "}": - if (this.inContext(Context.Block)) { - this.popContext(); - } - return { - type: Token.Punctuator, - value: ch1 - }; - - // A pound sign (for Node shebangs) - case "#": - return { - type: Token.Punctuator, - value: ch1 - }; - - // We're at the end of input - case "": - return null; - } - - // Peek more characters - - ch2 = this.peek(1); - ch3 = this.peek(2); - ch4 = this.peek(3); - - // 4-character punctuator: >>>= - - if (ch1 === ">" && ch2 === ">" && ch3 === ">" && ch4 === "=") { - return { - type: Token.Punctuator, - value: ">>>=" - }; - } - - // 3-character punctuators: === !== >>> <<= >>= - - if (ch1 === "=" && ch2 === "=" && ch3 === "=") { - return { - type: Token.Punctuator, - value: "===" - }; - } - - if (ch1 === "!" && ch2 === "=" && ch3 === "=") { - return { - type: Token.Punctuator, - value: "!==" - }; - } - - if (ch1 === ">" && ch2 === ">" && ch3 === ">") { - return { - type: Token.Punctuator, - value: ">>>" - }; - } - - if (ch1 === "<" && ch2 === "<" && ch3 === "=") { - return { - type: Token.Punctuator, - value: "<<=" - }; - } - - if (ch1 === ">" && ch2 === ">" && ch3 === "=") { - return { - type: Token.Punctuator, - value: ">>=" - }; - } - - // Fat arrow punctuator - if (ch1 === "=" && ch2 === ">") { - return { - type: Token.Punctuator, - value: ch1 + ch2 - }; - } - - // 2-character punctuators: <= >= == != ++ -- << >> && || - // += -= *= %= &= |= ^= (but not /=, see below) - if (ch1 === ch2 && ("+-<>&|".indexOf(ch1) >= 0)) { - return { - type: Token.Punctuator, - value: ch1 + ch2 - }; - } - - if ("<>=!+-*%&|^".indexOf(ch1) >= 0) { - if (ch2 === "=") { - return { - type: Token.Punctuator, - value: ch1 + ch2 - }; - } - - return { - type: Token.Punctuator, - value: ch1 - }; - } - - // Special case: /=. - - if (ch1 === "/") { - if (ch2 === "=") { - return { - type: Token.Punctuator, - value: "/=" - }; - } - - return { - type: Token.Punctuator, - value: "/" - }; - } - - return null; - }, - - /* - * Extract a comment out of the next sequence of characters and/or - * lines or return 'null' if its not possible. Since comments can - * span across multiple lines this method has to move the char - * pointer. - * - * In addition to normal JavaScript comments (// and /*) this method - * also recognizes JSHint- and JSLint-specific comments such as - * /*jshint, /*jslint, /*globals and so on. - */ - scanComments: function() { - var ch1 = this.peek(); - var ch2 = this.peek(1); - var rest = this.input.substr(2); - var startLine = this.line; - var startChar = this.char; - - // Create a comment token object and make sure it - // has all the data JSHint needs to work with special - // comments. - - function commentToken(label, body, opt) { - var special = ["jshint", "jslint", "members", "member", "globals", "global", "exported"]; - var isSpecial = false; - var value = label + body; - var commentType = "plain"; - opt = opt || {}; - - if (opt.isMultiline) { - value += "*/"; - } - - body = body.replace(/\n/g, " "); - - special.forEach(function(str) { - if (isSpecial) { - return; - } - - // Don't recognize any special comments other than jshint for single-line - // comments. This introduced many problems with legit comments. - if (label === "//" && str !== "jshint") { - return; - } - - if (body.charAt(str.length) === " " && body.substr(0, str.length) === str) { - isSpecial = true; - label = label + str; - body = body.substr(str.length); - } - - if (!isSpecial && body.charAt(0) === " " && body.charAt(str.length + 1) === " " && - body.substr(1, str.length) === str) { - isSpecial = true; - label = label + " " + str; - body = body.substr(str.length + 1); - } - - if (!isSpecial) { - return; - } - - switch (str) { - case "member": - commentType = "members"; - break; - case "global": - commentType = "globals"; - break; - default: - commentType = str; - } - }); - - return { - type: Token.Comment, - commentType: commentType, - value: value, - body: body, - isSpecial: isSpecial, - isMultiline: opt.isMultiline || false, - isMalformed: opt.isMalformed || false - }; - } - - // End of unbegun comment. Raise an error and skip that input. - if (ch1 === "*" && ch2 === "/") { - this.trigger("error", { - code: "E018", - line: startLine, - character: startChar - }); - - this.skip(2); - return null; - } - - // Comments must start either with // or /* - if (ch1 !== "/" || (ch2 !== "*" && ch2 !== "/")) { - return null; - } - - // One-line comment - if (ch2 === "/") { - this.skip(this.input.length); // Skip to the EOL. - return commentToken("//", rest); - } - - var body = ""; - - /* Multi-line comment */ - if (ch2 === "*") { - this.inComment = true; - this.skip(2); - - while (this.peek() !== "*" || this.peek(1) !== "/") { - if (this.peek() === "") { // End of Line - body += "\n"; - - // If we hit EOF and our comment is still unclosed, - // trigger an error and end the comment implicitly. - if (!this.nextLine()) { - this.trigger("error", { - code: "E017", - line: startLine, - character: startChar - }); - - this.inComment = false; - return commentToken("/*", body, { - isMultiline: true, - isMalformed: true - }); - } - } else { - body += this.peek(); - this.skip(); - } - } - - this.skip(2); - this.inComment = false; - return commentToken("/*", body, { isMultiline: true }); - } - }, - - /* - * Extract a keyword out of the next sequence of characters or - * return 'null' if its not possible. - */ - scanKeyword: function() { - var result = /^[a-zA-Z_$][a-zA-Z0-9_$]*/.exec(this.input); - var keywords = [ - "if", "in", "do", "var", "for", "new", - "try", "let", "this", "else", "case", - "void", "with", "enum", "while", "break", - "catch", "throw", "const", "yield", "class", - "super", "return", "typeof", "delete", - "switch", "export", "import", "default", - "finally", "extends", "function", "continue", - "debugger", "instanceof" - ]; - - if (result && keywords.indexOf(result[0]) >= 0) { - return { - type: Token.Keyword, - value: result[0] - }; - } - - return null; - }, - - /* - * Extract a JavaScript identifier out of the next sequence of - * characters or return 'null' if its not possible. In addition, - * to Identifier this method can also produce BooleanLiteral - * (true/false) and NullLiteral (null). - */ - scanIdentifier: function() { - var id = ""; - var index = 0; - var type, char; - - function isNonAsciiIdentifierStart(code) { - return code > 256; - } - - function isNonAsciiIdentifierPart(code) { - return code > 256; - } - - function isHexDigit(str) { - return (/^[0-9a-fA-F]$/).test(str); - } - - var readUnicodeEscapeSequence = function() { - /*jshint validthis:true */ - index += 1; - - if (this.peek(index) !== "u") { - return null; - } - - var ch1 = this.peek(index + 1); - var ch2 = this.peek(index + 2); - var ch3 = this.peek(index + 3); - var ch4 = this.peek(index + 4); - var code; - - if (isHexDigit(ch1) && isHexDigit(ch2) && isHexDigit(ch3) && isHexDigit(ch4)) { - code = parseInt(ch1 + ch2 + ch3 + ch4, 16); - - if (asciiIdentifierPartTable[code] || isNonAsciiIdentifierPart(code)) { - index += 5; - return "\\u" + ch1 + ch2 + ch3 + ch4; - } - - return null; - } - - return null; - }.bind(this); - - var getIdentifierStart = function() { - /*jshint validthis:true */ - var chr = this.peek(index); - var code = chr.charCodeAt(0); - - if (code === 92) { - return readUnicodeEscapeSequence(); - } - - if (code < 128) { - if (asciiIdentifierStartTable[code]) { - index += 1; - return chr; - } - - return null; - } - - if (isNonAsciiIdentifierStart(code)) { - index += 1; - return chr; - } - - return null; - }.bind(this); - - var getIdentifierPart = function() { - /*jshint validthis:true */ - var chr = this.peek(index); - var code = chr.charCodeAt(0); - - if (code === 92) { - return readUnicodeEscapeSequence(); - } - - if (code < 128) { - if (asciiIdentifierPartTable[code]) { - index += 1; - return chr; - } - - return null; - } - - if (isNonAsciiIdentifierPart(code)) { - index += 1; - return chr; - } - - return null; - }.bind(this); - - function removeEscapeSequences(id) { - return id.replace(/\\u([0-9a-fA-F]{4})/g, function(m0, codepoint) { - return String.fromCharCode(parseInt(codepoint, 16)); - }); - } - - char = getIdentifierStart(); - if (char === null) { - return null; - } - - id = char; - for (;;) { - char = getIdentifierPart(); - - if (char === null) { - break; - } - - id += char; - } - - switch (id) { - case "true": - case "false": - type = Token.BooleanLiteral; - break; - case "null": - type = Token.NullLiteral; - break; - default: - type = Token.Identifier; - } - - return { - type: type, - value: removeEscapeSequences(id), - text: id, - tokenLength: id.length - }; - }, - - /* - * Extract a numeric literal out of the next sequence of - * characters or return 'null' if its not possible. This method - * supports all numeric literals described in section 7.8.3 - * of the EcmaScript 5 specification. - * - * This method's implementation was heavily influenced by the - * scanNumericLiteral function in the Esprima parser's source code. - */ - scanNumericLiteral: function() { - var index = 0; - var value = ""; - var length = this.input.length; - var char = this.peek(index); - var bad; - var isAllowedDigit = isDecimalDigit; - var base = 10; - var isLegacy = false; - - function isDecimalDigit(str) { - return (/^[0-9]$/).test(str); - } - - function isOctalDigit(str) { - return (/^[0-7]$/).test(str); - } - - function isBinaryDigit(str) { - return (/^[01]$/).test(str); - } - - function isHexDigit(str) { - return (/^[0-9a-fA-F]$/).test(str); - } - - function isIdentifierStart(ch) { - return (ch === "$") || (ch === "_") || (ch === "\\") || - (ch >= "a" && ch <= "z") || (ch >= "A" && ch <= "Z"); - } - - // Numbers must start either with a decimal digit or a point. - - if (char !== "." && !isDecimalDigit(char)) { - return null; - } - - if (char !== ".") { - value = this.peek(index); - index += 1; - char = this.peek(index); - - if (value === "0") { - // Base-16 numbers. - if (char === "x" || char === "X") { - isAllowedDigit = isHexDigit; - base = 16; - - index += 1; - value += char; - } - - // Base-8 numbers. - if (char === "o" || char === "O") { - isAllowedDigit = isOctalDigit; - base = 8; - - if (!state.option.esnext) { - this.trigger("warning", { - code: "W119", - line: this.line, - character: this.char, - data: [ "Octal integer literal" ] - }); - } - - index += 1; - value += char; - } - - // Base-2 numbers. - if (char === "b" || char === "B") { - isAllowedDigit = isBinaryDigit; - base = 2; - - if (!state.option.esnext) { - this.trigger("warning", { - code: "W119", - line: this.line, - character: this.char, - data: [ "Binary integer literal" ] - }); - } - - index += 1; - value += char; - } - - // Legacy base-8 numbers. - if (isOctalDigit(char)) { - isAllowedDigit = isOctalDigit; - base = 8; - isLegacy = true; - bad = false; - - index += 1; - value += char; - } - - // Decimal numbers that start with '0' such as '09' are illegal - // but we still parse them and return as malformed. - - if (!isOctalDigit(char) && isDecimalDigit(char)) { - index += 1; - value += char; - } - } - - while (index < length) { - char = this.peek(index); - - if (isLegacy && isDecimalDigit(char)) { - // Numbers like '019' (note the 9) are not valid octals - // but we still parse them and mark as malformed. - bad = true; - } else if (!isAllowedDigit(char)) { - break; - } - value += char; - index += 1; - } - - if (isAllowedDigit !== isDecimalDigit) { - if (!isLegacy && value.length <= 2) { // 0x - return { - type: Token.NumericLiteral, - value: value, - isMalformed: true - }; - } - - if (index < length) { - char = this.peek(index); - if (isIdentifierStart(char)) { - return null; - } - } - - return { - type: Token.NumericLiteral, - value: value, - base: base, - isLegacy: isLegacy, - isMalformed: false - }; - } - } - - // Decimal digits. - - if (char === ".") { - value += char; - index += 1; - - while (index < length) { - char = this.peek(index); - if (!isDecimalDigit(char)) { - break; - } - value += char; - index += 1; - } - } - - // Exponent part. - - if (char === "e" || char === "E") { - value += char; - index += 1; - char = this.peek(index); - - if (char === "+" || char === "-") { - value += this.peek(index); - index += 1; - } - - char = this.peek(index); - if (isDecimalDigit(char)) { - value += char; - index += 1; - - while (index < length) { - char = this.peek(index); - if (!isDecimalDigit(char)) { - break; - } - value += char; - index += 1; - } - } else { - return null; - } - } - - if (index < length) { - char = this.peek(index); - if (isIdentifierStart(char)) { - return null; - } - } - - return { - type: Token.NumericLiteral, - value: value, - base: base, - isMalformed: !isFinite(value) - }; - }, - - - // Assumes previously parsed character was \ (=== '\\') and was not skipped. - scanEscapeSequence: function(checks) { - var allowNewLine = false; - var jump = 1; - this.skip(); - var char = this.peek(); - - switch (char) { - case "'": - this.triggerAsync("warning", { - code: "W114", - line: this.line, - character: this.char, - data: [ "\\'" ] - }, checks, function() {return state.jsonMode; }); - break; - case "b": - char = "\\b"; - break; - case "f": - char = "\\f"; - break; - case "n": - char = "\\n"; - break; - case "r": - char = "\\r"; - break; - case "t": - char = "\\t"; - break; - case "0": - char = "\\0"; - - // Octal literals fail in strict mode. - // Check if the number is between 00 and 07. - var n = parseInt(this.peek(1), 10); - this.triggerAsync("warning", { - code: "W115", - line: this.line, - character: this.char - }, checks, - function() { return n >= 0 && n <= 7 && state.directive["use strict"]; }); - break; - case "u": - var hexCode = this.input.substr(1, 4); - var code = parseInt(hexCode, 16); - if (isNaN(code)) { - this.trigger("warning", { - code: "W052", - line: this.line, - character: this.char, - data: [ "u" + hexCode ] - }); - } - char = String.fromCharCode(code); - jump = 5; - break; - case "v": - this.triggerAsync("warning", { - code: "W114", - line: this.line, - character: this.char, - data: [ "\\v" ] - }, checks, function() { return state.jsonMode; }); - - char = "\v"; - break; - case "x": - var x = parseInt(this.input.substr(1, 2), 16); - - this.triggerAsync("warning", { - code: "W114", - line: this.line, - character: this.char, - data: [ "\\x-" ] - }, checks, function() { return state.jsonMode; }); - - char = String.fromCharCode(x); - jump = 3; - break; - case "\\": - char = "\\\\"; - break; - case "\"": - char = "\\\""; - break; - case "/": - break; - case "": - allowNewLine = true; - char = ""; - break; - } - - return { char: char, jump: jump, allowNewLine: allowNewLine }; - }, - - /* - * Extract a template literal out of the next sequence of characters - * and/or lines or return 'null' if its not possible. Since template - * literals can span across multiple lines, this method has to move - * the char pointer. - */ - scanTemplateLiteral: function(checks) { - var tokenType; - var value = ""; - var ch; - var startLine = this.line; - var startChar = this.char; - var depth = this.templateStarts.length; - - if (!state.option.esnext) { - // Only lex template strings in ESNext mode. - return null; - } else if (this.peek() === "`") { - // Template must start with a backtick. - tokenType = Token.TemplateHead; - this.templateStarts.push({ line: this.line, char: this.char }); - depth = this.templateStarts.length; - this.skip(1); - this.pushContext(Context.Template); - } else if (this.inContext(Context.Template) && this.peek() === "}") { - // If we're in a template context, and we have a '}', lex a TemplateMiddle. - tokenType = Token.TemplateMiddle; - } else { - // Go lex something else. - return null; - } - - while (this.peek() !== "`") { - while ((ch = this.peek()) === "") { - value += "\n"; - if (!this.nextLine()) { - // Unclosed template literal --- point to the starting "`" - var startPos = this.templateStarts.pop(); - this.trigger("error", { - code: "E052", - line: startPos.line, - character: startPos.char - }); - return { - type: tokenType, - value: value, - startLine: startLine, - startChar: startChar, - isUnclosed: true, - depth: depth, - context: this.popContext() - }; - } - } - - if (ch === '$' && this.peek(1) === '{') { - value += '${'; - this.skip(2); - return { - type: tokenType, - value: value, - startLine: startLine, - startChar: startChar, - isUnclosed: false, - depth: depth, - context: this.currentContext() - }; - } else if (ch === '\\') { - var escape = this.scanEscapeSequence(checks); - value += escape.char; - this.skip(escape.jump); - } else if (ch !== '`') { - // Otherwise, append the value and continue. - value += ch; - this.skip(1); - } - } - - // Final value is either NoSubstTemplate or TemplateTail - tokenType = tokenType === Token.TemplateHead ? Token.NoSubstTemplate : Token.TemplateTail; - this.skip(1); - this.templateStarts.pop(); - - return { - type: tokenType, - value: value, - startLine: startLine, - startChar: startChar, - isUnclosed: false, - depth: depth, - context: this.popContext() - }; - }, - - /* - * Extract a string out of the next sequence of characters and/or - * lines or return 'null' if its not possible. Since strings can - * span across multiple lines this method has to move the char - * pointer. - * - * This method recognizes pseudo-multiline JavaScript strings: - * - * var str = "hello\ - * world"; - */ - scanStringLiteral: function(checks) { - /*jshint loopfunc:true */ - var quote = this.peek(); - - // String must start with a quote. - if (quote !== "\"" && quote !== "'") { - return null; - } - - // In JSON strings must always use double quotes. - this.triggerAsync("warning", { - code: "W108", - line: this.line, - character: this.char // +1? - }, checks, function() { return state.jsonMode && quote !== "\""; }); - - var value = ""; - var startLine = this.line; - var startChar = this.char; - var allowNewLine = false; - - this.skip(); - - outer: while (this.peek() !== quote) { - while (this.peek() === "") { // End Of Line - - // If an EOL is not preceded by a backslash, show a warning - // and proceed like it was a legit multi-line string where - // author simply forgot to escape the newline symbol. - // - // Another approach is to implicitly close a string on EOL - // but it generates too many false positives. - - if (!allowNewLine) { - this.trigger("warning", { - code: "W112", - line: this.line, - character: this.char - }); - } else { - allowNewLine = false; - - // Otherwise show a warning if multistr option was not set. - // For JSON, show warning no matter what. - - this.triggerAsync("warning", { - code: "W043", - line: this.line, - character: this.char - }, checks, function() { return !state.option.multistr; }); - - this.triggerAsync("warning", { - code: "W042", - line: this.line, - character: this.char - }, checks, function() { return state.jsonMode && state.option.multistr; }); - } - - // If we get an EOF inside of an unclosed string, show an - // error and implicitly close it at the EOF point. - - if (!this.nextLine()) { - this.trigger("error", { - code: "E029", - line: startLine, - character: startChar - }); - - return { - type: Token.StringLiteral, - value: value, - startLine: startLine, - startChar: startChar, - isUnclosed: true, - quote: quote - }; - } - - if (this.peek() == quote) - break outer; - } - - allowNewLine = false; - var char = this.peek(); - var jump = 1; // A length of a jump, after we're done - // parsing this character. - - if (char < " ") { - // Warn about a control character in a string. - this.trigger("warning", { - code: "W113", - line: this.line, - character: this.char, - data: [ "" ] - }); - } - - // Special treatment for some escaped characters. - if (char === "\\") { - var parsed = this.scanEscapeSequence(checks); - char = parsed.char; - jump = parsed.jump; - allowNewLine = parsed.allowNewLine; - } - - value += char; - this.skip(jump); - } - - this.skip(); - return { - type: Token.StringLiteral, - value: value, - startLine: startLine, - startChar: startChar, - isUnclosed: false, - quote: quote - }; - }, - - /* - * Extract a regular expression out of the next sequence of - * characters and/or lines or return 'null' if its not possible. - * - * This method is platform dependent: it accepts almost any - * regular expression values but then tries to compile and run - * them using system's RegExp object. This means that there are - * rare edge cases where one JavaScript engine complains about - * your regular expression while others don't. - */ - scanRegExp: function() { - var index = 0; - var length = this.input.length; - var char = this.peek(); - var value = char; - var body = ""; - var flags = []; - var malformed = false; - var isCharSet = false; - var terminated; - - var scanUnexpectedChars = function() { - // Unexpected control character - if (char < " ") { - malformed = true; - this.trigger("warning", { - code: "W048", - line: this.line, - character: this.char - }); - } - - // Unexpected escaped character - if (char === "<") { - malformed = true; - this.trigger("warning", { - code: "W049", - line: this.line, - character: this.char, - data: [ char ] - }); - } - }.bind(this); - - // Regular expressions must start with '/' - if (!this.prereg || char !== "/") { - return null; - } - - index += 1; - terminated = false; - - // Try to get everything in between slashes. A couple of - // cases aside (see scanUnexpectedChars) we don't really - // care whether the resulting expression is valid or not. - // We will check that later using the RegExp object. - - while (index < length) { - char = this.peek(index); - value += char; - body += char; - - if (isCharSet) { - if (char === "]") { - if (this.peek(index - 1) !== "\\" || this.peek(index - 2) === "\\") { - isCharSet = false; - } - } - - if (char === "\\") { - index += 1; - char = this.peek(index); - body += char; - value += char; - - scanUnexpectedChars(); - } - - index += 1; - continue; - } - - if (char === "\\") { - index += 1; - char = this.peek(index); - body += char; - value += char; - - scanUnexpectedChars(); - - if (char === "/") { - index += 1; - continue; - } - - if (char === "[") { - index += 1; - continue; - } - } - - if (char === "[") { - isCharSet = true; - index += 1; - continue; - } - - if (char === "/") { - body = body.substr(0, body.length - 1); - terminated = true; - index += 1; - break; - } - - index += 1; - } - - // A regular expression that was never closed is an - // error from which we cannot recover. - - if (!terminated) { - this.trigger("error", { - code: "E015", - line: this.line, - character: this.from - }); - - return void this.trigger("fatal", { - line: this.line, - from: this.from - }); - } - - // Parse flags (if any). - - while (index < length) { - char = this.peek(index); - if (!/[gim]/.test(char)) { - break; - } - flags.push(char); - value += char; - index += 1; - } - - // Check regular expression for correctness. - - try { - new RegExp(body, flags.join("")); - } catch (err) { - malformed = true; - this.trigger("error", { - code: "E016", - line: this.line, - character: this.char, - data: [ err.message ] // Platform dependent! - }); - } - - return { - type: Token.RegExp, - value: value, - flags: flags, - isMalformed: malformed - }; - }, - - /* - * Scan for any occurrence of non-breaking spaces. Non-breaking spaces - * can be mistakenly typed on OS X with option-space. Non UTF-8 web - * pages with non-breaking pages produce syntax errors. - */ - scanNonBreakingSpaces: function() { - return state.option.nonbsp ? - this.input.search(/(\u00A0)/) : -1; - }, - - /* - * Scan for characters that get silently deleted by one or more browsers. - */ - scanUnsafeChars: function() { - return this.input.search(reg.unsafeChars); - }, - - /* - * Produce the next raw token or return 'null' if no tokens can be matched. - * This method skips over all space characters. - */ - next: function(checks) { - this.from = this.char; - - // Move to the next non-space character. - var start; - if (/\s/.test(this.peek())) { - start = this.char; - - while (/\s/.test(this.peek())) { - this.from += 1; - this.skip(); - } - } - - // Methods that work with multi-line structures and move the - // character pointer. - - var match = this.scanComments() || - this.scanStringLiteral(checks) || - this.scanTemplateLiteral(checks); - - if (match) { - return match; - } - - // Methods that don't move the character pointer. - - match = - this.scanRegExp() || - this.scanPunctuator() || - this.scanKeyword() || - this.scanIdentifier() || - this.scanNumericLiteral(); - - if (match) { - this.skip(match.tokenLength || match.value.length); - return match; - } - - // No token could be matched, give up. - - return null; - }, - - /* - * Switch to the next line and reset all char pointers. Once - * switched, this method also checks for other minor warnings. - */ - nextLine: function() { - var char; - - if (this.line >= this.getLines().length) { - return false; - } - - this.input = this.getLines()[this.line]; - this.line += 1; - this.char = 1; - this.from = 1; - - var inputTrimmed = this.input.trim(); - - var startsWith = function() { - return _.some(arguments, function(prefix) { - return inputTrimmed.indexOf(prefix) === 0; - }); - }; - - var endsWith = function() { - return _.some(arguments, function(suffix) { - return inputTrimmed.indexOf(suffix, inputTrimmed.length - suffix.length) !== -1; - }); - }; - - // If we are ignoring linter errors, replace the input with empty string - // if it doesn't already at least start or end a multi-line comment - if (state.ignoreLinterErrors === true) { - if (!startsWith("/*", "//") && !(this.inComment && endsWith("*/"))) { - this.input = ""; - } - } - - char = this.scanNonBreakingSpaces(); - if (char >= 0) { - this.trigger("warning", { code: "W125", line: this.line, character: char + 1 }); - } - - this.input = this.input.replace(/\t/g, state.tab); - char = this.scanUnsafeChars(); - - if (char >= 0) { - this.trigger("warning", { code: "W100", line: this.line, character: char }); - } - - // If there is a limit on line length, warn when lines get too - // long. - - if (state.option.maxlen && state.option.maxlen < this.input.length) { - var inComment = this.inComment || - startsWith.call(inputTrimmed, "//") || - startsWith.call(inputTrimmed, "/*"); - - var shouldTriggerError = !inComment || !reg.maxlenException.test(inputTrimmed); - - if (shouldTriggerError) { - this.trigger("warning", { code: "W101", line: this.line, character: this.input.length }); - } - } - - return true; - }, - - /* - * This is simply a synonym for nextLine() method with a friendlier - * public name. - */ - start: function() { - this.nextLine(); - }, - - /* - * Produce the next token. This function is called by advance() to get - * the next token. It returns a token in a JSLint-compatible format. - */ - token: function() { - /*jshint loopfunc:true */ - var checks = asyncTrigger(); - var token; - - - function isReserved(token, isProperty) { - if (!token.reserved) { - return false; - } - var meta = token.meta; - - if (meta && meta.isFutureReservedWord && state.option.inES5()) { - // ES3 FutureReservedWord in an ES5 environment. - if (!meta.es5) { - return false; - } - - // Some ES5 FutureReservedWord identifiers are active only - // within a strict mode environment. - if (meta.strictOnly) { - if (!state.option.strict && !state.directive["use strict"]) { - return false; - } - } - - if (isProperty) { - return false; - } - } - - return true; - } - - // Produce a token object. - var create = function(type, value, isProperty, token) { - /*jshint validthis:true */ - var obj; - - if (type !== "(endline)" && type !== "(end)") { - this.prereg = false; - } - - if (type === "(punctuator)") { - switch (value) { - case ".": - case ")": - case "~": - case "#": - case "]": - case "++": - case "--": - this.prereg = false; - break; - default: - this.prereg = true; - } - - obj = Object.create(state.syntax[value] || state.syntax["(error)"]); - } - - if (type === "(identifier)") { - if (value === "return" || value === "case" || value === "typeof") { - this.prereg = true; - } - - if (_.has(state.syntax, value)) { - obj = Object.create(state.syntax[value] || state.syntax["(error)"]); - - // If this can't be a reserved keyword, reset the object. - if (!isReserved(obj, isProperty && type === "(identifier)")) { - obj = null; - } - } - } - - if (!obj) { - obj = Object.create(state.syntax[type]); - } - - obj.identifier = (type === "(identifier)"); - obj.type = obj.type || type; - obj.value = value; - obj.line = this.line; - obj.character = this.char; - obj.from = this.from; - if (obj.identifier && token) obj.raw_text = token.text || token.value; - if (token && token.startLine && token.startLine !== this.line) { - obj.startLine = token.startLine; - } - if (token && token.context) { - // Context of current token - obj.context = token.context; - } - if (token && token.depth) { - // Nested template depth - obj.depth = token.depth; - } - if (token && token.isUnclosed) { - // Mark token as unclosed string / template literal - obj.isUnclosed = token.isUnclosed; - } - - if (isProperty && obj.identifier) { - obj.isProperty = isProperty; - } - - obj.check = checks.check; - - return obj; - }.bind(this); - - for (;;) { - if (!this.input.length) { - return create(this.nextLine() ? "(endline)" : "(end)", ""); - } - - token = this.next(checks); - - if (!token) { - if (this.input.length) { - // Unexpected character. - this.trigger("error", { - code: "E024", - line: this.line, - character: this.char, - data: [ this.peek() ] - }); - - this.input = ""; - } - - continue; - } - - switch (token.type) { - case Token.StringLiteral: - this.triggerAsync("String", { - line: this.line, - char: this.char, - from: this.from, - startLine: token.startLine, - startChar: token.startChar, - value: token.value, - quote: token.quote - }, checks, function() { return true; }); - - return create("(string)", token.value, null, token); - - case Token.TemplateHead: - this.trigger("TemplateHead", { - line: this.line, - char: this.char, - from: this.from, - startLine: token.startLine, - startChar: token.startChar, - value: token.value - }); - return create("(template)", token.value, null, token); - - case Token.TemplateMiddle: - this.trigger("TemplateMiddle", { - line: this.line, - char: this.char, - from: this.from, - startLine: token.startLine, - startChar: token.startChar, - value: token.value - }); - return create("(template middle)", token.value, null, token); - - case Token.TemplateTail: - this.trigger("TemplateTail", { - line: this.line, - char: this.char, - from: this.from, - startLine: token.startLine, - startChar: token.startChar, - value: token.value - }); - return create("(template tail)", token.value, null, token); - - case Token.NoSubstTemplate: - this.trigger("NoSubstTemplate", { - line: this.line, - char: this.char, - from: this.from, - startLine: token.startLine, - startChar: token.startChar, - value: token.value - }); - return create("(no subst template)", token.value, null, token); - - case Token.Identifier: - this.trigger("Identifier", { - line: this.line, - char: this.char, - from: this.form, - name: token.value, - raw_name: token.text, - isProperty: state.tokens.curr.id === "." - }); - - /* falls through */ - case Token.Keyword: - case Token.NullLiteral: - case Token.BooleanLiteral: - return create("(identifier)", token.value, state.tokens.curr.id === ".", token); - - case Token.NumericLiteral: - if (token.isMalformed) { - this.trigger("warning", { - code: "W045", - line: this.line, - character: this.char, - data: [ token.value ] - }); - } - - this.triggerAsync("warning", { - code: "W114", - line: this.line, - character: this.char, - data: [ "0x-" ] - }, checks, function() { return token.base === 16 && state.jsonMode; }); - - this.triggerAsync("warning", { - code: "W115", - line: this.line, - character: this.char - }, checks, function() { - return state.directive["use strict"] && token.base === 8 && token.isLegacy; - }); - - this.trigger("Number", { - line: this.line, - char: this.char, - from: this.from, - value: token.value, - base: token.base, - isMalformed: token.malformed - }); - - return create("(number)", token.value); - - case Token.RegExp: - return create("(regexp)", token.value); - - case Token.Comment: - state.tokens.curr.comment = true; - - if (token.isSpecial) { - return { - id: '(comment)', - value: token.value, - body: token.body, - type: token.commentType, - isSpecial: token.isSpecial, - line: this.line, - character: this.char, - from: this.from - }; - } - - break; - - case "": - break; - - default: - return create("(punctuator)", token.value); - } - } - } -}; - -exports.Lexer = Lexer; -exports.Context = Context; - -}, -{"../data/ascii-identifier-data.js":1,"./reg.js":8,"./state.js":9,"events":12,"underscore":2}], -5:[function(_dereq_,module,exports){ -"use strict"; - -var _ = _dereq_("underscore"); - -var errors = { - // JSHint options - E001: "Bad option: '{a}'.", - E002: "Bad option value.", - - // JSHint input - E003: "Expected a JSON value.", - E004: "Input is neither a string nor an array of strings.", - E005: "Input is empty.", - E006: "Unexpected early end of program.", - - // Strict mode - E007: "Missing \"use strict\" statement.", - E008: "Strict violation.", - E009: "Option 'validthis' can't be used in a global scope.", - E010: "'with' is not allowed in strict mode.", - - // Constants - E011: "const '{a}' has already been declared.", - E012: "const '{a}' is initialized to 'undefined'.", - E013: "Attempting to override '{a}' which is a constant.", - - // Regular expressions - E014: "A regular expression literal can be confused with '/='.", - E015: "Unclosed regular expression.", - E016: "Invalid regular expression.", - - // Tokens - E017: "Unclosed comment.", - E018: "Unbegun comment.", - E019: "Unmatched '{a}'.", - E020: "Expected '{a}' to match '{b}' from line {c} and instead saw '{d}'.", - E021: "Expected '{a}' and instead saw '{b}'.", - E022: "Line breaking error '{a}'.", - E023: "Missing '{a}'.", - E024: "Unexpected '{a}'.", - E025: "Missing ':' on a case clause.", - E026: "Missing '}' to match '{' from line {a}.", - E027: "Missing ']' to match '[' from line {a}.", - E028: "Illegal comma.", - E029: "Unclosed string.", - - // Everything else - E030: "Expected an identifier and instead saw '{a}'.", - E031: "Bad assignment.", // FIXME: Rephrase - E032: "Expected a small integer or 'false' and instead saw '{a}'.", - E033: "Expected an operator and instead saw '{a}'.", - E034: "get/set are ES5 features.", - E035: "Missing property name.", - E036: "Expected to see a statement and instead saw a block.", - E037: null, - E038: null, - E039: "Function declarations are not invocable. Wrap the whole function invocation in parens.", - E040: "Each value should have its own case label.", - E041: "Unrecoverable syntax error.", - E042: "Stopping.", - E043: "Too many errors.", - E044: null, - E045: "Invalid for each loop.", - E046: "A yield statement shall be within a generator function (with syntax: `function*`)", - E047: null, // Vacant - E048: "Let declaration not directly within block.", - E049: "A {a} cannot be named '{b}'.", - E050: "Mozilla requires the yield expression to be parenthesized here.", - E051: "Regular parameters cannot come after default parameters.", - E052: "Unclosed template literal.", - E053: "Export declaration must be in global scope.", - E054: "Class properties must be methods. Expected '(' but instead saw '{a}'." -}; - -var warnings = { - W001: "'hasOwnProperty' is a really bad name.", - W002: "Value of '{a}' may be overwritten in IE 8 and earlier.", - W003: "'{a}' was used before it was defined.", - W004: "'{a}' is already defined.", - W005: "A dot following a number can be confused with a decimal point.", - W006: "Confusing minuses.", - W007: "Confusing plusses.", - W008: "A leading decimal point can be confused with a dot: '{a}'.", - W009: "The array literal notation [] is preferable.", - W010: "The object literal notation {} is preferable.", - W011: null, - W012: null, - W013: null, - W014: "Bad line breaking before '{a}'.", - W015: null, - W016: "Unexpected use of '{a}'.", - W017: "Bad operand.", - W018: "Confusing use of '{a}'.", - W019: "Use the isNaN function to compare with NaN.", - W020: "Read only.", - W021: "'{a}' is a function.", - W022: "Do not assign to the exception parameter.", - W023: "Expected an identifier in an assignment and instead saw a function invocation.", - W024: "Expected an identifier and instead saw '{a}' (a reserved word).", - W025: "Missing name in function declaration.", - W026: "Inner functions should be listed at the top of the outer function.", - W027: "Unreachable '{a}' after '{b}'.", - W028: "Label '{a}' on {b} statement.", - W030: "Expected an assignment or function call and instead saw an expression.", - W031: "Do not use 'new' for side effects.", - W032: "Unnecessary semicolon.", - W033: "Missing semicolon.", - W034: "Unnecessary directive \"{a}\".", - W035: "Empty block.", - W036: "Unexpected /*member '{a}'.", - W037: "'{a}' is a statement label.", - W038: "'{a}' used out of scope.", - W039: "'{a}' is not allowed.", - W040: "Possible strict violation.", - W041: "Use '{a}' to compare with '{b}'.", - W042: "Avoid EOL escaping.", - W043: "Bad escaping of EOL. Use option multistr if needed.", - W044: "Bad or unnecessary escaping.", /* TODO(caitp): remove W044 */ - W045: "Bad number '{a}'.", - W046: "Don't use extra leading zeros '{a}'.", - W047: "A trailing decimal point can be confused with a dot: '{a}'.", - W048: "Unexpected control character in regular expression.", - W049: "Unexpected escaped character '{a}' in regular expression.", - W050: "JavaScript URL.", - W051: "Variables should not be deleted.", - W052: "Unexpected '{a}'.", - W053: "Do not use {a} as a constructor.", - W054: "The Function constructor is a form of eval.", - W055: "A constructor name should start with an uppercase letter.", - W056: "Bad constructor.", - W057: "Weird construction. Is 'new' necessary?", - W058: "Missing '()' invoking a constructor.", - W059: "Avoid arguments.{a}.", - W060: "document.write can be a form of eval.", - W061: "eval can be harmful.", - W062: "Wrap an immediate function invocation in parens " + - "to assist the reader in understanding that the expression " + - "is the result of a function, and not the function itself.", - W063: "Math is not a function.", - W064: "Missing 'new' prefix when invoking a constructor.", - W065: "Missing radix parameter.", - W066: "Implied eval. Consider passing a function instead of a string.", - W067: "Bad invocation.", - W068: "Wrapping non-IIFE function literals in parens is unnecessary.", - W069: "['{a}'] is better written in dot notation.", - W070: "Extra comma. (it breaks older versions of IE)", - W071: "This function has too many statements. ({a})", - W072: "This function has too many parameters. ({a})", - W073: "Blocks are nested too deeply. ({a})", - W074: "This function's cyclomatic complexity is too high. ({a})", - W075: "Duplicate {a} '{b}'.", - W076: "Unexpected parameter '{a}' in get {b} function.", - W077: "Expected a single parameter in set {a} function.", - W078: "Setter is defined without getter.", - W079: "Redefinition of '{a}'.", - W080: "It's not necessary to initialize '{a}' to 'undefined'.", - W081: null, - W082: "Function declarations should not be placed in blocks. " + - "Use a function expression or move the statement to the top of " + - "the outer function.", - W083: "Don't make functions within a loop.", - W084: "Assignment in conditional expression", - W085: "Don't use 'with'.", - W086: "Expected a 'break' statement before '{a}'.", - W087: "Forgotten 'debugger' statement?", - W088: "Creating global 'for' variable. Should be 'for (var {a} ...'.", - W089: "The body of a for in should be wrapped in an if statement to filter " + - "unwanted properties from the prototype.", - W090: "'{a}' is not a statement label.", - W091: "'{a}' is out of scope.", - W093: "Did you mean to return a conditional instead of an assignment?", - W094: "Unexpected comma.", - W095: "Expected a string and instead saw {a}.", - W096: "The '{a}' key may produce unexpected results.", - W097: "Use the function form of \"use strict\".", - W098: "'{a}' is defined but never used.", - W099: null, - W100: "This character may get silently deleted by one or more browsers.", - W101: "Line is too long.", - W102: null, - W103: "The '{a}' property is deprecated.", - W104: "'{a}' is available in ES6 (use esnext option) or Mozilla JS extensions (use moz).", - W105: "Unexpected {a} in '{b}'.", - W106: "Identifier '{a}' is not in camel case.", - W107: "Script URL.", - W108: "Strings must use doublequote.", - W109: "Strings must use singlequote.", - W110: "Mixed double and single quotes.", - W112: "Unclosed string.", - W113: "Control character in string: {a}.", - W114: "Avoid {a}.", - W115: "Octal literals are not allowed in strict mode.", - W116: "Expected '{a}' and instead saw '{b}'.", - W117: "'{a}' is not defined.", - W118: "'{a}' is only available in Mozilla JavaScript extensions (use moz option).", - W119: "'{a}' is only available in ES6 (use esnext option).", - W120: "You might be leaking a variable ({a}) here.", - W121: "Extending prototype of native object: '{a}'.", - W122: "Invalid typeof value '{a}'", - W123: "'{a}' is already defined in outer scope.", - W124: "A generator function shall contain a yield statement.", - W125: "This line contains non-breaking spaces: http://jshint.com/doc/options/#nonbsp", - W126: "Unnecessary grouping operator.", - W127: "Unexpected use of a comma operator.", - W128: "Empty array elements require elision=true.", - W129: "'{a}' is defined in a future version of JavaScript. Use a " + - "different variable name to avoid migration issues.", - W130: "Invalid element after rest element.", - W131: "Invalid parameter after rest parameter." -}; - -var info = { - I001: "Comma warnings can be turned off with 'laxcomma'.", - I002: null, - I003: "ES5 option is now set per default" -}; - -exports.errors = {}; -exports.warnings = {}; -exports.info = {}; - -_.each(errors, function(desc, code) { - exports.errors[code] = { code: code, desc: desc }; -}); - -_.each(warnings, function(desc, code) { - exports.warnings[code] = { code: code, desc: desc }; -}); - -_.each(info, function(desc, code) { - exports.info[code] = { code: code, desc: desc }; -}); - -}, -{"underscore":2}], -6:[function(_dereq_,module,exports){ -"use strict"; - -function NameStack() { - this._stack = []; -} - -Object.defineProperty(NameStack.prototype, "length", { - get: function() { - return this._stack.length; - } -}); - -/** - * Create a new entry in the stack. Useful for tracking names across - * expressions. - */ -NameStack.prototype.push = function() { - this._stack.push(null); -}; - -/** - * Discard the most recently-created name on the stack. - */ -NameStack.prototype.pop = function() { - this._stack.pop(); -}; - -/** - * Update the most recent name on the top of the stack. - * - * @param {object} token The token to consider as the source for the most - * recent name. - */ -NameStack.prototype.set = function(token) { - this._stack[this.length - 1] = token; -}; - -/** - * Generate a string representation of the most recent name. - * - * @returns {string} - */ -NameStack.prototype.infer = function() { - var nameToken = this._stack[this.length - 1]; - var prefix = ""; - var type; - - // During expected operation, the topmost entry on the stack will only - // reflect the current function's name when the function is declared without - // the `function` keyword (i.e. for in-line accessor methods). In other - // cases, the `function` expression itself will introduce an empty entry on - // the top of the stack, and this should be ignored. - if (!nameToken || nameToken.type === "class") { - nameToken = this._stack[this.length - 2]; - } - - if (!nameToken) { - return "(empty)"; - } - - type = nameToken.type; - - if (type !== "(string)" && type !== "(number)" && type !== "(identifier)" && type !== "default") { - return "(expression)"; - } - - if (nameToken.accessorType) { - prefix = nameToken.accessorType + " "; - } - - return prefix + nameToken.value; -}; - -module.exports = NameStack; - -}, -{}], -7:[function(_dereq_,module,exports){ -"use strict"; - -// These are the JSHint boolean options. -exports.bool = { - enforcing: { - - /** - * This option prohibits the use of bitwise operators such as `^` (XOR), - * `|` (OR) and others. Bitwise operators are very rare in JavaScript - * programs and quite often `&` is simply a mistyped `&&`. - */ - bitwise : true, - - /** - * - * This options prohibits overwriting prototypes of native objects such as - * `Array`, `Date` and so on. - * - * // jshint freeze:true - * Array.prototype.count = function (value) { return 4; }; - * // -> Warning: Extending prototype of native object: 'Array'. - */ - freeze : true, - - /** - * This option allows you to force all variable names to use either - * camelCase style or UPPER_CASE with underscores. - * - * @deprecated JSHint is limiting its scope to issues of code correctness. - * If you would like to enforce rules relating to code style, - * check out [the JSCS - * project](https://github.com/jscs-dev/node-jscs). - */ - camelcase : true, - - /** - * This option requires you to always put curly braces around blocks in - * loops and conditionals. JavaScript allows you to omit curly braces when - * the block consists of only one statement, for example: - * - * while (day) - * shuffle(); - * - * However, in some circumstances, it can lead to bugs (you'd think that - * `sleep()` is a part of the loop while in reality it is not): - * - * while (day) - * shuffle(); - * sleep(); - */ - curly : true, - - /** - * This options prohibits the use of `==` and `!=` in favor of `===` and - * `!==`. The former try to coerce values before comparing them which can - * lead to some unexpected results. The latter don't do any coercion so - * they are generally safer. If you would like to learn more about type - * coercion in JavaScript, we recommend [Truth, Equality and - * JavaScript](http://javascriptweblog.wordpress.com/2011/02/07/truth-equality-and-javascript/) - * by Angus Croll. - */ - eqeqeq : true, - - /** - * This option enables warnings about the use of identifiers which are - * defined in future versions of JavaScript. Although overwriting them has - * no effect in contexts where they are not implemented, this practice can - * cause issues when migrating codebases to newer versions of the language. - */ - futurehostile: true, - - /** - * This option suppresses warnings about invalid `typeof` operator values. - * This operator has only [a limited set of possible return - * values](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof). - * By default, JSHint warns when you compare its result with an invalid - * value which often can be a typo. - * - * // 'fuction' instead of 'function' - * if (typeof a == "fuction") { // Invalid typeof value 'fuction' - * // ... - * } - * - * Do not use this option unless you're absolutely sure you don't want - * these checks. - */ - notypeof : true, - - /** - * This option tells JSHint that your code needs to adhere to ECMAScript 3 - * specification. Use this option if you need your program to be executable - * in older browsers—such as Internet Explorer 6/7/8/9—and other legacy - * JavaScript environments. - */ - es3 : true, - - /** - * This option enables syntax first defined in [the ECMAScript 5.1 - * specification](http://es5.github.io/). This includes allowing reserved - * keywords as object properties. - */ - es5 : true, - - /** - * This option requires all `for in` loops to filter object's items. The - * for in statement allows for looping through the names of all of the - * properties of an object including those inherited through the prototype - * chain. This behavior can lead to unexpected items in your object so it - * is generally safer to always filter inherited properties out as shown in - * the example: - * - * for (key in obj) { - * if (obj.hasOwnProperty(key)) { - * // We are sure that obj[key] belongs to the object and was not inherited. - * } - * } - * - * For more in-depth understanding of `for in` loops in JavaScript, read - * [Exploring JavaScript for-in - * loops](http://javascriptweblog.wordpress.com/2011/01/04/exploring-javascript-for-in-loops/) - * by Angus Croll. - */ - forin : true, - - /** - * This option suppresses warnings about declaring variables inside of - * control - * structures while accessing them later from the outside. Even though - * JavaScript has only two real scopes—global and function—such practice - * leads to confusion among people new to the language and hard-to-debug - * bugs. This is why, by default, JSHint warns about variables that are - * used outside of their intended scope. - * - * function test() { - * if (true) { - * var x = 0; - * } - * - * x += 1; // Default: 'x' used out of scope. - * // No warning when funcscope:true - * } - */ - funcscope : true, - - /** - * This option suppresses warnings about the use of global strict mode. - * Global strict mode can break third-party widgets so it is not - * recommended. - * - * For more info about strict mode see the `strict` option. - */ - globalstrict: true, - - /** - * This option prohibits the use of immediate function invocations without - * wrapping them in parentheses. Wrapping parentheses assists readers of - * your code in understanding that the expression is the result of a - * function, and not the function itself. - * - * @deprecated JSHint is limiting its scope to issues of code correctness. - * If you would like to enforce rules relating to code style, - * check out [the JSCS - * project](https://github.com/jscs-dev/node-jscs). - */ - immed : true, - - /** - * This option suppresses warnings about the `__iterator__` property. This - * property is not supported by all browsers so use it carefully. - */ - iterator : true, - - /** - * This option requires you to capitalize names of constructor functions. - * Capitalizing functions that are intended to be used with `new` operator - * is just a convention that helps programmers to visually distinguish - * constructor functions from other types of functions to help spot - * mistakes when using `this`. - * - * Not doing so won't break your code in any browsers or environments but - * it will be a bit harder to figure out—by reading the code—if the - * function was supposed to be used with or without new. And this is - * important because when the function that was intended to be used with - * `new` is used without it, `this` will point to the global object instead - * of a new object. - * - * @deprecated JSHint is limiting its scope to issues of code correctness. - * If you would like to enforce rules relating to code style, - * check out [the JSCS - * project](https://github.com/jscs-dev/node-jscs). - */ - newcap : true, - - /** - * This option prohibits the use of `arguments.caller` and - * `arguments.callee`. Both `.caller` and `.callee` make quite a few - * optimizations impossible so they were deprecated in future versions of - * JavaScript. In fact, ECMAScript 5 forbids the use of `arguments.callee` - * in strict mode. - */ - noarg : true, - - /** - * This option prohibits the use of the comma operator. When misused, the - * comma operator can obscure the value of a statement and promote - * incorrect code. - */ - nocomma : true, - - /** - * This option warns when you have an empty block in your code. JSLint was - * originally warning for all empty blocks and we simply made it optional. - * There were no studies reporting that empty blocks in JavaScript break - * your code in any way. - * - * @deprecated JSHint is limiting its scope to issues of code correctness. - * If you would like to enforce rules relating to code style, - * check out [the JSCS - * project](https://github.com/jscs-dev/node-jscs). - */ - noempty : true, - - /** - * This option warns about "non-breaking whitespace" characters. These - * characters can be entered with option-space on Mac computers and have a - * potential of breaking non-UTF8 web pages. - */ - nonbsp : true, - - /** - * This option prohibits the use of constructor functions for side-effects. - * Some people like to call constructor functions without assigning its - * result to any variable: - * - * new MyConstructor(); - * - * There is no advantage in this approach over simply calling - * `MyConstructor` since the object that the operator `new` creates isn't - * used anywhere so you should generally avoid constructors like this one. - */ - nonew : true, - - /** - * This option prohibits the use of explicitly undeclared variables. This - * option is very useful for spotting leaking and mistyped variables. - * - * // jshint undef:true - * - * function test() { - * var myVar = 'Hello, World'; - * console.log(myvar); // Oops, typoed here. JSHint with undef will complain - * } - * - * If your variable is defined in another file, you can use the `global` - * directive to tell JSHint about it. - */ - undef : true, - - /** - * This option prohibits the use of the grouping operator when it is not - * strictly required. Such usage commonly reflects a misunderstanding of - * unary operators, for example: - * - * // jshint singleGroups: true - * - * delete(obj.attr); // Warning: Unnecessary grouping operator. - */ - singleGroups: false, - - /** - * This option is a short hand for the most strict JSHint configuration. It - * enables all enforcing options and disables all relaxing options. - * - * @deprecated The option automatically opts users in to new features which - * can lead to unexpected warnings/errors in when upgrading - * between minor versions of JSHint. - */ - enforceall : false - }, - relaxing: { - - /** - * This option suppresses warnings about missing semicolons. There is a lot - * of FUD about semicolon spread by quite a few people in the community. - * The common myths are that semicolons are required all the time (they are - * not) and that they are unreliable. JavaScript has rules about semicolons - * which are followed by *all* browsers so it is up to you to decide - * whether you should or should not use semicolons in your code. - * - * For more information about semicolons in JavaScript read [An Open Letter - * to JavaScript Leaders Regarding - * Semicolons](http://blog.izs.me/post/2353458699/an-open-letter-to-javascript-leaders-regarding) - * by Isaac Schlueter and [JavaScript Semicolon - * Insertion](http://inimino.org/~inimino/blog/javascript_semicolons). - */ - asi : true, - - /** - * This option suppresses warnings about multi-line strings. Multi-line - * strings can be dangerous in JavaScript because all hell breaks loose if - * you accidentally put a whitespace in between the escape character (`\`) - * and a new line. - * - * Note that even though this option allows correct multi-line strings, it - * still warns about multi-line strings without escape characters or with - * anything in between the escape character and a whitespace. - * - * // jshint multistr:true - * - * var text = "Hello\ - * World"; // All good. - * - * text = "Hello - * World"; // Warning, no escape character. - * - * text = "Hello\ - * World"; // Warning, there is a space after \ - * - * @deprecated JSHint is limiting its scope to issues of code correctness. - * If you would like to enforce rules relating to code style, - * check out [the JSCS - * project](https://github.com/jscs-dev/node-jscs). - */ - multistr : true, - - /** - * This option suppresses warnings about the `debugger` statements in your - * code. - */ - debug : true, - - /** - * This option suppresses warnings about the use of assignments in cases - * where comparisons are expected. More often than not, code like `if (a = - * 10) {}` is a typo. However, it can be useful in cases like this one: - * - * for (var i = 0, person; person = people[i]; i++) {} - * - * You can silence this error on a per-use basis by surrounding the assignment - * with parenthesis, such as: - * - * for (var i = 0, person; (person = people[i]); i++) {} - */ - boss : true, - - /** - * This option defines globals available when your core is running inside - * of the PhantomJS runtime environment. [PhantomJS](http://phantomjs.org/) - * is a headless WebKit scriptable with a JavaScript API. It has fast and - * native support for various web standards: DOM handling, CSS selector, - * JSON, Canvas, and SVG. - */ - phantom : true, - - /** - * This option suppresses warnings about the use of `eval`. The use of - * `eval` is discouraged because it can make your code vulnerable to - * various injection attacks and it makes it hard for JavaScript - * interpreter to do certain optimizations. - */ - evil : true, - - /** - * This option prohibits the use of unary increment and decrement - * operators. Some people think that `++` and `--` reduces the quality of - * their coding styles and there are programming languages—such as - * Python—that go completely without these operators. - */ - plusplus : true, - - /** - * This option suppresses warnings about the `__proto__` property. - */ - proto : true, - - /** - * This option suppresses warnings about the use of script-targeted - * URLs—such as `javascript:...`. - */ - scripturl : true, - - /** - * This option requires all functions to run in ECMAScript 5's strict mode. - * [Strict mode](https://developer.mozilla.org/en/JavaScript/Strict_mode) - * is a way to opt in to a restricted variant of JavaScript. Strict mode - * eliminates some JavaScript pitfalls that didn't cause errors by changing - * them to produce errors. It also fixes mistakes that made it difficult - * for the JavaScript engines to perform certain optimizations. - * - * *Note:* This option enables strict mode for function scope only. It - * *prohibits* the global scoped strict mode because it might break - * third-party widgets on your page. If you really want to use global - * strict mode, see the *globalstrict* option. - */ - strict : true, - - /** - * This option suppresses warnings about using `[]` notation when it can be - * expressed in dot notation: `person['name']` vs. `person.name`. - * - * @deprecated JSHint is limiting its scope to issues of code correctness. - * If you would like to enforce rules relating to code style, - * check out [the JSCS - * project](https://github.com/jscs-dev/node-jscs). - */ - sub : true, - - /** - * This option suppresses warnings about "weird" constructions like - * `new function () { ... }` and `new Object;`. Such constructions are - * sometimes used to produce singletons in JavaScript: - * - * var singleton = new function() { - * var privateVar; - * - * this.publicMethod = function () {} - * this.publicMethod2 = function () {} - * }; - */ - supernew : true, - - /** - * This option suppresses most of the warnings about possibly unsafe line - * breakings in your code. It doesn't suppress warnings about comma-first - * coding style. To suppress those you have to use `laxcomma` (see below). - * - * @deprecated JSHint is limiting its scope to issues of code correctness. - * If you would like to enforce rules relating to code style, - * check out [the JSCS - * project](https://github.com/jscs-dev/node-jscs). - */ - laxbreak : true, - - /** - * This option suppresses warnings about comma-first coding style: - * - * var obj = { - * name: 'Anton' - * , handle: 'valueof' - * , role: 'SW Engineer' - * }; - * - * @deprecated JSHint is limiting its scope to issues of code correctness. - * If you would like to enforce rules relating to code style, - * check out [the JSCS - * project](https://github.com/jscs-dev/node-jscs). - */ - laxcomma : true, - - /** - * This option suppresses warnings about possible strict violations when - * the code is running in strict mode and you use `this` in a - * non-constructor function. You should use this option—in a function scope - * only—when you are positive that your use of `this` is valid in the - * strict mode (for example, if you call your function using - * `Function.call`). - * - * **Note:** This option can be used only inside of a function scope. - * JSHint will fail with an error if you will try to set this option - * globally. - */ - validthis : true, - - /** - * This option suppresses warnings about the use of the `with` statement. - * The semantics of the `with` statement can cause confusion among - * developers and accidental definition of global variables. - * - * More info: - * - * * [with Statement Considered - * Harmful](http://yuiblog.com/blog/2006/04/11/with-statement-considered-harmful/) - */ - withstmt : true, - - /** - * This options tells JSHint that your code uses Mozilla JavaScript - * extensions. Unless you develop specifically for the Firefox web browser - * you don't need this option. - * - * More info: - * - * * [New in JavaScript - * 1.7](https://developer.mozilla.org/en-US/docs/JavaScript/New_in_JavaScript/1.7) - */ - moz : true, - - /** - * This option suppresses warnings about generator functions with no - * `yield` statement in them. - */ - noyield : true, - - /** - * This option suppresses warnings about `== null` comparisons. Such - * comparisons are often useful when you want to check if a variable is - * `null` or `undefined`. - */ - eqnull : true, - - /** - * This option suppresses warnings about missing semicolons, but only when - * the semicolon is omitted for the last statement in a one-line block: - * - * var name = (function() { return 'Anton' }()); - * - * This is a very niche use case that is useful only when you use automatic - * JavaScript code generators. - */ - lastsemic : true, - - /** - * This option suppresses warnings about functions inside of loops. - * Defining functions inside of loops can lead to bugs such as this one: - * - * var nums = []; - * - * for (var i = 0; i < 10; i++) { - * nums[i] = function (j) { - * return i + j; - * }; - * } - * - * nums[0](2); // Prints 12 instead of 2 - * - * To fix the code above you need to copy the value of `i`: - * - * var nums = []; - * - * for (var i = 0; i < 10; i++) { - * (function (i) { - * nums[i] = function (j) { - * return i + j; - * }; - * }(i)); - * } - */ - loopfunc : true, - - /** - * This option suppresses warnings about the use of expressions where - * normally you would expect to see assignments or function calls. Most of - * the time, such code is a typo. However, it is not forbidden by the spec - * and that's why this warning is optional. - */ - expr : true, - - /** - * This option tells JSHint that your code uses ECMAScript 6 specific - * syntax. Note that these features are not finalized yet and not all - * browsers implement them. - * - * More info: - * - * * [Draft Specification for ES.next (ECMA-262 Ed. - * 6)](http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts) - */ - esnext : true, - - /** - * This option tells JSHint that your code uses ES3 array elision elements, - * or empty elements (for example, `[1, , , 4, , , 7]`). - */ - elision : true, - }, - - // Third party globals - environments: { - - /** - * This option defines globals exposed by the - * [MooTools](http://mootools.net/) JavaScript framework. - */ - mootools : true, - - /** - * This option defines globals exposed by - * [CouchDB](http://couchdb.apache.org/). CouchDB is a document-oriented - * database that can be queried and indexed in a MapReduce fashion using - * JavaScript. - */ - couch : true, - - /** - * This option defines globals exposed by [the Jasmine unit testing - * framework](https://jasmine.github.io/). - */ - jasmine : true, - - /** - * This option defines globals exposed by the [jQuery](http://jquery.com/) - * JavaScript library. - */ - jquery : true, - - /** - * This option defines globals available when your code is running inside - * of the Node runtime environment. [Node.js](http://nodejs.org/) is a - * server-side JavaScript environment that uses an asynchronous - * event-driven model. This option also skips some warnings that make sense - * in the browser environments but don't make sense in Node such as - * file-level `use strict` pragmas and `console.log` statements. - */ - node : true, - - /** - * This option defines globals exposed by [the QUnit unit testing - * framework](http://qunitjs.com/). - */ - qunit : true, - - /** - * This option defines globals available when your code is running inside - * of the Rhino runtime environment. [Rhino](http://www.mozilla.org/rhino/) - * is an open-source implementation of JavaScript written entirely in Java. - */ - rhino : true, - - /** - * This option defines globals exposed by [the ShellJS - * library](http://documentup.com/arturadib/shelljs). - */ - shelljs : true, - - /** - * This option defines globals exposed by the - * [Prototype](http://www.prototypejs.org/) JavaScript framework. - */ - prototypejs : true, - - /** - * This option defines globals exposed by the [YUI](http://yuilibrary.com/) - * JavaScript framework. - */ - yui : true, - - /** - * This option defines globals exposed by the "BDD" and "TDD" UIs of the - * [Mocha unit testing framework](http://mochajs.org/). - */ - mocha : true, - - /** - * This option defines globals available when your code is running as a - * script for the [Windows Script - * Host](http://en.wikipedia.org/wiki/Windows_Script_Host). - */ - wsh : true, - - /** - * This option defines globals available when your code is running inside - * of a Web Worker. [Web - * Workers](https://developer.mozilla.org/en/Using_web_workers) provide a - * simple means for web content to run scripts in background threads. - */ - worker : true, - - /** - * This option defines non-standard but widely adopted globals such as - * `escape` and `unescape`. - */ - nonstandard : true, - - /** - * This option defines globals exposed by modern browsers: all the way from - * good old `document` and `navigator` to the HTML5 `FileReader` and other - * new developments in the browser world. - * - * **Note:** This option doesn't expose variables like `alert` or - * `console`. See option `devel` for more information. - */ - browser : true, - - /** - * This option defines globals available when using [the Browserify - * tool](http://browserify.org/) to build a project. - */ - browserify : true, - - /** - * This option defines globals that are usually used for logging poor-man's - * debugging: `console`, `alert`, etc. It is usually a good idea to not - * ship them in production because, for example, `console.log` breaks in - * legacy versions of Internet Explorer. - */ - devel : true, - - /** - * This option defines globals exposed by the [Dojo - * Toolkit](http://dojotoolkit.org/). - */ - dojo : true, - - /** - * This option defines globals for typed array constructors. - * - * More info: - * - * * [JavaScript typed - * arrays](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays) - */ - typed : true - }, - - // Obsolete options - obsolete: { - onecase : true, // if one case switch statements should be allowed - regexp : true, // if the . should not be allowed in regexp literals - regexdash : true // if unescaped first/last dash (-) inside brackets - // should be tolerated - } -}; - -// These are the JSHint options that can take any value -// (we use this object to detect invalid options) -exports.val = { - - /** - * This option lets you set the maximum length of a line. - * - * @deprecated JSHint is limiting its scope to issues of code correctness. If - * you would like to enforce rules relating to code style, check - * out [the JSCS project](https://github.com/jscs-dev/node-jscs). - */ - maxlen : false, - - /** - * This option sets a specific tab width for your code. - * - * @deprecated JSHint is limiting its scope to issues of code correctness. If - * you would like to enforce rules relating to code style, check - * out [the JSCS project](https://github.com/jscs-dev/node-jscs). - */ - indent : false, - - /** - * This options allows you to set the maximum amount of warnings JSHint will - * produce before giving up. Default is 50. - */ - maxerr : false, - - predef : false, // predef is deprecated and being replaced by globals - - /** - * This option can be used to specify a white list of global variables that - * are not formally defined in the source code. This is most useful when - * combined with the `undef` option in order to suppress warnings for - * project-specific global variables. - * - * Setting an entry to `true` enables reading and writing to that variable. - * Setting it to `false` will trigger JSHint to consider that variable - * read-only. - * - * See also the "environment" options: a set of options to be used as short - * hand for enabling global variables defined in common JavaScript - * environments. - */ - globals : false, - - /** - * This option enforces the consistency of quotation marks used throughout - * your code. It accepts three values: `true` if you don't want to enforce - * one particular style but want some consistency, `"single"` if you want to - * allow only single quotes and `"double"` if you want to allow only double - * quotes. - * - * @deprecated JSHint is limiting its scope to issues of code correctness. If - * you would like to enforce rules relating to code style, check - * out [the JSCS project](https://github.com/jscs-dev/node-jscs). - */ - quotmark : false, - - scope : false, - - /** - * This option lets you set the max number of statements allowed per function: - * - * // jshint maxstatements:4 - * - * function main() { - * var i = 0; - * var j = 0; - * - * // Function declarations count as one statement. Their bodies - * // don't get taken into account for the outer function. - * function inner() { - * var i2 = 1; - * var j2 = 1; - * - * return i2 + j2; - * } - * - * j = i + j; - * return j; // JSHint: Too many statements per function. (5) - * } - */ - maxstatements: false, - - /** - * This option lets you control how nested do you want your blocks to be: - * - * // jshint maxdepth:2 - * - * function main(meaning) { - * var day = true; - * - * if (meaning === 42) { - * while (day) { - * shuffle(); - * - * if (tired) { // JSHint: Blocks are nested too deeply (3). - * sleep(); - * } - * } - * } - * } - */ - maxdepth : false, - - /** - * This option lets you set the max number of formal parameters allowed per - * function: - * - * // jshint maxparams:3 - * - * function login(request, onSuccess) { - * // ... - * } - * - * // JSHint: Too many parameters per function (4). - * function logout(request, isManual, whereAmI, onSuccess) { - * // ... - * } - */ - maxparams : false, - - /** - * This option lets you control cyclomatic complexity throughout your code. - * Cyclomatic complexity measures the number of linearly independent paths - * through a program's source code. Read more about [cyclomatic complexity on - * Wikipedia](http://en.wikipedia.org/wiki/Cyclomatic_complexity). - */ - maxcomplexity: false, - - /** - * This option suppresses warnings about variable shadowing i.e. declaring a - * variable that had been already declared somewhere in the outer scope. - * - * - "inner" - check for variables defined in the same scope only - * - "outer" - check for variables defined in outer scopes as well - * - false - same as inner - * - true - allow variable shadowing - */ - shadow : false, - - /** - * This option warns when you define and never use your variables. It is very - * useful for general code cleanup, especially when used in addition to - * `undef`. - * - * // jshint unused:true - * - * function test(a, b) { - * var c, d = 2; - * - * return a + d; - * } - * - * test(1, 2); - * - * // Line 3: 'b' was defined but never used. - * // Line 4: 'c' was defined but never used. - * - * In addition to that, this option will warn you about unused global - * variables declared via the `global` directive. - * - * This can be set to `vars` to only check for variables, not function - * parameters, or `strict` to check all variables and parameters. The - * default (true) behavior is to allow unused parameters that are followed by - * a used parameter. - */ - unused : true, - - /** - * This option prohibits the use of a variable before it was defined. - * JavaScript has function scope only and, in addition to that, all variables - * are always moved—or hoisted— to the top of the function. This behavior can - * lead to some very nasty bugs and that's why it is safer to always use - * variable only after they have been explicitly defined. - * - * Setting this option to "nofunc" will allow function declarations to be - * ignored. - * - * For more in-depth understanding of scoping and hoisting in JavaScript, - * read [JavaScript Scoping and - * Hoisting](http://www.adequatelygood.com/2010/2/JavaScript-Scoping-and-Hoisting) - * by Ben Cherry. - */ - latedef : false, - - ignore : false, // start/end ignoring lines of code, bypassing the lexer - // start - start ignoring lines, including the current line - // end - stop ignoring lines, starting on the next line - // line - ignore warnings / errors for just a single line - // (this option does not bypass the lexer) - ignoreDelimiters: false // array of start/end delimiters used to ignore - // certain chunks from code -}; - -// These are JSHint boolean options which are shared with JSLint -// where the definition in JSHint is opposite JSLint -exports.inverted = { - bitwise : true, - forin : true, - newcap : true, - plusplus: true, - regexp : true, - undef : true, - - // Inverted and renamed, use JSHint name here - eqeqeq : true, - strict : true -}; - -exports.validNames = Object.keys(exports.val) - .concat(Object.keys(exports.bool.relaxing)) - .concat(Object.keys(exports.bool.enforcing)) - .concat(Object.keys(exports.bool.obsolete)) - .concat(Object.keys(exports.bool.environments)); - -// These are JSHint boolean options which are shared with JSLint -// where the name has been changed but the effect is unchanged -exports.renamed = { - eqeq : "eqeqeq", - windows: "wsh", - sloppy : "strict" -}; - -exports.removed = { - nomen: true, - onevar: true, - passfail: true, - white: true, - gcl: true, - smarttabs: true, - trailing: true -}; - -}, -{}], -8:[function(_dereq_,module,exports){ -/* - * Regular expressions. Some of these are stupidly long. - */ - -/*jshint maxlen:1000 */ - -"use strict"; - -// Unsafe comment or string (ax) -exports.unsafeString = - /@cc|<\/?|script|\]\s*\]|<\s*!|</i; - -// Unsafe characters that are silently deleted by one or more browsers (cx) -exports.unsafeChars = - /[\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/; - -// Characters in strings that need escaping (nx and nxg) -exports.needEsc = - /[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/; - -exports.needEscGlobal = - /[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; - -// Star slash (lx) -exports.starSlash = /\*\//; - -// Identifier (ix) -exports.identifier = /^([a-zA-Z_$][a-zA-Z0-9_$]*)$/; - -// JavaScript URL (jx) -exports.javascriptURL = /^(?:javascript|jscript|ecmascript|vbscript|livescript)\s*:/i; - -// Catches /* falls through */ comments (ft) -exports.fallsThrough = /^\s*\/\*\s*falls?\sthrough\s*\*\/\s*$/; - -// very conservative rule (eg: only one space between the start of the comment and the first character) -// to relax the maxlen option -exports.maxlenException = /^(?:(?:\/\/|\/\*|\*) ?)?[^ ]+$/; - -}, -{}], -9:[function(_dereq_,module,exports){ -"use strict"; -var NameStack = _dereq_("./name-stack.js"); - -var state = { - syntax: {}, - - reset: function() { - this.tokens = { - prev: null, - next: null, - curr: null - }; - - this.option = {}; - this.ignored = {}; - this.directive = {}; - this.jsonMode = false; - this.jsonWarnings = []; - this.lines = []; - this.tab = ""; - this.cache = {}; // Node.JS doesn't have Map. Sniff. - this.ignoredLines = {}; - this.forinifcheckneeded = false; - this.nameStack = new NameStack(); - - // Blank out non-multi-line-commented lines when ignoring linter errors - this.ignoreLinterErrors = false; - } -}; - -exports.state = state; - -}, -{"./name-stack.js":6}], -10:[function(_dereq_,module,exports){ -"use strict"; - -exports.register = function(linter) { - // Check for properties named __proto__. This special property was - // deprecated and then re-introduced for ES6. - - linter.on("Identifier", function style_scanProto(data) { - if (linter.getOption("proto")) { - return; - } - - if (data.name === "__proto__") { - linter.warn("W103", { - line: data.line, - char: data.char, - data: [ data.name ] - }); - } - }); - - // Check for properties named __iterator__. This is a special property - // available only in browsers with JavaScript 1.7 implementation. - - linter.on("Identifier", function style_scanIterator(data) { - if (linter.getOption("iterator")) { - return; - } - - if (data.name === "__iterator__") { - linter.warn("W104", { - line: data.line, - char: data.char, - data: [ data.name ] - }); - } - }); - - // Check that all identifiers are using camelCase notation. - // Exceptions: names like MY_VAR and _myVar. - - linter.on("Identifier", function style_scanCamelCase(data) { - if (!linter.getOption("camelcase")) { - return; - } - - if (data.name.replace(/^_+|_+$/g, "").indexOf("_") > -1 && !data.name.match(/^[A-Z0-9_]*$/)) { - linter.warn("W106", { - line: data.line, - char: data.from, - data: [ data.name ] - }); - } - }); - - // Enforce consistency in style of quoting. - - linter.on("String", function style_scanQuotes(data) { - var quotmark = linter.getOption("quotmark"); - var code; - - if (!quotmark) { - return; - } - - // If quotmark is set to 'single' warn about all double-quotes. - - if (quotmark === "single" && data.quote !== "'") { - code = "W109"; - } - - // If quotmark is set to 'double' warn about all single-quotes. - - if (quotmark === "double" && data.quote !== "\"") { - code = "W108"; - } - - // If quotmark is set to true, remember the first quotation style - // and then warn about all others. - - if (quotmark === true) { - if (!linter.getCache("quotmark")) { - linter.setCache("quotmark", data.quote); - } - - if (linter.getCache("quotmark") !== data.quote) { - code = "W110"; - } - } - - if (code) { - linter.warn(code, { - line: data.line, - char: data.char, - }); - } - }); - - linter.on("Number", function style_scanNumbers(data) { - if (data.value.charAt(0) === ".") { - // Warn about a leading decimal point. - linter.warn("W008", { - line: data.line, - char: data.char, - data: [ data.value ] - }); - } - - if (data.value.substr(data.value.length - 1) === ".") { - // Warn about a trailing decimal point. - linter.warn("W047", { - line: data.line, - char: data.char, - data: [ data.value ] - }); - } - - if (/^00+/.test(data.value)) { - // Multiple leading zeroes. - linter.warn("W046", { - line: data.line, - char: data.char, - data: [ data.value ] - }); - } - }); - - // Warn about script URLs. - - linter.on("String", function style_scanJavaScriptURLs(data) { - var re = /^(?:javascript|jscript|ecmascript|vbscript|livescript)\s*:/i; - - if (linter.getOption("scripturl")) { - return; - } - - if (re.test(data.value)) { - linter.warn("W107", { - line: data.line, - char: data.char - }); - } - }); -}; - -}, -{}], -11:[function(_dereq_,module,exports){ -// jshint -W001 - -"use strict"; - -// Identifiers provided by the ECMAScript standard. - -exports.reservedVars = { - arguments : false, - NaN : false -}; - -exports.ecmaIdentifiers = { - 3: { - 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, - Math : false, - Number : false, - Object : false, - parseInt : false, - parseFloat : false, - RangeError : false, - ReferenceError : false, - RegExp : false, - String : false, - SyntaxError : false, - TypeError : false, - URIError : false - }, - 5: { - JSON : false - }, - 6: { - Map : false, - Promise : false, - Proxy : false, - Reflect : false, - Set : false, - Symbol : false, - WeakMap : false, - WeakSet : false - } -}; - -// Global variables commonly provided by a web browser environment. - -exports.browser = { - Audio : false, - Blob : false, - addEventListener : false, - applicationCache : false, - atob : false, - blur : false, - btoa : false, - cancelAnimationFrame : false, - CanvasGradient : false, - CanvasPattern : false, - CanvasRenderingContext2D: false, - CSS : false, - clearInterval : false, - clearTimeout : false, - close : false, - closed : false, - Comment : false, - CustomEvent : false, - DOMParser : false, - defaultStatus : false, - Document : false, - document : false, - DocumentFragment : false, - Element : false, - ElementTimeControl : false, - Event : false, - event : false, - FileReader : 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, - HTMLTemplateElement : false, - HTMLTextAreaElement : false, - HTMLTitleElement : false, - HTMLUListElement : false, - HTMLVideoElement : false, - history : false, - Image : false, - Intl : false, - length : false, - localStorage : false, - location : false, - matchMedia : false, - MessageChannel : false, - MessageEvent : false, - MessagePort : false, - MouseEvent : false, - moveBy : false, - moveTo : false, - MutationObserver : false, - name : false, - Node : false, - NodeFilter : false, - NodeList : false, - Notification : 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, - Range : false, - requestAnimationFrame : 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, - SVGAElement : false, - SVGAltGlyphDefElement: false, - SVGAltGlyphElement : false, - SVGAltGlyphItemElement: false, - SVGAngle : false, - SVGAnimateColorElement: false, - SVGAnimateElement : false, - SVGAnimateMotionElement: false, - SVGAnimateTransformElement: false, - SVGAnimatedAngle : false, - SVGAnimatedBoolean : false, - SVGAnimatedEnumeration: false, - SVGAnimatedInteger : false, - SVGAnimatedLength : false, - SVGAnimatedLengthList: false, - SVGAnimatedNumber : false, - SVGAnimatedNumberList: false, - SVGAnimatedPathData : false, - SVGAnimatedPoints : false, - SVGAnimatedPreserveAspectRatio: false, - SVGAnimatedRect : false, - SVGAnimatedString : false, - SVGAnimatedTransformList: false, - SVGAnimationElement : false, - SVGCSSRule : false, - SVGCircleElement : false, - SVGClipPathElement : false, - SVGColor : false, - SVGColorProfileElement: false, - SVGColorProfileRule : false, - SVGComponentTransferFunctionElement: false, - SVGCursorElement : false, - SVGDefsElement : false, - SVGDescElement : false, - SVGDocument : false, - SVGElement : false, - SVGElementInstance : false, - SVGElementInstanceList: false, - SVGEllipseElement : false, - SVGExternalResourcesRequired: false, - SVGFEBlendElement : false, - SVGFEColorMatrixElement: false, - SVGFEComponentTransferElement: false, - SVGFECompositeElement: false, - SVGFEConvolveMatrixElement: false, - SVGFEDiffuseLightingElement: false, - SVGFEDisplacementMapElement: false, - SVGFEDistantLightElement: false, - SVGFEFloodElement : false, - SVGFEFuncAElement : false, - SVGFEFuncBElement : false, - SVGFEFuncGElement : false, - SVGFEFuncRElement : false, - SVGFEGaussianBlurElement: false, - SVGFEImageElement : false, - SVGFEMergeElement : false, - SVGFEMergeNodeElement: false, - SVGFEMorphologyElement: false, - SVGFEOffsetElement : false, - SVGFEPointLightElement: false, - SVGFESpecularLightingElement: false, - SVGFESpotLightElement: false, - SVGFETileElement : false, - SVGFETurbulenceElement: false, - SVGFilterElement : false, - SVGFilterPrimitiveStandardAttributes: false, - SVGFitToViewBox : false, - SVGFontElement : false, - SVGFontFaceElement : false, - SVGFontFaceFormatElement: false, - SVGFontFaceNameElement: false, - SVGFontFaceSrcElement: false, - SVGFontFaceUriElement: false, - SVGForeignObjectElement: false, - SVGGElement : false, - SVGGlyphElement : false, - SVGGlyphRefElement : false, - SVGGradientElement : false, - SVGHKernElement : false, - SVGICCColor : false, - SVGImageElement : false, - SVGLangSpace : false, - SVGLength : false, - SVGLengthList : false, - SVGLineElement : false, - SVGLinearGradientElement: false, - SVGLocatable : false, - SVGMPathElement : false, - SVGMarkerElement : false, - SVGMaskElement : false, - SVGMatrix : false, - SVGMetadataElement : false, - SVGMissingGlyphElement: false, - SVGNumber : false, - SVGNumberList : false, - SVGPaint : false, - SVGPathElement : false, - SVGPathSeg : false, - SVGPathSegArcAbs : false, - SVGPathSegArcRel : false, - SVGPathSegClosePath : false, - SVGPathSegCurvetoCubicAbs: false, - SVGPathSegCurvetoCubicRel: false, - SVGPathSegCurvetoCubicSmoothAbs: false, - SVGPathSegCurvetoCubicSmoothRel: false, - SVGPathSegCurvetoQuadraticAbs: false, - SVGPathSegCurvetoQuadraticRel: false, - SVGPathSegCurvetoQuadraticSmoothAbs: false, - SVGPathSegCurvetoQuadraticSmoothRel: false, - SVGPathSegLinetoAbs : false, - SVGPathSegLinetoHorizontalAbs: false, - SVGPathSegLinetoHorizontalRel: false, - SVGPathSegLinetoRel : false, - SVGPathSegLinetoVerticalAbs: false, - SVGPathSegLinetoVerticalRel: false, - SVGPathSegList : false, - SVGPathSegMovetoAbs : false, - SVGPathSegMovetoRel : false, - SVGPatternElement : false, - SVGPoint : false, - SVGPointList : false, - SVGPolygonElement : false, - SVGPolylineElement : false, - SVGPreserveAspectRatio: false, - SVGRadialGradientElement: false, - SVGRect : false, - SVGRectElement : false, - SVGRenderingIntent : false, - SVGSVGElement : false, - SVGScriptElement : false, - SVGSetElement : false, - SVGStopElement : false, - SVGStringList : false, - SVGStylable : false, - SVGStyleElement : false, - SVGSwitchElement : false, - SVGSymbolElement : false, - SVGTRefElement : false, - SVGTSpanElement : false, - SVGTests : false, - SVGTextContentElement: false, - SVGTextElement : false, - SVGTextPathElement : false, - SVGTextPositioningElement: false, - SVGTitleElement : false, - SVGTransform : false, - SVGTransformList : false, - SVGTransformable : false, - SVGURIReference : false, - SVGUnitTypes : false, - SVGUseElement : false, - SVGVKernElement : false, - SVGViewElement : false, - SVGViewSpec : false, - SVGZoomAndPan : false, - Text : false, - TextDecoder : false, - TextEncoder : false, - TimeEvent : false, - top : false, - URL : false, - WebGLActiveInfo : false, - WebGLBuffer : false, - WebGLContextEvent : false, - WebGLFramebuffer : false, - WebGLProgram : false, - WebGLRenderbuffer : false, - WebGLRenderingContext: false, - WebGLShader : false, - WebGLShaderPrecisionFormat: false, - WebGLTexture : false, - WebGLUniformLocation : false, - WebSocket : false, - window : false, - Worker : false, - XDomainRequest : false, - XMLHttpRequest : false, - XMLSerializer : false, - XPathEvaluator : false, - XPathException : false, - XPathExpression : false, - XPathNamespace : false, - XPathNSResolver : false, - XPathResult : false -}; - -exports.devel = { - alert : false, - confirm: false, - console: false, - Debug : false, - opera : false, - prompt : false -}; - -exports.worker = { - importScripts : true, - postMessage : true, - self : true, - FileReaderSync : true -}; - -// Widely adopted global names that are not part of ECMAScript standard -exports.nonstandard = { - escape : false, - unescape: false -}; - -// Globals provided by popular JavaScript environments. - -exports.couch = { - "require" : false, - respond : false, - getRow : false, - emit : false, - send : false, - start : false, - sum : false, - log : false, - exports : false, - module : false, - provides : false -}; - -exports.node = { - __filename : false, - __dirname : false, - GLOBAL : false, - global : false, - module : false, - require : false, - - // These globals are writeable because Node allows the following - // usage pattern: var Buffer = require("buffer").Buffer; - - Buffer : true, - console : true, - exports : true, - process : true, - setTimeout : true, - clearTimeout : true, - setInterval : true, - clearInterval : true, - setImmediate : true, // v0.9.1+ - clearImmediate: true // v0.9.1+ -}; - -exports.browserify = { - __filename : false, - __dirname : false, - global : false, - module : false, - require : false, - Buffer : true, - exports : true, - process : true -}; - -exports.phantom = { - phantom : true, - require : true, - WebPage : true, - console : true, // in examples, but undocumented - exports : true // v1.7+ -}; - -exports.qunit = { - asyncTest : false, - deepEqual : false, - equal : false, - expect : false, - module : false, - notDeepEqual : false, - notEqual : false, - notPropEqual : false, - notStrictEqual : false, - ok : false, - propEqual : false, - QUnit : false, - raises : false, - start : false, - stop : false, - strictEqual : false, - test : false, - "throws" : false -}; - -exports.rhino = { - defineClass : false, - deserialize : false, - gc : false, - help : false, - importClass : false, - importPackage: false, - "java" : false, - load : false, - loadClass : false, - Packages : false, - print : false, - quit : false, - readFile : false, - readUrl : false, - runCommand : false, - seal : false, - serialize : false, - spawn : false, - sync : false, - toint32 : false, - version : false -}; - -exports.shelljs = { - target : false, - echo : false, - exit : false, - cd : false, - pwd : false, - ls : false, - find : false, - cp : false, - rm : false, - mv : false, - mkdir : false, - test : false, - cat : false, - sed : false, - grep : false, - which : false, - dirs : false, - pushd : false, - popd : false, - env : false, - exec : false, - chmod : false, - config : false, - error : false, - tempdir : false -}; - -exports.typed = { - ArrayBuffer : false, - ArrayBufferView : false, - DataView : false, - Float32Array : false, - Float64Array : false, - Int16Array : false, - Int32Array : false, - Int8Array : false, - Uint16Array : false, - Uint32Array : false, - Uint8Array : false, - Uint8ClampedArray : false -}; - -exports.wsh = { - ActiveXObject : true, - Enumerator : true, - GetObject : true, - ScriptEngine : true, - ScriptEngineBuildVersion : true, - ScriptEngineMajorVersion : true, - ScriptEngineMinorVersion : true, - VBArray : true, - WSH : true, - WScript : true, - XDomainRequest : true -}; - -// Globals provided by popular JavaScript libraries. - -exports.dojo = { - dojo : false, - dijit : false, - dojox : false, - define : false, - "require": false -}; - -exports.jquery = { - "$" : false, - jQuery : false -}; - -exports.mootools = { - "$" : false, - "$$" : false, - Asset : false, - Browser : false, - Chain : false, - Class : false, - Color : false, - Cookie : false, - Core : false, - Document : false, - DomReady : false, - DOMEvent : 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 -}; - -exports.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 -}; - -exports.yui = { - YUI : false, - Y : false, - YUI_config: false -}; - -exports.mocha = { - // BDD - describe : false, - xdescribe : false, - it : false, - xit : false, - context : false, - xcontext : false, - before : false, - after : false, - beforeEach : false, - afterEach : false, - // TDD - suite : false, - test : false, - setup : false, - teardown : false, - suiteSetup : false, - suiteTeardown : false -}; - -exports.jasmine = { - jasmine : false, - describe : false, - it : false, - xit : false, - beforeEach : false, - afterEach : false, - setFixtures : false, - loadFixtures: false, - spyOn : false, - expect : false, - // Jasmine 1.3 - runs : false, - waitsFor : false, - waits : false, - // Jasmine 2.1 - beforeAll : false, - afterAll : false, - fail : false, - fdescribe : false, - fit : false -}; - -}, -{}], -12:[function(_dereq_,module,exports){ -// Copyright Joyent, Inc. and other Node contributors. -// -// 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. - -function EventEmitter() { - this._events = this._events || {}; - this._maxListeners = this._maxListeners || undefined; -} -module.exports = EventEmitter; - -// Backwards-compat with node 0.10.x -EventEmitter.EventEmitter = EventEmitter; - -EventEmitter.prototype._events = undefined; -EventEmitter.prototype._maxListeners = undefined; - -// By default EventEmitters will print a warning if more than 10 listeners are -// added to it. This is a useful default which helps finding memory leaks. -EventEmitter.defaultMaxListeners = 10; - -// Obviously not all Emitters should be limited to 10. This function allows -// that to be increased. Set to zero for unlimited. -EventEmitter.prototype.setMaxListeners = function(n) { - if (!isNumber(n) || n < 0 || isNaN(n)) - throw TypeError('n must be a positive number'); - this._maxListeners = n; - return this; -}; - -EventEmitter.prototype.emit = function(type) { - var er, handler, len, args, i, listeners; - - if (!this._events) - this._events = {}; - - // If there is no 'error' event listener then throw. - if (type === 'error') { - if (!this._events.error || - (isObject(this._events.error) && !this._events.error.length)) { - er = arguments[1]; - if (er instanceof Error) { - throw er; // Unhandled 'error' event - } else { - throw TypeError('Uncaught, unspecified "error" event.'); - } - return false; - } - } - - handler = this._events[type]; - - if (isUndefined(handler)) - return false; - - if (isFunction(handler)) { - switch (arguments.length) { - // fast cases - case 1: - handler.call(this); - break; - case 2: - handler.call(this, arguments[1]); - break; - case 3: - handler.call(this, arguments[1], arguments[2]); - break; - // slower - default: - len = arguments.length; - args = new Array(len - 1); - for (i = 1; i < len; i++) - args[i - 1] = arguments[i]; - handler.apply(this, args); - } - } else if (isObject(handler)) { - len = arguments.length; - args = new Array(len - 1); - for (i = 1; i < len; i++) - args[i - 1] = arguments[i]; - - listeners = handler.slice(); - len = listeners.length; - for (i = 0; i < len; i++) - listeners[i].apply(this, args); - } - - return true; -}; - -EventEmitter.prototype.addListener = function(type, listener) { - var m; - - if (!isFunction(listener)) - throw TypeError('listener must be a function'); - - if (!this._events) - this._events = {}; - - // To avoid recursion in the case that type === "newListener"! Before - // adding it to the listeners, first emit "newListener". - if (this._events.newListener) - this.emit('newListener', type, - isFunction(listener.listener) ? - listener.listener : listener); - - if (!this._events[type]) - // Optimize the case of one listener. Don't need the extra array object. - this._events[type] = listener; - else if (isObject(this._events[type])) - // If we've already got an array, just append. - this._events[type].push(listener); - else - // Adding the second element, need to change to array. - this._events[type] = [this._events[type], listener]; - - // Check for listener leak - if (isObject(this._events[type]) && !this._events[type].warned) { - var m; - if (!isUndefined(this._maxListeners)) { - m = this._maxListeners; - } else { - m = EventEmitter.defaultMaxListeners; - } - - if (m && m > 0 && this._events[type].length > m) { - this._events[type].warned = true; - console.error('(node) warning: possible EventEmitter memory ' + - 'leak detected. %d listeners added. ' + - 'Use emitter.setMaxListeners() to increase limit.', - this._events[type].length); - if (typeof console.trace === 'function') { - // not supported in IE 10 - console.trace(); - } - } - } - - return this; -}; - -EventEmitter.prototype.on = EventEmitter.prototype.addListener; - -EventEmitter.prototype.once = function(type, listener) { - if (!isFunction(listener)) - throw TypeError('listener must be a function'); - - var fired = false; - - function g() { - this.removeListener(type, g); - - if (!fired) { - fired = true; - listener.apply(this, arguments); - } - } - - g.listener = listener; - this.on(type, g); - - return this; -}; - -// emits a 'removeListener' event iff the listener was removed -EventEmitter.prototype.removeListener = function(type, listener) { - var list, position, length, i; - - if (!isFunction(listener)) - throw TypeError('listener must be a function'); - - if (!this._events || !this._events[type]) - return this; - - list = this._events[type]; - length = list.length; - position = -1; - - if (list === listener || - (isFunction(list.listener) && list.listener === listener)) { - delete this._events[type]; - if (this._events.removeListener) - this.emit('removeListener', type, listener); - - } else if (isObject(list)) { - for (i = length; i-- > 0;) { - if (list[i] === listener || - (list[i].listener && list[i].listener === listener)) { - position = i; - break; - } - } - - if (position < 0) - return this; - - if (list.length === 1) { - list.length = 0; - delete this._events[type]; - } else { - list.splice(position, 1); - } - - if (this._events.removeListener) - this.emit('removeListener', type, listener); - } - - return this; -}; - -EventEmitter.prototype.removeAllListeners = function(type) { - var key, listeners; - - if (!this._events) - return this; - - // not listening for removeListener, no need to emit - if (!this._events.removeListener) { - if (arguments.length === 0) - this._events = {}; - else if (this._events[type]) - delete this._events[type]; - return this; - } - - // emit removeListener for all listeners on all events - if (arguments.length === 0) { - for (key in this._events) { - if (key === 'removeListener') continue; - this.removeAllListeners(key); - } - this.removeAllListeners('removeListener'); - this._events = {}; - return this; - } - - listeners = this._events[type]; - - if (isFunction(listeners)) { - this.removeListener(type, listeners); - } else { - // LIFO order - while (listeners.length) - this.removeListener(type, listeners[listeners.length - 1]); - } - delete this._events[type]; - - return this; -}; - -EventEmitter.prototype.listeners = function(type) { - var ret; - if (!this._events || !this._events[type]) - ret = []; - else if (isFunction(this._events[type])) - ret = [this._events[type]]; - else - ret = this._events[type].slice(); - return ret; -}; - -EventEmitter.listenerCount = function(emitter, type) { - var ret; - if (!emitter._events || !emitter._events[type]) - ret = 0; - else if (isFunction(emitter._events[type])) - ret = 1; - else - ret = emitter._events[type].length; - return ret; -}; - -function isFunction(arg) { - return typeof arg === 'function'; -} - -function isNumber(arg) { - return typeof arg === 'number'; -} - -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} - -function isUndefined(arg) { - return arg === void 0; -} - -}, -{}]},{},[3]) -(3) - -}); \ No newline at end of file diff --git a/lib/ace/mode/javascript_highlight_rules.js b/lib/ace/mode/javascript_highlight_rules.js index 5bdcce12..ad3efba8 100644 --- a/lib/ace/mode/javascript_highlight_rules.js +++ b/lib/ace/mode/javascript_highlight_rules.js @@ -1,30 +1,38 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. * - * 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. + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * Mihai Sucan + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,44 +40,64 @@ define(function(require, exports, module) { "use strict"; 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(options) { +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 - "keyword": - "const|yield|import|get|set|" + - "break|case|catch|continue|default|delete|do|else|finally|for|function|" + - "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + - // invalid or reserved - "__parent__|__count__|escape|unescape|with|__proto__|" + - "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", - "storage.type": - "const|let|var|function", - "constant.language": - "null|Infinity|NaN|undefined", - "support.function": - "alert", - "constant.language.boolean": "true|false" - }, "identifier"); + var 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|void"; + 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 = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b"; + 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 @@ -83,15 +111,15 @@ var JavaScriptHighlightRules = function(options) { // regexps are ordered -> the first match is used this.$rules = { - "no_regex" : [ + "start" : [ { token : "comment", - regex : "\\/\\/", - next : "line_comment" + regex : /\/\/.*$/ }, DocCommentHighlightRules.getStartRule("doc-start"), { token : "comment", // multi line comment + merge : true, regex : /\/\*/, next : "comment" }, { @@ -108,181 +136,245 @@ var JavaScriptHighlightRules = function(options) { }, { token : "constant.numeric", // float regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/ - }, { - // Sound.prototype.play = + }, { // match stuff like: Sound.prototype.play = function() { } token : [ - "storage.type", "punctuation.operator", "support.function", - "punctuation.operator", "entity.name.function", "text","keyword.operator" + "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*)(=)", + regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", next: "function_arguments" - }, { - // Sound.play = function() { } + }, { // match stuff like: Sound.prototype.play = myfunc token : [ - "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", "storage.type", "text", "paren.lparen" + "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" - }, { - // play = function() { } + }, { // match stuff like: play = function() { } token : [ - "entity.name.function", "text", "keyword.operator", "text", "storage.type", - "text", "paren.lparen" + "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() { } + }, { // 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" + "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) { } + }, { // match regular function like: function myFunc(arg) { } token : [ - "storage.type", "text", "entity.name.function", "text", "paren.lparen" + "storage.type", + "text", + "entity.name.function", + "text", + "paren.lparen" ], regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", next: "function_arguments" - }, { - // foobar: function() { } + }, { // match stuff like: foobar: function() { } token : [ - "entity.name.function", "text", "punctuation.operator", - "text", "storage.type", "text", "paren.lparen" + "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() { }) + }, { // Attempt to match : function() { } (this is for issues with 'foo': function() { }) token : [ - "text", "text", "storage.type", "text", "paren.lparen" + "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 : "start" + 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(?:op|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(?=\()/ + 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|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + 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 : ["support.constant"], - regex : /that\b/ }, { token : ["storage.type", "punctuation.operator", "support.function.firebug"], - regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + regex : /(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/ }, { - token : keywordMapper, + 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 : /--|\+\+|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/, - next : "start" + regex : /!|\$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=|\b(?:in|instanceof|new|delete|typeof|void)/, + next : "regex_allowed" }, { token : "punctuation.operator", - regex : /[?:,;.]/, - next : "start" + regex : /\?|\:|\,|\;|\./, + next : "regex_allowed" }, { token : "paren.lparen", regex : /[\[({]/, - next : "start" + 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 - "start": [ + "regex_allowed": [ DocCommentHighlightRules.getStartRule("doc-start"), { token : "comment", // multi line comment + merge : true, regex : "\\/\\*", next : "comment_regex_allowed" }, { token : "comment", - regex : "\\/\\/", - next : "line_comment_regex_allowed" + regex : "\\/\\/.*$" }, { token: "string.regexp", regex: "\\/", - next: "regex" + next: "regex", + merge: true }, { token : "text", - regex : "\\s+|^$", - next : "start" + regex : "\\s+" }, { // immediately return to the start mode without matching // anything token: "empty", regex: "", - next: "no_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: "/[sxngimy]*", - next: "no_regex" + regex: "/\\w*", + next: "start", + merge: true }, { - // invalid operators - token : "invalid", - regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + token: "string.regexp", + regex: "[^\\\\/\\[]+", + merge: true }, { - // operators - token : "constant.language.escape", - regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ - }, { - token : "constant.language.delimiter", - regex: /\|/ - }, { - token: "constant.language.escape", - regex: /\[\^?/, - next: "regex_character_class" + token: "string.regexp.charachterclass", + regex: "\\[", + next: "regex_character_class", + merge: true }, { token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp" + regex: "", + next: "start" } ], "regex_character_class": [ { - token: "regexp.charclass.keyword.operator", + token: "regexp.keyword.operator", regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" }, { - token: "constant.language.escape", + token: "string.regexp.charachterclass", regex: "]", - next: "regex" + next: "regex", + merge: true }, { - token: "constant.language.escape", - regex: "-" + token: "string.regexp.charachterclass", + regex: "[^\\\\\\]]+", + merge: true }, { token: "empty", - regex: "$", - next: "no_regex" - }, { - defaultToken: "string.regexp.charachterclass" + regex: "", + next: "start" } ], "function_arguments": [ @@ -291,112 +383,86 @@ var JavaScriptHighlightRules = function(options) { regex: identifierRe }, { token: "punctuation.operator", - regex: "[, ]+" + regex: "[, ]+", + merge: true }, { token: "punctuation.operator", - regex: "$" + regex: "$", + merge: true }, { token: "empty", regex: "", - next: "no_regex" + next: "start" } ], "comment_regex_allowed" : [ - DocCommentHighlightRules.getTagRule(), - {token : "comment", regex : "\\*\\/", next : "start"}, - {defaultToken : "comment", caseInsensitive: true} + { + token : "comment", // closing comment + regex : ".*?\\*\\/", + merge : true, + next : "regex_allowed" + }, { + token : "comment", // comment spanning whole line + merge : true, + regex : ".+" + } ], "comment" : [ - DocCommentHighlightRules.getTagRule(), - {token : "comment", regex : "\\*\\/", next : "no_regex"}, - {defaultToken : "comment", caseInsensitive: true} - ], - "line_comment_regex_allowed" : [ - DocCommentHighlightRules.getTagRule(), - {token : "comment", regex : "$|^", next : "start"}, - {defaultToken : "comment", caseInsensitive: true} - ], - "line_comment" : [ - DocCommentHighlightRules.getTagRule(), - {token : "comment", regex : "$|^", next : "no_regex"}, - {defaultToken : "comment", caseInsensitive: true} + { + 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" + next : "qqstring", + merge : true }, { token : "string", regex : '"|$', - next : "no_regex" - }, { - defaultToken: "string" + next : "start", + merge : true } ], "qstring" : [ { token : "constant.language.escape", regex : escapedRe + }, { + token : "string", + regex : "[^'\\\\]+", + merge : true }, { token : "string", regex : "\\\\$", - next : "qstring" + next : "qstring", + merge : true }, { token : "string", regex : "'|$", - next : "no_regex" - }, { - defaultToken: "string" + next : "start", + merge : true } ] }; - - - if (!options || !options.noES6) { - this.$rules.no_regex.unshift({ - regex: "[{}]", onMatch: function(val, state, stack) { - this.next = val == "{" ? this.nextState : ""; - if (val == "{" && stack.length) { - stack.unshift("start", state); - return "paren"; - } - if (val == "}" && stack.length) { - stack.shift(); - this.next = stack.shift(); - if (this.next.indexOf("string") != -1) - return "paren.quasi.end"; - } - return val == "{" ? "paren.lparen" : "paren.rparen"; - }, - nextState: "start" - }, { - token : "string.quasi.start", - regex : /`/, - push : [{ - token : "constant.language.escape", - regex : escapedRe - }, { - token : "paren.quasi.start", - regex : /\${/, - push : "start" - }, { - token : "string.quasi.end", - regex : /`/, - next : "pop" - }, { - defaultToken: "string.quasi" - }] - }); - } - + this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("no_regex") ]); - - this.normalizeRules(); + [ DocCommentHighlightRules.getEndRule("start") ]); }; oop.inherits(JavaScriptHighlightRules, TextHighlightRules); diff --git a/lib/ace/mode/javascript_highlight_rules_test.js b/lib/ace/mode/javascript_highlight_rules_test.js new file mode 100644 index 00000000..dd9d2fb1 --- /dev/null +++ b/lib/ace/mode/javascript_highlight_rules_test.js @@ -0,0 +1,225 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +if (typeof process !== "undefined") { + require("amd-loader"); +} + +define(function(require, exports, module) { +"use strict"; + +var JavaScriptMode = require("./javascript").Mode; +var assert = require("../test/assertions"); + +module.exports = { + + name: "JavaScript Tokenizer", + + setUp : function() { + this.tokenizer = new JavaScriptMode().getTokenizer(); + }, + + "test: tokenize1" : function() { + var line = "foo = function"; + + var tokens = this.tokenizer.getLineTokens(line, "start").tokens; + + assert.equal(5, tokens.length); + assert.equal("identifier", tokens[0].type); + assert.equal("text", tokens[1].type); + assert.equal("keyword.operator", tokens[2].type); + assert.equal("text", tokens[3].type); + assert.equal("storage.type", tokens[4].type); + }, + + "test: tokenize 'standard' functions" : function() { + var line = "string.charCodeAt(23); document.getElementById('test'); console.log('Here it is');"; + + var tokens = this.tokenizer.getLineTokens(line, "start").tokens; + + assert.equal(23, tokens.length); + assert.equal("support.function", tokens[2].type); // charCodeAt + assert.equal("support.function.dom", tokens[10].type); // getElementById + assert.equal("support.function.firebug", tokens[18].type); // log + }, + + "test: tokenize doc comment" : function() { + var line = "abc /** de */ fg"; + + var tokens = this.tokenizer.getLineTokens(line, "start").tokens; + + assert.equal(5, tokens.length); + assert.equal("identifier", tokens[0].type); + assert.equal("text", tokens[1].type); + assert.equal("comment.doc", tokens[2].type); + assert.equal("text", tokens[3].type); + assert.equal("identifier", tokens[4].type); + }, + + "test: tokenize doc comment with tag" : function() { + var line = "/** @param {} */"; + + var tokens = this.tokenizer.getLineTokens(line, "start").tokens; + + assert.equal(3, tokens.length); + assert.equal("comment.doc", tokens[0].type); + assert.equal("comment.doc.tag", tokens[1].type); + assert.equal("comment.doc", tokens[2].type); + }, + + "test: tokenize parens" : function() { + var line = "[{( )}]"; + + var tokens = this.tokenizer.getLineTokens(line, "start").tokens; + + assert.equal(7, tokens.length); + assert.equal("paren.lparen", tokens[0].type); + assert.equal("paren.lparen", tokens[1].type); + assert.equal("paren.lparen", tokens[2].type); + assert.equal("text", tokens[3].type); + assert.equal("paren.rparen", tokens[4].type); + assert.equal("paren.rparen", tokens[5].type); + assert.equal("paren.rparen", tokens[6].type); + }, + + "test for last rule in ruleset to catch capturing group bugs" : function() { + var tokens = this.tokenizer.getLineTokens("}", "start").tokens; + + assert.equal(1, tokens.length); + assert.equal("paren.rparen", tokens[0].type); + }, + + "test tokenize arithmetic expression which looks like a regexp": function() { + var tokens = this.tokenizer.getLineTokens("a/b/c", "start").tokens; + assert.equal(5, tokens.length); + + var tokens = this.tokenizer.getLineTokens("a/=b/c", "start").tokens; + assert.equal(5, tokens.length); + }, + + "test tokenize reg exps" : function() { + var tokens = this.tokenizer.getLineTokens("a=/b/g", "start").tokens; + assert.equal(3, tokens.length); + assert.equal("string.regexp", tokens[2].type); + + var tokens = this.tokenizer.getLineTokens("a+/b/g", "start").tokens; + assert.equal(3, tokens.length); + assert.equal("string.regexp", tokens[2].type); + + var tokens = this.tokenizer.getLineTokens("a = 1 + /2 + 1/b", "start").tokens; + assert.equal(9, tokens.length); + assert.equal("string.regexp", tokens[8].type); + + var tokens = this.tokenizer.getLineTokens("a=/a/ / /a/", "start").tokens; + assert.equal(7, tokens.length); + assert.equal("string.regexp", tokens[2].type); + assert.equal("string.regexp", tokens[6].type); + + var tokens = this.tokenizer.getLineTokens("case /a/.test(c)", "start").tokens; + assert.equal(8, tokens.length); + assert.equal("string.regexp", tokens[2].type); + }, + + "test tokenize multi-line comment containing a single line comment" : function() { + var tokens = this.tokenizer.getLineTokens("/* foo // bar */", "start").tokens; + assert.equal(1, tokens.length); + assert.equal("comment", tokens[0].type); + + var tokens = this.tokenizer.getLineTokens("/* foo // bar */", "regex_allowed").tokens; + assert.equal(1, tokens.length); + assert.equal("comment", tokens[0].type); + }, + + "test tokenize identifier with umlauts": function() { + var tokens = this.tokenizer.getLineTokens("füße", "start").tokens; + assert.equal(1, tokens.length); + }, + + "test // is not a regexp": function() { + var tokens = this.tokenizer.getLineTokens("{ // 123", "start").tokens; + assert.equal(3, tokens.length); + assert.equal("paren.lparen", tokens[0].type); + assert.equal("text", tokens[1].type); + assert.equal("comment", tokens[2].type); + }, + + "test skipping escaped chars": function() { + var line = "console.log('Meh\\nNeh');" + var tokens = this.tokenizer.getLineTokens(line, "start").tokens; + + assert.equal(9, tokens.length); + assert.equal("constant.language.escape", tokens[5].type); + + line = "console.log('\\u1232Feh');"; + tokens = this.tokenizer.getLineTokens(line, "start").tokens; + + assert.equal(9, tokens.length); + assert.equal("constant.language.escape", tokens[5].type); + }, + + "test multiline strings": function() { + var line = "console.log('Meh\\" + var data = this.tokenizer.getLineTokens(line, "start") + + assert.equal(5, data.tokens.length); + assert.equal(data.state, "qstring"); + + line = "console.log('Meh\\ " + data = this.tokenizer.getLineTokens(line, "start") + + assert.equal(6, data.tokens.length); + assert.equal(data.state, "start"); + + line = 'console.log("\\' + data = this.tokenizer.getLineTokens(line, "start") + + assert.equal(5, data.tokens.length); + assert.equal(data.state, "qqstring"); + + line = 'a="' + data = this.tokenizer.getLineTokens(line, "start") + + assert.equal(3, data.tokens.length); + assert.equal(data.state, "start"); + } +}; + +}); + +if (typeof module !== "undefined" && module === require.main) { + require("asyncjs").test.testcase(module.exports).exec() +} diff --git a/lib/ace/mode/javascript_test.js b/lib/ace/mode/javascript_test.js index b413765a..20cf5935 100644 --- a/lib/ace/mode/javascript_test.js +++ b/lib/ace/mode/javascript_test.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -56,46 +63,16 @@ module.exports = { "test: toggle comment lines should prepend '//' to each line" : function() { var session = new EditSession([" abc", "cde", "fg"]); - session.setTabSize(1); this.mode.toggleCommentLines("start", session, 0, 1); - assert.equal(["// abc", "// cde", "fg"].join("\n"), session.toString()); + assert.equal(["// abc", "//cde", "fg"].join("\n"), session.toString()); }, "test: toggle comment on commented lines should remove leading '//' chars" : function() { var session = new EditSession(["// abc", "//cde", "fg"]); - session.setTabSize(1); this.mode.toggleCommentLines("start", session, 0, 1); - assert.equal([" abc", "cde", "fg"].join("\n"), session.toString()); - }, - - "test: toggle comment on all empty lines" : function() { - var session = new EditSession([" ", " ", " "]); - session.setTabSize(1); - - this.mode.toggleCommentLines("start", session, 0, 1); - assert.equal([" // ", " // ", " "].join("\n"), session.toString()); - }, - - "test: toggle comment with empty lines" : function() { - var session = new EditSession([ - " abc", - "", - " cde", - " fg"]); - - var initial = session.toString(); - this.mode.toggleCommentLines("start", session, 0, 3); - assert.equal([ - " // abc", - "", - " // cde", - " // fg"].join("\n"), - session.toString() - ); - this.mode.toggleCommentLines("start", session, 0, 3); - assert.equal(initial, session.toString()); + assert.equal([" abc", "cde", "fg"].join("\n"), session.toString()); }, "test: toggle comment lines twice should return the original text" : function() { @@ -107,10 +84,10 @@ module.exports = { }, "test: toggle comment on multiple lines with one commented line prepend '//' to each line" : function() { - var session = new EditSession([" // abc", " //cde", " fg"]); - session.setTabSize(1); + var session = new EditSession(["// abc", "//cde", "fg"]); + this.mode.toggleCommentLines("start", session, 0, 2); - assert.equal([" // // abc", " // //cde", " // fg"].join("\n"), session.toString()); + assert.equal(["//// abc", "////cde", "//fg"].join("\n"), session.toString()); }, "test: toggle comment on a comment line with leading white space": function() { @@ -120,31 +97,6 @@ module.exports = { assert.equal(["cde", " fg"].join("\n"), session.toString()); }, - "test: toggle comment lines should take tabsize into account" : function() { - var session = new EditSession([" // abc", " // cde", "// fg"]); - session.setTabSize(2); - this.mode.toggleCommentLines("start", session, 0, 2); - assert.equal([" abc", " cde", " fg"].join("\n"), session.toString()); - session.setTabSize(4); - this.mode.toggleCommentLines("start", session, 0, 2); - assert.equal(["// abc", "// cde", "// fg"].join("\n"), session.toString()); - this.mode.toggleCommentLines("start", session, 0, 2); - assert.equal([" abc", " cde", " fg"].join("\n"), session.toString()); - - session.insert({row: 0, column: 0}, " "); - this.mode.toggleCommentLines("start", session, 0, 2); - assert.equal(["// abc", "// cde", "// fg"].join("\n"), session.toString()); - }, - //there doesn't seem to be any way to make this work - "!test: togglecomment on line with one space" : function() { - var session = new EditSession([" abc", " // cde", "// fg"]); - var initialValue = session + ""; - session.setTabSize(4); - this.mode.toggleCommentLines("start", session, 0, 0); - this.mode.toggleCommentLines("start", session, 0, 0); - assert.equal(initialValue, session.toString()); - }, - "test: auto indent after opening brace" : function() { assert.equal(" ", this.mode.getNextLineIndent("start", "if () {", " ")); }, @@ -170,7 +122,7 @@ module.exports = { "test: no auto indent should add to existing indent" : function() { assert.equal(" ", this.mode.getNextLineIndent("start", " if () {", " ")); assert.equal(" ", this.mode.getNextLineIndent("start", " cde", " ")); - assert.equal(" ", this.mode.getNextLineIndent("start", "function foo(items) {", " ")); + assert.equal(" ", this.mode.getNextLineIndent("regex_allowed", "function foo(items) {", " ")); }, "test: special indent in doc comments" : function() { diff --git a/lib/ace/mode/javascript_worker.js b/lib/ace/mode/javascript_worker.js index fd5788e7..d4aceb4b 100644 --- a/lib/ace/mode/javascript_worker.js +++ b/lib/ace/mode/javascript_worker.js @@ -1,185 +1,88 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ - + define(function(require, exports, module) { "use strict"; - + var oop = require("../lib/oop"); var Mirror = require("../worker/mirror").Mirror; -var lint = require("./javascript/jshint").JSHINT; - -function startRegex(arr) { - return RegExp("^(" + arr.join("|") + ")"); -} - -var disabledWarningsRe = startRegex([ - "Bad for in variable '(.+)'.", - 'Missing "use strict"' -]); -var errorsRe = startRegex([ - "Unexpected", - "Expected ", - "Confusing (plus|minus)", - "\\{a\\} unterminated regular expression", - "Unclosed ", - "Unmatched ", - "Unbegun comment", - "Bad invocation", - "Missing space after", - "Missing operator at" -]); -var infoRe = startRegex([ - "Expected an assignment", - "Bad escapement of EOL", - "Unexpected comma", - "Unexpected space", - "Missing radix parameter.", - "A leading decimal point can", - "\\['{a}'\\] is better written in dot notation.", - "'{a}' used out of scope" -]); - +var lint = require("../worker/jshint").JSHINT; +var parser = require("../narcissus/parser"); + var JavaScriptWorker = exports.JavaScriptWorker = function(sender) { Mirror.call(this, sender); this.setTimeout(500); - this.setOptions(); }; oop.inherits(JavaScriptWorker, Mirror); (function() { - this.setOptions = function(options) { - this.options = options || { - // undef: true, - // unused: true, - esnext: true, - moz: true, - devel: true, - browser: true, - node: true, - laxcomma: true, - laxbreak: true, - lastsemic: true, - onevar: false, - passfail: false, - maxerr: 100, - expr: true, - multistr: true, - globalstrict: true - }; - this.doc.getValue() && this.deferredUpdate.schedule(100); - }; - - this.changeOptions = function(newOptions) { - oop.mixin(this.options, newOptions); - this.doc.getValue() && this.deferredUpdate.schedule(100); - }; - - this.isValidJS = function(str) { - try { - // evaluated code can only create variables in this function - eval("throw 0;" + str); - } catch(e) { - if (e === 0) - return true; - } - return false - }; - + this.onUpdate = function() { var value = this.doc.getValue(); value = value.replace(/^#!.*\n/, "\n"); - if (!value) - return this.sender.emit("annotate", []); - - var errors = []; - // jshint reports many false errors - // report them as error only if code is actually invalid - var maxErrorLevel = this.isValidJS(value) ? "warning" : "error"; - - // var start = new Date(); - lint(value, this.options); - var results = lint.errors; - - var errorAdded = false - for (var i = 0; i < results.length; i++) { - var error = results[i]; - if (!error) - continue; - var raw = error.raw; - var type = "warning"; - - if (raw == "Missing semicolon.") { - var str = error.evidence.substr(error.character); - str = str.charAt(str.search(/\S/)); - if (maxErrorLevel == "error" && str && /[\w\d{(['"]/.test(str)) { - error.reason = 'Missing ";" before statement'; - type = "error"; - } else { - type = "info"; - } - } - else if (disabledWarningsRe.test(raw)) { - continue; - } - else if (infoRe.test(raw)) { - type = "info" - } - else if (errorsRe.test(raw)) { - errorAdded = true; - type = maxErrorLevel; - } - else if (raw == "'{a}' is not defined.") { - type = "warning"; - } - else if (raw == "'{a}' is defined but never used.") { - type = "info"; - } - - errors.push({ - row: error.line-1, - column: error.character-1, - text: error.reason, - type: type, - raw: raw + +// 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" }); - - if (errorAdded) { - // break; - } + return; + } finally { +// console.log("parse time: " + (new Date() - start)); } - // console.log("lint time: " + (new Date() - start)); - - this.sender.emit("annotate", errors); - }; - + +// 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); }); diff --git a/lib/ace/mode/javascript_worker_test.js b/lib/ace/mode/javascript_worker_test.js index 5d61fc89..dd66e2ec 100644 --- a/lib/ace/mode/javascript_worker_test.js +++ b/lib/ace/mode/javascript_worker_test.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -58,11 +65,11 @@ module.exports = { worker.setValue("Juhu Kinners"); worker.deferredUpdate.call(); - var error = this.sender.events[0][1][0]; - assert.equal(error.text, 'Missing ";" before statement'); + var error = this.sender.events[0][1]; + assert.equal(error.text, "missing ; before statement"); assert.equal(error.type, "error"); assert.equal(error.row, 0); - assert.equal(error.column, 4); + assert.equal(error.column, null); }, "test invalid multi line string": function() { @@ -70,32 +77,18 @@ module.exports = { worker.setValue('"a\n\\nn"'); worker.deferredUpdate.call(); - var error = this.sender.events[0][1][0]; - assert.equal(error.text, "Unclosed string."); + var error = this.sender.events[0][1]; + assert.equal(error.text, "Unterminated string literal"); assert.equal(error.type, "error"); assert.equal(error.row, 0); - assert.equal(error.column, 2); + assert.equal(error.column, null); }, - "test another invalid string": function() { + "test check for narcissus bug": function() { var worker = new JavaScriptWorker(this.sender); worker.setValue("if('"); worker.deferredUpdate.call(); - - var error = this.sender.events[0][1][0]; - assert.equal(error.text, "Unclosed string."); - assert.equal(error.type, "error"); - assert.equal(error.row, 0); - assert.equal(error.column, 4); - }, - - "test for each": function() { - var worker = new JavaScriptWorker(this.sender); - worker.setValue("for each(var i in x)"); - worker.deferredUpdate.call(); - - var error = this.sender.events[0][1][0]; - assert.equal(error.text, "Unexpected early end of program."); + assert.equal(this.sender.events[0][1].type, "error"); } }; diff --git a/lib/ace/mode/js_regex_highlight_rules.js b/lib/ace/mode/js_regex_highlight_rules.js deleted file mode 100644 index d54e2ca3..00000000 --- a/lib/ace/mode/js_regex_highlight_rules.js +++ /dev/null @@ -1,94 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var escape = "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"; -var quantifier = "({\\d+\\b,?\\d*}|[+*?])(\\??)"; - -var JsRegexHighlightRules = function() { - this.$rules = { - "start": [{ - // operators - token : "keyword", - regex: "\\\\[bB]", - next: "no_quantifier" - }, { - token: "regexp.keyword.operator", - regex: escape - }, { - // flag - token: "string.regexp", - regex: "/\\w*", - next: "start" - }, { - token : ["string", "string.regex"], - regex: quantifier, - next: "no_quantifier" - }, { - // operators - token : "keyword", - regex: "[$^]|\\\\[bB]", - next: "no_quantifier" - }, { - // operators - token : "constant.language.escape", - regex: /\(\?[:=!]|\)|[()$^+*?]/, - next: "no_quantifier" - }, { - token : "constant.language.delimiter", - regex: /\|/, - next: "no_quantifier" - }, { - token: "constant.language.escape", - regex: /\[\^?/, - next: "character_class" - }, { - token: "empty", - regex: "$", - next: "start" - } - ], - - - "character_class": [{ - regex: /\\[dDwWsS]/ - },{ - token: "markup.list", - regex: "(?:" + escape + "|.)-(?:[^\\]\\\\]|" + escape + ")" - }, { - token: "keyword", - regex: escape - }, { - token: "constant.language.escape", - regex: "]", - next: "start" - }, { - token: "constant.language.escape", - regex: "-" - }, { - token: "empty", - regex: "$", - next: "start" - }, { - defaultToken: "string.regexp.charachterclass" - } - ], - "no_quantifier":[{ - token: "invalid", - regex: quantifier - }, { - token: "invalid", - regex: "", - next: "start" - } - ] - - }; -}; - -oop.inherits(JsRegexHighlightRules, TextHighlightRules); - -exports.JsRegexHighlightRules = JsRegexHighlightRules; -}); diff --git a/lib/ace/mode/json.js b/lib/ace/mode/json.js index cfb00dab..758553f3 100644 --- a/lib/ace/mode/json.js +++ b/lib/ace/mode/json.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -33,6 +40,7 @@ define(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; @@ -40,7 +48,7 @@ var CStyleFoldMode = require("./folding/cstyle").FoldMode; var WorkerClient = require("../worker/worker_client").WorkerClient; var Mode = function() { - this.HighlightRules = HighlightRules; + this.$tokenizer = new Tokenizer(new HighlightRules().getRules()); this.$outdent = new MatchingBraceOutdent(); this.$behaviour = new CstyleBehaviour(); this.foldingRules = new CStyleFoldMode(); @@ -74,11 +82,11 @@ oop.inherits(Mode, TextMode); var worker = new WorkerClient(["ace"], "ace/mode/json_worker", "JsonWorker"); worker.attachToDocument(session.getDocument()); - worker.on("annotate", function(e) { - session.setAnnotations(e.data); + worker.on("error", function(e) { + session.setAnnotations([e.data]); }); - worker.on("terminate", function() { + worker.on("ok", function() { session.clearAnnotations(); }); @@ -86,7 +94,6 @@ oop.inherits(Mode, TextMode); }; - this.$id = "ace/mode/json"; }).call(Mode.prototype); exports.Mode = Mode; diff --git a/lib/ace/mode/json_highlight_rules.js b/lib/ace/mode/json_highlight_rules.js index 4bccaf18..e2ba3be8 100644 --- a/lib/ace/mode/json_highlight_rules.js +++ b/lib/ace/mode/json_highlight_rules.js @@ -1,30 +1,38 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * Mihai Sucan + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -79,15 +87,18 @@ var JsonHighlightRules = function() { regex : /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/ }, { token : "string", - regex : '[^"\\\\]+' + regex : '[^"\\\\]+', + merge : true }, { token : "string", regex : '"', - next : "start" + next : "start", + merge : true }, { token : "string", regex : "", - next : "start" + next : "start", + merge : true } ] }; diff --git a/lib/ace/mode/json_worker.js b/lib/ace/mode/json_worker.js index 168278ba..ba207b3f 100644 --- a/lib/ace/mode/json_worker.js +++ b/lib/ace/mode/json_worker.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -46,20 +53,49 @@ oop.inherits(JsonWorker, Mirror); this.onUpdate = function() { var value = this.doc.getValue(); - var errors = []; + try { - if (value) - parse(value); + var result = parse(value); } catch (e) { - var pos = this.doc.indexToPosition(e.at-1); - errors.push({ + 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("annotate", errors); + 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); diff --git a/lib/ace/mode/json_worker_test.js b/lib/ace/mode/json_worker_test.js index 7113342d..3dea50e6 100644 --- a/lib/ace/mode/json_worker_test.js +++ b/lib/ace/mode/json_worker_test.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -58,7 +65,7 @@ module.exports = { worker.setValue("{}"); worker.deferredUpdate.call(); - assert.equal(this.sender.events[0][1].length, 0); + assert.equal(this.sender.events[0][0], "ok"); }, "test check for syntax error": function() { @@ -71,12 +78,11 @@ module.exports = { worker.deferredUpdate.call(); var event = this.sender.events[0]; - assert.equal(event[0], "annotate"); - assert.equal(event[1].length, 1); - assert.equal(event[1][0].type, "error"); - assert.equal(event[1][0].text, "Bad string"); - assert.equal(event[1][0].row, 1); - assert.equal(event[1][0].column, 0); + assert.equal(event[0], "error"); + assert.equal(event[1].type, "error"); + assert.equal(event[1].text, "Bad string"); + assert.equal(event[1].row, 1); + assert.equal(event[1].column, 0); }, @@ -86,11 +92,11 @@ module.exports = { worker.deferredUpdate.call(); var event = this.sender.events[0]; - assert.equal(event[0], "annotate"); - assert.equal(event[1][0].type, "error"); - assert.equal(event[1][0].text, "Unexpected 'x'"); - assert.equal(event[1][0].row, 0); - assert.equal(event[1][0].column, 0); + assert.equal(event[0], "error"); + assert.equal(event[1].type, "error"); + assert.equal(event[1].text, "Unexpected 'x'"); + assert.equal(event[1].row, 0); + assert.equal(event[1].column, 0); } }; diff --git a/lib/ace/mode/jsoniq.js b/lib/ace/mode/jsoniq.js deleted file mode 100644 index 64dc9541..00000000 --- a/lib/ace/mode/jsoniq.js +++ /dev/null @@ -1,203 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ -define(function(require, exports, module) { -"use strict"; - -var WorkerClient = require("../worker/worker_client").WorkerClient; -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var JSONiqLexer = require("./xquery/jsoniq_lexer").JSONiqLexer; -var Range = require("../range").Range; -var XQueryBehaviour = require("./behaviour/xquery").XQueryBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; -var Anchor = require("../anchor").Anchor; - -var Mode = function() { - this.$tokenizer = new JSONiqLexer(); - this.$behaviour = new XQueryBehaviour(); - this.foldingRules = new CStyleFoldMode(); - this.$highlightRules = new TextHighlightRules(); -}; - -oop.inherits(Mode, TextMode); - -(function() { - - this.completer = { - getCompletions: function(editor, session, pos, prefix, callback) { - if (!session.$worker) - return callback(); - session.$worker.emit("complete", { data: { pos: pos, prefix: prefix } }); - session.$worker.on("complete", function(e){ - callback(null, e.data); - }); - } - }; - - 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.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) { - - var worker = new WorkerClient(["ace"], "ace/mode/xquery_worker", "XQueryWorker"); - var that = this; - - worker.attachToDocument(session.getDocument()); - - worker.on("ok", function(e) { - session.clearAnnotations(); - }); - - worker.on("markers", function(e) { - session.clearAnnotations(); - that.addMarkers(e.data, session); - }); - - return worker; - }; - - this.removeMarkers = function(session) { - var markers = session.getMarkers(false); - for (var id in markers) { - // All language analysis' markers are prefixed with language_highlight - if (markers[id].clazz.indexOf('language_highlight_') === 0) { - session.removeMarker(id); - } - } - for (var i = 0; i < session.markerAnchors.length; i++) { - session.markerAnchors[i].detach(); - } - session.markerAnchors = []; - }; - - this.addMarkers = function(annos, mySession) { - var _self = this; - - if (!mySession.markerAnchors) mySession.markerAnchors = []; - this.removeMarkers(mySession); - mySession.languageAnnos = []; - annos.forEach(function(anno) { - // Certain annotations can temporarily be disabled - //if (_self.disabledMarkerTypes[anno.type]) - // return; - // Multi-line markers are not supported, and typically are a result from a bad error recover, ignore - //if(anno.pos.el && anno.pos.sl !== anno.pos.el) - // return; - // Using anchors here, to automaticaly move markers as text around the marker is updated - var anchor = new Anchor(mySession.getDocument(), anno.pos.sl, anno.pos.sc || 0); - mySession.markerAnchors.push(anchor); - var markerId; - var colDiff = anno.pos.ec - anno.pos.sc; - var rowDiff = anno.pos.el - anno.pos.sl; - var gutterAnno = { - guttertext: anno.message, - type: anno.level || "warning", - text: anno.message - // row will be filled in updateFloat() - }; - - function updateFloat(single) { - if (markerId) - mySession.removeMarker(markerId); - gutterAnno.row = anchor.row; - if (anno.pos.sc !== undefined && anno.pos.ec !== undefined) { - var range = new Range(anno.pos.sl, anno.pos.sc, anno.pos.el, anno.pos.ec); - //var range = Range.fromPoints(anchor.getPosition(), { - // row: anchor.row + rowDiff, - // column: anchor.column + colDiff - //}); - markerId = mySession.addMarker(range, "language_highlight_" + (anno.type ? anno.type : "default")); - } - if (single) mySession.setAnnotations(mySession.languageAnnos); - } - updateFloat(); - anchor.on("change", function() { - updateFloat(true); - }); - if (anno.message) mySession.languageAnnos.push(gutterAnno); - }); - mySession.setAnnotations(mySession.languageAnnos); - }; - - this.$id = "ace/mode/jsoniq"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); diff --git a/lib/ace/mode/jsp.js b/lib/ace/mode/jsp.js deleted file mode 100644 index c1cb0254..00000000 --- a/lib/ace/mode/jsp.js +++ /dev/null @@ -1,55 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var JspHighlightRules = require("./jsp_highlight_rules").JspHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = JspHighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.$id = "ace/mode/jsp"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); diff --git a/lib/ace/mode/jsp_highlight_rules.js b/lib/ace/mode/jsp_highlight_rules.js deleted file mode 100644 index e6775f53..00000000 --- a/lib/ace/mode/jsp_highlight_rules.js +++ /dev/null @@ -1,91 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -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); - - var builtinVariables = 'request|response|out|session|' + - 'application|config|pageContext|page|Exception'; - - var keywords = 'page|include|taglib'; - - var startRules = [ - { - token : "comment", - regex : "<%--", - push : "jsp-dcomment" - }, { - token : "meta.tag", // jsp open tag - regex : "<%@?|<%=?|]+>", - push : "jsp-start" - } - ]; - - var endRules = [ - { - token : "meta.tag", // jsp close tag - regex : "%>|<\\/jsp:[^>]+>", - next : "pop" - }, { - token: "variable.language", - regex : builtinVariables - }, { - token: "keyword", - regex : keywords - } - ]; - - for (var key in this.$rules) - this.$rules[key].unshift.apply(this.$rules[key], startRules); - - this.embedRules(JavaHighlightRules, "jsp-", endRules, ["start"]); - - this.addRules({ - "jsp-dcomment" : [{ - token : "comment", - regex : ".*?--%>", - next : "pop" - }] - }); - - this.normalizeRules(); -}; - -oop.inherits(JspHighlightRules, HtmlHighlightRules); - -exports.JspHighlightRules = JspHighlightRules; -}); diff --git a/lib/ace/mode/jsx.js b/lib/ace/mode/jsx.js index 2406a232..1031e9dc 100644 --- a/lib/ace/mode/jsx.js +++ b/lib/ace/mode/jsx.js @@ -3,13 +3,14 @@ define(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.HighlightRules = JsxHighlightRules; + this.$tokenizer = new Tokenizer(new JsxHighlightRules().getRules()); this.$outdent = new MatchingBraceOutdent(); this.$behaviour = new CstyleBehaviour(); this.foldingRules = new CStyleFoldMode(); @@ -18,38 +19,34 @@ oop.inherits(Mode, TextMode); (function() { - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; + this.getNextLineIndent = function(state, line, tab) { + var indent = this.$getIndent(line); - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); + var tokenizedLine = this.$tokenizer.getLineTokens(line, state); + var tokens = tokenizedLine.tokens; - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; + if (tokens.length && tokens[tokens.length-1].type == "comment") { + return indent; + } - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } + if (state == "start") { + var match = line.match(/^.*[\{\(\[]\s*$/); + if (match) { + indent += tab; + } + } - if (state == "start") { - var match = line.match(/^.*[\{\(\[]\s*$/); - if (match) { - indent += tab; - } - } + return indent; + }; - return indent; - }; + this.checkOutdent = function(state, line, input) { + return this.$outdent.checkOutdent(line, input); + }; - this.checkOutdent = function(state, line, input) { - return this.$outdent.checkOutdent(line, input); - }; + this.autoOutdent = function(state, doc, row) { + this.$outdent.autoOutdent(doc, row); + }; - this.autoOutdent = function(state, doc, row) { - this.$outdent.autoOutdent(doc, row); - }; - - this.$id = "ace/mode/jsx"; }).call(Mode.prototype); exports.Mode = Mode; diff --git a/lib/ace/mode/jsx_highlight_rules.js b/lib/ace/mode/jsx_highlight_rules.js index 5dcfbd6c..0700b011 100644 --- a/lib/ace/mode/jsx_highlight_rules.js +++ b/lib/ace/mode/jsx_highlight_rules.js @@ -1,120 +1,122 @@ define(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 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 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 : "\\/\\*", - 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"; + 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 : "\\/\\/.*$" }, - // 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 - 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") ]); }; - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("start") ]); -}; + oop.inherits(JsxHighlightRules, TextHighlightRules); -oop.inherits(JsxHighlightRules, TextHighlightRules); - -exports.JsxHighlightRules = JsxHighlightRules; + exports.JsxHighlightRules = JsxHighlightRules; }); \ No newline at end of file diff --git a/lib/ace/mode/julia.js b/lib/ace/mode/julia.js deleted file mode 100644 index ddba928f..00000000 --- a/lib/ace/mode/julia.js +++ /dev/null @@ -1,62 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * - * - * ***** END LICENSE BLOCK ***** */ - -/* - THIS FILE WAS AUTOGENERATED BY mode.tmpl.js -*/ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var JuliaHighlightRules = require("./julia_highlight_rules").JuliaHighlightRules; -// TODO: pick appropriate fold mode -var FoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = JuliaHighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "#"; - this.blockComment = ""; - this.$id = "ace/mode/julia"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); \ No newline at end of file diff --git a/lib/ace/mode/julia_highlight_rules.js b/lib/ace/mode/julia_highlight_rules.js deleted file mode 100644 index acff4f4a..00000000 --- a/lib/ace/mode/julia_highlight_rules.js +++ /dev/null @@ -1,170 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -/* This file was autogenerated from https://raw.github.com/JuliaLang/julia/master/contrib/Julia.tmbundle/Syntaxes/Julia.tmLanguage (uuid: ) */ -/**************************************************************************************** - * IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. * - * fileTypes * - ****************************************************************************************/ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var JuliaHighlightRules = function() { - // regexp must not have capturing parentheses. Use (?:) instead. - // regexps are ordered -> the first match is used - - this.$rules = { start: - [ { include: '#function_decl' }, - { include: '#function_call' }, - { include: '#type_decl' }, - { include: '#keyword' }, - { include: '#operator' }, - { include: '#number' }, - { include: '#string' }, - { include: '#comment' } ], - '#bracket': - [ { token: 'keyword.bracket.julia', - regex: '\\(|\\)|\\[|\\]|\\{|\\}|,' } ], - '#comment': - [ { token: - [ 'punctuation.definition.comment.julia', - 'comment.line.number-sign.julia' ], - regex: '(#)(?!\\{)(.*$)'} ], - '#function_call': - [ { token: [ 'support.function.julia', 'text' ], - regex: '([a-zA-Z0-9_]+!?)([\\w\\xff-\\u218e\\u2455-\\uffff]*\\()'} ], - '#function_decl': - [ { token: [ 'keyword.other.julia', 'meta.function.julia', - 'entity.name.function.julia', 'meta.function.julia','text' ], - regex: '(function|macro)(\\s*)([a-zA-Z0-9_\\{]+!?)([\\w\\xff-\\u218e\\u2455-\\uffff]*)([(\\\\{])'} ], - '#keyword': - [ { token: 'keyword.other.julia', - regex: '\\b(?:function|type|immutable|macro|quote|abstract|bitstype|typealias|module|baremodule|new)\\b' }, - { token: 'keyword.control.julia', - regex: '\\b(?:if|else|elseif|while|for|in|begin|let|end|do|try|catch|finally|return|break|continue)\\b' }, - { token: 'storage.modifier.variable.julia', - regex: '\\b(?:global|local|const|export|import|importall|using)\\b' }, - { token: 'variable.macro.julia', regex: '@[\\w\\xff-\\u218e\\u2455-\\uffff]+\\b' } ], - '#number': - [ { token: 'constant.numeric.julia', - regex: '\\b0(?:x|X)[0-9a-fA-F]*|(?:\\b[0-9]+\\.?[0-9]*|\\.[0-9]+)(?:(?:e|E)(?:\\+|-)?[0-9]*)?(?:im)?|\\bInf(?:32)?\\b|\\bNaN(?:32)?\\b|\\btrue\\b|\\bfalse\\b' } ], - '#operator': - [ { token: 'keyword.operator.update.julia', - regex: '=|:=|\\+=|-=|\\*=|/=|//=|\\.//=|\\.\\*=|\\\\=|\\.\\\\=|^=|\\.^=|%=|\\|=|&=|\\$=|<<=|>>=' }, - { token: 'keyword.operator.ternary.julia', regex: '\\?|:' }, - { token: 'keyword.operator.boolean.julia', - regex: '\\|\\||&&|!' }, - { token: 'keyword.operator.arrow.julia', regex: '->|<-|-->' }, - { token: 'keyword.operator.relation.julia', - regex: '>|<|>=|<=|==|!=|\\.>|\\.<|\\.>=|\\.>=|\\.==|\\.!=|\\.=|\\.!|<:|:>' }, - { token: 'keyword.operator.range.julia', regex: ':' }, - { token: 'keyword.operator.shift.julia', regex: '<<|>>' }, - { token: 'keyword.operator.bitwise.julia', regex: '\\||\\&|~' }, - { token: 'keyword.operator.arithmetic.julia', - regex: '\\+|-|\\*|\\.\\*|/|\\./|//|\\.//|%|\\.%|\\\\|\\.\\\\|\\^|\\.\\^' }, - { token: 'keyword.operator.isa.julia', regex: '::' }, - { token: 'keyword.operator.dots.julia', - regex: '\\.(?=[a-zA-Z])|\\.\\.+' }, - { token: 'keyword.operator.interpolation.julia', - regex: '\\$#?(?=.)' }, - { token: [ 'variable', 'keyword.operator.transposed-variable.julia' ], - regex: '([\\w\\xff-\\u218e\\u2455-\\uffff]+)((?:\'|\\.\')*\\.?\')' }, - { token: 'text', - regex: '\\[|\\('}, - { token: [ 'text', 'keyword.operator.transposed-matrix.julia' ], - regex: "([\\]\\)])((?:'|\\.')*\\.?')"} ], - '#string': - [ { token: 'punctuation.definition.string.begin.julia', - regex: '\'', - push: - [ { token: 'punctuation.definition.string.end.julia', - regex: '\'', - next: 'pop' }, - { include: '#string_escaped_char' }, - { defaultToken: 'string.quoted.single.julia' } ] }, - { token: 'punctuation.definition.string.begin.julia', - regex: '"', - push: - [ { token: 'punctuation.definition.string.end.julia', - regex: '"', - next: 'pop' }, - { include: '#string_escaped_char' }, - { defaultToken: 'string.quoted.double.julia' } ] }, - { token: 'punctuation.definition.string.begin.julia', - regex: '\\b[\\w\\xff-\\u218e\\u2455-\\uffff]+"', - push: - [ { token: 'punctuation.definition.string.end.julia', - regex: '"[\\w\\xff-\\u218e\\u2455-\\uffff]*', - next: 'pop' }, - { include: '#string_custom_escaped_char' }, - { defaultToken: 'string.quoted.custom-double.julia' } ] }, - { token: 'punctuation.definition.string.begin.julia', - regex: '`', - push: - [ { token: 'punctuation.definition.string.end.julia', - regex: '`', - next: 'pop' }, - { include: '#string_escaped_char' }, - { defaultToken: 'string.quoted.backtick.julia' } ] } ], - '#string_custom_escaped_char': [ { token: 'constant.character.escape.julia', regex: '\\\\"' } ], - '#string_escaped_char': - [ { token: 'constant.character.escape.julia', - regex: '\\\\(?:\\\\|[0-3]\\d{,2}|[4-7]\\d?|x[a-fA-F0-9]{,2}|u[a-fA-F0-9]{,4}|U[a-fA-F0-9]{,8}|.)' } ], - '#type_decl': - [ { token: - [ 'keyword.control.type.julia', - 'meta.type.julia', - 'entity.name.type.julia', - 'entity.other.inherited-class.julia', - 'punctuation.separator.inheritance.julia', - 'entity.other.inherited-class.julia' ], - regex: '(type|immutable)(\\s+)([a-zA-Z0-9_]+)(?:(\\s*)(<:)(\\s*[.a-zA-Z0-9_:]+))?' }, - { token: [ 'other.typed-variable.julia', 'support.type.julia' ], - regex: '([a-zA-Z0-9_]+)(::[a-zA-Z0-9_{}]+)' } ] } - - this.normalizeRules(); -}; - -JuliaHighlightRules.metaData = { fileTypes: [ 'jl' ], - firstLineMatch: '^#!.*\\bjulia\\s*$', - foldingStartMarker: '^\\s*(?:if|while|for|begin|function|macro|module|baremodule|type|immutable|let)\\b(?!.*\\bend\\b).*$', - foldingStopMarker: '^\\s*(?:end)\\b.*$', - name: 'Julia', - scopeName: 'source.julia' } - - -oop.inherits(JuliaHighlightRules, TextHighlightRules); - -exports.JuliaHighlightRules = JuliaHighlightRules; -}); \ No newline at end of file diff --git a/lib/ace/mode/latex.js b/lib/ace/mode/latex.js index 24048d5e..ca7c82cc 100644 --- a/lib/ace/mode/latex.js +++ b/lib/ace/mode/latex.js @@ -3,22 +3,53 @@ define(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 LatexFoldMode = require("./folding/latex").FoldMode; var Range = require("../range").Range; -var Mode = function() { - this.HighlightRules = LatexHighlightRules; - this.foldingRules = new LatexFoldMode(); +var Mode = function() +{ + this.$tokenizer = new Tokenizer(new LatexHighlightRules().getRules()); }; oop.inherits(Mode, TextMode); (function() { - this.type = "text"; - - this.lineCommentStart = "%"; + 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*)\%/; - this.$id = "ace/mode/latex"; + 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; diff --git a/lib/ace/mode/latex_highlight_rules.js b/lib/ace/mode/latex_highlight_rules.js index bf9b9f3b..e07024cb 100644 --- a/lib/ace/mode/latex_highlight_rules.js +++ b/lib/ace/mode/latex_highlight_rules.js @@ -4,30 +4,12 @@ define(function(require, exports, module) { var oop = require("../lib/oop"); var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var LatexHighlightRules = function() { - +var LatexHighlightRules = function() { this.$rules = { "start" : [{ - // A comment. Tex comments start with % and go to - // the end of the line - token : "comment", - regex : "%.*$" - }, { - // Documentclass and usepackage - token : ["keyword", "lparen", "variable.parameter", "rparen", "lparen", "storage.type", "rparen"], - regex : "(\\\\(?:documentclass|usepackage|input))(?:(\\[)([^\\]]*)(\\]))?({)([^}]*)(})" - }, { - // A label - token : ["keyword","lparen", "variable.parameter", "rparen"], - regex : "(\\\\(?:label|v?ref|cite(?:[^{]*)))(?:({)([^}]*)(}))?" - }, { - // A block - token : ["storage.type", "lparen", "variable.parameter", "rparen"], - regex : "(\\\\(?:begin|end))({)(\\w*)(})" - }, { // A tex command e.g. \foo - token : "storage.type", - regex : "\\\\[a-zA-Z]+" + token : "keyword", + regex : "\\\\(?:[^a-zA-Z]|[a-zA-Z]+)", }, { // Curly and square braces token : "lparen", @@ -37,35 +19,18 @@ var LatexHighlightRules = function() { token : "rparen", regex : "[\\])}]" }, { - // Escaped character (including new line) - token : "constant.character.escape", - regex : "\\\\[^a-zA-Z]?" - }, { - // An equation + // Inline math between two $ symbols token : "string", - regex : "\\${1,2}", - next : "equation" - }], - "equation" : [{ + regex : "\\$(?:(?:\\\\.)|(?:[^\\$\\\\]))*?\\$" + }, { + // A comment. Tex comments start with % and go to + // the end of the line token : "comment", regex : "%.*$" - }, { - token : "string", - regex : "\\${1,2}", - next : "start" - }, { - token : "constant.character.escape", - regex : "\\\\(?:[^a-zA-Z]|[a-zA-Z]+)" - }, { - token : "error", - regex : "^\\s*$", - next : "start" - }, { - defaultToken : "string" }] - }; }; + oop.inherits(LatexHighlightRules, TextHighlightRules); exports.LatexHighlightRules = LatexHighlightRules; diff --git a/lib/ace/mode/lean.js b/lib/ace/mode/lean.js deleted file mode 100644 index e421f2b5..00000000 --- a/lib/ace/mode/lean.js +++ /dev/null @@ -1,101 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var leanHighlightRules = require("./lean_highlight_rules").leanHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -// TODO(soonhok): figure out behavior and foldmode -// var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -// var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = leanHighlightRules; - - this.$outdent = new MatchingBraceOutdent(); - // this.$behaviour = new CstyleBehaviour(); - // this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "--"; - this.blockComment = {start: "/-", end: "-/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().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); - }; - - this.$id = "ace/mode/lean"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); diff --git a/lib/ace/mode/lean_highlight_rules.js b/lib/ace/mode/lean_highlight_rules.js deleted file mode 100644 index d4a37d20..00000000 --- a/lib/ace/mode/lean_highlight_rules.js +++ /dev/null @@ -1,156 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var leanHighlightRules = function() { - - var keywordControls = ( - [ "add_rewrite", "alias", "as", "assume", "attribute", - "begin", "by", "calc", "calc_refl", "calc_subst", "calc_trans", "check", - "classes", "coercions", "conjecture", "constants", "context", - "corollary", "else", "end", "environment", "eval", "example", - "exists", "exit", "export", "exposing", "extends", "fields", "find_decl", - "forall", "from", "fun", "have", "help", "hiding", "if", - "import", "in", "infix", "infixl", "infixr", "instances", - "let", "local", "match", "namespace", "notation", "obtain", "obtains", - "omit", "opaque", "open", "options", "parameter", "parameters", "postfix", - "precedence", "prefix", "premise", "premises", "print", "private", "proof", - "protected", "qed", "raw", "renaming", "section", "set_option", - "show", "tactic_hint", "take", "then", "universe", - "universes", "using", "variable", "variables", "with"].join("|") - ); - - var nameProviders = ( - ["inductive", "structure", "record", "theorem", "axiom", - "axioms", "lemma", "hypothesis", "definition", "constant"].join("|") - ); - - var storageType = ( - ["Prop", "Type", "Type'", "Type₊", "Type₁", "Type₂", "Type₃"].join("|") - ); - - var storageModifiers = ( - "\\[(" + - ["abbreviations", "all-transparent", "begin-end-hints", "class", "classes", "coercion", - "coercions", "declarations", "decls", "instance", "irreducible", - "multiple-instances", "notation", "notations", "parsing-only", "persistent", - "reduce-hints", "reducible", "tactic-hints", "visible", "wf", "whnf" - ].join("|") + - ")\\]" - ); - - var keywordOperators = ( - [].join("|") - ); - - var keywordMapper = this.$keywords = this.createKeywordMapper({ - "keyword.control" : keywordControls, - "storage.type" : storageType, - "keyword.operator" : keywordOperators, - "variable.language": "sorry", - }, "identifier"); - - var identifierRe = "[A-Za-z_\u03b1-\u03ba\u03bc-\u03fb\u1f00-\u1ffe\u2100-\u214f][A-Za-z0-9_'\u03b1-\u03ba\u03bc-\u03fb\u1f00-\u1ffe\u2070-\u2079\u207f-\u2089\u2090-\u209c\u2100-\u214f]*"; - var operatorRe = new RegExp(["#", "@", "->", "∼", "↔", "/", "==", "=", ":=", "<->", - "/\\", "\\/", "∧", "∨", "≠", "<", ">", "≤", "≥", "¬", - "<=", ">=", "⁻¹", "⬝", "▸", "\\+", "\\*", "-", "/", - "λ", "→", "∃", "∀", ":="].join("|")); - // regexp must not have capturing parentheses. Use (?:) instead. - // regexps are ordered -> the first match is used - - this.$rules = { - "start" : [ - { - token : "comment", // single line comment "--" - regex : "--.*$" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment "/-" - regex : "\\/-", - next : "comment" - }, { - stateName: "qqstring", - token : "string.start", regex : '"', next : [ - {token : "string.end", regex : '"', next : "start"}, - {token : "constant.language.escape", regex : /\\[n"\\]/}, - {defaultToken: "string"} - ] - }, { - token : "keyword.control", regex : nameProviders, next : [ - {token : "variable.language", regex : identifierRe, next : "start"} ] - }, { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" - }, { - token : "storage.modifier", - regex : storageModifiers - }, { - token : keywordMapper, - regex : identifierRe - }, { - token : "operator", - regex : operatorRe - }, { - token : "punctuation.operator", - regex : "\\?|\\:|\\,|\\;|\\." - }, { - token : "paren.lparen", - regex : "[[({]" - }, { - token : "paren.rparen", - regex : "[\\])}]" - }, { - token : "text", - regex : "\\s+" - } - ], - "comment" : [ {token: "comment", regex: "-/", next: "start"}, - {defaultToken: "comment"} ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("start") ]); - this.normalizeRules(); -}; - -oop.inherits(leanHighlightRules, TextHighlightRules); - -exports.leanHighlightRules = leanHighlightRules; -}); diff --git a/lib/ace/mode/less.js b/lib/ace/mode/less.js index 658efb3e..4251106b 100644 --- a/lib/ace/mode/less.js +++ b/lib/ace/mode/less.js @@ -1,30 +1,38 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * John Roepke + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -33,29 +41,25 @@ define(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 CssBehaviour = require("./behaviour/css").CssBehaviour; var CStyleFoldMode = require("./folding/cstyle").FoldMode; var Mode = function() { - this.HighlightRules = LessHighlightRules; + this.$tokenizer = new Tokenizer(new LessHighlightRules().getRules(), "i"); this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CssBehaviour(); this.foldingRules = new CStyleFoldMode(); }; oop.inherits(Mode, TextMode); (function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; this.getNextLineIndent = function(state, line, tab) { var indent = this.$getIndent(line); // ignore braces in comments - var tokens = this.getTokenizer().getLineTokens(line, state).tokens; + var tokens = this.$tokenizer.getLineTokens(line, state).tokens; if (tokens.length && tokens[tokens.length-1].type == "comment") { return indent; } @@ -76,7 +80,6 @@ oop.inherits(Mode, TextMode); this.$outdent.autoOutdent(doc, row); }; - this.$id = "ace/mode/less"; }).call(Mode.prototype); exports.Mode = Mode; diff --git a/lib/ace/mode/less_highlight_rules.js b/lib/ace/mode/less_highlight_rules.js index a0162765..8ec0d15c 100644 --- a/lib/ace/mode/less_highlight_rules.js +++ b/lib/ace/mode/less_highlight_rules.js @@ -1,30 +1,38 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * John Roepke + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -177,6 +185,7 @@ var LessHighlightRules = function() { }, { token : "comment", // multi line comment + merge : true, regex : "\\/\\*", next : "comment" }, { @@ -231,7 +240,7 @@ var LessHighlightRules = function() { regex: "\\.[a-z0-9-_]+" }, { token: "variable.language", - regex: ":[a-z_][a-z0-9-_]*" + regex: ":[a-z0-9-_]+" }, { token: "constant", regex: "[a-z0-9-_]+" @@ -247,8 +256,6 @@ var LessHighlightRules = function() { }, { token : "text", regex : "\\s+" - }, { - caseInsensitive: true } ], "comment" : [ @@ -258,6 +265,7 @@ var LessHighlightRules = function() { next : "start" }, { token : "comment", // comment spanning whole line + merge : true, regex : ".+" } ] diff --git a/lib/ace/mode/liquid.js b/lib/ace/mode/liquid.js index b16c2194..ecd2d167 100644 --- a/lib/ace/mode/liquid.js +++ b/lib/ace/mode/liquid.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,24 +39,52 @@ define(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.HighlightRules = LiquidHighlightRules; + this.$tokenizer = new Tokenizer(new LiquidHighlightRules().getRules()); this.$outdent = new MatchingBraceOutdent(); }; oop.inherits(Mode, TextMode); (function() { - this.blockComment = {start: ""}; + 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.getTokenizer().getLineTokens(line, state); + var tokenizedLine = this.$tokenizer.getLineTokens(line, state); var tokens = tokenizedLine.tokens; var endState = tokenizedLine.state; @@ -75,7 +110,6 @@ oop.inherits(Mode, TextMode); this.$outdent.autoOutdent(doc, row); }; - this.$id = "ace/mode/liquid"; }).call(Mode.prototype); exports.Mode = Mode; diff --git a/lib/ace/mode/liquid_highlight_rules.js b/lib/ace/mode/liquid_highlight_rules.js index 50a9376c..cb8fcb35 100644 --- a/lib/ace/mode/liquid_highlight_rules.js +++ b/lib/ace/mode/liquid_highlight_rules.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,98 +39,180 @@ define(function(require, exports, module) { "use strict"; var oop = require("../lib/oop"); +var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules; +var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; +var lang = require("../lib/lang"); +var xmlUtil = require("./xml_util"); var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; var LiquidHighlightRules = function() { - HtmlHighlightRules.call(this); // see: https://developer.mozilla.org/en/Liquid/Reference/Global_Objects - var functions = ( + var functions = lang.arrayToMap( // Standard Filters - "date|capitalize|downcase|upcase|first|last|join|sort|map|size|escape|" + + ("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" + ).split("|") ); - var keywords = ( + var keywords = lang.arrayToMap( // Standard Tags - "capture|endcapture|case|endcase|when|comment|endcomment|" + + ("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" + // Commonly used tags + "style|text|image|widget|plugin|marker|endmarker|tablerow|endtablerow").split("|") ); - var builtinVariables = 'forloop|tablerowloop'; - // "forloop\\.(length|index|index0|rindex|rindex0|first|last)|limit|offset|range" + + var builtinVariables = lang.arrayToMap( + ['forloop'] + // ("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)" + // "col_first|col_last)").split("|") + ); - var definitions = ("assign"); + var definitions = lang.arrayToMap(("assign").split("|")); - 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 - // add liquid start tags to the HTML start tags - for (var rule in this.$rules) { - this.$rules[rule].unshift({ - token : "variable", - regex : "{%", - push : "liquid-start" - }, { - token : "variable", - regex : "{{", - push : "liquid-start" - }); - } + 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 : "[^<]+" + } ], - this.addRules({ - "liquid-start" : [{ - token: "variable", - regex: "}}", - next: "pop" - }, { - token: "variable", - regex: "%}", - next: "pop" - }, { - 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+" - }] - }); + cdata : [ { + token : "text", + regex : "\\]\\]>", + next : "start" + }, { + token : "text", + merge : true, + regex : "\\s+" + }, { + token : "text", + merge : true, + regex : ".+" + } ], - this.normalizeRules(); + 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 : function(value) { + if (functions.hasOwnProperty(value)) + return "support.function"; + else if (keywords.hasOwnProperty(value)) + return "keyword"; + else if (builtinVariables.hasOwnProperty(value)) + return "variable.language"; + else if (definitions.hasOwnProperty(value)) + return "keyword.definition"; + 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+" + }] + }; + + 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); diff --git a/lib/ace/mode/liquid_highlight_rules_test.js b/lib/ace/mode/liquid_highlight_rules_test.js new file mode 100644 index 00000000..45626046 --- /dev/null +++ b/lib/ace/mode/liquid_highlight_rules_test.js @@ -0,0 +1,91 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +if (typeof process !== "undefined") { + require("amd-loader"); +} + +define(function(require, exports, module) { + +var LiquidMode = require("./liquid").Mode; +var assert = require("../test/assertions"); + +module.exports = { + + name: "Liquid Tokenizer", + + setUp : function() { + this.tokenizer = new LiquidMode().getTokenizer(); + }, + + "test: tokenize tags" : function() { + var line = "for one in many"; + + var tokens = this.tokenizer.getLineTokens(line, "liquid_start").tokens; + + assert.equal(7, tokens.length); + assert.equal("keyword", tokens[0].type); + assert.equal("text", tokens[1].type); + assert.equal("identifier", tokens[2].type); + assert.equal("text", tokens[3].type); + assert.equal("keyword", tokens[4].type); + assert.equal("text", tokens[5].type); + assert.equal("identifier", tokens[6].type); + }, + + "test: tokenize parens" : function() { + var line = "[{( )}]"; + + var tokens = this.tokenizer.getLineTokens(line, "liquid_start").tokens; + + assert.equal(7, tokens.length); + assert.equal("paren.lparen", tokens[0].type); + assert.equal("paren.lparen", tokens[1].type); + assert.equal("paren.lparen", tokens[2].type); + assert.equal("text", tokens[3].type); + assert.equal("paren.rparen", tokens[4].type); + assert.equal("paren.rparen", tokens[5].type); + assert.equal("paren.rparen", tokens[6].type); + } + +}; + +}); + +if (typeof module !== "undefined" && module === require.main) { + require("asyncjs").test.testcase(module.exports).exec() +} diff --git a/lib/ace/mode/lisp.js b/lib/ace/mode/lisp.js deleted file mode 100644 index 59c97939..00000000 --- a/lib/ace/mode/lisp.js +++ /dev/null @@ -1,56 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * ***** END LICENSE BLOCK ***** */ - -/* - THIS FILE WAS AUTOGENERATED BY mode.tmpl.js -*/ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var LispHighlightRules = require("./lisp_highlight_rules").LispHighlightRules; - -var Mode = function() { - this.HighlightRules = LispHighlightRules; -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = ";"; - - this.$id = "ace/mode/lisp"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); \ No newline at end of file diff --git a/lib/ace/mode/lisp_highlight_rules.js b/lib/ace/mode/lisp_highlight_rules.js deleted file mode 100644 index 06f7344e..00000000 --- a/lib/ace/mode/lisp_highlight_rules.js +++ /dev/null @@ -1,124 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * Garen J. Torikian - * - * ***** END LICENSE BLOCK ***** */ - - /* - THIS FILE WAS AUTOGENERATED BY Lisp.tmlanguage (UUID: 00D451C9-6B1D-11D9-8DFA-000D93589AF6) */ - - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var LispHighlightRules = function() { - var keywordControl = "case|do|let|loop|if|else|when"; - var keywordOperator = "eq|neq|and|or"; - var constantLanguage = "null|nil"; - var supportFunctions = "cons|car|cdr|cond|lambda|format|setq|setf|quote|eval|append|list|listp|memberp|t|load|progn"; - - var keywordMapper = this.createKeywordMapper({ - "keyword.control": keywordControl, - "keyword.operator": keywordOperator, - "constant.language": constantLanguage, - "support.function": supportFunctions - }, "identifier", true); - - // regexp must not have capturing parentheses. Use (?:) instead. - // regexps are ordered -> the first match is used - - this.$rules = - { - "start": [ - { - token : "comment", - regex : ";.*$" - }, - { - token: ["storage.type.function-type.lisp", "text", "entity.name.function.lisp"], - regex: "(?:\\b(?:(defun|defmethod|defmacro))\\b)(\\s+)((?:\\w|\\-|\\!|\\?)*)" - }, - { - token: ["punctuation.definition.constant.character.lisp", "constant.character.lisp"], - regex: "(#)((?:\\w|[\\\\+-=<>'\"&#])+)" - }, - { - token: ["punctuation.definition.variable.lisp", "variable.other.global.lisp", "punctuation.definition.variable.lisp"], - regex: "(\\*)(\\S*)(\\*)" - }, - { - token : "constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+(?:L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" - }, - { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(?:L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b" - }, - { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, - { - token : "string", - regex : '"(?=.)', - next : "qqstring" - } - ], - "qqstring": [ - { - token: "constant.character.escape.lisp", - regex: "\\\\." - }, - { - token : "string", - regex : '[^"\\\\]+' - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "start" - } - ] -} - -}; - -oop.inherits(LispHighlightRules, TextHighlightRules); - -exports.LispHighlightRules = LispHighlightRules; -}); diff --git a/lib/ace/mode/livescript.js b/lib/ace/mode/livescript.js deleted file mode 100644 index d8330791..00000000 --- a/lib/ace/mode/livescript.js +++ /dev/null @@ -1,246 +0,0 @@ -define(function(require, exports, module){ - var identifier, LiveScriptMode, keywordend, stringfill; - identifier = '(?![\\d\\s])[$\\w\\xAA-\\uFFDC](?:(?!\\s)[$\\w\\xAA-\\uFFDC]|-[A-Za-z])*'; - exports.Mode = LiveScriptMode = (function(superclass){ - var indenter, prototype = extend$((import$(LiveScriptMode, superclass).displayName = 'LiveScriptMode', LiveScriptMode), superclass).prototype, constructor = LiveScriptMode; - function LiveScriptMode(){ - var that; - this.$tokenizer = new (require('../tokenizer')).Tokenizer(LiveScriptMode.Rules); - if (that = require('../mode/matching_brace_outdent')) { - this.$outdent = new that.MatchingBraceOutdent; - } - this.$id = "ace/mode/livescript"; - } - indenter = RegExp('(?:[({[=:]|[-~]>|\\b(?:e(?:lse|xport)|d(?:o|efault)|t(?:ry|hen)|finally|import(?:\\s*all)?|const|var|let|new|catch(?:\\s*' + identifier + ')?))\\s*$'); - prototype.getNextLineIndent = function(state, line, tab){ - var indent, tokens; - indent = this.$getIndent(line); - tokens = this.$tokenizer.getLineTokens(line, state).tokens; - if (!(tokens.length && tokens[tokens.length - 1].type === 'comment')) { - if (state === 'start' && indenter.test(line)) { - indent += tab; - } - } - return indent; - }; - prototype.toggleCommentLines = function(state, doc, startRow, endRow){ - var comment, range, i$, i, out, line; - comment = /^(\s*)#/; - range = new (require('../range')).Range(0, 0, 0, 0); - for (i$ = startRow; i$ <= endRow; ++i$) { - i = i$; - if (out = comment.test(line = doc.getLine(i))) { - line = line.replace(comment, '$1'); - } else { - line = line.replace(/^\s*/, '$&#'); - } - range.end.row = range.start.row = i; - range.end.column = line.length + 1; - doc.replace(range, line); - } - return 1 - out * 2; - }; - prototype.checkOutdent = function(state, line, input){ - var ref$; - return (ref$ = this.$outdent) != null ? ref$.checkOutdent(line, input) : void 8; - }; - prototype.autoOutdent = function(state, doc, row){ - var ref$; - return (ref$ = this.$outdent) != null ? ref$.autoOutdent(doc, row) : void 8; - }; - return LiveScriptMode; - }(require('../mode/text').Mode)); - keywordend = '(?![$\\w]|-[A-Za-z]|\\s*:(?![:=]))'; - stringfill = { - defaultToken: 'string' - }; - LiveScriptMode.Rules = { - start: [ - { - token: 'keyword', - regex: '(?:t(?:h(?:is|row|en)|ry|ypeof!?)|c(?:on(?:tinue|st)|a(?:se|tch)|lass)|i(?:n(?:stanceof)?|mp(?:ort(?:\\s+all)?|lements)|[fs])|d(?:e(?:fault|lete|bugger)|o)|f(?:or(?:\\s+own)?|inally|unction)|s(?:uper|witch)|e(?:lse|x(?:tends|port)|val)|a(?:nd|rguments)|n(?:ew|ot)|un(?:less|til)|w(?:hile|ith)|o[fr]|return|break|let|var|loop)' + keywordend - }, { - token: 'constant.language', - regex: '(?:true|false|yes|no|on|off|null|void|undefined)' + keywordend - }, { - token: 'invalid.illegal', - regex: '(?:p(?:ackage|r(?:ivate|otected)|ublic)|i(?:mplements|nterface)|enum|static|yield)' + keywordend - }, { - token: 'language.support.class', - regex: '(?:R(?:e(?:gExp|ferenceError)|angeError)|S(?:tring|yntaxError)|E(?:rror|valError)|Array|Boolean|Date|Function|Number|Object|TypeError|URIError)' + keywordend - }, { - token: 'language.support.function', - regex: '(?:is(?:NaN|Finite)|parse(?:Int|Float)|Math|JSON|(?:en|de)codeURI(?:Component)?)' + keywordend - }, { - token: 'variable.language', - regex: '(?:t(?:hat|il|o)|f(?:rom|allthrough)|it|by|e)' + keywordend - }, { - token: 'identifier', - regex: identifier + '\\s*:(?![:=])' - }, { - token: 'variable', - regex: identifier - }, { - token: 'keyword.operator', - regex: '(?:\\.{3}|\\s+\\?)' - }, { - token: 'keyword.variable', - regex: '(?:@+|::|\\.\\.)', - next: 'key' - }, { - token: 'keyword.operator', - regex: '\\.\\s*', - next: 'key' - }, { - token: 'string', - regex: '\\\\\\S[^\\s,;)}\\]]*' - }, { - token: 'string.doc', - regex: '\'\'\'', - next: 'qdoc' - }, { - token: 'string.doc', - regex: '"""', - next: 'qqdoc' - }, { - token: 'string', - regex: '\'', - next: 'qstring' - }, { - token: 'string', - regex: '"', - next: 'qqstring' - }, { - token: 'string', - regex: '`', - next: 'js' - }, { - token: 'string', - regex: '<\\[', - next: 'words' - }, { - token: 'string.regex', - regex: '//', - next: 'heregex' - }, { - token: 'comment.doc', - regex: '/\\*', - next: 'comment' - }, { - token: 'comment', - regex: '#.*' - }, { - token: 'string.regex', - regex: '\\/(?:[^[\\/\\n\\\\]*(?:(?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[\\/\\n\\\\]*)*)\\/[gimy$]{0,4}', - next: 'key' - }, { - token: 'constant.numeric', - regex: '(?:0x[\\da-fA-F][\\da-fA-F_]*|(?:[2-9]|[12]\\d|3[0-6])r[\\da-zA-Z][\\da-zA-Z_]*|(?:\\d[\\d_]*(?:\\.\\d[\\d_]*)?|\\.\\d[\\d_]*)(?:e[+-]?\\d[\\d_]*)?[\\w$]*)' - }, { - token: 'lparen', - regex: '[({[]' - }, { - token: 'rparen', - regex: '[)}\\]]', - next: 'key' - }, { - token: 'keyword.operator', - regex: '[\\^!|&%+\\-]+' - }, { - token: 'text', - regex: '\\s+' - } - ], - heregex: [ - { - token: 'string.regex', - regex: '.*?//[gimy$?]{0,4}', - next: 'start' - }, { - token: 'string.regex', - regex: '\\s*#{' - }, { - token: 'comment.regex', - regex: '\\s+(?:#.*)?' - }, { - defaultToken: 'string.regex' - } - ], - key: [ - { - token: 'keyword.operator', - regex: '[.?@!]+' - }, { - token: 'identifier', - regex: identifier, - next: 'start' - }, { - token: 'text', - regex: '', - next: 'start' - } - ], - comment: [ - { - token: 'comment.doc', - regex: '.*?\\*/', - next: 'start' - }, { - defaultToken: 'comment.doc' - } - ], - qdoc: [ - { - token: 'string', - regex: ".*?'''", - next: 'key' - }, stringfill - ], - qqdoc: [ - { - token: 'string', - regex: '.*?"""', - next: 'key' - }, stringfill - ], - qstring: [ - { - token: 'string', - regex: '[^\\\\\']*(?:\\\\.[^\\\\\']*)*\'', - next: 'key' - }, stringfill - ], - qqstring: [ - { - token: 'string', - regex: '[^\\\\"]*(?:\\\\.[^\\\\"]*)*"', - next: 'key' - }, stringfill - ], - js: [ - { - token: 'string', - regex: '[^\\\\`]*(?:\\\\.[^\\\\`]*)*`', - next: 'key' - }, stringfill - ], - words: [ - { - token: 'string', - regex: '.*?\\]>', - next: 'key' - }, stringfill - ] - }; -function extend$(sub, sup){ - function fun(){} fun.prototype = (sub.superclass = sup).prototype; - (sub.prototype = new fun).constructor = sub; - if (typeof sup.extended == 'function') sup.extended(sub); - return sub; -} -function import$(obj, src){ - var own = {}.hasOwnProperty; - for (var key in src) if (own.call(src, key)) obj[key] = src[key]; - return obj; -} -}); \ No newline at end of file diff --git a/lib/ace/mode/logiql.js b/lib/ace/mode/logiql.js deleted file mode 100644 index be1cb7c1..00000000 --- a/lib/ace/mode/logiql.js +++ /dev/null @@ -1,139 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var LogiQLHighlightRules = require("./logiql_highlight_rules").LogiQLHighlightRules; -var FoldMode = require("./folding/coffee").FoldMode; -var TokenIterator = require("../token_iterator").TokenIterator; -var Range = require("../range").Range; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; - -var Mode = function() { - this.HighlightRules = LogiQLHighlightRules; - this.foldingRules = new FoldMode(); - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CstyleBehaviour(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - if (/comment|string/.test(endState)) - return indent; - if (tokens.length && tokens[tokens.length - 1].type == "comment.single") - return indent; - - var match = line.match(); - if (/(-->|<--|<-|->|{)\s*$/.test(line)) - indent += tab; - return indent; - }; - - this.checkOutdent = function(state, line, input) { - if (this.$outdent.checkOutdent(line, input)) - return true; - - if (input !== "\n" && input !== "\r\n") - return false; - - if (!/^\s+/.test(line)) - return false; - - return true; - }; - - this.autoOutdent = function(state, doc, row) { - if (this.$outdent.autoOutdent(doc, row)) - return; - var prevLine = doc.getLine(row); - var match = prevLine.match(/^\s+/); - var column = prevLine.lastIndexOf(".") + 1; - if (!match || !row || !column) return 0; - - var line = doc.getLine(row + 1); - var startRange = this.getMatching(doc, {row: row, column: column}); - if (!startRange || startRange.start.row == row) return 0; - - column = match[0].length; - var indent = this.$getIndent(doc.getLine(startRange.start.row)); - doc.replace(new Range(row + 1, 0, row + 1, column), indent); - }; - - this.getMatching = function(session, row, column) { - if (row == undefined) - row = session.selection.lead - if (typeof row == "object") { - column = row.column; - row = row.row; - } - - var startToken = session.getTokenAt(row, column); - var KW_START = "keyword.start", KW_END = "keyword.end"; - var tok; - if (!startToken) - return; - if (startToken.type == KW_START) { - var it = new TokenIterator(session, row, column); - it.step = it.stepForward; - } else if (startToken.type == KW_END) { - var it = new TokenIterator(session, row, column); - it.step = it.stepBackward; - } else - return; - - while (tok = it.step()) { - if (tok.type == KW_START || tok.type == KW_END) - break; - } - if (!tok || tok.type == startToken.type) - return; - - var col = it.getCurrentTokenColumn(); - var row = it.getCurrentTokenRow(); - return new Range(row, col, row, col + tok.value.length); - }; - this.$id = "ace/mode/logiql"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); \ No newline at end of file diff --git a/lib/ace/mode/logiql_highlight_rules.js b/lib/ace/mode/logiql_highlight_rules.js deleted file mode 100644 index 5f2fecba..00000000 --- a/lib/ace/mode/logiql_highlight_rules.js +++ /dev/null @@ -1,119 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -/* THIS FILE WAS AUTOGENERATED FROM tool\LogicBlox.tmbundle\Syntaxes\LogicBlox.tmLanguage (UUID: 59bf5022-e261-453f-b1cb-9f9fa0712413) */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var LogiQLHighlightRules = function() { - // regexp must not have capturing parentheses. Use (?:) instead. - // regexps are ordered -> the first match is used - - this.$rules = { start: - [ { token: 'comment.block', - regex: '/\\*', - push: - [ { token: 'comment.block', regex: '\\*/', next: 'pop' }, - { defaultToken: 'comment.block' } ], - //A block comment. - }, - { token: 'comment.single', - regex: '//.*', - //A single line comment. - }, - { token: 'constant.numeric', - regex: '\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?[fd]?', - //An integer constant. - //Or a Real number. - }, - { token: 'string', - regex: '"', - push: - [ { token: 'string', regex: '"', next: 'pop' }, - { defaultToken: 'string' } ], - //Strings - }, - { token: 'constant.language', - regex: '\\b(true|false)\\b', - //Boolean values. - }, - { token: 'entity.name.type.logicblox', - regex: '`[a-zA-Z_:]+(\\d|\\a)*\\b', - //LogicBlox Symbol - }, - { token: 'keyword.start', regex: '->', comment: 'Constraint' }, - { token: 'keyword.start', regex: '-->', comment: 'Level 1 Constraint'}, - { token: 'keyword.start', regex: '<-', comment: 'Rule' }, - { token: 'keyword.start', regex: '<--', comment: 'Level 1 Rule' }, - { token: 'keyword.end', regex: '\\.', comment: 'Terminator' }, - { token: 'keyword.other', regex: '!', comment: 'Negation' }, - { token: 'keyword.other', regex: ',', comment: 'Conjunction' }, - { token: 'keyword.other', regex: ';', comment: 'Disjunction' }, - { token: 'keyword.operator', regex: '<=|>=|!=|<|>', comment: 'Equality'}, - { token: 'keyword.other', regex: '@', comment: 'Equality' }, - { token: 'keyword.operator', regex: '\\+|-|\\*|/', comment: 'Arithmetic operations'}, - { token: 'keyword', regex: '::', comment: 'Colon colon' }, - { token: 'support.function', - regex: '\\b(agg\\s*<<)', - push: - [ { include: '$self' }, - { token: 'support.function', - regex: '>>', - next: 'pop' } ], - //Aggregations - }, - { token: 'storage.modifier', - regex: '\\b(lang:[\\w:]*)', - //All the lang system predicates - }, - { token: [ 'storage.type', 'text' ], - regex: '(export|sealed|clauses|block|alias|alias_all)(\\s*\\()(?=`)', - //Module keywords - }, - { token: 'entity.name', - regex: '[a-zA-Z_][a-zA-Z_0-9:]*(@prev|@init|@final)?(?=(\\(|\\[))', - //A predicate name. - }, - { token: 'variable.parameter', - regex: '([a-zA-Z][a-zA-Z_0-9]*|_)\\s*(?=(,|\\.|<-|->|\\)|\\]|=))', - //A variable to a functional predicate. - } ] } - - this.normalizeRules(); -}; - -oop.inherits(LogiQLHighlightRules, TextHighlightRules); - -exports.LogiQLHighlightRules = LogiQLHighlightRules; -}); diff --git a/lib/ace/mode/logiql_test.js b/lib/ace/mode/logiql_test.js deleted file mode 100644 index 1a6e4c08..00000000 --- a/lib/ace/mode/logiql_test.js +++ /dev/null @@ -1,98 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -if (typeof process !== "undefined") { - require("amd-loader"); -} - -define(function(require, exports, module) { -"use strict"; - -var EditSession = require("../edit_session").EditSession; -var LogiQLMode = require("./logiql").Mode; -var assert = require("../test/assertions"); - -module.exports = { - setUp : function() { - this.mode = new LogiQLMode(); - }, - - "test: toggle comment lines should prepend '//' to each line" : function() { - var session = new EditSession([" abc", "cde", "fg"]); - - this.mode.toggleCommentLines("start", session, 0, 1); - assert.equal(["// abc", "// cde", "fg"].join("\n"), session.toString()); - }, - - "test: auto indent after ->" : function() { - assert.equal(" ", this.mode.getNextLineIndent("start", "parent(a, b) ->", " ")); - }, - - "test: auto indent after <--" : function() { - assert.equal(" ", this.mode.getNextLineIndent("start", "foo <-- ", " ")); - }, - - "test: no auto indent in multi line comment" : function() { - assert.equal("", this.mode.getNextLineIndent("start", "/* -->", " ")); - assert.equal(" ", this.mode.getNextLineIndent("start", " /* ->", " ")); - assert.equal(" ", this.mode.getNextLineIndent("comment.block", " abcd", " ")); - }, - - "test: no auto indent after -> in single line comment" : function() { - assert.equal("", this.mode.getNextLineIndent("start", "//->", " ")); - assert.equal(" ", this.mode.getNextLineIndent("start", " //->", " ")); - }, - - "test: trigger outdent if line ends with ." : function() { - assert.ok(this.mode.checkOutdent("start", " ", "\n")); - assert.ok(this.mode.checkOutdent("start", " a ", "\r\n")); - assert.ok(!this.mode.checkOutdent("start", "", "}")); - assert.ok(!this.mode.checkOutdent("start", " ", "a }")); - assert.ok(!this.mode.checkOutdent("start", " }", "}")); - }, - - "test: auto outdent should indent the line with the same indent as the line with the matching ->" : function() { - var session = new EditSession([" bar (a, b) ->", " foo(a)[1.2]", " bla.", " "], new LogiQLMode()); - this.mode.autoOutdent("start", session, 2); - assert.equal(" ", session.getLine(3)); - }, - - "test: no auto outdent if no matching brace is found" : function() { - var session = new EditSession([" bar (a, b) ->", " foo(a)[1.2].", " bla.", " "], new LogiQLMode()); - this.mode.autoOutdent("start", session, 2); - assert.equal(" ", session.getLine(3)); - } -}; - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec() -} diff --git a/lib/ace/mode/lsl.js b/lib/ace/mode/lsl.js deleted file mode 100644 index 14a67244..00000000 --- a/lib/ace/mode/lsl.js +++ /dev/null @@ -1,92 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2013, 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(function(require, exports, module) { -"use strict"; - -var Rules = require("./lsl_highlight_rules").LSLHighlightRules; -var Outdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; -var TextMode = require("./text").Mode; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; -var oop = require("../lib/oop"); - -var Mode = function() { - this.HighlightRules = Rules; - this.$outdent = new Outdent(); - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = ["//"]; - - this.blockComment = { - start: "/*", - end: "*/" - }; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - var endState = tokenizedLine.state; - - if (tokens.length && tokens[tokens.length-1].type === "comment.block.lsl") { - 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.$id = "ace/mode/lsl"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); diff --git a/lib/ace/mode/lsl_highlight_rules.js b/lib/ace/mode/lsl_highlight_rules.js deleted file mode 100644 index c912c627..00000000 --- a/lib/ace/mode/lsl_highlight_rules.js +++ /dev/null @@ -1,123 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2013, 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(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -oop.inherits(LSLHighlightRules, TextHighlightRules); - -function LSLHighlightRules() { - var keywordMapper = this.createKeywordMapper({ - "constant.language.float.lsl" : "DEG_TO_RAD|PI|PI_BY_TWO|RAD_TO_DEG|SQRT2|TWO_PI", - "constant.language.integer.lsl": "ACTIVE|AGENT|AGENT_ALWAYS_RUN|AGENT_ATTACHMENTS|AGENT_AUTOPILOT|AGENT_AWAY|AGENT_BUSY|AGENT_BY_LEGACY_NAME|AGENT_BY_USERNAME|AGENT_CROUCHING|AGENT_FLYING|AGENT_IN_AIR|AGENT_LIST_PARCEL|AGENT_LIST_PARCEL_OWNER|AGENT_LIST_REGION|AGENT_MOUSELOOK|AGENT_ON_OBJECT|AGENT_SCRIPTED|AGENT_SITTING|AGENT_TYPING|AGENT_WALKING|ALL_SIDES|ANIM_ON|ATTACH_AVATAR_CENTER|ATTACH_BACK|ATTACH_BELLY|ATTACH_CHEST|ATTACH_CHIN|ATTACH_HEAD|ATTACH_HUD_BOTTOM|ATTACH_HUD_BOTTOM_LEFT|ATTACH_HUD_BOTTOM_RIGHT|ATTACH_HUD_CENTER_1|ATTACH_HUD_CENTER_2|ATTACH_HUD_TOP_CENTER|ATTACH_HUD_TOP_LEFT|ATTACH_HUD_TOP_RIGHT|ATTACH_LEAR|ATTACH_LEFT_PEC|ATTACH_LEYE|ATTACH_LFOOT|ATTACH_LHAND|ATTACH_LHIP|ATTACH_LLARM|ATTACH_LLLEG|ATTACH_LSHOULDER|ATTACH_LUARM|ATTACH_LULEG|ATTACH_MOUTH|ATTACH_NECK|ATTACH_NOSE|ATTACH_PELVIS|ATTACH_REAR|ATTACH_REYE|ATTACH_RFOOT|ATTACH_RHAND|ATTACH_RHIP|ATTACH_RIGHT_PEC|ATTACH_RLARM|ATTACH_RLLEG|ATTACH_RSHOULDER|ATTACH_RUARM|ATTACH_RULEG|AVOID_CHARACTERS|AVOID_DYNAMIC_OBSTACLES|AVOID_NONE|CAMERA_ACTIVE|CAMERA_BEHINDNESS_ANGLE|CAMERA_BEHINDNESS_LAG|CAMERA_DISTANCE|CAMERA_FOCUS|CAMERA_FOCUS_LAG|CAMERA_FOCUS_LOCKED|CAMERA_FOCUS_OFFSET|CAMERA_FOCUS_THRESHOLD|CAMERA_PITCH|CAMERA_POSITION|CAMERA_POSITION_LAG|CAMERA_POSITION_LOCKED|CAMERA_POSITION_THRESHOLD|CHANGED_ALLOWED_DROP|CHANGED_COLOR|CHANGED_INVENTORY|CHANGED_LINK|CHANGED_MEDIA|CHANGED_OWNER|CHANGED_REGION|CHANGED_REGION_START|CHANGED_SCALE|CHANGED_SHAPE|CHANGED_TELEPORT|CHANGED_TEXTURE|CHARACTER_ACCOUNT_FOR_SKIPPED_FRAMES|CHARACTER_AVOIDANCE_MODE|CHARACTER_CMD_JUMP|CHARACTER_CMD_SMOOTH_STOP|CHARACTER_CMD_STOP|CHARACTER_DESIRED_SPEED|CHARACTER_DESIRED_TURN_SPEED|CHARACTER_LENGTH|CHARACTER_MAX_ACCEL|CHARACTER_MAX_DECEL|CHARACTER_MAX_SPEED|CHARACTER_MAX_TURN_RADIUS|CHARACTER_ORIENTATION|CHARACTER_RADIUS|CHARACTER_STAY_WITHIN_PARCEL|CHARACTER_TYPE|CHARACTER_TYPE_A|CHARACTER_TYPE_B|CHARACTER_TYPE_C|CHARACTER_TYPE_D|CHARACTER_TYPE_NONE|CLICK_ACTION_BUY|CLICK_ACTION_NONE|CLICK_ACTION_OPEN|CLICK_ACTION_OPEN_MEDIA|CLICK_ACTION_PAY|CLICK_ACTION_PLAY|CLICK_ACTION_SIT|CLICK_ACTION_TOUCH|CONTENT_TYPE_ATOM|CONTENT_TYPE_FORM|CONTENT_TYPE_HTML|CONTENT_TYPE_JSON|CONTENT_TYPE_LLSD|CONTENT_TYPE_RSS|CONTENT_TYPE_TEXT|CONTENT_TYPE_XHTML|CONTENT_TYPE_XML|CONTROL_BACK|CONTROL_DOWN|CONTROL_FWD|CONTROL_LBUTTON|CONTROL_LEFT|CONTROL_ML_LBUTTON|CONTROL_RIGHT|CONTROL_ROT_LEFT|CONTROL_ROT_RIGHT|CONTROL_UP|DATA_BORN|DATA_NAME|DATA_ONLINE|DATA_PAYINFO|DATA_SIM_POS|DATA_SIM_RATING|DATA_SIM_STATUS|DEBUG_CHANNEL|DENSITY|ERR_GENERIC|ERR_MALFORMED_PARAMS|ERR_PARCEL_PERMISSIONS|ERR_RUNTIME_PERMISSIONS|ERR_THROTTLED|ESTATE_ACCESS_ALLOWED_AGENT_ADD|ESTATE_ACCESS_ALLOWED_AGENT_REMOVE|ESTATE_ACCESS_ALLOWED_GROUP_ADD|ESTATE_ACCESS_ALLOWED_GROUP_REMOVE|ESTATE_ACCESS_BANNED_AGENT_ADD|ESTATE_ACCESS_BANNED_AGENT_REMOVE|FALSE|FORCE_DIRECT_PATH|FRICTION|GCNP_RADIUS|GCNP_STATIC|GRAVITY_MULTIPLIER|HORIZONTAL|HTTP_BODY_MAXLENGTH|HTTP_BODY_TRUNCATED|HTTP_CUSTOM_HEADER|HTTP_METHOD|HTTP_MIMETYPE|HTTP_PRAGMA_NO_CACHE|HTTP_VERBOSE_THROTTLE|HTTP_VERIFY_CERT|INVENTORY_ALL|INVENTORY_ANIMATION|INVENTORY_BODYPART|INVENTORY_CLOTHING|INVENTORY_GESTURE|INVENTORY_LANDMARK|INVENTORY_NONE|INVENTORY_NOTECARD|INVENTORY_OBJECT|INVENTORY_SCRIPT|INVENTORY_SOUND|INVENTORY_TEXTURE|JSON_APPEND|KFM_CMD_PAUSE|KFM_CMD_PLAY|KFM_CMD_SET_MODE|KFM_CMD_STOP|KFM_COMMAND|KFM_DATA|KFM_FORWARD|KFM_LOOP|KFM_MODE|KFM_PING_PONG|KFM_REVERSE|KFM_ROTATION|KFM_TRANSLATION|LAND_LEVEL|LAND_LOWER|LAND_NOISE|LAND_RAISE|LAND_REVERT|LAND_SMOOTH|LINK_ALL_CHILDREN|LINK_ALL_OTHERS|LINK_ROOT|LINK_SET|LINK_THIS|LIST_STAT_GEOMETRIC_MEAN|LIST_STAT_MAX|LIST_STAT_MEAN|LIST_STAT_MEDIAN|LIST_STAT_MIN|LIST_STAT_NUM_COUNT|LIST_STAT_RANGE|LIST_STAT_STD_DEV|LIST_STAT_SUM|LIST_STAT_SUM_SQUARES|LOOP|MASK_BASE|MASK_EVERYONE|MASK_GROUP|MASK_NEXT|MASK_OWNER|OBJECT_ATTACHED_POINT|OBJECT_CHARACTER_TIME|OBJECT_CREATOR|OBJECT_DESC|OBJECT_GROUP|OBJECT_NAME|OBJECT_OWNER|OBJECT_PATHFINDING_TYPE|OBJECT_PHANTOM|OBJECT_PHYSICS|OBJECT_PHYSICS_COST|OBJECT_POS|OBJECT_PRIM_EQUIVALENCE|OBJECT_RENDER_WEIGHT|OBJECT_RETURN_PARCEL|OBJECT_RETURN_PARCEL_OWNER|OBJECT_RETURN_REGION|OBJECT_ROOT|OBJECT_ROT|OBJECT_RUNNING_SCRIPT_COUNT|OBJECT_SCRIPT_MEMORY|OBJECT_SCRIPT_TIME|OBJECT_SERVER_COST|OBJECT_STREAMING_COST|OBJECT_TEMP_ON_REZ|OBJECT_TOTAL_SCRIPT_COUNT|OBJECT_UNKNOWN_DETAIL|OBJECT_VELOCITY|OPT_AVATAR|OPT_CHARACTER|OPT_EXCLUSION_VOLUME|OPT_LEGACY_LINKSET|OPT_MATERIAL_VOLUME|OPT_OTHER|OPT_STATIC_OBSTACLE|OPT_WALKABLE|PARCEL_COUNT_GROUP|PARCEL_COUNT_OTHER|PARCEL_COUNT_OWNER|PARCEL_COUNT_SELECTED|PARCEL_COUNT_TEMP|PARCEL_COUNT_TOTAL|PARCEL_DETAILS_AREA|PARCEL_DETAILS_DESC|PARCEL_DETAILS_GROUP|PARCEL_DETAILS_ID|PARCEL_DETAILS_NAME|PARCEL_DETAILS_OWNER|PARCEL_DETAILS_SEE_AVATARS|PARCEL_FLAG_ALLOW_ALL_OBJECT_ENTRY|PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS|PARCEL_FLAG_ALLOW_CREATE_OBJECTS|PARCEL_FLAG_ALLOW_DAMAGE|PARCEL_FLAG_ALLOW_FLY|PARCEL_FLAG_ALLOW_GROUP_OBJECT_ENTRY|PARCEL_FLAG_ALLOW_GROUP_SCRIPTS|PARCEL_FLAG_ALLOW_LANDMARK|PARCEL_FLAG_ALLOW_SCRIPTS|PARCEL_FLAG_ALLOW_TERRAFORM|PARCEL_FLAG_LOCAL_SOUND_ONLY|PARCEL_FLAG_RESTRICT_PUSHOBJECT|PARCEL_FLAG_USE_ACCESS_GROUP|PARCEL_FLAG_USE_ACCESS_LIST|PARCEL_FLAG_USE_BAN_LIST|PARCEL_FLAG_USE_LAND_PASS_LIST|PARCEL_MEDIA_COMMAND_AGENT|PARCEL_MEDIA_COMMAND_AUTO_ALIGN|PARCEL_MEDIA_COMMAND_DESC|PARCEL_MEDIA_COMMAND_LOOP|PARCEL_MEDIA_COMMAND_LOOP_SET|PARCEL_MEDIA_COMMAND_PAUSE|PARCEL_MEDIA_COMMAND_PLAY|PARCEL_MEDIA_COMMAND_SIZE|PARCEL_MEDIA_COMMAND_STOP|PARCEL_MEDIA_COMMAND_TEXTURE|PARCEL_MEDIA_COMMAND_TIME|PARCEL_MEDIA_COMMAND_TYPE|PARCEL_MEDIA_COMMAND_UNLOAD|PARCEL_MEDIA_COMMAND_URL|PASSIVE|PATROL_PAUSE_AT_WAYPOINTS|PAYMENT_INFO_ON_FILE|PAYMENT_INFO_USED|PAY_DEFAULT|PAY_HIDE|PERMISSION_ATTACH|PERMISSION_CHANGE_LINKS|PERMISSION_CONTROL_CAMERA|PERMISSION_DEBIT|PERMISSION_OVERRIDE_ANIMATIONS|PERMISSION_RETURN_OBJECTS|PERMISSION_SILENT_ESTATE_MANAGEMENT|PERMISSION_TAKE_CONTROLS|PERMISSION_TELEPORT|PERMISSION_TRACK_CAMERA|PERMISSION_TRIGGER_ANIMATION|PERM_ALL|PERM_COPY|PERM_MODIFY|PERM_MOVE|PERM_TRANSFER|PING_PONG|PRIM_ALPHA_MODE|PRIM_ALPHA_MODE_BLEND|PRIM_ALPHA_MODE_EMISSIVE|PRIM_ALPHA_MODE_MASK|PRIM_ALPHA_MODE_NONE|PRIM_BUMP_BARK|PRIM_BUMP_BLOBS|PRIM_BUMP_BRICKS|PRIM_BUMP_BRIGHT|PRIM_BUMP_CHECKER|PRIM_BUMP_CONCRETE|PRIM_BUMP_DARK|PRIM_BUMP_DISKS|PRIM_BUMP_GRAVEL|PRIM_BUMP_LARGETILE|PRIM_BUMP_NONE|PRIM_BUMP_SHINY|PRIM_BUMP_SIDING|PRIM_BUMP_STONE|PRIM_BUMP_STUCCO|PRIM_BUMP_SUCTION|PRIM_BUMP_TILE|PRIM_BUMP_WEAVE|PRIM_BUMP_WOOD|PRIM_COLOR|PRIM_DESC|PRIM_FLEXIBLE|PRIM_FULLBRIGHT|PRIM_GLOW|PRIM_HOLE_CIRCLE|PRIM_HOLE_DEFAULT|PRIM_HOLE_SQUARE|PRIM_HOLE_TRIANGLE|PRIM_LINK_TARGET|PRIM_MATERIAL|PRIM_MATERIAL_FLESH|PRIM_MATERIAL_GLASS|PRIM_MATERIAL_METAL|PRIM_MATERIAL_PLASTIC|PRIM_MATERIAL_RUBBER|PRIM_MATERIAL_STONE|PRIM_MATERIAL_WOOD|PRIM_MEDIA_ALT_IMAGE_ENABLE|PRIM_MEDIA_AUTO_LOOP|PRIM_MEDIA_AUTO_PLAY|PRIM_MEDIA_AUTO_SCALE|PRIM_MEDIA_AUTO_ZOOM|PRIM_MEDIA_CONTROLS|PRIM_MEDIA_CONTROLS_MINI|PRIM_MEDIA_CONTROLS_STANDARD|PRIM_MEDIA_CURRENT_URL|PRIM_MEDIA_FIRST_CLICK_INTERACT|PRIM_MEDIA_HEIGHT_PIXELS|PRIM_MEDIA_HOME_URL|PRIM_MEDIA_MAX_HEIGHT_PIXELS|PRIM_MEDIA_MAX_URL_LENGTH|PRIM_MEDIA_MAX_WHITELIST_COUNT|PRIM_MEDIA_MAX_WHITELIST_SIZE|PRIM_MEDIA_MAX_WIDTH_PIXELS|PRIM_MEDIA_PARAM_MAX|PRIM_MEDIA_PERMS_CONTROL|PRIM_MEDIA_PERMS_INTERACT|PRIM_MEDIA_PERM_ANYONE|PRIM_MEDIA_PERM_GROUP|PRIM_MEDIA_PERM_NONE|PRIM_MEDIA_PERM_OWNER|PRIM_MEDIA_WHITELIST|PRIM_MEDIA_WHITELIST_ENABLE|PRIM_MEDIA_WIDTH_PIXELS|PRIM_NAME|PRIM_NORMAL|PRIM_OMEGA|PRIM_PHANTOM|PRIM_PHYSICS|PRIM_PHYSICS_SHAPE_CONVEX|PRIM_PHYSICS_SHAPE_NONE|PRIM_PHYSICS_SHAPE_PRIM|PRIM_PHYSICS_SHAPE_TYPE|PRIM_POINT_LIGHT|PRIM_POSITION|PRIM_POS_LOCAL|PRIM_ROTATION|PRIM_ROT_LOCAL|PRIM_SCULPT_FLAG_INVERT|PRIM_SCULPT_FLAG_MIRROR|PRIM_SCULPT_TYPE_CYLINDER|PRIM_SCULPT_TYPE_MASK|PRIM_SCULPT_TYPE_PLANE|PRIM_SCULPT_TYPE_SPHERE|PRIM_SCULPT_TYPE_TORUS|PRIM_SHINY_HIGH|PRIM_SHINY_LOW|PRIM_SHINY_MEDIUM|PRIM_SHINY_NONE|PRIM_SIZE|PRIM_SLICE|PRIM_SPECULAR|PRIM_TEMP_ON_REZ|PRIM_TEXGEN|PRIM_TEXGEN_DEFAULT|PRIM_TEXGEN_PLANAR|PRIM_TEXT|PRIM_TEXTURE|PRIM_TYPE|PRIM_TYPE_BOX|PRIM_TYPE_CYLINDER|PRIM_TYPE_PRISM|PRIM_TYPE_RING|PRIM_TYPE_SCULPT|PRIM_TYPE_SPHERE|PRIM_TYPE_TORUS|PRIM_TYPE_TUBE|PROFILE_NONE|PROFILE_SCRIPT_MEMORY|PSYS_PART_BF_DEST_COLOR|PSYS_PART_BF_ONE|PSYS_PART_BF_ONE_MINUS_DEST_COLOR|PSYS_PART_BF_ONE_MINUS_SOURCE_ALPHA|PSYS_PART_BF_ONE_MINUS_SOURCE_COLOR|PSYS_PART_BF_SOURCE_ALPHA|PSYS_PART_BF_SOURCE_COLOR|PSYS_PART_BF_ZERO|PSYS_PART_BLEND_FUNC_DEST|PSYS_PART_BLEND_FUNC_SOURCE|PSYS_PART_BOUNCE_MASK|PSYS_PART_EMISSIVE_MASK|PSYS_PART_END_ALPHA|PSYS_PART_END_COLOR|PSYS_PART_END_GLOW|PSYS_PART_END_SCALE|PSYS_PART_FLAGS|PSYS_PART_FOLLOW_SRC_MASK|PSYS_PART_FOLLOW_VELOCITY_MASK|PSYS_PART_INTERP_COLOR_MASK|PSYS_PART_INTERP_SCALE_MASK|PSYS_PART_MAX_AGE|PSYS_PART_RIBBON_MASK|PSYS_PART_START_ALPHA|PSYS_PART_START_COLOR|PSYS_PART_START_GLOW|PSYS_PART_START_SCALE|PSYS_PART_TARGET_LINEAR_MASK|PSYS_PART_TARGET_POS_MASK|PSYS_PART_WIND_MASK|PSYS_SRC_ACCEL|PSYS_SRC_ANGLE_BEGIN|PSYS_SRC_ANGLE_END|PSYS_SRC_BURST_PART_COUNT|PSYS_SRC_BURST_RADIUS|PSYS_SRC_BURST_RATE|PSYS_SRC_BURST_SPEED_MAX|PSYS_SRC_BURST_SPEED_MIN|PSYS_SRC_MAX_AGE|PSYS_SRC_OMEGA|PSYS_SRC_PATTERN|PSYS_SRC_PATTERN_ANGLE|PSYS_SRC_PATTERN_ANGLE_CONE|PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY|PSYS_SRC_PATTERN_DROP|PSYS_SRC_PATTERN_EXPLODE|PSYS_SRC_TARGET_KEY|PSYS_SRC_TEXTURE|PUBLIC_CHANNEL|PURSUIT_FUZZ_FACTOR|PURSUIT_GOAL_TOLERANCE|PURSUIT_INTERCEPT|PURSUIT_OFFSET|PU_EVADE_HIDDEN|PU_EVADE_SPOTTED|PU_FAILURE_DYNAMIC_PATHFINDING_DISABLED|PU_FAILURE_INVALID_GOAL|PU_FAILURE_INVALID_START|PU_FAILURE_NO_NAVMESH|PU_FAILURE_NO_VALID_DESTINATION|PU_FAILURE_OTHER|PU_FAILURE_PARCEL_UNREACHABLE|PU_FAILURE_TARGET_GONE|PU_FAILURE_UNREACHABLE|PU_GOAL_REACHED|PU_SLOWDOWN_DISTANCE_REACHED|RCERR_CAST_TIME_EXCEEDED|RCERR_SIM_PERF_LOW|RCERR_UNKNOWN|RC_DATA_FLAGS|RC_DETECT_PHANTOM|RC_GET_LINK_NUM|RC_GET_NORMAL|RC_GET_ROOT_KEY|RC_MAX_HITS|RC_REJECT_AGENTS|RC_REJECT_LAND|RC_REJECT_NONPHYSICAL|RC_REJECT_PHYSICAL|RC_REJECT_TYPES|REGION_FLAG_ALLOW_DAMAGE|REGION_FLAG_ALLOW_DIRECT_TELEPORT|REGION_FLAG_BLOCK_FLY|REGION_FLAG_BLOCK_TERRAFORM|REGION_FLAG_DISABLE_COLLISIONS|REGION_FLAG_DISABLE_PHYSICS|REGION_FLAG_FIXED_SUN|REGION_FLAG_RESTRICT_PUSHOBJECT|REGION_FLAG_SANDBOX|REMOTE_DATA_CHANNEL|REMOTE_DATA_REPLY|REMOTE_DATA_REQUEST|REQUIRE_LINE_OF_SIGHT|RESTITUTION|REVERSE|ROTATE|SCALE|SCRIPTED|SIM_STAT_PCT_CHARS_STEPPED|SMOOTH|STATUS_BLOCK_GRAB|STATUS_BLOCK_GRAB_OBJECT|STATUS_BOUNDS_ERROR|STATUS_CAST_SHADOWS|STATUS_DIE_AT_EDGE|STATUS_INTERNAL_ERROR|STATUS_MALFORMED_PARAMS|STATUS_NOT_FOUND|STATUS_NOT_SUPPORTED|STATUS_OK|STATUS_PHANTOM|STATUS_PHYSICS|STATUS_RETURN_AT_EDGE|STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z|STATUS_SANDBOX|STATUS_TYPE_MISMATCH|STATUS_WHITELIST_FAILED|STRING_TRIM|STRING_TRIM_HEAD|STRING_TRIM_TAIL|TOUCH_INVALID_FACE|TRAVERSAL_TYPE|TRAVERSAL_TYPE_FAST|TRAVERSAL_TYPE_NONE|TRAVERSAL_TYPE_SLOW|TRUE|TYPE_FLOAT|TYPE_INTEGER|TYPE_INVALID|TYPE_KEY|TYPE_ROTATION|TYPE_STRING|TYPE_VECTOR|VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY|VEHICLE_ANGULAR_DEFLECTION_TIMESCALE|VEHICLE_ANGULAR_FRICTION_TIMESCALE|VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE|VEHICLE_ANGULAR_MOTOR_DIRECTION|VEHICLE_ANGULAR_MOTOR_TIMESCALE|VEHICLE_BANKING_EFFICIENCY|VEHICLE_BANKING_MIX|VEHICLE_BANKING_TIMESCALE|VEHICLE_BUOYANCY|VEHICLE_FLAG_CAMERA_DECOUPLED|VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT|VEHICLE_FLAG_HOVER_TERRAIN_ONLY|VEHICLE_FLAG_HOVER_UP_ONLY|VEHICLE_FLAG_HOVER_WATER_ONLY|VEHICLE_FLAG_LIMIT_MOTOR_UP|VEHICLE_FLAG_LIMIT_ROLL_ONLY|VEHICLE_FLAG_MOUSELOOK_BANK|VEHICLE_FLAG_MOUSELOOK_STEER|VEHICLE_FLAG_NO_DEFLECTION_UP|VEHICLE_HOVER_EFFICIENCY|VEHICLE_HOVER_HEIGHT|VEHICLE_HOVER_TIMESCALE|VEHICLE_LINEAR_DEFLECTION_EFFICIENCY|VEHICLE_LINEAR_DEFLECTION_TIMESCALE|VEHICLE_LINEAR_FRICTION_TIMESCALE|VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE|VEHICLE_LINEAR_MOTOR_DIRECTION|VEHICLE_LINEAR_MOTOR_OFFSET|VEHICLE_LINEAR_MOTOR_TIMESCALE|VEHICLE_REFERENCE_FRAME|VEHICLE_TYPE_AIRPLANE|VEHICLE_TYPE_BALLOON|VEHICLE_TYPE_BOAT|VEHICLE_TYPE_CAR|VEHICLE_TYPE_NONE|VEHICLE_TYPE_SLED|VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY|VEHICLE_VERTICAL_ATTRACTION_TIMESCALE|VERTICAL|WANDER_PAUSE_AT_WAYPOINTS|XP_ERROR_EXPERIENCES_DISABLED|XP_ERROR_EXPERIENCE_DISABLED|XP_ERROR_EXPERIENCE_SUSPENDED|XP_ERROR_INVALID_EXPERIENCE|XP_ERROR_INVALID_PARAMETERS|XP_ERROR_KEY_NOT_FOUND|XP_ERROR_MATURITY_EXCEEDED|XP_ERROR_NONE|XP_ERROR_NOT_FOUND|XP_ERROR_NOT_PERMITTED|XP_ERROR_NO_EXPERIENCE|XP_ERROR_QUOTA_EXCEEDED|XP_ERROR_RETRY_UPDATE|XP_ERROR_STORAGE_EXCEPTION|XP_ERROR_STORE_DISABLED|XP_ERROR_THROTTLED|XP_ERROR_UNKNOWN_ERROR", - "constant.language.integer.boolean.lsl" : "FALSE|TRUE", - "constant.language.quaternion.lsl" : "ZERO_ROTATION", - "constant.language.string.lsl" : "EOF|JSON_ARRAY|JSON_DELETE|JSON_FALSE|JSON_INVALID|JSON_NULL|JSON_NUMBER|JSON_OBJECT|JSON_STRING|JSON_TRUE|NULL_KEY|TEXTURE_BLANK|TEXTURE_DEFAULT|TEXTURE_MEDIA|TEXTURE_PLYWOOD|TEXTURE_TRANSPARENT|URL_REQUEST_DENIED|URL_REQUEST_GRANTED", - "constant.language.vector.lsl" : "TOUCH_INVALID_TEXCOORD|TOUCH_INVALID_VECTOR|ZERO_VECTOR", - "invalid.broken.lsl": "LAND_LARGE_BRUSH|LAND_MEDIUM_BRUSH|LAND_SMALL_BRUSH", - "invalid.deprecated.lsl" : "ATTACH_LPEC|ATTACH_RPEC|DATA_RATING|OBJECT_ATTACHMENT_GEOMETRY_BYTES|OBJECT_ATTACHMENT_SURFACE_AREA|PRIM_CAST_SHADOWS|PRIM_MATERIAL_LIGHT|PRIM_TYPE_LEGACY|PSYS_SRC_INNERANGLE|PSYS_SRC_OUTERANGLE|VEHICLE_FLAG_NO_FLY_UP|llClearExperiencePermissions|llCloud|llGetExperienceList|llMakeExplosion|llMakeFire|llMakeFountain|llMakeSmoke|llRemoteDataSetRegion|llSound|llSoundPreload|llXorBase64Strings|llXorBase64StringsCorrect", - "invalid.illegal.lsl": "event", - "invalid.unimplemented.lsl": "CHARACTER_MAX_ANGULAR_ACCEL|CHARACTER_MAX_ANGULAR_SPEED|CHARACTER_TURN_SPEED_MULTIPLIER|PERMISSION_CHANGE_JOINTS|PERMISSION_CHANGE_PERMISSIONS|PERMISSION_RELEASE_OWNERSHIP|PERMISSION_REMAP_CONTROLS|PRIM_PHYSICS_MATERIAL|PSYS_SRC_OBJ_REL_MASK|llCollisionSprite|llPointAt|llRefreshPrimURL|llReleaseCamera|llRemoteLoadScript|llSetPrimURL|llStopPointAt|llTakeCamera", - "reserved.godmode.lsl": "llGodLikeRezObject|llSetInventoryPermMask|llSetObjectPermMask", - "reserved.log.lsl" : "print", - "keyword.control.lsl" : "do|else|for|if|jump|return|while", - "storage.type.lsl" : "float|integer|key|list|quaternion|rotation|string|vector", - "support.function.lsl": "llAbs|llAcos|llAddToLandBanList|llAddToLandPassList|llAdjustSoundVolume|llAgentInExperience|llAllowInventoryDrop|llAngleBetween|llApplyImpulse|llApplyRotationalImpulse|llAsin|llAtan2|llAttachToAvatar|llAttachToAvatarTemp|llAvatarOnLinkSitTarget|llAvatarOnSitTarget|llAxes2Rot|llAxisAngle2Rot|llBase64ToInteger|llBase64ToString|llBreakAllLinks|llBreakLink|llCSV2List|llCastRay|llCeil|llClearCameraParams|llClearLinkMedia|llClearPrimMedia|llCloseRemoteDataChannel|llCollisionFilter|llCollisionSound|llCos|llCreateCharacter|llCreateKeyValue|llCreateLink|llDataSizeKeyValue|llDeleteCharacter|llDeleteKeyValue|llDeleteSubList|llDeleteSubString|llDetachFromAvatar|llDetectedGrab|llDetectedGroup|llDetectedKey|llDetectedLinkNumber|llDetectedName|llDetectedOwner|llDetectedPos|llDetectedRot|llDetectedTouchBinormal|llDetectedTouchFace|llDetectedTouchNormal|llDetectedTouchPos|llDetectedTouchST|llDetectedTouchUV|llDetectedType|llDetectedVel|llDialog|llDie|llDumpList2String|llEdgeOfWorld|llEjectFromLand|llEmail|llEscapeURL|llEuler2Rot|llEvade|llExecCharacterCmd|llFabs|llFleeFrom|llFloor|llForceMouselook|llFrand|llGenerateKey|llGetAccel|llGetAgentInfo|llGetAgentLanguage|llGetAgentList|llGetAgentSize|llGetAlpha|llGetAndResetTime|llGetAnimation|llGetAnimationList|llGetAnimationOverride|llGetAttached|llGetBoundingBox|llGetCameraPos|llGetCameraRot|llGetCenterOfMass|llGetClosestNavPoint|llGetColor|llGetCreator|llGetDate|llGetDisplayName|llGetEnergy|llGetEnv|llGetExperienceDetails|llGetExperienceErrorMessage|llGetForce|llGetFreeMemory|llGetFreeURLs|llGetGMTclock|llGetGeometricCenter|llGetHTTPHeader|llGetInventoryCreator|llGetInventoryKey|llGetInventoryName|llGetInventoryNumber|llGetInventoryPermMask|llGetInventoryType|llGetKey|llGetLandOwnerAt|llGetLinkKey|llGetLinkMedia|llGetLinkName|llGetLinkNumber|llGetLinkNumberOfSides|llGetLinkPrimitiveParams|llGetListEntryType|llGetListLength|llGetLocalPos|llGetLocalRot|llGetMass|llGetMassMKS|llGetMaxScaleFactor|llGetMemoryLimit|llGetMinScaleFactor|llGetNextEmail|llGetNotecardLine|llGetNumberOfNotecardLines|llGetNumberOfPrims|llGetNumberOfSides|llGetObjectDesc|llGetObjectDetails|llGetObjectMass|llGetObjectName|llGetObjectPermMask|llGetObjectPrimCount|llGetOmega|llGetOwner|llGetOwnerKey|llGetParcelDetails|llGetParcelFlags|llGetParcelMaxPrims|llGetParcelMusicURL|llGetParcelPrimCount|llGetParcelPrimOwners|llGetPermissions|llGetPermissionsKey|llGetPhysicsMaterial|llGetPos|llGetPrimMediaParams|llGetPrimitiveParams|llGetRegionAgentCount|llGetRegionCorner|llGetRegionFPS|llGetRegionFlags|llGetRegionName|llGetRegionTimeDilation|llGetRootPosition|llGetRootRotation|llGetRot|llGetSPMaxMemory|llGetScale|llGetScriptName|llGetScriptState|llGetSimStats|llGetSimulatorHostname|llGetStartParameter|llGetStaticPath|llGetStatus|llGetSubString|llGetSunDirection|llGetTexture|llGetTextureOffset|llGetTextureRot|llGetTextureScale|llGetTime|llGetTimeOfDay|llGetTimestamp|llGetTorque|llGetUnixTime|llGetUsedMemory|llGetUsername|llGetVel|llGetWallclock|llGiveInventory|llGiveInventoryList|llGiveMoney|llGround|llGroundContour|llGroundNormal|llGroundRepel|llGroundSlope|llHTTPRequest|llHTTPResponse|llInsertString|llInstantMessage|llIntegerToBase64|llJson2List|llJsonGetValue|llJsonSetValue|llJsonValueType|llKey2Name|llKeyCountKeyValue|llKeysKeyValue|llLinkParticleSystem|llLinkSitTarget|llList2CSV|llList2Float|llList2Integer|llList2Json|llList2Key|llList2List|llList2ListStrided|llList2Rot|llList2String|llList2Vector|llListFindList|llListInsertList|llListRandomize|llListReplaceList|llListSort|llListStatistics|llListen|llListenControl|llListenRemove|llLoadURL|llLog|llLog10|llLookAt|llLoopSound|llLoopSoundMaster|llLoopSoundSlave|llMD5String|llManageEstateAccess|llMapDestination|llMessageLinked|llMinEventDelay|llModPow|llModifyLand|llMoveToTarget|llNavigateTo|llOffsetTexture|llOpenRemoteDataChannel|llOverMyLand|llOwnerSay|llParcelMediaCommandList|llParcelMediaQuery|llParseString2List|llParseStringKeepNulls|llParticleSystem|llPassCollisions|llPassTouches|llPatrolPoints|llPlaySound|llPlaySoundSlave|llPow|llPreloadSound|llPursue|llPushObject|llReadKeyValue|llRegionSay|llRegionSayTo|llReleaseControls|llReleaseURL|llRemoteDataReply|llRemoteLoadScriptPin|llRemoveFromLandBanList|llRemoveFromLandPassList|llRemoveInventory|llRemoveVehicleFlags|llRequestAgentData|llRequestDisplayName|llRequestExperiencePermissions|llRequestInventoryData|llRequestPermissions|llRequestSecureURL|llRequestSimulatorData|llRequestURL|llRequestUsername|llResetAnimationOverride|llResetLandBanList|llResetLandPassList|llResetOtherScript|llResetScript|llResetTime|llReturnObjectsByID|llReturnObjectsByOwner|llRezAtRoot|llRezObject|llRot2Angle|llRot2Axis|llRot2Euler|llRot2Fwd|llRot2Left|llRot2Up|llRotBetween|llRotLookAt|llRotTarget|llRotTargetRemove|llRotateTexture|llRound|llSHA1String|llSameGroup|llSay|llScaleByFactor|llScaleTexture|llScriptDanger|llScriptProfiler|llSendRemoteData|llSensor|llSensorRemove|llSensorRepeat|llSetAlpha|llSetAngularVelocity|llSetAnimationOverride|llSetBuoyancy|llSetCameraAtOffset|llSetCameraEyeOffset|llSetCameraParams|llSetClickAction|llSetColor|llSetContentType|llSetDamage|llSetForce|llSetForceAndTorque|llSetHoverHeight|llSetKeyframedMotion|llSetLinkAlpha|llSetLinkCamera|llSetLinkColor|llSetLinkMedia|llSetLinkPrimitiveParams|llSetLinkPrimitiveParamsFast|llSetLinkTexture|llSetLinkTextureAnim|llSetLocalRot|llSetMemoryLimit|llSetObjectDesc|llSetObjectName|llSetParcelMusicURL|llSetPayPrice|llSetPhysicsMaterial|llSetPos|llSetPrimMediaParams|llSetPrimitiveParams|llSetRegionPos|llSetRemoteScriptAccessPin|llSetRot|llSetScale|llSetScriptState|llSetSitText|llSetSoundQueueing|llSetSoundRadius|llSetStatus|llSetText|llSetTexture|llSetTextureAnim|llSetTimerEvent|llSetTorque|llSetTouchText|llSetVehicleFlags|llSetVehicleFloatParam|llSetVehicleRotationParam|llSetVehicleType|llSetVehicleVectorParam|llSetVelocity|llShout|llSin|llSitTarget|llSleep|llSqrt|llStartAnimation|llStopAnimation|llStopHover|llStopLookAt|llStopMoveToTarget|llStopSound|llStringLength|llStringToBase64|llStringTrim|llSubStringIndex|llTakeControls|llTan|llTarget|llTargetOmega|llTargetRemove|llTeleportAgent|llTeleportAgentGlobalCoords|llTeleportAgentHome|llTextBox|llToLower|llToUpper|llTransferLindenDollars|llTriggerSound|llTriggerSoundLimited|llUnSit|llUnescapeURL|llUpdateCharacter|llUpdateKeyValue|llVecDist|llVecMag|llVecNorm|llVolumeDetect|llWanderWithin|llWater|llWhisper|llWind|llXorBase64", - "support.function.event.lsl" : "at_rot_target|at_target|attach|changed|collision|collision_end|collision_start|control|dataserver|email|experience_permissions|experience_permissions_denied|http_request|http_response|land_collision|land_collision_end|land_collision_start|link_message|listen|money|moving_end|moving_start|no_sensor|not_at_rot_target|not_at_target|object_rez|on_rez|path_update|remote_data|run_time_permissions|sensor|state_entry|state_exit|timer|touch|touch_end|touch_start|transaction_result" - }, "identifier"); - - this.$rules = { - "start" : [ - { - token : "comment.line.double-slash.lsl", - regex : "\\/\\/.*$" - }, { - token : "comment.block.begin.lsl", - regex : "\\/\\*", - next : "comment" - }, { - token : "string.quoted.double.lsl", - start : '"', - end : '"', - next : [{ - token : "constant.character.escape.lsl", - regex : /\\[tn"\\]/ - }] - }, { - token : "constant.numeric.lsl", - regex : "(0[xX][0-9a-fA-F]+|[+-]?[0-9]+(?:(?:\\.[0-9]*)?(?:[eE][+-]?[0-9]+)?)?)\\b" - }, { - token : "entity.name.state.lsl", - regex : "\\b((state)\\s+[A-Za-z_]\\w*|default)\\b" - }, { - token : keywordMapper, - regex : "\\b[a-zA-Z_][a-zA-Z0-9_]*\\b" - }, { - token : "support.function.user-defined.lsl", - regex : /\b([a-zA-Z_]\w*)(?=\(.*?\))/ - }, { - token : "keyword.operator.lsl", - regex : "\\+\\+|\\-\\-|<<|>>|&&?|\\|\\|?|\\^|~|[!%<>=*+\\-\\/]=?" - }, { - token : "invalid.illegal.keyword.operator.lsl", - regex : ":=?" - }, { - token : "punctuation.operator.lsl", - regex : "\\,|\\;" - }, { - token : "paren.lparen.lsl", - regex : "[\\[\\(\\{]" - }, { - token : "paren.rparen.lsl", - regex : "[\\]\\)\\}]" - }, { - token : "text.lsl", - regex : "\\s+" - } - ], - "comment" : [ - { - token : "comment.block.end.lsl", - regex : "\\*\\/", - next : "start" - }, { - token : "comment.block.lsl", - regex : ".+" - } - ] - }; - this.normalizeRules(); -} - -exports.LSLHighlightRules = LSLHighlightRules; -}); diff --git a/lib/ace/mode/lua.js b/lib/ace/mode/lua.js index 75e91982..8280f6c2 100644 --- a/lib/ace/mode/lua.js +++ b/lib/ace/mode/lua.js @@ -1,55 +1,58 @@ /* ***** 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 ***** */ +* Version: MPL 1.1/GPL 2.0/LGPL 2.1 +* +* The contents of this file are subject to the Mozilla Public License Version +* 1.1 (the "License"); you may not use this file except in compliance with +* the License. You may obtain a copy of the License at +* http://www.mozilla.org/MPL/ +* +* Software distributed under the License is distributed on an "AS IS" basis, +* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +* for the specific language governing rights and limitations under the +* License. +* +* The Original Code is Ajax.org Code Editor (ACE). +* +* The Initial Developer of the Original Code is +* Ajax.org B.V. +* Portions created by the Initial Developer are Copyright (C) 2010 +* the Initial Developer. All Rights Reserved. +* +* Contributor(s): +* Fabian Jakobs +* Colin Gourlay +* Lee Gao +* Tim Starling +* +* Alternatively, the contents of this file may be used under the terms of +* either the GNU General Public License Version 2 or later (the "GPL"), or +* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +* in which case the provisions of the GPL or the LGPL are applicable instead +* of those above. If you wish to allow use of your version of this file only +* under the terms of either the GPL or the LGPL, and not to allow others to +* use your version of this file under the terms of the MPL, indicate your +* decision by deleting the provisions above and replace them with the notice +* and other provisions required by the GPL or the LGPL. If you do not delete +* the provisions above, a recipient may use your version of this file under +* the terms of any one of the MPL, the GPL or the LGPL. +* +* ***** END LICENSE BLOCK ***** */ define(function(require, exports, module) { "use strict"; var oop = require("../lib/oop"); var TextMode = require("./text").Mode; +var Tokenizer = require("../tokenizer").Tokenizer; var LuaHighlightRules = require("./lua_highlight_rules").LuaHighlightRules; -var LuaFoldMode = require("./folding/lua").FoldMode; var Range = require("../range").Range; -var WorkerClient = require("../worker/worker_client").WorkerClient; var Mode = function() { - this.HighlightRules = LuaHighlightRules; - - this.foldingRules = new LuaFoldMode(); + this.$tokenizer = new Tokenizer(new LuaHighlightRules().getRules()); }; oop.inherits(Mode, TextMode); (function() { - - this.lineCommentStart = "--"; - this.blockComment = {start: "--[", end: "]--"}; - var indentKeywords = { "function": 1, "then": 1, @@ -58,7 +61,7 @@ oop.inherits(Mode, TextMode); "elseif": 1, "repeat": 1, "end": -1, - "until": -1 + "until": -1, }; var outdentKeywords = [ "else", @@ -71,7 +74,7 @@ oop.inherits(Mode, TextMode); var level = 0; // Support single-line blocks by decrementing the indent level if // an ending token is found - for (var i = 0; i < tokens.length; i++) { + for (var i in tokens){ var token = tokens[i]; if (token.type == "keyword") { if (token.value in indentKeywords) { @@ -98,7 +101,7 @@ oop.inherits(Mode, TextMode); var indent = this.$getIndent(line); var level = 0; - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); + var tokenizedLine = this.$tokenizer.getLineTokens(line, state); var tokens = tokenizedLine.tokens; if (state == "start") { @@ -122,7 +125,7 @@ oop.inherits(Mode, TextMode); if (line.match(/^\s*[\)\}\]]$/)) return true; - var tokens = this.getTokenizer().getLineTokens(line.trim(), state).tokens; + var tokens = this.$tokenizer.getLineTokens(line.trim(), state).tokens; if (!tokens || !tokens.length) return false; @@ -133,7 +136,7 @@ oop.inherits(Mode, TextMode); this.autoOutdent = function(state, session, row) { var prevLine = session.getLine(row - 1); var prevIndent = this.$getIndent(prevLine).length; - var prevTokens = this.getTokenizer().getLineTokens(prevLine, "start").tokens; + 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; @@ -144,22 +147,6 @@ oop.inherits(Mode, TextMode); session.outdentRows(new Range(row, 0, row + 2, 0)); }; - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/lua_worker", "Worker"); - worker.attachToDocument(session.getDocument()); - - worker.on("annotate", function(e) { - session.setAnnotations(e.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/lua"; }).call(Mode.prototype); exports.Mode = Mode; diff --git a/lib/ace/mode/lua/luaparse.js b/lib/ace/mode/lua/luaparse.js deleted file mode 100644 index 75efb153..00000000 --- a/lib/ace/mode/lua/luaparse.js +++ /dev/null @@ -1,1989 +0,0 @@ -define(function(require, exports, module) { -/*global exports:true module:true require:true define:true global:true */ - -(function (root, name, factory) { - factory(exports) -}(this, 'luaparse', function (exports) { - 'use strict'; - - exports.version = '0.1.4'; - - var input, options, length; - - // Options can be set either globally on the parser object through - // defaultOptions, or during the parse call. - var defaultOptions = exports.defaultOptions = { - // Explicitly tell the parser when the input ends. - wait: false - // Store comments as an array in the chunk object. - , comments: true - // Track identifier scopes by adding an isLocal attribute to each - // identifier-node. - , scope: false - // Store location information on each syntax node as - // `loc: { start: { line, column }, end: { line, column } }`. - , locations: false - // Store the start and end character locations on each syntax node as - // `range: [start, end]`. - , ranges: false - }; - - // The available tokens expressed as enum flags so they can be checked with - // bitwise operations. - - var EOF = 1, StringLiteral = 2, Keyword = 4, Identifier = 8 - , NumericLiteral = 16, Punctuator = 32, BooleanLiteral = 64 - , NilLiteral = 128, VarargLiteral = 256; - - exports.tokenTypes = { EOF: EOF, StringLiteral: StringLiteral - , Keyword: Keyword, Identifier: Identifier, NumericLiteral: NumericLiteral - , Punctuator: Punctuator, BooleanLiteral: BooleanLiteral - , NilLiteral: NilLiteral, VarargLiteral: VarargLiteral - }; - - // As this parser is a bit different from luas own, the error messages - // will be different in some situations. - - var errors = exports.errors = { - unexpected: 'Unexpected %1 \'%2\' near \'%3\'' - , expected: '\'%1\' expected near \'%2\'' - , expectedToken: '%1 expected near \'%2\'' - , unfinishedString: 'unfinished string near \'%1\'' - , malformedNumber: 'malformed number near \'%1\'' - }; - - // ### Abstract Syntax Tree - // - // The default AST structure is inspired by the Mozilla Parser API but can - // easily be customized by overriding these functions. - - var ast = exports.ast = { - labelStatement: function(label) { - return { - type: 'LabelStatement' - , label: label - }; - } - - , breakStatement: function() { - return { - type: 'BreakStatement' - }; - } - - , gotoStatement: function(label) { - return { - type: 'GotoStatement' - , label: label - }; - } - - , returnStatement: function(args) { - return { - type: 'ReturnStatement' - , 'arguments': args - }; - } - - , ifStatement: function(clauses) { - return { - type: 'IfStatement' - , clauses: clauses - }; - } - , ifClause: function(condition, body) { - return { - type: 'IfClause' - , condition: condition - , body: body - }; - } - , elseifClause: function(condition, body) { - return { - type: 'ElseifClause' - , condition: condition - , body: body - }; - } - , elseClause: function(body) { - return { - type: 'ElseClause' - , body: body - }; - } - - , whileStatement: function(condition, body) { - return { - type: 'WhileStatement' - , condition: condition - , body: body - }; - } - - , doStatement: function(body) { - return { - type: 'DoStatement' - , body: body - }; - } - - , repeatStatement: function(condition, body) { - return { - type: 'RepeatStatement' - , condition: condition - , body: body - }; - } - - , localStatement: function(variables, init) { - return { - type: 'LocalStatement' - , variables: variables - , init: init - }; - } - - , assignmentStatement: function(variables, init) { - return { - type: 'AssignmentStatement' - , variables: variables - , init: init - }; - } - - , callStatement: function(expression) { - return { - type: 'CallStatement' - , expression: expression - }; - } - - , functionStatement: function(identifier, parameters, isLocal, body) { - return { - type: 'FunctionDeclaration' - , identifier: identifier - , isLocal: isLocal - , parameters: parameters - , body: body - }; - } - - , forNumericStatement: function(variable, start, end, step, body) { - return { - type: 'ForNumericStatement' - , variable: variable - , start: start - , end: end - , step: step - , body: body - }; - } - - , forGenericStatement: function(variables, iterators, body) { - return { - type: 'ForGenericStatement' - , variables: variables - , iterators: iterators - , body: body - }; - } - - , chunk: function(body) { - return { - type: 'Chunk' - , body: body - }; - } - - , identifier: function(name) { - return { - type: 'Identifier' - , name: name - }; - } - - , literal: function(type, value, raw) { - type = (type === StringLiteral) ? 'StringLiteral' - : (type === NumericLiteral) ? 'NumericLiteral' - : (type === BooleanLiteral) ? 'BooleanLiteral' - : (type === NilLiteral) ? 'NilLiteral' - : 'VarargLiteral'; - - return { - type: type - , value: value - , raw: raw - }; - } - - , tableKey: function(key, value) { - return { - type: 'TableKey' - , key: key - , value: value - }; - } - , tableKeyString: function(key, value) { - return { - type: 'TableKeyString' - , key: key - , value: value - }; - } - , tableValue: function(value) { - return { - type: 'TableValue' - , value: value - }; - } - - - , tableConstructorExpression: function(fields) { - return { - type: 'TableConstructorExpression' - , fields: fields - }; - } - , binaryExpression: function(operator, left, right) { - var type = ('and' === operator || 'or' === operator) ? - 'LogicalExpression' : - 'BinaryExpression'; - - return { - type: type - , operator: operator - , left: left - , right: right - }; - } - , unaryExpression: function(operator, argument) { - return { - type: 'UnaryExpression' - , operator: operator - , argument: argument - }; - } - , memberExpression: function(base, indexer, identifier) { - return { - type: 'MemberExpression' - , indexer: indexer - , identifier: identifier - , base: base - }; - } - - , indexExpression: function(base, index) { - return { - type: 'IndexExpression' - , base: base - , index: index - }; - } - - , callExpression: function(base, args) { - return { - type: 'CallExpression' - , base: base - , 'arguments': args - }; - } - - , tableCallExpression: function(base, args) { - return { - type: 'TableCallExpression' - , base: base - , 'arguments': args - }; - } - - , stringCallExpression: function(base, argument) { - return { - type: 'StringCallExpression' - , base: base - , argument: argument - }; - } - - , comment: function(value, raw) { - return { - type: 'Comment' - , value: value - , raw: raw - }; - } - }; - - // Wrap up the node object. - - function finishNode(node) { - // Pop a `Marker` off the location-array and attach its location data. - if (trackLocations) { - var location = locations.pop(); - location.complete(); - if (options.locations) node.loc = location.loc; - if (options.ranges) node.range = location.range; - } - return node; - } - - - - // Helpers - // ------- - - var slice = Array.prototype.slice - , toString = Object.prototype.toString - , indexOf = function indexOf(array, element) { - for (var i = 0, length = array.length; i < length; i++) { - if (array[i] === element) return i; - } - return -1; - }; - - // Iterate through an array of objects and return the index of an object - // with a matching property. - - function indexOfObject(array, property, element) { - for (var i = 0, length = array.length; i < length; i++) { - if (array[i][property] === element) return i; - } - return -1; - } - - // A sprintf implementation using %index (beginning at 1) to input - // arguments in the format string. - // - // Example: - // - // // Unexpected function in token - // sprintf('Unexpected %2 in %1.', 'token', 'function'); - - function sprintf(format) { - var args = slice.call(arguments, 1); - format = format.replace(/%(\d)/g, function (match, index) { - return '' + args[index - 1] || ''; - }); - return format; - } - - // Returns a new object with the properties from all objectes passed as - // arguments. Last argument takes precedence. - // - // Example: - // - // this.options = extend(options, { output: false }); - - function extend() { - var args = slice.call(arguments) - , dest = {} - , src, prop; - - for (var i = 0, length = args.length; i < length; i++) { - src = args[i]; - for (prop in src) if (src.hasOwnProperty(prop)) { - dest[prop] = src[prop]; - } - } - return dest; - } - - // ### Error functions - - // #### Raise an exception. - // - // Raise an exception by passing a token, a string format and its paramters. - // - // The passed tokens location will automatically be added to the error - // message if it exists, if not it will default to the lexers current - // position. - // - // Example: - // - // // [1:0] expected [ near ( - // raise(token, "expected %1 near %2", '[', token.value); - - function raise(token) { - var message = sprintf.apply(null, slice.call(arguments, 1)) - , error, col; - - if ('undefined' !== typeof token.line) { - col = token.range[0] - token.lineStart; - error = new SyntaxError(sprintf('[%1:%2] %3', token.line, col, message)); - error.line = token.line; - error.index = token.range[0]; - error.column = col; - } else { - col = index - lineStart + 1; - error = new SyntaxError(sprintf('[%1:%2] %3', line, col, message)); - error.index = index; - error.line = line; - error.column = col; - } - throw error; - } - - // #### Raise an unexpected token error. - // - // Example: - // - // // expected near '0' - // raiseUnexpectedToken('', token); - - function raiseUnexpectedToken(type, token) { - raise(token, errors.expectedToken, type, token.value); - } - - // #### Raise a general unexpected error - // - // Usage should pass either a token object or a symbol string which was - // expected. We can also specify a nearby token such as , this will - // default to the currently active token. - // - // Example: - // - // // Unexpected symbol 'end' near '' - // unexpected(token); - // - // If there's no token in the buffer it means we have reached . - - function unexpected(found, near) { - if ('undefined' === typeof near) near = lookahead.value; - if ('undefined' !== typeof found.type) { - var type; - switch (found.type) { - case StringLiteral: type = 'string'; break; - case Keyword: type = 'keyword'; break; - case Identifier: type = 'identifier'; break; - case NumericLiteral: type = 'number'; break; - case Punctuator: type = 'symbol'; break; - case BooleanLiteral: type = 'boolean'; break; - case NilLiteral: - return raise(found, errors.unexpected, 'symbol', 'nil', near); - } - return raise(found, errors.unexpected, type, found.value, near); - } - return raise(found, errors.unexpected, 'symbol', found, near); - } - - // Lexer - // ----- - // - // The lexer, or the tokenizer reads the input string character by character - // and derives a token left-right. To be as efficient as possible the lexer - // prioritizes the common cases such as identifiers. It also works with - // character codes instead of characters as string comparisons was the - // biggest bottleneck of the parser. - // - // If `options.comments` is enabled, all comments encountered will be stored - // in an array which later will be appended to the chunk object. If disabled, - // they will simply be disregarded. - // - // When the lexer has derived a valid token, it will be returned as an object - // containing its value and as well as its position in the input string (this - // is always enabled to provide proper debug messages). - // - // `lex()` starts lexing and returns the following token in the stream. - - var index - , token - , previousToken - , lookahead - , comments - , tokenStart - , line - , lineStart; - - exports.lex = lex; - - function lex() { - skipWhiteSpace(); - - // Skip comments beginning with -- - while (45 === input.charCodeAt(index) && - 45 === input.charCodeAt(index + 1)) { - scanComment(); - skipWhiteSpace(); - } - if (index >= length) return { - type : EOF - , value: '' - , line: line - , lineStart: lineStart - , range: [index, index] - }; - - var charCode = input.charCodeAt(index) - , next = input.charCodeAt(index + 1); - - // Memorize the range index where the token begins. - tokenStart = index; - if (isIdentifierStart(charCode)) return scanIdentifierOrKeyword(); - - switch (charCode) { - case 39: case 34: // '" - return scanStringLiteral(); - - // 0-9 - case 48: case 49: case 50: case 51: case 52: case 53: - case 54: case 55: case 56: case 57: - return scanNumericLiteral(); - - case 46: // . - // If the dot is followed by a digit it's a float. - if (isDecDigit(next)) return scanNumericLiteral(); - if (46 === next) { - if (46 === input.charCodeAt(index + 2)) return scanVarargLiteral(); - return scanPunctuator('..'); - } - return scanPunctuator('.'); - - case 61: // = - if (61 === next) return scanPunctuator('=='); - return scanPunctuator('='); - - case 62: // > - if (61 === next) return scanPunctuator('>='); - return scanPunctuator('>'); - - case 60: // < - if (61 === next) return scanPunctuator('<='); - return scanPunctuator('<'); - - case 126: // ~ - if (61 === next) return scanPunctuator('~='); - return raise({}, errors.expected, '=', '~'); - - case 58: // : - if (58 === next) return scanPunctuator('::'); - return scanPunctuator(':'); - - case 91: // [ - // Check for a multiline string, they begin with [= or [[ - if (91 === next || 61 === next) return scanLongStringLiteral(); - return scanPunctuator('['); - - // \* / ^ % , { } ] ( ) ; # - + - case 42: case 47: case 94: case 37: case 44: case 123: case 125: - case 93: case 40: case 41: case 59: case 35: case 45: case 43: - return scanPunctuator(input.charAt(index)); - } - - return unexpected(input.charAt(index)); - } - - // Whitespace has no semantic meaning in lua so simply skip ahead while - // tracking the encounted newlines. Newlines are also tracked in all - // token functions where multiline values are allowed. - - function skipWhiteSpace() { - while (index < length) { - var charCode = input.charCodeAt(index); - if (isWhiteSpace(charCode)) { - index++; - } else if (isLineTerminator(charCode)) { - line++; - lineStart = ++index; - } else { - break; - } - } - } - - // Identifiers, keywords, booleans and nil all look the same syntax wise. We - // simply go through them one by one and defaulting to an identifier if no - // previous case matched. - - function scanIdentifierOrKeyword() { - var value, type; - - // Slicing the input string is prefered before string concatenation in a - // loop for performance reasons. - while (isIdentifierPart(input.charCodeAt(++index))); - value = input.slice(tokenStart, index); - - // Decide on the token type and possibly cast the value. - if (isKeyword(value)) { - type = Keyword; - } else if ('true' === value || 'false' === value) { - type = BooleanLiteral; - value = ('true' === value); - } else if ('nil' === value) { - type = NilLiteral; - value = null; - } else { - type = Identifier; - } - - return { - type: type - , value: value - , line: line - , lineStart: lineStart - , range: [tokenStart, index] - }; - } - - // Once a punctuator reaches this function it should already have been - // validated so we simply return it as a token. - - function scanPunctuator(value) { - index += value.length; - return { - type: Punctuator - , value: value - , line: line - , lineStart: lineStart - , range: [tokenStart, index] - }; - } - - // A vararg literal consists of three dots. - - function scanVarargLiteral() { - index += 3; - return { - type: VarargLiteral - , value: '...' - , line: line - , lineStart: lineStart - , range: [tokenStart, index] - }; - } - - // Find the string literal by matching the delimiter marks used. - - function scanStringLiteral() { - var delimiter = input.charCodeAt(index++) - , stringStart = index - , string = '' - , charCode; - - while (index < length) { - charCode = input.charCodeAt(index++); - if (delimiter === charCode) break; - if (92 === charCode) { // \ - string += input.slice(stringStart, index - 1) + readEscapeSequence(); - stringStart = index; - } - // EOF or `\n` terminates a string literal. If we haven't found the - // ending delimiter by now, raise an exception. - else if (index >= length || isLineTerminator(charCode)) { - string += input.slice(stringStart, index - 1); - raise({}, errors.unfinishedString, string + String.fromCharCode(charCode)); - } - } - string += input.slice(stringStart, index - 1); - - return { - type: StringLiteral - , value: string - , line: line - , lineStart: lineStart - , range: [tokenStart, index] - }; - } - - // Expect a multiline string literal and return it as a regular string - // literal, if it doesn't validate into a valid multiline string, throw an - // exception. - - function scanLongStringLiteral() { - var string = readLongString(); - // Fail if it's not a multiline literal. - if (false === string) raise(token, errors.expected, '[', token.value); - - return { - type: StringLiteral - , value: string - , line: line - , lineStart: lineStart - , range: [tokenStart, index] - }; - } - - // Numeric literals will be returned as floating-point numbers instead of - // strings. The raw value should be retrieved from slicing the input string - // later on in the process. - // - // If a hexadecimal number is encountered, it will be converted. - - function scanNumericLiteral() { - var character = input.charAt(index) - , next = input.charAt(index + 1); - - var value = ('0' === character && 'xX'.indexOf(next || null) >= 0) ? - readHexLiteral() : readDecLiteral(); - - return { - type: NumericLiteral - , value: value - , line: line - , lineStart: lineStart - , range: [tokenStart, index] - }; - } - - // Lua hexadecimals have an optional fraction part and an optional binary - // exoponent part. These are not included in JavaScript so we will compute - // all three parts separately and then sum them up at the end of the function - // with the following algorithm. - // - // Digit := toDec(digit) - // Fraction := toDec(fraction) / 16 ^ fractionCount - // BinaryExp := 2 ^ binaryExp - // Number := ( Digit + Fraction ) * BinaryExp - - function readHexLiteral() { - var fraction = 0 // defaults to 0 as it gets summed - , binaryExponent = 1 // defaults to 1 as it gets multiplied - , binarySign = 1 // positive - , digit, fractionStart, exponentStart, digitStart; - - digitStart = index += 2; // Skip 0x part - - // A minimum of one hex digit is required. - if (!isHexDigit(input.charCodeAt(index))) - raise({}, errors.malformedNumber, input.slice(tokenStart, index)); - - while (isHexDigit(input.charCodeAt(index))) index++; - // Convert the hexadecimal digit to base 10. - digit = parseInt(input.slice(digitStart, index), 16); - - // Fraction part i optional. - if ('.' === input.charAt(index)) { - fractionStart = ++index; - - while (isHexDigit(input.charCodeAt(index))) index++; - fraction = input.slice(fractionStart, index); - - // Empty fraction parts should default to 0, others should be converted - // 0.x form so we can use summation at the end. - fraction = (fractionStart === index) ? 0 - : parseInt(fraction, 16) / Math.pow(16, index - fractionStart); - } - - // Binary exponents are optional - if ('pP'.indexOf(input.charAt(index) || null) >= 0) { - index++; - - // Sign part is optional and defaults to 1 (positive). - if ('+-'.indexOf(input.charAt(index) || null) >= 0) - binarySign = ('+' === input.charAt(index++)) ? 1 : -1; - - exponentStart = index; - - // The binary exponent sign requires a decimal digit. - if (!isDecDigit(input.charCodeAt(index))) - raise({}, errors.malformedNumber, input.slice(tokenStart, index)); - - while (isDecDigit(input.charCodeAt(index))) index++; - binaryExponent = input.slice(exponentStart, index); - - // Calculate the binary exponent of the number. - binaryExponent = Math.pow(2, binaryExponent * binarySign); - } - - return (digit + fraction) * binaryExponent; - } - - // Decimal numbers are exactly the same in Lua and in JavaScript, because of - // this we check where the token ends and then parse it with native - // functions. - - function readDecLiteral() { - while (isDecDigit(input.charCodeAt(index))) index++; - // Fraction part is optional - if ('.' === input.charAt(index)) { - index++; - // Fraction part defaults to 0 - while (isDecDigit(input.charCodeAt(index))) index++; - } - // Exponent part is optional. - if ('eE'.indexOf(input.charAt(index) || null) >= 0) { - index++; - // Sign part is optional. - if ('+-'.indexOf(input.charAt(index) || null) >= 0) index++; - // An exponent is required to contain at least one decimal digit. - if (!isDecDigit(input.charCodeAt(index))) - raise({}, errors.malformedNumber, input.slice(tokenStart, index)); - - while (isDecDigit(input.charCodeAt(index))) index++; - } - - return parseFloat(input.slice(tokenStart, index)); - } - - - // Translate escape sequences to the actual characters. - - function readEscapeSequence() { - var sequenceStart = index; - switch (input.charAt(index)) { - // Lua allow the following escape sequences. - // We don't escape the bell sequence. - case 'n': index++; return '\n'; - case 'r': index++; return '\r'; - case 't': index++; return '\t'; - case 'v': index++; return '\x0B'; - case 'b': index++; return '\b'; - case 'f': index++; return '\f'; - // Skips the following span of white-space. - case 'z': index++; skipWhiteSpace(); return ''; - // Byte representation should for now be returned as is. - case 'x': - // \xXX, where XX is a sequence of exactly two hexadecimal digits - if (isHexDigit(input.charCodeAt(index + 1)) && - isHexDigit(input.charCodeAt(index + 2))) { - index += 3; - // Return it as is, without translating the byte. - return '\\' + input.slice(sequenceStart, index); - } - return '\\' + input.charAt(index++); - default: - // \ddd, where ddd is a sequence of up to three decimal digits. - if (isDecDigit(input.charCodeAt(index))) { - while (isDecDigit(input.charCodeAt(++index))); - return '\\' + input.slice(sequenceStart, index); - } - // Simply return the \ as is, it's not escaping any sequence. - return input.charAt(index++); - } - } - - // Comments begin with -- after which it will be decided if they are - // multiline comments or not. - // - // The multiline functionality works the exact same way as with string - // literals so we reuse the functionality. - - function scanComment() { - tokenStart = index; - index += 2; // -- - - var character = input.charAt(index) - , content = '' - , isLong = false - , commentStart = index - , lineStartComment = lineStart - , lineComment = line; - - if ('[' === character) { - content = readLongString(); - // This wasn't a multiline comment after all. - if (false === content) content = character; - else isLong = true; - } - // Scan until next line as long as it's not a multiline comment. - if (!isLong) { - while (index < length) { - if (isLineTerminator(input.charCodeAt(index))) break; - index++; - } - if (options.comments) content = input.slice(commentStart, index); - } - - if (options.comments) { - var node = ast.comment(content, input.slice(tokenStart, index)); - - // `Marker`s depend on tokens available in the parser and as comments are - // intercepted in the lexer all location data is set manually. - if (options.locations) { - node.loc = { - start: { line: lineComment, column: tokenStart - lineStartComment } - , end: { line: line, column: index - lineStart } - }; - } - if (options.ranges) { - node.range = [tokenStart, index]; - } - comments.push(node); - } - } - - // Read a multiline string by calculating the depth of `=` characters and - // then appending until an equal depth is found. - - function readLongString() { - var level = 0 - , content = '' - , terminator = false - , character, stringStart; - - index++; // [ - - // Calculate the depth of the comment. - while ('=' === input.charAt(index + level)) level++; - // Exit, this is not a long string afterall. - if ('[' !== input.charAt(index + level)) return false; - - index += level + 1; - - // If the first character is a newline, ignore it and begin on next line. - if (isLineTerminator(input.charCodeAt(index))) { - line++; - lineStart = index++; - } - - stringStart = index; - while (index < length) { - character = input.charAt(index++); - - // We have to keep track of newlines as `skipWhiteSpace()` does not get - // to scan this part. - if (isLineTerminator(character.charCodeAt(0))) { - line++; - lineStart = index; - } - - // Once the delimiter is found, iterate through the depth count and see - // if it matches. - if (']' === character) { - terminator = true; - for (var i = 0; i < level; i++) { - if ('=' !== input.charAt(index + i)) terminator = false; - } - if (']' !== input.charAt(index + level)) terminator = false; - } - - // We reached the end of the multiline string. Get out now. - if (terminator) break; - } - content += input.slice(stringStart, index - 1); - index += level + 1; - - return content; - } - - // ## Lex functions and helpers. - - // Read the next token. - // - // This is actually done by setting the current token to the lookahead and - // reading in the new lookahead token. - - function next() { - previousToken = token; - token = lookahead; - lookahead = lex(); - } - - // Consume a token if its value matches. Once consumed or not, return the - // success of the operation. - - function consume(value) { - if (value === token.value) { - next(); - return true; - } - return false; - } - - // Expect the next token value to match. If not, throw an exception. - - function expect(value) { - if (value === token.value) next(); - else raise(token, errors.expected, value, token.value); - } - - // ### Validation functions - - function isWhiteSpace(charCode) { - return 9 === charCode || 32 === charCode || 0xB === charCode || 0xC === charCode; - } - - function isLineTerminator(charCode) { - return 10 === charCode || 13 === charCode; - } - - function isDecDigit(charCode) { - return charCode >= 48 && charCode <= 57; - } - - function isHexDigit(charCode) { - return (charCode >= 48 && charCode <= 57) || (charCode >= 97 && charCode <= 102) || (charCode >= 65 && charCode <= 70); - } - - // From [Lua 5.2](http://www.lua.org/manual/5.2/manual.html#8.1) onwards - // identifiers cannot use locale-dependet letters. - - function isIdentifierStart(charCode) { - return (charCode >= 65 && charCode <= 90) || (charCode >= 97 && charCode <= 122) || 95 === charCode; - } - - function isIdentifierPart(charCode) { - return (charCode >= 65 && charCode <= 90) || (charCode >= 97 && charCode <= 122) || 95 === charCode || (charCode >= 48 && charCode <= 57); - } - - // [3.1 Lexical Conventions](http://www.lua.org/manual/5.2/manual.html#3.1) - // - // `true`, `false` and `nil` will not be considered keywords, but literals. - - function isKeyword(id) { - switch (id.length) { - case 2: - return 'do' === id || 'if' === id || 'in' === id || 'or' === id; - case 3: - return 'and' === id || 'end' === id || 'for' === id || 'not' === id; - case 4: - return 'else' === id || 'goto' === id || 'then' === id; - case 5: - return 'break' === id || 'local' === id || 'until' === id || 'while' === id; - case 6: - return 'elseif' === id || 'repeat' === id || 'return' === id; - case 8: - return 'function' === id; - } - return false; - } - - function isUnary(token) { - if (Punctuator === token.type) return '#-'.indexOf(token.value) >= 0; - if (Keyword === token.type) return 'not' === token.value; - return false; - } - - // @TODO this needs to be rethought. - function isCallExpression(expression) { - switch (expression.type) { - case 'CallExpression': - case 'TableCallExpression': - case 'StringCallExpression': - return true; - } - return false; - } - - // Check if the token syntactically closes a block. - - function isBlockFollow(token) { - if (EOF === token.type) return true; - if (Keyword !== token.type) return false; - switch (token.value) { - case 'else': case 'elseif': - case 'end': case 'until': - return true; - default: - return false; - } - } - - // Scope - // ----- - - // Store each block scope as a an array of identifier names. Each scope is - // stored in an FILO-array. - var scopes - // The current scope index - , scopeDepth - // A list of all global identifier nodes. - , globals; - - // Create a new scope inheriting all declarations from the previous scope. - function createScope() { - scopes.push(Array.apply(null, scopes[scopeDepth++])); - } - - // Exit and remove the current scope. - function exitScope() { - scopes.pop(); - scopeDepth--; - } - - // Add identifier name to the current scope if it doesnt already exist. - function scopeIdentifierName(name) { - if (-1 !== indexOf(scopes[scopeDepth], name)) return; - scopes[scopeDepth].push(name); - } - - // Add identifier to the current scope - function scopeIdentifier(node) { - scopeIdentifierName(node.name); - attachScope(node, true); - } - - // Attach scope information to node. If the node is global, store it in the - // globals array so we can return the information to the user. - function attachScope(node, isLocal) { - if (!isLocal && -1 === indexOfObject(globals, 'name', node.name)) - globals.push(node); - - node.isLocal = isLocal; - } - - // Is the identifier name available in this scope. - function scopeHasName(name) { - return (-1 !== indexOf(scopes[scopeDepth], name)); - } - - // Location tracking - // ----------------- - // - // Locations are stored in FILO-array as a `Marker` object consisting of both - // `loc` and `range` data. Once a `Marker` is popped off the list an end - // location is added and the data is attached to a syntax node. - - var locations = [] - , trackLocations; - - function createLocationMarker() { - return new Marker(token); - } - - function Marker(token) { - if (options.locations) { - this.loc = { - start: { - line: token.line - , column: token.range[0] - token.lineStart - } - , end: { - line: 0 - , column: 0 - } - }; - } - if (options.ranges) this.range = [token.range[0], 0]; - } - - // Complete the location data stored in the `Marker` by adding the location - // of the *previous token* as an end location. - Marker.prototype.complete = function() { - if (options.locations) { - this.loc.end.line = previousToken.line; - this.loc.end.column = previousToken.range[1] - previousToken.lineStart; - } - if (options.ranges) { - this.range[1] = previousToken.range[1]; - } - }; - - // Create a new `Marker` and add it to the FILO-array. - function markLocation() { - if (trackLocations) locations.push(createLocationMarker()); - } - - // Push an arbitrary `Marker` object onto the FILO-array. - function pushLocation(marker) { - if (trackLocations) locations.push(marker); - } - - // Parse functions - // --------------- - - // Chunk is the main program object. Syntactically it's the same as a block. - // - // chunk ::= block - - function parseChunk() { - next(); - markLocation(); - var body = parseBlock(); - if (EOF !== token.type) unexpected(token); - // If the body is empty no previousToken exists when finishNode runs. - if (trackLocations && !body.length) previousToken = token; - return finishNode(ast.chunk(body)); - } - - // A block contains a list of statements with an optional return statement - // as its last statement. - // - // block ::= {stat} [retstat] - - function parseBlock(terminator) { - var block = [] - , statement; - - // Each block creates a new scope. - if (options.scope) createScope(); - - while (!isBlockFollow(token)) { - // Return has to be the last statement in a block. - if ('return' === token.value) { - block.push(parseStatement()); - break; - } - statement = parseStatement(); - // Statements are only added if they are returned, this allows us to - // ignore some statements, such as EmptyStatement. - if (statement) block.push(statement); - } - - if (options.scope) exitScope(); - // Doesn't really need an ast node - return block; - } - - // There are two types of statements, simple and compound. - // - // statement ::= break | goto | do | while | repeat | return - // | if | for | function | local | label | assignment - // | functioncall | ';' - - function parseStatement() { - markLocation(); - if (Keyword === token.type) { - switch (token.value) { - case 'local': next(); return parseLocalStatement(); - case 'if': next(); return parseIfStatement(); - case 'return': next(); return parseReturnStatement(); - case 'function': next(); - var name = parseFunctionName(); - return parseFunctionDeclaration(name); - case 'while': next(); return parseWhileStatement(); - case 'for': next(); return parseForStatement(); - case 'repeat': next(); return parseRepeatStatement(); - case 'break': next(); return parseBreakStatement(); - case 'do': next(); return parseDoStatement(); - case 'goto': next(); return parseGotoStatement(); - } - } - - if (Punctuator === token.type) { - if (consume('::')) return parseLabelStatement(); - } - // Assignments memorizes the location and pushes it manually for wrapper - // nodes. Additionally empty `;` statements should not mark a location. - if (trackLocations) locations.pop(); - - // When a `;` is encounted, simply eat it without storing it. - if (consume(';')) return; - - return parseAssignmentOrCallStatement(); - } - - // ## Statements - - // label ::= '::' Name '::' - - function parseLabelStatement() { - var name = token.value - , label = parseIdentifier(); - - if (options.scope) { - scopeIdentifierName('::' + name + '::'); - attachScope(label, true); - } - - expect('::'); - return finishNode(ast.labelStatement(label)); - } - - // break ::= 'break' - - function parseBreakStatement() { - return finishNode(ast.breakStatement()); - } - - // goto ::= 'goto' Name - - function parseGotoStatement() { - var name = token.value - , label = parseIdentifier(); - - if (options.scope) label.isLabel = scopeHasName('::' + name + '::'); - return finishNode(ast.gotoStatement(label)); - } - - // do ::= 'do' block 'end' - - function parseDoStatement() { - var body = parseBlock(); - expect('end'); - return finishNode(ast.doStatement(body)); - } - - // while ::= 'while' exp 'do' block 'end' - - function parseWhileStatement() { - var condition = parseExpectedExpression(); - expect('do'); - var body = parseBlock(); - expect('end'); - return finishNode(ast.whileStatement(condition, body)); - } - - // repeat ::= 'repeat' block 'until' exp - - function parseRepeatStatement() { - var body = parseBlock(); - expect('until'); - var condition = parseExpectedExpression(); - return finishNode(ast.repeatStatement(condition, body)); - } - - // retstat ::= 'return' [exp {',' exp}] [';'] - - function parseReturnStatement() { - var expressions = []; - - if ('end' !== token.value) { - var expression = parseExpression(); - if (null != expression) expressions.push(expression); - while (consume(',')) { - expression = parseExpectedExpression(); - expressions.push(expression); - } - consume(';'); // grammar tells us ; is optional here. - } - return finishNode(ast.returnStatement(expressions)); - } - - // if ::= 'if' exp 'then' block {elif} ['else' block] 'end' - // elif ::= 'elseif' exp 'then' block - - function parseIfStatement() { - var clauses = [] - , condition - , body - , marker; - - // IfClauses begin at the same location as the parent IfStatement. - // It ends at the start of `end`, `else`, or `elseif`. - if (trackLocations) { - marker = locations[locations.length - 1]; - locations.push(marker); - } - condition = parseExpectedExpression(); - expect('then'); - body = parseBlock(); - clauses.push(finishNode(ast.ifClause(condition, body))); - - if (trackLocations) marker = createLocationMarker(); - while (consume('elseif')) { - pushLocation(marker); - condition = parseExpectedExpression(); - expect('then'); - body = parseBlock(); - clauses.push(finishNode(ast.elseifClause(condition, body))); - if (trackLocations) marker = createLocationMarker(); - } - - if (consume('else')) { - // Include the `else` in the location of ElseClause. - if (trackLocations) { - marker = new Marker(previousToken); - locations.push(marker); - } - body = parseBlock(); - clauses.push(finishNode(ast.elseClause(body))); - } - - expect('end'); - return finishNode(ast.ifStatement(clauses)); - } - - // There are two types of for statements, generic and numeric. - // - // for ::= Name '=' exp ',' exp [',' exp] 'do' block 'end' - // for ::= namelist 'in' explist 'do' block 'end' - // namelist ::= Name {',' Name} - // explist ::= exp {',' exp} - - function parseForStatement() { - var variable = parseIdentifier() - , body; - - // The start-identifier is local. - if (options.scope) scopeIdentifier(variable); - - // If the first expression is followed by a `=` punctuator, this is a - // Numeric For Statement. - if (consume('=')) { - // Start expression - var start = parseExpectedExpression(); - expect(','); - // End expression - var end = parseExpectedExpression(); - // Optional step expression - var step = consume(',') ? parseExpectedExpression() : null; - - expect('do'); - body = parseBlock(); - expect('end'); - - return finishNode(ast.forNumericStatement(variable, start, end, step, body)); - } - // If not, it's a Generic For Statement - else { - // The namelist can contain one or more identifiers. - var variables = [variable]; - while (consume(',')) { - variable = parseIdentifier(); - // Each variable in the namelist is locally scoped. - if (options.scope) scopeIdentifier(variable); - variables.push(variable); - } - expect('in'); - var iterators = []; - - // One or more expressions in the explist. - do { - var expression = parseExpectedExpression(); - iterators.push(expression); - } while (consume(',')); - - expect('do'); - body = parseBlock(); - expect('end'); - - return finishNode(ast.forGenericStatement(variables, iterators, body)); - } - } - - // Local statements can either be variable assignments or function - // definitions. If a function definition is found, it will be delegated to - // `parseFunctionDeclaration()` with the isLocal flag. - // - // This AST structure might change into a local assignment with a function - // child. - // - // local ::= 'local' 'function' Name funcdecl - // | 'local' Name {',' Name} ['=' exp {',' exp} - - function parseLocalStatement() { - var name; - - if (Identifier === token.type) { - var variables = [] - , init = []; - - do { - name = parseIdentifier(); - - variables.push(name); - } while (consume(',')); - - if (consume('=')) { - do { - var expression = parseExpectedExpression(); - init.push(expression); - } while (consume(',')); - } - - // Declarations doesn't exist before the statement has been evaluated. - // Therefore assignments can't use their declarator. And the identifiers - // shouldn't be added to the scope until the statement is complete. - if (options.scope) { - for (var i = 0, l = variables.length; i < l; i++) { - scopeIdentifier(variables[i]); - } - } - - return finishNode(ast.localStatement(variables, init)); - } - if (consume('function')) { - name = parseIdentifier(); - if (options.scope) scopeIdentifier(name); - - // MemberExpressions are not allowed in local function statements. - return parseFunctionDeclaration(name, true); - } else { - raiseUnexpectedToken('', token); - } - } - - // assignment ::= varlist '=' explist - // varlist ::= prefixexp {',' prefixexp} - // explist ::= exp {',' exp} - // - // call ::= callexp - // callexp ::= prefixexp args | prefixexp ':' Name args - - function parseAssignmentOrCallStatement() { - // Keep a reference to the previous token for better error messages in case - // of invalid statement - var previous = token - , expression, marker; - - if (trackLocations) marker = createLocationMarker(); - expression = parsePrefixExpression(); - - if (null == expression) return unexpected(token); - if (',='.indexOf(token.value) >= 0) { - var variables = [expression] - , init = [] - , exp; - - while (consume(',')) { - exp = parsePrefixExpression(); - if (null == exp) raiseUnexpectedToken('', token); - variables.push(exp); - } - expect('='); - do { - exp = parseExpectedExpression(); - init.push(exp); - } while (consume(',')); - - pushLocation(marker); - return finishNode(ast.assignmentStatement(variables, init)); - } - if (isCallExpression(expression)) { - pushLocation(marker); - return finishNode(ast.callStatement(expression)); - } - // The prefix expression was neither part of an assignment or a - // callstatement, however as it was valid it's been consumed, so raise - // the exception on the previous token to provide a helpful message. - return unexpected(previous); - } - - - - // ### Non-statements - - // Identifier ::= Name - - function parseIdentifier() { - markLocation(); - var identifier = token.value; - if (Identifier !== token.type) raiseUnexpectedToken('', token); - next(); - return finishNode(ast.identifier(identifier)); - } - - // Parse the functions parameters and body block. The name should already - // have been parsed and passed to this declaration function. By separating - // this we allow for anonymous functions in expressions. - // - // For local functions there's a boolean parameter which needs to be set - // when parsing the declaration. - // - // funcdecl ::= '(' [parlist] ')' block 'end' - // parlist ::= Name {',' Name} | [',' '...'] | '...' - - function parseFunctionDeclaration(name, isLocal) { - var parameters = []; - expect('('); - - // The declaration has arguments - if (!consume(')')) { - // Arguments are a comma separated list of identifiers, optionally ending - // with a vararg. - while (true) { - if (Identifier === token.type) { - var parameter = parseIdentifier(); - // Function parameters are local. - if (options.scope) scopeIdentifier(parameter); - - parameters.push(parameter); - - if (consume(',')) continue; - else if (consume(')')) break; - } - // No arguments are allowed after a vararg. - else if (VarargLiteral === token.type) { - parameters.push(parsePrimaryExpression()); - expect(')'); - break; - } else { - raiseUnexpectedToken(' or \'...\'', token); - } - } - } - - var body = parseBlock(); - expect('end'); - - isLocal = isLocal || false; - return finishNode(ast.functionStatement(name, parameters, isLocal, body)); - } - - // Parse the function name as identifiers and member expressions. - // - // Name {'.' Name} [':' Name] - - function parseFunctionName() { - var base, name, marker; - - if (trackLocations) marker = createLocationMarker(); - base = parseIdentifier(); - - if (options.scope) attachScope(base, false); - - while (consume('.')) { - pushLocation(marker); - name = parseIdentifier(); - if (options.scope) attachScope(name, false); - base = finishNode(ast.memberExpression(base, '.', name)); - } - - if (consume(':')) { - pushLocation(marker); - name = parseIdentifier(); - if (options.scope) attachScope(name, false); - base = finishNode(ast.memberExpression(base, ':', name)); - } - - return base; - } - - // tableconstructor ::= '{' [fieldlist] '}' - // fieldlist ::= field {fieldsep field} fieldsep - // field ::= '[' exp ']' '=' exp | Name = 'exp' | exp - // - // fieldsep ::= ',' | ';' - - function parseTableConstructor() { - var fields = [] - , key, value; - - while (true) { - markLocation(); - if (Punctuator === token.type && consume('[')) { - key = parseExpectedExpression(); - expect(']'); - expect('='); - value = parseExpectedExpression(); - fields.push(finishNode(ast.tableKey(key, value))); - } else if (Identifier === token.type) { - key = parseExpectedExpression(); - if (consume('=')) { - value = parseExpectedExpression(); - fields.push(finishNode(ast.tableKeyString(key, value))); - } else { - fields.push(finishNode(ast.tableValue(key))); - } - } else { - if (null == (value = parseExpression())) { - locations.pop(); - break; - } - fields.push(finishNode(ast.tableValue(value))); - } - if (',;'.indexOf(token.value) >= 0) { - next(); - continue; - } - if ('}' === token.value) break; - } - expect('}'); - return finishNode(ast.tableConstructorExpression(fields)); - } - - // Expression parser - // ----------------- - // - // Expressions are evaluated and always return a value. If nothing is - // matched null will be returned. - // - // exp ::= (unop exp | primary | prefixexp ) { binop exp } - // - // primary ::= nil | false | true | Number | String | '...' - // | functiondef | tableconstructor - // - // prefixexp ::= (Name | '(' exp ')' ) { '[' exp ']' - // | '.' Name | ':' Name args | args } - // - - function parseExpression() { - var expression = parseSubExpression(0); - return expression; - } - - // Parse an expression expecting it to be valid. - - function parseExpectedExpression() { - var expression = parseExpression(); - if (null == expression) raiseUnexpectedToken('', token); - else return expression; - } - - - // Return the precedence priority of the operator. - // - // As unary `-` can't be distinguished from binary `-`, unary precedence - // isn't described in this table but in `parseSubExpression()` itself. - // - // As this function gets hit on every expression it's been optimized due to - // the expensive CompareICStub which took ~8% of the parse time. - - function binaryPrecedence(operator) { - var charCode = operator.charCodeAt(0) - , length = operator.length; - - if (1 === length) { - switch (charCode) { - case 94: return 10; // ^ - case 42: case 47: case 37: return 7; // * / % - case 43: case 45: return 6; // + - - case 60: case 62: return 3; // < > - } - } else if (2 === length) { - switch (charCode) { - case 46: return 5; // .. - case 60: case 62: case 61: case 126: return 3; // <= >= == ~= - case 111: return 1; // or - } - } else if (97 === charCode && 'and' === operator) return 2; - return 0; - } - - // Implement an operator-precedence parser to handle binary operator - // precedence. - // - // We use this algorithm because it's compact, it's fast and Lua core uses - // the same so we can be sure our expressions are parsed in the same manner - // without excessive amounts of tests. - // - // exp ::= (unop exp | primary | prefixexp ) { binop exp } - - function parseSubExpression(minPrecedence) { - var operator = token.value - // The left-hand side in binary operations. - , expression, marker; - - if (trackLocations) marker = createLocationMarker(); - - // UnaryExpression - if (isUnary(token)) { - markLocation(); - next(); - var argument = parseSubExpression(8); - if (argument == null) raiseUnexpectedToken('', token); - expression = finishNode(ast.unaryExpression(operator, argument)); - } - if (null == expression) { - // PrimaryExpression - expression = parsePrimaryExpression(); - - // PrefixExpression - if (null == expression) { - expression = parsePrefixExpression(); - } - } - // This is not a valid left hand expression. - if (null == expression) return null; - - var precedence; - while (true) { - operator = token.value; - - precedence = (Punctuator === token.type || Keyword === token.type) ? - binaryPrecedence(operator) : 0; - - if (precedence === 0 || precedence <= minPrecedence) break; - // Right-hand precedence operators - if ('^' === operator || '..' === operator) precedence--; - next(); - var right = parseSubExpression(precedence); - if (null == right) raiseUnexpectedToken('', token); - // Push in the marker created before the loop to wrap its entirety. - if (trackLocations) locations.push(marker); - expression = finishNode(ast.binaryExpression(operator, expression, right)); - - } - return expression; - } - - // prefixexp ::= prefix {suffix} - // prefix ::= Name | '(' exp ')' - // suffix ::= '[' exp ']' | '.' Name | ':' Name args | args - // - // args ::= '(' [explist] ')' | tableconstructor | String - - function parsePrefixExpression() { - var base, name, marker - // Keep track of the scope, if a parent is local so are the children. - , isLocal; - - if (trackLocations) marker = createLocationMarker(); - - // The prefix - if (Identifier === token.type) { - name = token.value; - base = parseIdentifier(); - // Set the parent scope. - if (options.scope) attachScope(base, isLocal = scopeHasName(name)); - } else if (consume('(')) { - base = parseExpectedExpression(); - expect(')'); - if (options.scope) isLocal = base.isLocal; - } else { - return null; - } - - // The suffix - var expression, identifier; - while (true) { - if (Punctuator === token.type) { - switch (token.value) { - case '[': - pushLocation(marker); - next(); - expression = parseExpectedExpression(); - base = finishNode(ast.indexExpression(base, expression)); - expect(']'); - break; - case '.': - pushLocation(marker); - next(); - identifier = parseIdentifier(); - // Inherit the scope - if (options.scope) attachScope(identifier, isLocal); - base = finishNode(ast.memberExpression(base, '.', identifier)); - break; - case ':': - pushLocation(marker); - next(); - identifier = parseIdentifier(); - if (options.scope) attachScope(identifier, isLocal); - base = finishNode(ast.memberExpression(base, ':', identifier)); - // Once a : is found, this has to be a CallExpression, otherwise - // throw an error. - pushLocation(marker); - base = parseCallExpression(base); - break; - case '(': case '{': // args - pushLocation(marker); - base = parseCallExpression(base); - break; - default: - return base; - } - } else if (StringLiteral === token.type) { - pushLocation(marker); - base = parseCallExpression(base); - } else { - break; - } - } - - return base; - } - - // args ::= '(' [explist] ')' | tableconstructor | String - - function parseCallExpression(base) { - if (Punctuator === token.type) { - switch (token.value) { - case '(': - next(); - - // List of expressions - var expressions = []; - var expression = parseExpression(); - if (null != expression) expressions.push(expression); - while (consume(',')) { - expression = parseExpectedExpression(); - expressions.push(expression); - } - - expect(')'); - return finishNode(ast.callExpression(base, expressions)); - - case '{': - markLocation(); - next(); - var table = parseTableConstructor(); - return finishNode(ast.tableCallExpression(base, table)); - } - } else if (StringLiteral === token.type) { - return finishNode(ast.stringCallExpression(base, parsePrimaryExpression())); - } - - raiseUnexpectedToken('function arguments', token); - } - - // primary ::= String | Numeric | nil | true | false - // | functiondef | tableconstructor | '...' - - function parsePrimaryExpression() { - var literals = StringLiteral | NumericLiteral | BooleanLiteral | NilLiteral | VarargLiteral - , value = token.value - , type = token.type - , marker; - - if (trackLocations) marker = createLocationMarker(); - - if (type & literals) { - pushLocation(marker); - var raw = input.slice(token.range[0], token.range[1]); - next(); - return finishNode(ast.literal(type, value, raw)); - } else if (Keyword === type && 'function' === value) { - pushLocation(marker); - next(); - return parseFunctionDeclaration(null); - } else if (consume('{')) { - pushLocation(marker); - return parseTableConstructor(); - } - } - - // Parser - // ------ - - // Export the main parser. - // - // - `wait` Hold parsing until end() is called. Defaults to false - // - `comments` Store comments. Defaults to true. - // - `scope` Track identifier scope. Defaults to false. - // - // Example: - // - // var parser = require('luaparser'); - // parser.parse('i = 0'); - - exports.parse = parse; - - function parse(_input, _options) { - if ('undefined' === typeof _options && 'object' === typeof _input) { - _options = _input; - _input = undefined; - } - if (!_options) _options = {}; - - input = _input || ''; - options = extend(defaultOptions, _options); - - // Rewind the lexer - index = 0; - line = 1; - lineStart = 0; - length = input.length; - // When tracking identifier scope, initialize with an empty scope. - scopes = [[]]; - scopeDepth = 0; - globals = []; - locations = []; - - if (options.comments) comments = []; - if (!options.wait) return end(); - return exports; - } - - // Write to the source code buffer without beginning the parse. - exports.write = write; - - function write(_input) { - input += String(_input); - length = input.length; - return exports; - } - - // Send an EOF and begin parsing. - exports.end = end; - - function end(_input) { - if ('undefined' !== typeof _input) write(_input); - - length = input.length; - trackLocations = options.locations || options.ranges; - // Initialize with a lookahead token. - lookahead = lex(); - - var chunk = parseChunk(); - if (options.comments) chunk.comments = comments; - if (options.scope) chunk.globals = globals; - - if (locations.length > 0) - throw new Error('Location tracking failed. This is most likely a bug in luaparse'); - - return chunk; - } - -})); -/* vim: set sw=2 ts=2 et tw=79 : */ - -}); \ No newline at end of file diff --git a/lib/ace/mode/lua_highlight_rules.js b/lib/ace/mode/lua_highlight_rules.js index faa37bc2..57e5fead 100644 --- a/lib/ace/mode/lua_highlight_rules.js +++ b/lib/ace/mode/lua_highlight_rules.js @@ -1,51 +1,62 @@ /* ***** 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 ***** */ +* Version: MPL 1.1/GPL 2.0/LGPL 2.1 +* +* The contents of this file are subject to the Mozilla Public License Version +* 1.1 (the "License"); you may not use this file except in compliance with +* the License. You may obtain a copy of the License at +* http://www.mozilla.org/MPL/ +* +* Software distributed under the License is distributed on an "AS IS" basis, +* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +* for the specific language governing rights and limitations under the +* License. +* +* The Original Code is Ajax.org Code Editor (ACE). +* +* The Initial Developer of the Original Code is +* Ajax.org B.V. +* Portions created by the Initial Developer are Copyright (C) 2010 +* the Initial Developer. All Rights Reserved. +* +* Contributor(s): +* Fabian Jakobs +* Colin Gourlay +* Lee Gao +* +* Alternatively, the contents of this file may be used under the terms of +* either the GNU General Public License Version 2 or later (the "GPL"), or +* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +* in which case the provisions of the GPL or the LGPL are applicable instead +* of those above. If you wish to allow use of your version of this file only +* under the terms of either the GPL or the LGPL, and not to allow others to +* use your version of this file under the terms of the MPL, indicate your +* decision by deleting the provisions above and replace them with the notice +* and other provisions required by the GPL or the LGPL. If you do not delete +* the provisions above, a recipient may use your version of this file under +* the terms of any one of the MPL, the GPL or the LGPL. +* +* ***** END LICENSE BLOCK ***** */ define(function(require, exports, module) { "use strict"; var oop = require("../lib/oop"); +var lang = require("../lib/lang"); 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 keywords = lang.arrayToMap( + ("break|do|else|elseif|end|for|function|if|in|local|repeat|"+ + "return|then|until|while|or|and|not").split("|") ); - var builtinConstants = ("true|false|nil|_G|_VERSION"); + var builtinConstants = lang.arrayToMap( + ("true|false|nil|_G|_VERSION").split("|") + ); - var functions = ( - // builtinFunctions - "string|xpcall|package|tostring|print|os|unpack|require|"+ + 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|"+ @@ -64,27 +75,27 @@ var LuaHighlightRules = function() { "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" + "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 stdLibaries = ("string|package|os|io|math|debug|table|coroutine"); + var futureReserved = lang.arrayToMap( + ("").split("|") + ); + + var deprecatedIn5152 = lang.arrayToMap( + ("setn|foreach|foreachi|gcinfo|log10|maxn").split("|") + ); - 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": "self" - }, "identifier"); + var strPre = ""; var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))"; var hexInteger = "(?:0[xX][\\dA-Fa-f]+)"; @@ -94,72 +105,151 @@ var LuaHighlightRules = function() { var intPart = "(?:\\d+)"; var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))"; var floatNumber = "(?:" + pointFloat + ")"; - + + var comment_stack = []; + this.$rules = { - "start" : [{ - stateName: "bracketedComment", - onMatch : function(value, currentState, stack){ - stack.unshift(this.next, value.length - 2, currentState); + "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 : /\-\-\[=*\[/, - next : [ - { - onMatch : function(value, currentState, stack) { - if (value.length == stack[1]) { - stack.shift(); - stack.shift(); - this.next = stack.shift(); - } else { - this.next = ""; - } - return "comment"; - }, - regex : /\]=*\]/, - next : "start" - }, { - defaultToken : "comment" - } - ] + regex : strPre + '\\-\\-\\[\\={5}\\=*\\[.*$', + merge : true, + next : "qcomment5" }, - + + // single line comments { token : "comment", regex : "\\-\\-.*$" - }, + }, + + // bracketed strings { - stateName: "bracketedString", - onMatch : function(value, currentState, stack){ - stack.unshift(this.next, value.length, currentState); - return "comment"; - }, - regex : /\[=*\[/, - next : [ - { - onMatch : function(value, currentState, stack) { - if (value.length == stack[1]) { - stack.shift(); - stack.shift(); - this.next = stack.shift(); - } else { - this.next = ""; - } - return "comment"; - }, - - regex : /\]=*\]/, - next : "start" - }, { - defaultToken : "comment" - } - ] + 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 : '"(?:[^\\\\]|\\\\.)*?"' + regex : strPre + '"(?:[^\\\\]|\\\\.)*?"' }, { token : "string", // ' string - regex : "'(?:[^\\\\]|\\\\.)*?'" + regex : strPre + "'(?:[^\\\\]|\\\\.)*?'" }, { token : "constant.numeric", // float regex : floatNumber @@ -167,7 +257,24 @@ var LuaHighlightRules = function() { token : "constant.numeric", // integer regex : integer + "\\b" }, { - token : keywordMapper, + 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", @@ -180,11 +287,147 @@ var LuaHighlightRules = function() { regex : "[\\]\\)\\}]" }, { token : "text", - regex : "\\s+|\\w+" + 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 : '.+' } ] + }; - - this.normalizeRules(); + } oop.inherits(LuaHighlightRules, TextHighlightRules); diff --git a/lib/ace/mode/lua_worker.js b/lib/ace/mode/lua_worker.js deleted file mode 100644 index dcff9514..00000000 --- a/lib/ace/mode/lua_worker.js +++ /dev/null @@ -1,70 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var Mirror = require("../worker/mirror").Mirror; -var luaparse = require("../mode/lua/luaparse"); - -var Worker = exports.Worker = function(sender) { - Mirror.call(this, sender); - this.setTimeout(500); -}; - -oop.inherits(Worker, Mirror); - -(function() { - - this.onUpdate = function() { - var value = this.doc.getValue(); - var errors = []; - - // var t=Date.now() - try { - luaparse.parse(value); - } catch(e) { - if (e instanceof SyntaxError) { - errors.push({ - row: e.line - 1, - column: e.column, - text: e.message, - type: "error" - }); - } - } - // console.log( t-Date.now()) - this.sender.emit("annotate", errors); - }; - -}).call(Worker.prototype); - -}); diff --git a/lib/ace/mode/luapage.js b/lib/ace/mode/luapage.js index 5ea79d14..4a03444c 100644 --- a/lib/ace/mode/luapage.js +++ b/lib/ace/mode/luapage.js @@ -4,21 +4,19 @@ define(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() { - HtmlMode.call(this); + var highlighter = new LuaPageHighlightRules(); - this.HighlightRules = LuaPageHighlightRules; + this.$tokenizer = new Tokenizer(new LuaPageHighlightRules().getRules()); + this.$embeds = highlighter.getEmbeds(); this.createModeDelegates({ "lua-": LuaMode }); }; oop.inherits(Mode, HtmlMode); -(function() { - this.$id = "ace/mode/luapage"; -}).call(Mode.prototype); - exports.Mode = Mode; }); \ No newline at end of file diff --git a/lib/ace/mode/luapage_highlight_rules.js b/lib/ace/mode/luapage_highlight_rules.js index 59878999..6a79102f 100644 --- a/lib/ace/mode/luapage_highlight_rules.js +++ b/lib/ace/mode/luapage_highlight_rules.js @@ -8,38 +8,31 @@ var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; var LuaHighlightRules = require("./lua_highlight_rules").LuaHighlightRules; var LuaPageHighlightRules = function() { - HtmlHighlightRules.call(this); - - var startRules = [ - { + this.$rules = new HtmlHighlightRules().getRules(); + + for (var i in this.$rules) { + this.$rules[i].unshift({ token: "keyword", regex: "<\\%\\=?", - push: "lua-start" + next: "lua-start" }, { token: "keyword", regex: "<\\?lua\\=?", - push: "lua-start" - } - ]; - - var endRules = [ + next: "lua-start" + }); + } + this.embedRules(LuaHighlightRules, "lua-", [ { token: "keyword", regex: "\\%>", - next: "pop" - }, { + next: "start" + }, + { token: "keyword", regex: "\\?>", - next: "pop" + next: "start" } - ]; - - this.embedRules(LuaHighlightRules, "lua-", endRules, ["start"]); - - for (var key in this.$rules) - this.$rules[key].unshift.apply(this.$rules[key], startRules); - - this.normalizeRules(); + ]); }; oop.inherits(LuaPageHighlightRules, HtmlHighlightRules); diff --git a/lib/ace/mode/lucene.js b/lib/ace/mode/lucene.js deleted file mode 100644 index 56743ef9..00000000 --- a/lib/ace/mode/lucene.js +++ /dev/null @@ -1,19 +0,0 @@ -define(function(require, exports, module) { -'use strict'; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var LuceneHighlightRules = require("./lucene_highlight_rules").LuceneHighlightRules; - -var Mode = function() { - this.HighlightRules = LuceneHighlightRules; -}; - -oop.inherits(Mode, TextMode); - -(function() { - this.$id = "ace/mode/lucene"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); \ No newline at end of file diff --git a/lib/ace/mode/lucene_highlight_rules.js b/lib/ace/mode/lucene_highlight_rules.js deleted file mode 100644 index 536aa1d3..00000000 --- a/lib/ace/mode/lucene_highlight_rules.js +++ /dev/null @@ -1,49 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var LuceneHighlightRules = function() { - this.$rules = { - "start" : [ - { - token : "constant.character.negation", - regex : "[\\-]" - }, { - token : "constant.character.interro", - regex : "[\\?]" - }, { - token : "constant.character.asterisk", - regex : "[\\*]" - }, { - token: 'constant.character.proximity', - regex: '~[0-9]+\\b' - }, { - token : 'keyword.operator', - regex: '(?:AND|OR|NOT)\\b' - }, { - token : "paren.lparen", - regex : "[\\(]" - }, { - token : "paren.rparen", - regex : "[\\)]" - }, { - token : "keyword", - regex : "[\\S]+:" - }, { - token : "string", // " string - regex : '".*?"' - }, { - token : "text", - regex : "\\s+" - } - ] - }; -}; - -oop.inherits(LuceneHighlightRules, TextHighlightRules); - -exports.LuceneHighlightRules = LuceneHighlightRules; -}); diff --git a/lib/ace/mode/makefile.js b/lib/ace/mode/makefile.js deleted file mode 100644 index efeca6ee..00000000 --- a/lib/ace/mode/makefile.js +++ /dev/null @@ -1,58 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -/* - THIS FILE WAS AUTOGENERATED BY mode.tmpl.js -*/ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var MakefileHighlightRules = require("./makefile_highlight_rules").MakefileHighlightRules; -var FoldMode = require("./folding/coffee").FoldMode; - -var Mode = function() { - this.HighlightRules = MakefileHighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "#"; - this.$indentWithTabs = true; - - this.$id = "ace/mode/makefile"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); \ No newline at end of file diff --git a/lib/ace/mode/makefile_highlight_rules.js b/lib/ace/mode/makefile_highlight_rules.js deleted file mode 100644 index 53ef1d05..00000000 --- a/lib/ace/mode/makefile_highlight_rules.js +++ /dev/null @@ -1,75 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var ShHighlightFile = require("./sh_highlight_rules"); - -var MakefileHighlightRules = function() { - - // regexp must not have capturing parentheses. Use (?:) instead. - // regexps are ordered -> the first match is used - - var keywordMapper = this.createKeywordMapper({ - "keyword": ShHighlightFile.reservedKeywords, - "support.function.builtin": ShHighlightFile.languageConstructs, - "invalid.deprecated": "debugger" - }, "string"); - - this.$rules = - { - "start": [ - { - token: "string.interpolated.backtick.makefile", - regex: "`", - next: "shell-start" - }, - { - token: "punctuation.definition.comment.makefile", - regex: /#(?=.)/, - next: "comment" - }, - { - token: [ "keyword.control.makefile"], - regex: "^(?:\\s*\\b)(\\-??include|ifeq|ifneq|ifdef|ifndef|else|endif|vpath|export|unexport|define|endef|override)(?:\\b)" - }, - {// ^([^\t ]+(\s[^\t ]+)*:(?!\=))\s*.* - token: ["entity.name.function.makefile", "text"], - regex: "^([^\\t ]+(?:\\s[^\\t ]+)*:)(\\s*.*)" - } - ], - "comment": [ - { - token : "punctuation.definition.comment.makefile", - regex : /.+\\/ - }, - { - token : "punctuation.definition.comment.makefile", - regex : ".+", - next : "start" - } - ], - "shell-start": [ - { - token: keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, - { - token: "string", - regex : "\\w+" - }, - { - token : "string.interpolated.backtick.makefile", - regex : "`", - next : "start" - } - ] -} - -}; - -oop.inherits(MakefileHighlightRules, TextHighlightRules); - -exports.MakefileHighlightRules = MakefileHighlightRules; -}); diff --git a/lib/ace/mode/markdown.js b/lib/ace/mode/markdown.js index efabed89..99f7bf38 100644 --- a/lib/ace/mode/markdown.js +++ b/lib/ace/mode/markdown.js @@ -1,30 +1,40 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: +/* vim:ts=4:sts=4:sw=4: + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. * - * 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. + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * Mihai Sucan + * Chris Spencer + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -36,40 +46,35 @@ var TextMode = require("./text").Mode; var JavaScriptMode = require("./javascript").Mode; var XmlMode = require("./xml").Mode; var HtmlMode = require("./html").Mode; +var Tokenizer = require("../tokenizer").Tokenizer; var MarkdownHighlightRules = require("./markdown_highlight_rules").MarkdownHighlightRules; -var MarkdownFoldMode = require("./folding/markdown").FoldMode; var Mode = function() { - this.HighlightRules = MarkdownHighlightRules; - + var highlighter = new MarkdownHighlightRules(); + + this.$tokenizer = new Tokenizer(highlighter.getRules()); + this.$embeds = highlighter.getEmbeds(); this.createModeDelegates({ - "js-": JavaScriptMode, - "xml-": XmlMode, - "html-": HtmlMode + "js-": JavaScriptMode, + "xml-": XmlMode, + "html-": HtmlMode }); - - this.foldingRules = new MarkdownFoldMode(); }; oop.inherits(Mode, TextMode); (function() { - this.type = "text"; - this.blockComment = {start: ""}; - this.getNextLineIndent = function(state, line, tab) { if (state == "listblock") { - var match = /^(\s*)(?:([-+*])|(\d+)\.)(\s+)/.exec(line); - if (!match) + var match = /^((?:.+)?)([-+*][ ]+)/.exec(line); + if (match) { + return new Array(match[1].length + 1).join(" ") + match[2]; + } else { return ""; - var marker = match[2]; - if (!marker) - marker = parseInt(match[3], 10) + 1 + "."; - return match[1] + marker + match[4]; + } } else { return this.$getIndent(line); } }; - this.$id = "ace/mode/markdown"; }).call(Mode.prototype); exports.Mode = Mode; diff --git a/lib/ace/mode/markdown_highlight_rules.js b/lib/ace/mode/markdown_highlight_rules.js index db4caec8..8961ff65 100644 --- a/lib/ace/mode/markdown_highlight_rules.js +++ b/lib/ace/mode/markdown_highlight_rules.js @@ -1,30 +1,38 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. * - * 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. + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * Chris Spencer + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,195 +40,154 @@ define(function(require, exports, module) { "use strict"; var oop = require("../lib/oop"); -var lang = require("../lib/lang"); 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; -var escaped = function(ch) { - return "(?:[^" + lang.escapeRegExp(ch) + "\\\\]|\\\\.)*"; -} - function github_embed(tag, prefix) { return { // Github style block token : "support.function", - regex : "^\\s*```" + tag + "\\s*$", - push : prefix + "start" + regex : "^```" + tag + "\\s*$", + next : prefix + "start" }; } var MarkdownHighlightRules = function() { - HtmlHighlightRules.call(this); + // regexp must not have capturing parentheses // regexps are ordered -> the first match is used - this.$rules["start"].unshift({ - token : "empty_line", - regex : '^$', - next: "allowBlock" - }, { // h1 - token: "markup.heading.1", - regex: "^=+(?=\\s*$)" - }, { // h2 - token: "markup.heading.2", - regex: "^\\-+(?=\\s*$)" - }, { - token : function(value) { - return "markup.heading." + value.length; - }, - regex : /^#{1,6}(?=\s*[^ #]|\s+#.)/, - next : "header" - }, - github_embed("(?:javascript|js)", "jscode-"), - github_embed("xml", "xmlcode-"), - github_embed("html", "htmlcode-"), - github_embed("css", "csscode-"), - { // Github style block - token : "support.function", - regex : "^\\s*```\\s*\\S*(?:{.*?\\})?\\s*$", - next : "githubblock" - }, { // block quote - token : "string.blockquote", - regex : "^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+", - next : "blockquote" - }, { // HR * - _ - token : "constant", - regex : "^ {0,2}(?:(?: ?\\* ?){3,}|(?: ?\\- ?){3,}|(?: ?\\_ ?){3,})\\s*$", - next: "allowBlock" - }, { // list - token : "markup.list", - regex : "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+", - next : "listblock-start" - }, { - include : "basic" - }); - - this.addRules({ - "basic" : [{ - token : "constant.language.escape", - regex : /\\[\\`*_{}\[\]()#+\-.!]/ + 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 : "(`+)(.*?[^`])(\\1)" + regex : "^[ ]{4}.+" + }, { // h1 + token: "markup.heading.1", + regex: "^=+(?=\\s*$)" + }, { // h2 + token: "markup.heading.1", + regex: "^\\-+(?=\\s*$)" + }, { // header + token : function(value) { + return "markup.heading." + value.length; + }, + 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 : "(\\[)(" + escaped("]") + ")(\\]\s*\\[)("+ escaped("]") + ")(\\])" + regex : "(\\[)((?:[[^\\]]*\\]|[^\\[\\]])*)(\\][ ]?(?:\\n[ ]*)?\\[)(.*?)(\\])" }, { // link by url token : ["text", "string", "text", "markup.underline", "string", "text"], - regex : "(\\[)(" + // [ - escaped("]") + // link text - ")(\\]\\()"+ // ]( - '((?:[^\\)\\s\\\\]|\\\\.|\\s(?=[^"]))*)' + // href - '(\\s*"' + escaped('"') + '"\\s*)?' + // "title" - "(\\))" // ) + regex : "(\\[)"+ + "(\\[[^\\]]*\\]|[^\\[\\]]*)"+ + "(\\]\\([ \\t]*)"+ + "(?)"+ + "((?:[ \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.strong", - regex : "([*]{2}|[_]{2}(?=\\S))(.*?\\S[*_]*)(\\1)" + token : ["string", "string", "string"], + regex : "([*]{2}|[_]{2}(?=\\S))([^\\r]*?\\S[*_]*)(\\1)" }, { // emphasis * _ - token : "string.emphasis", - regex : "([*]|[_](?=\\S))(.*?\\S[*_]*)(\\1)" - }, { // + 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]+"+ ")(>)" - }], - - // code block - "allowBlock": [ - {token : "support.function", regex : "^ {4}.+", next : "allowBlock"}, - {token : "empty", regex : "", next : "start"} - ], - - "header" : [{ - regex: "$", - next : "start" }, { - include: "basic" - }, { - defaultToken : "heading" + token : "text", + regex : "[^\\*_%$`\\[#<>]+" } ], - - "listblock-start" : [{ - token : "support.variable", - regex : /(?:\[[ x]\])?/, - next : "listblock" - }], - + "listblock" : [ { // Lists only escape on completely blank lines. token : "empty_line", regex : "^$", next : "start" - }, { // list + }, { token : "markup.list", - regex : "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+", - next : "listblock-start" - }, { - include : "basic", noEscape: true - }, { // Github style block - token : "support.function", - regex : "^\\s*```\\s*[a-zA-Z]*(?:{.*?\\})?\\s*$", - next : "githubblock" - }, { - defaultToken : "list" //do not use markup.list to allow stling leading `*` differntly + regex : ".+" } ], - - "blockquote" : [ { // Blockquotes only escape on blank lines. + + "blockquote" : [ { // BLockquotes only escape on blank lines. token : "empty_line", regex : "^\\s*$", next : "start" - }, { // block quote - token : "string.blockquote", - regex : "^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+", - next : "blockquote" }, { - include : "basic", noEscape: true - }, { - defaultToken : "string.blockquote" + token : "string", + regex : ".+" } ], - + "githubblock" : [ { token : "support.function", - regex : "^\\s*```", + regex : "^```", next : "start" }, { token : "support.function", regex : ".+" } ] - }); - - this.embedRules(JavaScriptHighlightRules, "jscode-", [{ + }; + + this.embedRules(JavaScriptHighlightRules, "js-", [{ token : "support.function", - regex : "^\\s*```", - next : "pop" + regex : "^```", + next : "start" }]); - - this.embedRules(HtmlHighlightRules, "htmlcode-", [{ + + this.embedRules(HtmlHighlightRules, "html-", [{ token : "support.function", - regex : "^\\s*```", - next : "pop" + regex : "^```", + next : "start" }]); - - this.embedRules(CssHighlightRules, "csscode-", [{ + + this.embedRules(CssHighlightRules, "css-", [{ token : "support.function", - regex : "^\\s*```", - next : "pop" + regex : "^```", + next : "start" }]); - - this.embedRules(XmlHighlightRules, "xmlcode-", [{ + + this.embedRules(XmlHighlightRules, "xml-", [{ token : "support.function", - regex : "^\\s*```", - next : "pop" + regex : "^```", + next : "start" }]); - - this.normalizeRules(); }; oop.inherits(MarkdownHighlightRules, TextHighlightRules); diff --git a/lib/ace/mode/mask.js b/lib/ace/mode/mask.js deleted file mode 100644 index ee94c82f..00000000 --- a/lib/ace/mode/mask.js +++ /dev/null @@ -1,84 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2014, 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(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var MaskHighlightRules = require("./mask_highlight_rules").MaskHighlightRules; -var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var CssBehaviour = require("./behaviour/css").CssBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = MaskHighlightRules; - this.$outdent = new MatchingBraceOutdent(); - this.$behaviour = new CssBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - // ignore braces in comments - var tokens = this.getTokenizer().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.$id = "ace/mode/mask"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); diff --git a/lib/ace/mode/mask_highlight_rules.js b/lib/ace/mode/mask_highlight_rules.js deleted file mode 100644 index 8142ebe0..00000000 --- a/lib/ace/mode/mask_highlight_rules.js +++ /dev/null @@ -1,309 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2014, 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(function(require, exports, module) { -"use strict"; - -exports.MaskHighlightRules = MaskHighlightRules; - -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); -var TextRules = require("./text_highlight_rules").TextHighlightRules; -var JSRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; -var CssRules = require("./css_highlight_rules").CssHighlightRules; -var MDRules = require("./markdown_highlight_rules").MarkdownHighlightRules; -var HTMLRules = require("./html_highlight_rules").HtmlHighlightRules; - -var token_TAG = "keyword.support.constant.language", - token_COMPO = "support.function.markup.bold", - token_KEYWORD = "keyword", - token_LANG = "constant.language", - token_UTIL = "keyword.control.markup.italic", - token_ATTR = "support.variable.class", - token_PUNKT = "keyword.operator", - token_ITALIC = "markup.italic", - token_BOLD = "markup.bold", - token_LPARE = "paren.lparen", - token_RPARE = "paren.rparen"; - -var const_FUNCTIONS, - const_KEYWORDS, - const_CONST, - const_TAGS; -(function(){ - const_FUNCTIONS = lang.arrayToMap( - ("log").split("|") - ); - const_CONST = lang.arrayToMap( - (":dualbind|:bind|:import|slot|event|style|html|markdown|md").split("|") - ); - const_KEYWORDS = lang.arrayToMap( - ("debugger|define|var|if|each|for|of|else|switch|case|with|visible|+if|+each|+for|+switch|+with|+visible|include|import").split("|") - ); - const_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("|") - ); -}()); - -function MaskHighlightRules () { - - this.$rules = { - "start" : [ - Token("comment", "\\/\\/.*$"), - Token("comment", "\\/\\*", [ - Token("comment", ".*?\\*\\/", "start"), - Token("comment", ".+") - ]), - - Blocks.string("'''"), - Blocks.string('"""'), - Blocks.string('"'), - Blocks.string("'"), - - Blocks.syntax(/(markdown|md)\b/, "md-multiline", "multiline"), - Blocks.syntax(/html\b/, "html-multiline", "multiline"), - Blocks.syntax(/(slot|event)\b/, "js-block", "block"), - Blocks.syntax(/style\b/, "css-block", "block"), - Blocks.syntax(/var\b/, "js-statement", "attr"), - - Blocks.tag(), - - Token(token_LPARE, "[[({>]"), - Token(token_RPARE, "[\\])};]", "start"), - { - caseInsensitive: true - } - ] - }; - var rules = this; - - addJavaScript("interpolation", /\]/, token_RPARE + "." + token_ITALIC); - addJavaScript("statement", /\)|}|;/); - addJavaScript("block", /\}/); - addCss(); - addMarkdown(); - addHtml(); - - function addJavaScript(name, escape, closeType) { - var prfx = "js-" + name + "-", - rootTokens = name === "block" ? ["start"] : ["start", "no_regex"]; - add( - JSRules - , prfx - , escape - , rootTokens - , closeType - ); - } - function addCss() { - add(CssRules, "css-block-", /\}/); - } - function addMarkdown() { - add(MDRules, "md-multiline-", /("""|''')/, []); - } - function addHtml() { - add(HTMLRules, "html-multiline-", /("""|''')/); - } - function add(Rules, strPrfx, rgxEnd, rootTokens, closeType) { - var next = "pop"; - var tokens = rootTokens || [ "start" ]; - if (tokens.length === 0) { - tokens = null; - } - if (/block|multiline/.test(strPrfx)) { - next = strPrfx + "end"; - rules.$rules[next] = [ - Token("empty", "", "start") - ]; - } - rules.embedRules( - Rules - , strPrfx - , [ Token(closeType || token_RPARE, rgxEnd, next) ] - , tokens - , tokens == null ? true : false - ); - } - - this.normalizeRules(); -} -oop.inherits(MaskHighlightRules, TextRules); - -var Blocks = { - string: function(str, next){ - var token = Token( - "string.start" - , str - , [ - Token(token_LPARE + "." + token_ITALIC, /~\[/, Blocks.interpolation()), - Token("string.end", str, "pop"), - { - defaultToken: "string" - } - ] - , next - ); - if (str.length === 1){ - var escaped = Token("string.escape", "\\\\" + str); - token.push.unshift(escaped); - } - return token; - }, - interpolation: function(){ - return [ - Token(token_UTIL, /\s*\w*\s*:/), - "js-interpolation-start" - ]; - }, - tagHead: function (rgx) { - return Token(token_ATTR, rgx, [ - Token(token_ATTR, /[\w\-_]+/), - Token(token_LPARE + "." + token_ITALIC, /~\[/, Blocks.interpolation()), - Blocks.goUp() - ]); - }, - tag: function () { - return { - token: 'tag', - onMatch : function(value) { - if (void 0 !== const_KEYWORDS[value]) - return token_KEYWORD; - if (void 0 !== const_CONST[value]) - return token_LANG; - if (void 0 !== const_FUNCTIONS[value]) - return "support.function"; - if (void 0 !== const_TAGS[value.toLowerCase()]) - return token_TAG; - - return token_COMPO; - }, - regex : /([@\w\-_:+]+)|((^|\s)(?=\s*(\.|#)))/, - push: [ - Blocks.tagHead(/\./) , - Blocks.tagHead(/\#/) , - Blocks.expression(), - Blocks.attribute(), - - Token(token_LPARE, /[;>{]/, "pop") - ] - }; - }, - syntax: function(rgx, next, type){ - return { - token: token_LANG, - regex : rgx, - push: ({ - "attr": [ - next + "-start", - Token(token_PUNKT, /;/, "start") - ], - "multiline": [ - Blocks.tagHead(/\./) , - Blocks.tagHead(/\#/) , - Blocks.attribute(), - Blocks.expression(), - Token(token_LPARE, /[>\{]/), - Token(token_PUNKT, /;/, "start"), - Token(token_LPARE, /'''|"""/, [ next + "-start" ]) - ], - "block": [ - Blocks.tagHead(/\./) , - Blocks.tagHead(/\#/) , - Blocks.attribute(), - Blocks.expression(), - Token(token_LPARE, /\{/, [ next + "-start" ]) - ] - })[type] - }; - }, - attribute: function(){ - return Token(function(value){ - return /^x\-/.test(value) - ? token_ATTR + "." + token_BOLD - : token_ATTR; - }, /[\w_-]+/, [ - Token(token_PUNKT, /\s*=\s*/, [ - Blocks.string('"'), - Blocks.string("'"), - Blocks.word(), - Blocks.goUp() - ]), - Blocks.goUp() - ]); - }, - expression: function(){ - return Token(token_LPARE, /\(/, [ "js-statement-start" ]); - }, - word: function(){ - return Token("string", /[\w-_]+/); - }, - goUp: function(){ - return Token("text", "", "pop"); - }, - goStart: function(){ - return Token("text", "", "start"); - } -}; - - -function Token(token, rgx, mix) { - var push, next, onMatch; - if (arguments.length === 4) { - push = mix; - next = arguments[3]; - } - else if (typeof mix === "string") { - next = mix; - } - else { - push = mix; - } - if (typeof token === "function") { - onMatch = token; - token = "empty"; - } - return { - token: token, - regex: rgx, - push: push, - next: next, - onMatch: onMatch - }; -} - -}); diff --git a/lib/ace/mode/matching_brace_outdent.js b/lib/ace/mode/matching_brace_outdent.js index 07f4829e..ed15131e 100644 --- a/lib/ace/mode/matching_brace_outdent.js +++ b/lib/ace/mode/matching_brace_outdent.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -60,7 +67,12 @@ var MatchingBraceOutdent = function() {}; }; this.$getIndent = function(line) { - return line.match(/^\s*/)[0]; + var match = line.match(/^(\s+)/); + if (match) { + return match[1]; + } + + return ""; }; }).call(MatchingBraceOutdent.prototype); diff --git a/lib/ace/mode/matching_parens_outdent.js b/lib/ace/mode/matching_parens_outdent.js index 0aadf6e8..ad93c023 100644 --- a/lib/ace/mode/matching_parens_outdent.js +++ b/lib/ace/mode/matching_parens_outdent.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ diff --git a/lib/ace/mode/matlab.js b/lib/ace/mode/matlab.js deleted file mode 100644 index 44b20d0d..00000000 --- a/lib/ace/mode/matlab.js +++ /dev/null @@ -1,55 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var MatlabHighlightRules = require("./matlab_highlight_rules").MatlabHighlightRules; -var Range = require("../range").Range; - -var Mode = function() { - this.HighlightRules = MatlabHighlightRules; -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "%"; - this.blockComment = {start: "%{", end: "%}"}; - - this.$id = "ace/mode/matlab"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); - diff --git a/lib/ace/mode/matlab_highlight_rules.js b/lib/ace/mode/matlab_highlight_rules.js deleted file mode 100644 index ee0e1ca8..00000000 --- a/lib/ace/mode/matlab_highlight_rules.js +++ /dev/null @@ -1,262 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var MatlabHighlightRules = function() { - -var keywords = ( - "break|case|catch|classdef|continue|else|elseif|end|for|function|global|if|otherwise|parfor|persistent|return|spmd|switch|try|while" - ); - - var builtinConstants = ( - "true|false|inf|Inf|nan|NaN|eps|pi|ans|nargin|nargout|varargin|varargout" - ); - - var builtinFunctions = ( - "abs|accumarray|acos(?:d|h)?|acot(?:d|h)?|acsc(?:d|h)?|actxcontrol(?:list|select)?|actxGetRunningServer|actxserver|addlistener|addpath|addpref|addtodate|"+ - "airy|align|alim|all|allchild|alpha|alphamap|amd|ancestor|and|angle|annotation|any|area|arrayfun|asec(?:d|h)?|asin(?:d|h)?|assert|assignin|atan(?:2|d|h)?|" + - "audiodevinfo|audioplayer|audiorecorder|aufinfo|auread|autumn|auwrite|avifile|aviinfo|aviread|axes|axis|balance|bar(?:3|3h|h)?|base2dec|beep|BeginInvoke|bench|"+ - "bessel(?:h|i|j|k|y)|beta|betainc|betaincinv|betaln|bicg|bicgstab|bicgstabl|bin2dec|bitand|bitcmp|bitget|bitmax|bitnot|bitor|bitset|bitshift|bitxor|blanks|blkdiag|"+ - "bone|box|brighten|brush|bsxfun|builddocsearchdb|builtin|bvp4c|bvp5c|bvpget|bvpinit|bvpset|bvpxtend|calendar|calllib|callSoapService|camdolly|cameratoolbar|camlight|"+ - "camlookat|camorbit|campan|campos|camproj|camroll|camtarget|camup|camva|camzoom|cart2pol|cart2sph|cast|cat|caxis|cd|cdf2rdf|cdfepoch|cdfinfo|cdflib(?:\.(?:close|closeVar|"+ - "computeEpoch|computeEpoch16|create|createAttr|createVar|delete|deleteAttr|deleteAttrEntry|deleteAttrgEntry|deleteVar|deleteVarRecords|epoch16Breakdown|epochBreakdown|getAttrEntry|"+ - "getAttrgEntry|getAttrMaxEntry|getAttrMaxgEntry|getAttrName|getAttrNum|getAttrScope|getCacheSize|getChecksum|getCompression|getCompressionCacheSize|getConstantNames|"+ - "getConstantValue|getCopyright|getFileBackward|getFormat|getLibraryCopyright|getLibraryVersion|getMajority|getName|getNumAttrEntries|getNumAttrgEntries|getNumAttributes|"+ - "getNumgAttributes|getReadOnlyMode|getStageCacheSize|getValidate|getVarAllocRecords|getVarBlockingFactor|getVarCacheSize|getVarCompression|getVarData|getVarMaxAllocRecNum|"+ - "getVarMaxWrittenRecNum|getVarName|getVarNum|getVarNumRecsWritten|getVarPadValue|getVarRecordData|getVarReservePercent|getVarsMaxWrittenRecNum|getVarSparseRecords|getVersion|"+ - "hyperGetVarData|hyperPutVarData|inquire|inquireAttr|inquireAttrEntry|inquireAttrgEntry|inquireVar|open|putAttrEntry|putAttrgEntry|putVarData|putVarRecordData|renameAttr|"+ - "renameVar|setCacheSize|setChecksum|setCompression|setCompressionCacheSize|setFileBackward|setFormat|setMajority|setReadOnlyMode|setStageCacheSize|setValidate|"+ - "setVarAllocBlockRecords|setVarBlockingFactor|setVarCacheSize|setVarCompression|setVarInitialRecs|setVarPadValue|SetVarReservePercent|setVarsCacheSize|setVarSparseRecords))?|"+ - "cdfread|cdfwrite|ceil|cell2mat|cell2struct|celldisp|cellfun|cellplot|cellstr|cgs|checkcode|checkin|checkout|chol|cholinc|cholupdate|circshift|cla|clabel|class|clc|clear|"+ - "clearvars|clf|clipboard|clock|close|closereq|cmopts|cmpermute|cmunique|colamd|colon|colorbar|colordef|colormap|colormapeditor|colperm|Combine|comet|comet3|commandhistory|"+ - "commandwindow|compan|compass|complex|computer|cond|condeig|condest|coneplot|conj|containers\.Map|contour(?:3|c|f|slice)?|contrast|conv|conv2|convhull|convhulln|convn|cool|"+ - "copper|copyfile|copyobj|corrcoef|cos(?:d|h)?|cot(?:d|h)?|cov|cplxpair|cputime|createClassFromWsdl|createSoapMessage|cross|csc(?:d|h)?|csvread|csvwrite|ctranspose|cumprod|"+ - "cumsum|cumtrapz|curl|customverctrl|cylinder|daqread|daspect|datacursormode|datatipinfo|date|datenum|datestr|datetick|datevec|dbclear|dbcont|dbdown|dblquad|dbmex|dbquit|"+ - "dbstack|dbstatus|dbstep|dbstop|dbtype|dbup|dde23|ddeget|ddesd|ddeset|deal|deblank|dec2base|dec2bin|dec2hex|decic|deconv|del2|delaunay|delaunay3|delaunayn|DelaunayTri|delete|"+ - "demo|depdir|depfun|det|detrend|deval|diag|dialog|diary|diff|diffuse|dir|disp|display|dither|divergence|dlmread|dlmwrite|dmperm|doc|docsearch|dos|dot|dragrect|drawnow|dsearch|"+ - "dsearchn|dynamicprops|echo|echodemo|edit|eig|eigs|ellipj|ellipke|ellipsoid|empty|enableNETfromNetworkDrive|enableservice|EndInvoke|enumeration|eomday|eq|erf|erfc|erfcinv|"+ - "erfcx|erfinv|error|errorbar|errordlg|etime|etree|etreeplot|eval|evalc|evalin|event\.(?:EventData|listener|PropertyEvent|proplistener)|exifread|exist|exit|exp|expint|expm|"+ - "expm1|export2wsdlg|eye|ezcontour|ezcontourf|ezmesh|ezmeshc|ezplot|ezplot3|ezpolar|ezsurf|ezsurfc|factor|factorial|fclose|feather|feature|feof|ferror|feval|fft|fft2|fftn|"+ - "fftshift|fftw|fgetl|fgets|fieldnames|figure|figurepalette|fileattrib|filebrowser|filemarker|fileparts|fileread|filesep|fill|fill3|filter|filter2|find|findall|findfigs|"+ - "findobj|findstr|finish|fitsdisp|fitsinfo|fitsread|fitswrite|fix|flag|flipdim|fliplr|flipud|floor|flow|fminbnd|fminsearch|fopen|format|fplot|fprintf|frame2im|fread|freqspace|"+ - "frewind|fscanf|fseek|ftell|FTP|full|fullfile|func2str|functions|funm|fwrite|fzero|gallery|gamma|gammainc|gammaincinv|gammaln|gca|gcbf|gcbo|gcd|gcf|gco|ge|genpath|genvarname|"+ - "get|getappdata|getenv|getfield|getframe|getpixelposition|getpref|ginput|gmres|gplot|grabcode|gradient|gray|graymon|grid|griddata(?:3|n)?|griddedInterpolant|gsvd|gt|gtext|"+ - "guidata|guide|guihandles|gunzip|gzip|h5create|h5disp|h5info|h5read|h5readatt|h5write|h5writeatt|hadamard|handle|hankel|hdf|hdf5|hdf5info|hdf5read|hdf5write|hdfinfo|"+ - "hdfread|hdftool|help|helpbrowser|helpdesk|helpdlg|helpwin|hess|hex2dec|hex2num|hgexport|hggroup|hgload|hgsave|hgsetget|hgtransform|hidden|hilb|hist|histc|hold|home|horzcat|"+ - "hostid|hot|hsv|hsv2rgb|hypot|ichol|idivide|ifft|ifft2|ifftn|ifftshift|ilu|im2frame|im2java|imag|image|imagesc|imapprox|imfinfo|imformats|import|importdata|imread|imwrite|"+ - "ind2rgb|ind2sub|inferiorto|info|inline|inmem|inpolygon|input|inputdlg|inputname|inputParser|inspect|instrcallback|instrfind|instrfindall|int2str|integral(?:2|3)?|interp(?:1|"+ - "1q|2|3|ft|n)|interpstreamspeed|intersect|intmax|intmin|inv|invhilb|ipermute|isa|isappdata|iscell|iscellstr|ischar|iscolumn|isdir|isempty|isequal|isequaln|isequalwithequalnans|"+ - "isfield|isfinite|isfloat|isglobal|ishandle|ishghandle|ishold|isinf|isinteger|isjava|iskeyword|isletter|islogical|ismac|ismatrix|ismember|ismethod|isnan|isnumeric|isobject|"+ - "isocaps|isocolors|isonormals|isosurface|ispc|ispref|isprime|isprop|isreal|isrow|isscalar|issorted|isspace|issparse|isstr|isstrprop|isstruct|isstudent|isunix|isvarname|"+ - "isvector|javaaddpath|javaArray|javachk|javaclasspath|javacomponent|javaMethod|javaMethodEDT|javaObject|javaObjectEDT|javarmpath|jet|keyboard|kron|lasterr|lasterror|"+ - "lastwarn|lcm|ldivide|ldl|le|legend|legendre|length|libfunctions|libfunctionsview|libisloaded|libpointer|libstruct|license|light|lightangle|lighting|lin2mu|line|lines|"+ - "linkaxes|linkdata|linkprop|linsolve|linspace|listdlg|listfonts|load|loadlibrary|loadobj|log|log10|log1p|log2|loglog|logm|logspace|lookfor|lower|ls|lscov|lsqnonneg|lsqr|"+ - "lt|lu|luinc|magic|makehgtform|mat2cell|mat2str|material|matfile|matlab\.io\.MatFile|matlab\.mixin\.(?:Copyable|Heterogeneous(?:\.getDefaultScalarElement)?)|matlabrc|"+ - "matlabroot|max|maxNumCompThreads|mean|median|membrane|memmapfile|memory|menu|mesh|meshc|meshgrid|meshz|meta\.(?:class(?:\.fromName)?|DynamicProperty|EnumeratedValue|event|"+ - "MetaData|method|package(?:\.(?:fromName|getAllPackages))?|property)|metaclass|methods|methodsview|mex(?:\.getCompilerConfigurations)?|MException|mexext|mfilename|min|minres|"+ - "minus|mislocked|mkdir|mkpp|mldivide|mlint|mlintrpt|mlock|mmfileinfo|mmreader|mod|mode|more|move|movefile|movegui|movie|movie2avi|mpower|mrdivide|msgbox|mtimes|mu2lin|"+ - "multibandread|multibandwrite|munlock|namelengthmax|nargchk|narginchk|nargoutchk|native2unicode|nccreate|ncdisp|nchoosek|ncinfo|ncread|ncreadatt|ncwrite|ncwriteatt|"+ - "ncwriteschema|ndgrid|ndims|ne|NET(?:\.(?:addAssembly|Assembly|convertArray|createArray|createGeneric|disableAutoRelease|enableAutoRelease|GenericClass|invokeGenericMethod|"+ - "NetException|setStaticProperty))?|netcdf\.(?:abort|close|copyAtt|create|defDim|defGrp|defVar|defVarChunking|defVarDeflate|defVarFill|defVarFletcher32|delAtt|endDef|getAtt|"+ - "getChunkCache|getConstant|getConstantNames|getVar|inq|inqAtt|inqAttID|inqAttName|inqDim|inqDimID|inqDimIDs|inqFormat|inqGrpName|inqGrpNameFull|inqGrpParent|inqGrps|"+ - "inqLibVers|inqNcid|inqUnlimDims|inqVar|inqVarChunking|inqVarDeflate|inqVarFill|inqVarFletcher32|inqVarID|inqVarIDs|open|putAtt|putVar|reDef|renameAtt|renameDim|renameVar|"+ - "setChunkCache|setDefaultFormat|setFill|sync)|newplot|nextpow2|nnz|noanimate|nonzeros|norm|normest|not|notebook|now|nthroot|null|num2cell|num2hex|num2str|numel|nzmax|"+ - "ode(?:113|15i|15s|23|23s|23t|23tb|45)|odeget|odeset|odextend|onCleanup|ones|open|openfig|opengl|openvar|optimget|optimset|or|ordeig|orderfields|ordqz|ordschur|orient|"+ - "orth|pack|padecoef|pagesetupdlg|pan|pareto|parseSoapResponse|pascal|patch|path|path2rc|pathsep|pathtool|pause|pbaspect|pcg|pchip|pcode|pcolor|pdepe|pdeval|peaks|perl|perms|"+ - "permute|pie|pink|pinv|planerot|playshow|plot|plot3|plotbrowser|plotedit|plotmatrix|plottools|plotyy|plus|pol2cart|polar|poly|polyarea|polyder|polyeig|polyfit|polyint|polyval|"+ - "polyvalm|pow2|power|ppval|prefdir|preferences|primes|print|printdlg|printopt|printpreview|prod|profile|profsave|propedit|propertyeditor|psi|publish|PutCharArray|PutFullMatrix|"+ - "PutWorkspaceData|pwd|qhull|qmr|qr|qrdelete|qrinsert|qrupdate|quad|quad2d|quadgk|quadl|quadv|questdlg|quit|quiver|quiver3|qz|rand|randi|randn|randperm|RandStream(?:\.(?:create|"+ - "getDefaultStream|getGlobalStream|list|setDefaultStream|setGlobalStream))?|rank|rat|rats|rbbox|rcond|rdivide|readasync|real|reallog|realmax|realmin|realpow|realsqrt|record|"+ - "rectangle|rectint|recycle|reducepatch|reducevolume|refresh|refreshdata|regexp|regexpi|regexprep|regexptranslate|rehash|rem|Remove|RemoveAll|repmat|reset|reshape|residue|"+ - "restoredefaultpath|rethrow|rgb2hsv|rgb2ind|rgbplot|ribbon|rmappdata|rmdir|rmfield|rmpath|rmpref|rng|roots|rose|rosser|rot90|rotate|rotate3d|round|rref|rsf2csf|run|save|saveas|"+ - "saveobj|savepath|scatter|scatter3|schur|sec|secd|sech|selectmoveresize|semilogx|semilogy|sendmail|serial|set|setappdata|setdiff|setenv|setfield|setpixelposition|setpref|setstr|"+ - "setxor|shading|shg|shiftdim|showplottool|shrinkfaces|sign|sin(?:d|h)?|size|slice|smooth3|snapnow|sort|sortrows|sound|soundsc|spalloc|spaugment|spconvert|spdiags|specular|speye|"+ - "spfun|sph2cart|sphere|spinmap|spline|spones|spparms|sprand|sprandn|sprandsym|sprank|spring|sprintf|spy|sqrt|sqrtm|squeeze|ss2tf|sscanf|stairs|startup|std|stem|stem3|stopasync|"+ - "str2double|str2func|str2mat|str2num|strcat|strcmp|strcmpi|stream2|stream3|streamline|streamparticles|streamribbon|streamslice|streamtube|strfind|strjust|strmatch|strncmp|"+ - "strncmpi|strread|strrep|strtok|strtrim|struct2cell|structfun|strvcat|sub2ind|subplot|subsasgn|subsindex|subspace|subsref|substruct|subvolume|sum|summer|superclasses|superiorto|"+ - "support|surf|surf2patch|surface|surfc|surfl|surfnorm|svd|svds|swapbytes|symamd|symbfact|symmlq|symrcm|symvar|system|tan(?:d|h)?|tar|tempdir|tempname|tetramesh|texlabel|text|"+ - "textread|textscan|textwrap|tfqmr|throw|tic|Tiff(?:\.(?:getTagNames|getVersion))?|timer|timerfind|timerfindall|times|timeseries|title|toc|todatenum|toeplitz|toolboxdir|trace|"+ - "transpose|trapz|treelayout|treeplot|tril|trimesh|triplequad|triplot|TriRep|TriScatteredInterp|trisurf|triu|tscollection|tsearch|tsearchn|tstool|type|typecast|uibuttongroup|"+ - "uicontextmenu|uicontrol|uigetdir|uigetfile|uigetpref|uiimport|uimenu|uiopen|uipanel|uipushtool|uiputfile|uiresume|uisave|uisetcolor|uisetfont|uisetpref|uistack|uitable|"+ - "uitoggletool|uitoolbar|uiwait|uminus|undocheckout|unicode2native|union|unique|unix|unloadlibrary|unmesh|unmkpp|untar|unwrap|unzip|uplus|upper|urlread|urlwrite|usejava|"+ - "userpath|validateattributes|validatestring|vander|var|vectorize|ver|verctrl|verLessThan|version|vertcat|VideoReader(?:\.isPlatformSupported)?|VideoWriter(?:\.getProfiles)?|"+ - "view|viewmtx|visdiff|volumebounds|voronoi|voronoin|wait|waitbar|waitfor|waitforbuttonpress|warndlg|warning|waterfall|wavfinfo|wavplay|wavread|wavrecord|wavwrite|web|weekday|"+ - "what|whatsnew|which|whitebg|who|whos|wilkinson|winopen|winqueryreg|winter|wk1finfo|wk1read|wk1write|workspace|xlabel|xlim|xlsfinfo|xlsread|xlswrite|xmlread|xmlwrite|xor|xslt|"+ - "ylabel|ylim|zeros|zip|zlabel|zlim|zoom|addedvarplot|andrewsplot|anova(?:1|2|n)|ansaribradley|aoctool|barttest|bbdesign|beta(?:cdf|fit|inv|like|pdf|rnd|stat)|bino(?:cdf|fit|inv|"+ - "pdf|rnd|stat)|biplot|bootci|bootstrp|boxplot|candexch|candgen|canoncorr|capability|capaplot|caseread|casewrite|categorical|ccdesign|cdfplot|chi2(?:cdf|gof|inv|pdf|rnd|stat)|"+ - "cholcov|Classification(?:BaggedEnsemble|Discriminant(?:\.(?:fit|make|template))?|Ensemble|KNN(?:\.(?:fit|template))?|PartitionedEnsemble|PartitionedModel|Tree(?:\.(?:fit|"+ - "template))?)|classify|classregtree|cluster|clusterdata|cmdscale|combnk|Compact(?:Classification(?:Discriminant|Ensemble|Tree)|Regression(?:Ensemble|Tree)|TreeBagger)|confusionmat|"+ - "controlchart|controlrules|cophenet|copula(?:cdf|fit|param|pdf|rnd|stat)|cordexch|corr|corrcov|coxphfit|createns|crosstab|crossval|cvpartition|datasample|dataset|daugment|dcovary|"+ - "dendrogram|dfittool|disttool|dummyvar|dwtest|ecdf|ecdfhist|ev(?:cdf|fit|inv|like|pdf|rnd|stat)|ExhaustiveSearcher|exp(?:cdf|fit|inv|like|pdf|rnd|stat)|factoran|fcdf|ff2n|finv|"+ - "fitdist|fitensemble|fpdf|fracfact|fracfactgen|friedman|frnd|fstat|fsurfht|fullfact|gagerr|gam(?:cdf|fit|inv|like|pdf|rnd|stat)|GeneralizedLinearModel(?:\.fit)?|geo(?:cdf|inv|mean|"+ - "pdf|rnd|stat)|gev(?:cdf|fit|inv|like|pdf|rnd|stat)|gline|glmfit|glmval|glyphplot|gmdistribution(?:\.fit)?|gname|gp(?:cdf|fit|inv|like|pdf|rnd|stat)|gplotmatrix|grp2idx|grpstats|"+ - "gscatter|haltonset|harmmean|hist3|histfit|hmm(?:decode|estimate|generate|train|viterbi)|hougen|hyge(?:cdf|inv|pdf|rnd|stat)|icdf|inconsistent|interactionplot|invpred|iqr|iwishrnd|"+ - "jackknife|jbtest|johnsrnd|KDTreeSearcher|kmeans|knnsearch|kruskalwallis|ksdensity|kstest|kstest2|kurtosis|lasso|lassoglm|lassoPlot|leverage|lhsdesign|lhsnorm|lillietest|"+ - "LinearModel(?:\.fit)?|linhyptest|linkage|logn(?:cdf|fit|inv|like|pdf|rnd|stat)|lsline|mad|mahal|maineffectsplot|manova1|manovacluster|mdscale|mhsample|mle|mlecov|mnpdf|"+ - "mnrfit|mnrnd|mnrval|moment|multcompare|multivarichart|mvn(?:cdf|pdf|rnd)|mvregress|mvregresslike|mvt(?:cdf|pdf|rnd)|NaiveBayes(?:\.fit)?|nan(?:cov|max|mean|median|min|std|"+ - "sum|var)|nbin(?:cdf|fit|inv|pdf|rnd|stat)|ncf(?:cdf|inv|pdf|rnd|stat)|nct(?:cdf|inv|pdf|rnd|stat)|ncx2(?:cdf|inv|pdf|rnd|stat)|NeighborSearcher|nlinfit|nlintool|nlmefit|nlmefitsa|"+ - "nlparci|nlpredci|nnmf|nominal|NonLinearModel(?:\.fit)?|norm(?:cdf|fit|inv|like|pdf|rnd|stat)|normplot|normspec|ordinal|outlierMeasure|parallelcoords|paretotails|partialcorr|"+ - "pcacov|pcares|pdf|pdist|pdist2|pearsrnd|perfcurve|perms|piecewisedistribution|plsregress|poiss(?:cdf|fit|inv|pdf|rnd|tat)|polyconf|polytool|prctile|princomp|ProbDist(?:Kernel|"+ - "Parametric|UnivKernel|UnivParam)?|probplot|procrustes|qqplot|qrandset|qrandstream|quantile|randg|random|randsample|randtool|range|rangesearch|ranksum|rayl(?:cdf|fit|inv|pdf|"+ - "rnd|stat)|rcoplot|refcurve|refline|regress|Regression(?:BaggedEnsemble|Ensemble|PartitionedEnsemble|PartitionedModel|Tree(?:\.(?:fit|template))?)|regstats|relieff|ridge|"+ - "robustdemo|robustfit|rotatefactors|rowexch|rsmdemo|rstool|runstest|sampsizepwr|scatterhist|sequentialfs|signrank|signtest|silhouette|skewness|slicesample|sobolset|squareform|"+ - "statget|statset|stepwise|stepwisefit|surfht|tabulate|tblread|tblwrite|tcdf|tdfread|tiedrank|tinv|tpdf|TreeBagger|treedisp|treefit|treeprune|treetest|treeval|trimmean|trnd|tstat|"+ - "ttest|ttest2|unid(?:cdf|inv|pdf|rnd|stat)|unif(?:cdf|inv|it|pdf|rnd|stat)|vartest(?:2|n)?|wbl(?:cdf|fit|inv|like|pdf|rnd|stat)|wblplot|wishrnd|x2fx|xptread|zscore|ztest"+ - "adapthisteq|analyze75info|analyze75read|applycform|applylut|axes2pix|bestblk|blockproc|bwarea|bwareaopen|bwboundaries|bwconncomp|bwconvhull|bwdist|bwdistgeodesic|bweuler|"+ - "bwhitmiss|bwlabel|bwlabeln|bwmorph|bwpack|bwperim|bwselect|bwtraceboundary|bwulterode|bwunpack|checkerboard|col2im|colfilt|conndef|convmtx2|corner|cornermetric|corr2|cp2tform|"+ - "cpcorr|cpselect|cpstruct2pairs|dct2|dctmtx|deconvblind|deconvlucy|deconvreg|deconvwnr|decorrstretch|demosaic|dicom(?:anon|dict|info|lookup|read|uid|write)|edge|edgetaper|entropy|"+ - "entropyfilt|fan2para|fanbeam|findbounds|fliptform|freqz2|fsamp2|fspecial|ftrans2|fwind1|fwind2|getheight|getimage|getimagemodel|getline|getneighbors|getnhood|getpts|"+ - "getrangefromclass|getrect|getsequence|gray2ind|graycomatrix|graycoprops|graydist|grayslice|graythresh|hdrread|hdrwrite|histeq|hough|houghlines|houghpeaks|iccfind|iccread|"+ - "iccroot|iccwrite|idct2|ifanbeam|im2bw|im2col|im2double|im2int16|im2java2d|im2single|im2uint16|im2uint8|imabsdiff|imadd|imadjust|ImageAdapter|imageinfo|imagemodel|imapplymatrix|"+ - "imattributes|imbothat|imclearborder|imclose|imcolormaptool|imcomplement|imcontour|imcontrast|imcrop|imdilate|imdisplayrange|imdistline|imdivide|imellipse|imerode|imextendedmax|"+ - "imextendedmin|imfill|imfilter|imfindcircles|imfreehand|imfuse|imgca|imgcf|imgetfile|imhandles|imhist|imhmax|imhmin|imimposemin|imlincomb|imline|immagbox|immovie|immultiply|imnoise|"+ - "imopen|imoverview|imoverviewpanel|impixel|impixelinfo|impixelinfoval|impixelregion|impixelregionpanel|implay|impoint|impoly|impositionrect|improfile|imputfile|impyramid|"+ - "imreconstruct|imrect|imregconfig|imregionalmax|imregionalmin|imregister|imresize|imroi|imrotate|imsave|imscrollpanel|imshow|imshowpair|imsubtract|imtool|imtophat|imtransform|"+ - "imview|ind2gray|ind2rgb|interfileinfo|interfileread|intlut|ippl|iptaddcallback|iptcheckconn|iptcheckhandle|iptcheckinput|iptcheckmap|iptchecknargin|iptcheckstrs|iptdemos|iptgetapi|"+ - "iptGetPointerBehavior|iptgetpref|ipticondir|iptnum2ordinal|iptPointerManager|iptprefs|iptremovecallback|iptSetPointerBehavior|iptsetpref|iptwindowalign|iradon|isbw|isflat|isgray|"+ - "isicc|isind|isnitf|isrgb|isrset|lab2double|lab2uint16|lab2uint8|label2rgb|labelmatrix|makecform|makeConstrainToRectFcn|makehdr|makelut|makeresampler|maketform|mat2gray|mean2|"+ - "medfilt2|montage|nitfinfo|nitfread|nlfilter|normxcorr2|ntsc2rgb|openrset|ordfilt2|otf2psf|padarray|para2fan|phantom|poly2mask|psf2otf|qtdecomp|qtgetblk|qtsetblk|radon|rangefilt|"+ - "reflect|regionprops|registration\.metric\.(?:MattesMutualInformation|MeanSquares)|registration\.optimizer\.(?:OnePlusOneEvolutionary|RegularStepGradientDescent)|rgb2gray|"+ - "rgb2ntsc|rgb2ycbcr|roicolor|roifill|roifilt2|roipoly|rsetwrite|std2|stdfilt|strel|stretchlim|subimage|tformarray|tformfwd|tforminv|tonemap|translate|truesize|uintlut|viscircles|"+ - "warp|watershed|whitepoint|wiener2|xyz2double|xyz2uint16|ycbcr2rgb|bintprog|color|fgoalattain|fminbnd|fmincon|fminimax|fminsearch|fminunc|fseminf|fsolve|fzero|fzmult|gangstr|ktrlink|"+ - "linprog|lsqcurvefit|lsqlin|lsqnonlin|lsqnonneg|optimget|optimset|optimtool|quadprog" - ); - var storageType = ( - "cell|struct|char|double|single|logical|u?int(?:8|16|32|64)|sparse" - ); - var keywordMapper = this.createKeywordMapper({ - "storage.type": storageType, - "support.function": builtinFunctions, - "keyword": keywords, - "constant.language": builtinConstants - }, "identifier", true); - - this.$rules = { - // allowQstring - start: [{ - token : "string", - regex : "'", - stateName : "qstring", - next : [{ - token : "constant.language.escape", - regex : "''" - }, { - token : "string", - regex : "'|$", - next : "start" - }, { - defaultToken: "string" - }] - }, { - token : "text", - regex : "\\s+" - }, { - regex: "", - next: "noQstring" - }], - noQstring : [{ - regex: "^\\s*%{\\s*$", - token: "comment.start", - push: "blockComment" - }, { - token : "comment", - regex : "%[^\r\n]*" - }, { - token : "string", - regex : '"', - stateName : "qqstring", - next : [{ - token : "constant.language.escape", - regex : /\\./ - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "start" - }, { - defaultToken: "string" - }] - }, { - 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 : "\\+|\\-|\\/|\\/\\/|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|=", - next: "start" - }, { - token : "punctuation.operator", - regex : "\\?|\\:|\\,|\\;|\\.", - next: "start" - }, { - token : "paren.lparen", - regex : "[({\\[]", - next: "start" - }, { - token : "paren.rparen", - regex : "[\\]})]" - }, { - token : "text", - regex : "\\s+" - }, { - token : "text", - regex : "$", - next : "start" - }], - blockComment: [{ - regex: "^\\s*%{\\s*$", - token: "comment.start", - push: "blockComment" - }, { - regex: "^\\s*%}\\s*$", - token: "comment.end", - next: "pop" - }, { - defaultToken: "comment" - }], - }; - - this.normalizeRules(); -}; - -oop.inherits(MatlabHighlightRules, TextHighlightRules); - -exports.MatlabHighlightRules = MatlabHighlightRules; -}); \ No newline at end of file diff --git a/lib/ace/mode/mel.js b/lib/ace/mode/mel.js deleted file mode 100644 index e8922a1c..00000000 --- a/lib/ace/mode/mel.js +++ /dev/null @@ -1,56 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var MELHighlightRules = require("./mel_highlight_rules").MELHighlightRules; -var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = MELHighlightRules; - this.$behaviour = new CstyleBehaviour(); - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - this.$id = "ace/mode/mel"; -}).call(Mode.prototype); - -exports.Mode = Mode; - -}); \ No newline at end of file diff --git a/lib/ace/mode/mel_highlight_rules.js b/lib/ace/mode/mel_highlight_rules.js deleted file mode 100644 index ca23fd4f..00000000 --- a/lib/ace/mode/mel_highlight_rules.js +++ /dev/null @@ -1,133 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -/* THIS FILE WAS AUTOGENERATED FROM MEL.tmLanguage (UUID: 69554E52-391D-42BC-9F65-7A77444BA1CF) */ -/**************************************************************** - * IT MIGHT NOT BE PERFECT, PARTICULARLY: * - * IN DECIDING STATES TO TRANSITION TO, * - * IGNORING WHITESPACE, * - * IGNORING GROUPS WITH ?:, * - * EXTENDING EXISTING MODES, * - * GATHERING KEYWORDS, OR * - * DECIDING WHEN TO USE PUSH. * - * ...But it's a good start from an existing *.tmlanguage file. * - ****************************************************************/ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var MELHighlightRules = function() { - // regexp must not have capturing parentheses. Use (?:) instead. - // regexps are ordered -> the first match is used - - this.$rules = { start: - [ { caseInsensitive: true, - token: 'storage.type.mel', - regex: '\\b(matrix|string|vector|float|int|void)\\b' }, - { caseInsensitive: true, - token: 'support.function.mel', - regex: '\\b((s(h(ow(ManipCtx|S(hadingGroupAttrEditor|electionInTitle)|H(idden|elp)|Window)|el(f(Button|TabLayout|Layout)|lField)|ading(GeometryRelCtx|Node|Connection|LightRelCtx))|y(s(tem|File)|mbol(Button|CheckBox))|nap(shot|Mode|2to2 |TogetherCtx|Key)|c(ulpt|ene(UIReplacement|Editor)|ale(BrushBrightness |Constraint|Key(Ctx)?)?|r(ipt(Node|Ctx|Table|edPanel(Type)?|Job|EditorInfo)|oll(Field|Layout))|mh)|t(itch(Surface(Points)?|AndExplodeShell )|a(ckTrace|rt(sWith |String ))|r(cmp|i(ng(ToStringArray |Array(Remove(Duplicates | )|C(ount |atenate )|ToString |Intersector))|p )|oke))|i(n(gleProfileBirailSurface)?|ze|gn|mplify)|o(u(nd(Control)?|rce)|ft(Mod(Ctx)?)?|rt)|u(perCtx|rface(S(haderList|ampler))?|b(st(itute(Geometry|AllString )?|ring)|d(M(irror|a(tchTopology|p(SewMove|Cut)))|iv(Crease|DisplaySmoothness)?|C(ollapse|leanTopology)|T(o(Blind|Poly)|ransferUVsToCache)|DuplicateAndConnect|EditUV|ListComponentConversion|AutoProjection)))|p(h(ere|rand)|otLight(PreviewPort)?|aceLocator|r(ing|eadSheetEditor))|e(t(s|MenuMode|Sta(te |rtupMessage|mpDensity )|NodeTypeFlag|ConstraintRestPosition |ToolTo|In(putDeviceMapping|finity)|D(ynamic|efaultShadingGroup|rivenKeyframe)|UITemplate|P(ar(ticleAttr|ent)|roject )|E(scapeCtx|dit(or|Ctx))|Key(Ctx|frame|Path)|F(ocus|luidAttr)|Attr(Mapping)?)|parator|ed|l(ect(Mode|ionConnection|Context|Type|edNodes|Pr(iority|ef)|Key(Ctx)?)?|LoadSettings)|archPathArray )|kin(Cluster|Percent)|q(uareSurface|rt)|w(itchTable|atchDisplayPort)|a(ve(Menu|Shelf|ToolSettings|I(nitialState|mage)|Pref(s|Objects)|Fluid|A(ttrPreset |llShelves))|mpleImage)|rtContext|mooth(step|Curve|TangentSurface))|h(sv_to_rgb|yp(ot|er(Graph|Shade|Panel))|i(tTest|de|lite)|ot(Box|key(Check)?)|ud(Button|Slider(Button)?)|e(lp(Line)?|adsUpDisplay|rmite)|wRe(nder(Load)?|flectionMap)|ard(enPointCurve|ware(RenderPanel)?))|n(o(nLinear|ise|de(Type|IconButton|Outliner|Preset)|rmal(ize |Constraint))|urbs(Boolean|S(elect|quare)|C(opyUVSet|ube)|To(Subdiv|Poly(gonsPref)?)|Plane|ViewDirectionVector )|ew(ton|PanelItems)|ame(space(Info)?|Command|Field))|c(h(oice|dir|eck(Box(Grp)?|DefaultRenderGlobals)|a(n(nelBox|geSubdiv(Region|ComponentDisplayLevel))|racter(Map|OutlineEditor)?))|y(cleCheck|linder)|tx(Completion|Traverse|EditMode|Abort)|irc(ularFillet|le)|o(s|n(str(uctionHistory|ain(Value)?)|nect(ionInfo|Control|Dynamic|Joint|Attr)|t(extInfo|rol)|dition|e|vert(SolidTx|Tessellation|Unit|FromOldLayers |Lightmap)|firmDialog)|py(SkinWeights|Key|Flexor|Array )|l(or(Slider(Grp|ButtonGrp)|Index(SliderGrp)?|Editor|AtPoint)?|umnLayout|lision)|arsenSubdivSelectionList|m(p(onentEditor|utePolysetVolume |actHairSystem )|mand(Port|Echo|Line)))|u(tKey|r(ve(MoveEPCtx|SketchCtx|CVCtx|Intersect|OnSurface|E(ditorCtx|PCtx)|AddPtCtx)?|rent(Ctx|Time(Ctx)?|Unit)))|p(GetSolverAttr|Button|S(olver(Types)?|e(t(SolverAttr|Edit)|am))|C(o(nstraint|llision)|ache)|Tool|P(anel|roperty))|eil|l(ip(Schedule(rOutliner)?|TrimBefore |Editor(CurrentTimeCtx)?)?|ose(Surface|Curve)|uster|ear(Cache)?|amp)|a(n(CreateManip|vas)|tch(Quiet)?|pitalizeString |mera(View)?)|r(oss(Product )?|eate(RenderLayer|MotionField |SubdivRegion|N(ode|ewShelf )|D(isplayLayer|rawCtx)|Editor))|md(Shell|FileOutput))|M(R(ender(ShadowData|Callback|Data|Util|View|Line(Array)?)|ampAttribute)|G(eometryData|lobal)|M(odelMessage|essage|a(nipData|t(erial|rix)))|BoundingBox|S(yntax|ceneMessage|t(atus|ring(Array)?)|imple|pace|elect(ion(Mask|List)|Info)|watchRender(Register|Base))|H(ardwareRenderer|WShaderSwatchGenerator)|NodeMessage|C(o(nditionMessage|lor(Array)?|m(putation|mand(Result|Message)))|ursor|loth(Material|S(ystem|olverRegister)|Con(straint|trol)|Triangle|Particle|Edge|Force)|allbackIdArray)|T(ypeId|ime(r(Message)?|Array)?|oolsInfo|esselationParams|r(imBoundaryArray|ansformationMatrix))|I(ntArray|t(Geometry|Mesh(Polygon|Edge|Vertex|FaceVertex)|S(urfaceCV|electionList)|CurveCV|Instancer|eratorType|D(ependency(Graph|Nodes)|ag)|Keyframe)|k(System|HandleGroup)|mage)|3dView|Object(SetMessage|Handle|Array)?|D(G(M(odifier|essage)|Context)|ynSwept(Triangle|Line)|istance|oubleArray|evice(State|Channel)|a(ta(Block|Handle)|g(M(odifier|essage)|Path(Array)?))|raw(Request(Queue)?|Info|Data|ProcedureBase))|U(serEventMessage|i(nt(Array|64Array)|Message))|P(o(int(Array)?|lyMessage)|lug(Array)?|rogressWindow|x(G(eometry(Iterator|Data)|lBuffer)|M(idiInputDevice|odelEditorCommand|anipContainer)|S(urfaceShape(UI)?|pringNode|electionContext)|HwShaderNode|Node|Co(ntext(Command)?|m(ponentShape|mand))|T(oolCommand|ransform(ationMatrix)?)|IkSolver(Node)?|3dModelView|ObjectSet|D(eformerNode|ata|ragAndDropBehavior)|PolyT(weakUVCommand|rg)|EmitterNode|F(i(eldNode|leTranslator)|luidEmitterNode)|LocatorNode))|E(ulerRotation|vent(Message)?)|ayatomr|Vector(Array)?|Quaternion|F(n(R(otateManip|eflectShader|adialField)|G(e(nericAttribute|ometry(Data|Filter))|ravityField)|M(otionPath|es(sageAttribute|h(Data)?)|a(nip3D|trix(Data|Attribute)))|B(l(innShader|endShapeDeformer)|ase)|S(caleManip|t(ateManip|ring(Data|ArrayData))|ingleIndexedComponent|ubd(Names|Data)?|p(hereData|otLight)|et|kinCluster)|HikEffector|N(on(ExtendedLight|AmbientLight)|u(rbs(Surface(Data)?|Curve(Data)?)|meric(Data|Attribute))|ewtonField)|C(haracter|ircleSweepManip|ompo(nent(ListData)?|undAttribute)|urveSegmentManip|lip|amera)|T(ypedAttribute|oggleManip|urbulenceField|r(ipleIndexedComponent|ansform))|I(ntArrayData|k(Solver|Handle|Joint|Effector))|D(ynSweptGeometryData|i(s(cManip|tanceManip)|rection(Manip|alLight))|ouble(IndexedComponent|ArrayData)|ependencyNode|a(ta|gNode)|ragField)|U(ni(tAttribute|formField)|Int64ArrayData)|P(hong(Shader|EShader)|oint(On(SurfaceManip|CurveManip)|Light|ArrayData)|fxGeometry|lugin(Data)?|arti(cleSystem|tion))|E(numAttribute|xpression)|V(o(lume(Light|AxisField)|rtexField)|ectorArrayData)|KeyframeDelta(Move|B(lockAddRemove|reakdown)|Scale|Tangent|InfType|Weighted|AddRemove)?|F(ield|luid|reePointTriadManip)|W(ireDeformer|eightGeometryFilter)|L(ight(DataAttribute)?|a(yeredShader|ttice(D(eformer|ata))?|mbertShader))|A(ni(sotropyShader|mCurve)|ttribute|irField|r(eaLight|rayAttrsData)|mbientLight))?|ile(IO|Object)|eedbackLine|loat(Matrix|Point(Array)?|Vector(Array)?|Array))|L(i(ghtLinks|brary)|ockMessage)|A(n(im(Message|C(ontrol|urveC(hange|lipboard(Item(Array)?)?))|Util)|gle)|ttribute(Spec(Array)?|Index)|r(rayData(Builder|Handle)|g(Database|Parser|List))))|t(hreePointArcCtx|ime(Control|Port|rX)|o(ol(Button|HasOptions|Collection|Dropped|PropertyWindow)|NativePath |upper|kenize(List )?|l(ower|erance)|rus|ggle(WindowVisibility|Axis)?)|u(rbulence|mble(Ctx)?)|ex(RotateContext|M(oveContext|anipContext)|t(ScrollList|Curves|ure(HairColor |DisplacePlane |PlacementContext|Window)|ToShelf |Field(Grp|ButtonGrp)?)?|S(caleContext|electContext|mudgeUVContext)|WinToolCtx)|woPointArcCtx|a(n(gentConstraint)?|bLayout)|r(im|unc(ate(HairCache|FluidCache))?|a(ns(formLimits|lator)|c(e|k(Ctx)?))))|i(s(olateSelect|Connected|True|Dirty|ParentOf |Valid(String |ObjectName |UiName )|AnimCurve )|n(s(tance(r)?|ert(Joint(Ctx)?|K(not(Surface|Curve)|eyCtx)))|heritTransform|t(S(crollBar|lider(Grp)?)|er(sect|nalVar|ToUI )|Field(Grp)?))|conText(Radio(Button|Collection)|Button|StaticLabel|CheckBox)|temFilter(Render|Type|Attr)?|prEngine|k(S(ystem(Info)?|olver|plineHandleCtx)|Handle(Ctx|DisplayScale)?|fkDisplayMethod)|m(portComposerCurves |fPlugins|age))|o(ceanNurbsPreviewPlane |utliner(Panel|Editor)|p(tion(Menu(Grp)?|Var)|en(GLExtension|MayaPref))|verrideModifier|ffset(Surface|Curve(OnSurface)?)|r(ientConstraint|bit(Ctx)?)|b(soleteProc |j(ect(Center|Type(UI)?|Layer )|Exists)))|d(yn(RelEd(itor|Panel)|Globals|C(ontrol|ache)|P(a(intEditor|rticleCtx)|ref)|Exp(ort|ression)|amicLoad)|i(s(connect(Joint|Attr)|tanceDim(Context|ension)|pla(y(RGBColor|S(tats|urface|moothness)|C(olor|ull)|Pref|LevelOfDetail|Affected)|cementToPoly)|kCache|able)|r(name |ect(ionalLight|KeyCtx)|map)|mWhen)|o(cServer|Blur|t(Product )?|ubleProfileBirailSurface|peSheetEditor|lly(Ctx)?)|uplicate(Surface|Curve)?|e(tach(Surface|Curve|DeviceAttr)|vice(Panel|Editor)|f(ine(DataServer|VirtualDevice)|ormer|ault(Navigation|LightListCheckBox))|l(ete(Sh(elfTab |adingGroupsAndMaterials )|U(nusedBrushes |I)|Attr)?|randstr)|g_to_rad)|agPose|r(opoffLocator|ag(gerContext)?)|g(timer|dirty|Info|eval))|CBG |u(serCtx|n(t(angleUV|rim)|i(t|form)|do(Info)?|loadPlugin|assignInputDevice|group)|iTemplate|p(dateAE |Axis)|v(Snapshot|Link))|joint(C(tx|luster)|DisplayScale|Lattice)?|p(sd(ChannelOutliner|TextureFile|E(ditTextureFile|xport))|close|i(c(ture|kWalk)|xelMove)|o(se|int(MatrixMult |C(onstraint|urveConstraint)|On(Surface|Curve)|Position|Light)|p(upMenu|en)|w|l(y(Reduce|GeoSampler|M(irrorFace|ove(UV|Edge|Vertex|Facet(UV)?)|erge(UV|Edge(Ctx)?|Vertex|Facet(Ctx)?)|ap(Sew(Move)?|Cut|Del))|B(oolOp|evel|l(indData|endColor))|S(traightenUVBorder|oftEdge|u(perCtx|bdivide(Edge|Facet))|p(her(icalProjection|e)|lit(Ring|Ctx|Edge|Vertex)?)|e(tToFaceNormal|parate|wEdge|lect(Constraint(Monitor)?|EditCtx))|mooth)|Normal(izeUV|PerVertex)?|C(hipOff|ylind(er|ricalProjection)|o(ne|pyUV|l(or(BlindData|Set|PerVertex)|lapse(Edge|Facet)))|u(t(Ctx)?|be)|l(ipboard|oseBorder)|acheMonitor|rea(seEdge|teFacet(Ctx)?))|T(o(Subdiv|rus)|r(iangulate|ansfer))|In(stallAction|fo)|Options|D(uplicate(Edge|AndConnect)|el(Edge|Vertex|Facet))|U(nite|VSet)|P(yramid|oke|lan(e|arProjection)|r(ism|ojection))|E(ditUV|valuate|xtrude(Edge|Facet))|Qu(eryBlindData|ad)|F(orceUV|lip(UV|Edge))|WedgeFace|L(istComponentConversion|ayoutUV)|A(utoProjection|ppend(Vertex|FacetCtx)?|verage(Normal|Vertex)))|eVectorConstraint))|utenv|er(cent|formanceOptions)|fxstrokes|wd|l(uginInfo|a(y(b(last|ackOptions))?|n(e|arSrf)))|a(steKey|ne(l(History|Configuration)?|Layout)|thAnimation|irBlend|use|lettePort|r(ti(cle(RenderInfo|Instancer|Exists)?|tion)|ent(Constraint)?|am(Dim(Context|ension)|Locator)))|r(int|o(j(ect(ion(Manip|Context)|Curve|Tangent)|FileViewer)|pMo(dCtx|ve)|gress(Bar|Window)|mptDialog)|eloadRefEd))|e(n(codeString|d(sWith |String )|v|ableDevice)|dit(RenderLayer(Globals|Members)|or(Template)?|DisplayLayer(Globals|Members)|AttrLimits )|v(ent|al(Deferred|Echo)?)|quivalent(Tol | )|ffector|r(f|ror)|x(clusiveLightCheckBox|t(end(Surface|Curve)|rude)|ists|p(ortComposerCurves |ression(EditorListen)?)?|ec(uteForEachObject )?|actWorldBoundingBox)|mit(ter)?)|v(i(sor|ew(Set|HeadOn|2dToolCtx|C(lipPlane|amera)|Place|Fit|LookAt))|o(lumeAxis|rtex)|e(ctorize|rifyCmd )|alidateShelfName )|key(Tangent|frame(Region(MoveKeyCtx|S(caleKeyCtx|e(tKeyCtx|lectKeyCtx))|CurrentTimeCtx|TrackCtx|InsertKeyCtx|D(irectKeyCtx|ollyCtx))|Stats|Outliner)?)|qu(it|erySubdiv)|f(c(heck|lose)|i(nd(RelatedSkinCluster |MenuItem |er|Keyframe|AllIntersections )|tBspline|l(ter(StudioImport|Curve|Expand)?|e(BrowserDialog|test|Info|Dialog|Extension )?|letCurve)|rstParentOf )|o(ntDialog|pen|rmLayout)|print|eof|flush|write|l(o(or|w|at(S(crollBar|lider(Grp|ButtonGrp|2)?)|Eq |Field(Grp)?))|u(shUndo|id(CacheInfo|Emitter|VoxelInfo))|exor)|r(omNativePath |e(eFormFillet|wind|ad)|ameLayout)|get(word|line)|mod)|w(hatIs|i(ndow(Pref)?|re(Context)?)|orkspace|ebBrowser(Prefs)?|a(itCursor|rning)|ri(nkle(Context)?|teTake))|l(s(T(hroughFilter|ype )|UI)?|i(st(Relatives|MenuAnnotation |Sets|History|NodeTypes|C(onnections|ameras)|Transforms |InputDevice(s|Buttons|Axes)|erEditor|DeviceAttachments|Unselected |A(nimatable|ttr))|n(step|eIntersection )|ght(link|List(Panel|Editor)?))|o(ckNode|okThru|ft|ad(NewShelf |P(lugin|refObjects)|Fluid)|g)|a(ssoContext|y(out|er(Button|ed(ShaderPort|TexturePort)))|ttice(DeformKeyCtx)?|unch(ImageEditor)?))|a(ssign(Command|InputDevice)|n(notate|im(C(one|urveEditor)|Display|View)|gle(Between)?)|tt(ach(Surface|Curve|DeviceAttr)|r(ibute(Menu|Info|Exists|Query)|NavigationControlGrp|Co(ntrolGrp|lorSliderGrp|mpatibility)|PresetEditWin|EnumOptionMenu(Grp)?|Field(Grp|SliderGrp)))|i(r|mConstraint)|d(d(NewShelfTab|Dynamic|PP|Attr(ibuteEditorNodeHelp)?)|vanceToNextDrivenKey)|uto(Place|Keyframe)|pp(endStringArray|l(y(Take|AttrPreset)|icationName))|ffect(s|edNet)|l(i(as(Attr)?|gn(Surface|C(tx|urve))?)|lViewFit)|r(c(len|Len(DimContext|gthDimension))|t(BuildPaintMenu|Se(tPaintCtx|lectCtx)|3dPaintCtx|UserPaintCtx|PuttyCtx|FluidAttrCtx|Attr(SkinPaintCtx|Ctx|PaintVertexCtx))|rayMapper)|mbientLight|b(s|out))|r(igid(Body|Solver)|o(t(at(ionInterpolation|e))?|otOf |undConstantRadius|w(ColumnLayout|Layout)|ll(Ctx)?)|un(up|TimeCommand)|e(s(olutionNode|et(Tool|AE )|ampleFluid)|hash|n(der(GlobalsNode|Manip|ThumbnailUpdate|Info|er|Partition|QualityNode|Window(SelectContext|Editor)|LayerButton)?|ame(SelectionList |UI|Attr)?)|cord(Device|Attr)|target|order(Deformers)?|do|v(olve|erse(Surface|Curve))|quires|f(ineSubdivSelectionList|erence(Edit|Query)?|resh(AE )?)|loadImage|adTake|root|move(MultiInstance|Joint)|build(Surface|Curve))|a(n(d(state|omizeFollicles )?|geControl)|d(i(o(MenuItemCollection|Button(Grp)?|Collection)|al)|_to_deg)|mpColorPort)|gb_to_hsv)|g(o(toBindPose |al)|e(t(M(odifiers|ayaPanelTypes )|Classification|InputDeviceRange|pid|env|DefaultBrush|Pa(nel|rticleAttr)|F(ileList|luidAttr)|A(ttr|pplicationVersionAsFloat ))|ometryConstraint)|l(Render(Editor)?|obalStitch)|a(uss|mma)|r(id(Layout)?|oup(ObjectsByName )?|a(dientControl(NoAttr)?|ph(SelectContext|TrackCtx|DollyCtx)|vity|bColor))|match)|x(pmPicker|form|bmLangPathList )|m(i(n(imizeApp)?|rrorJoint)|o(del(CurrentTimeCtx|Panel|Editor)|use|v(In|e(IKtoFK |VertexAlongDirection|KeyCtx)?|Out))|u(te|ltiProfileBirailSurface)|e(ssageLine|nu(BarLayout|Item(ToShelf )?|Editor)?|mory)|a(nip(Rotate(Context|LimitsCtx)|Move(Context|LimitsCtx)|Scale(Context|LimitsCtx)|Options)|tch|ke(Roll |SingleSurface|TubeOn |Identity|Paintable|bot|Live)|rker|g|x))|b(in(Membership|d(Skin|Pose))|o(neLattice|undary|x(ZoomCtx|DollyCtx))|u(tton(Manip)?|ild(BookmarkMenu|KeyframeMenu)|fferCurve)|e(ssel|vel(Plus)?)|l(indDataType|end(Shape(Panel|Editor)?|2|TwoAttr))|a(sename(Ex | )|tchRender|ke(Results|Simulation|Clip|PartialHistory|FluidShading )))))\\b' }, - { caseInsensitive: true, - token: 'support.constant.mel', - regex: '\\b(s(h(ellTessellate|a(d(ing(Map|Engine)|erGlow)|pe))|n(ow|apshot(Shape)?)|c(ulpt|aleConstraint|ript)|t(yleCurve|itch(Srf|AsNurbsShell)|u(cco|dioClearCoat)|encil|roke(Globals)?)|i(ngleShadingSwitch|mpleVolumeShader)|o(ftMod(Manip|Handle)?|lidFractal)|u(rface(Sha(der|pe)|Info|EdManip|VarGroup|Luminance)|b(Surface|d(M(odifier(UV|World)?|ap(SewMove|Cut|pingManip))|B(lindData|ase)|iv(ReverseFaces|SurfaceVarGroup|Co(llapse|mponentId)|To(Nurbs|Poly))?|HierBlind|CleanTopology|Tweak(UV)?|P(lanarProj|rojManip)|LayoutUV|A(ddTopology|utoProj))|Curve))|p(BirailSrf|otLight|ring)|e(tRange|lectionListOperator)|k(inCluster|etchPlane)|quareSrf|ampler(Info)?|m(ooth(Curve|TangentSrf)|ear))|h(svToRgb|yper(GraphInfo|View|Layout)|ik(Solver|Handle|Effector)|oldMatrix|eightField|w(Re(nderGlobals|flectionMap)|Shader)|a(ir(System|Constraint|TubeShader)|rd(enPoint|wareRenderGlobals)))|n(o(n(ExtendedLightShapeNode|Linear|AmbientLightShapeNode)|ise|rmalConstraint)|urbs(Surface|Curve|T(oSubdiv(Proc)?|essellate)|DimShape)|e(twork|wtonField))|c(h(o(ice|oser)|ecker|aracter(Map|Offset)?)|o(n(straint|tr(olPoint|ast)|dition)|py(ColorSet|UVSet))|urve(Range|Shape|Normalizer(Linear|Angle)?|In(tersect|fo)|VarGroup|From(Mesh(CoM|Edge)?|Su(rface(Bnd|CoS|Iso)?|bdiv(Edge|Face)?)))|l(ip(Scheduler|Library)|o(se(stPointOnSurface|Surface|Curve)|th|ud)|uster(Handle)?|amp)|amera(View)?|r(eate(BPManip|ColorSet|UVSet)|ater))|t(ime(ToUnitConversion|Function)?|oo(nLineAttributes|lDrawManip)|urbulenceField|ex(BaseDeformManip|ture(BakeSet|2d|ToGeom|3d|Env)|SmudgeUVManip|LatticeDeformManip)|weak|angentConstraint|r(i(pleShadingSwitch|m(WithBoundaries)?)|ansform(Geometry)?))|i(n(s(tancer|ertKnot(Surface|Curve))|tersectSurface)|k(RPsolver|MCsolver|S(ystem|olver|Csolver|plineSolver)|Handle|PASolver|Effector)|m(plicit(Box|Sphere|Cone)|agePlane))|o(cean(Shader)?|pticalFX|ffset(Surface|C(os|urve))|ldBlindDataBase|rient(Constraint|ationMarker)|bject(RenderFilter|MultiFilter|BinFilter|S(criptFilter|et)|NameFilter|TypeFilter|Filter|AttrFilter))|d(yn(Globals|Base)|i(s(tance(Between|DimShape)|pla(yLayer(Manager)?|cementShader)|kCache)|rect(ionalLight|edDisc)|mensionShape)|o(ubleShadingSwitch|f)|pBirailSrf|e(tach(Surface|Curve)|pendNode|f(orm(Bend|S(ine|quash)|Twist|ableShape|F(unc|lare)|Wave)|ault(RenderUtilityList|ShaderList|TextureList|LightList))|lete(Co(lorSet|mponent)|UVSet))|ag(Node|Pose)|r(opoffLocator|agField))|u(seBackground|n(trim|i(t(Conversion|ToTimeConversion)|formField)|known(Transform|Dag)?)|vChooser)|j(iggle|oint(Cluster|Ffd|Lattice)?)|p(sdFileTex|hong(E)?|o(s(tProcessList|itionMarker)|int(MatrixMult|Constraint|On(SurfaceInfo|CurveInfo)|Emitter|Light)|l(y(Reduce|M(irror|o(difier(UV|World)?|ve(UV|Edge|Vertex|Face(tUV)?))|erge(UV|Edge|Vert|Face)|ap(Sew(Move)?|Cut|Del))|B(oolOp|evel|lindData|ase)|S(traightenUVBorder|oftEdge|ubd(Edge|Face)|p(h(ere|Proj)|lit(Ring|Edge|Vert)?)|e(parate|wEdge)|mooth(Proxy|Face)?)|Normal(izeUV|PerVertex)?|C(hipOff|yl(inder|Proj)|o(ne|pyUV|l(orPerVertex|lapse(Edge|F)))|u(t(Manip(Container)?)?|be)|loseBorder|rea(seEdge|t(or|eFace)))|T(o(Subdiv|rus)|weak(UV)?|r(iangulate|ansfer))|OptUvs|D(uplicateEdge|el(Edge|Vertex|Facet))|Unite|P(yramid|oke(Manip)?|lan(e|arProj)|r(i(sm|mitive)|oj))|Extrude(Edge|Vertex|Face)|VertexNormalManip|Quad|Flip(UV|Edge)|WedgeFace|LayoutUV|A(utoProj|ppend(Vertex)?|verageVertex))|eVectorConstraint))|fx(Geometry|Hair|Toon)|l(usMinusAverage|a(n(e|arTrimSurface)|ce(2dTexture|3dTexture)))|a(ssMatrix|irBlend|r(ti(cle(SamplerInfo|C(olorMapper|loud)|TranspMapper|IncandMapper|AgeMapper)?|tion)|ent(Constraint|Tessellate)|amDimension))|r(imitive|o(ject(ion|Curve|Tangent)|xyManager)))|e(n(tity|v(Ball|ironmentFog|S(phere|ky)|C(hrome|ube)|Fog))|x(t(end(Surface|Curve)|rude)|p(lodeNurbsShell|ression)))|v(iewManip|o(lume(Shader|Noise|Fog|Light|AxisField)|rtexField)|e(ctor(RenderGlobals|Product)|rtexBakeSet))|quadShadingSwitch|f(i(tBspline|eld|l(ter(Resample|Simplify|ClosestSample|Euler)?|e|letCurve))|o(urByFourMatrix|llicle)|urPointOn(MeshInfo|Subd)|f(BlendSrf(Obsolete)?|d|FilletSrf)|l(ow|uid(S(hape|liceManip)|Texture(2D|3D)|Emitter)|exorShape)|ra(ctal|meCache))|w(tAddMatrix|ire|ood|eightGeometryFilter|ater|rap)|l(ight(Info|Fog|Li(st|nker))?|o(cator|okAt|d(Group|Thresholds)|ft)|uminance|ea(stSquaresModifier|ther)|a(yered(Shader|Texture)|ttice|mbert))|a(n(notationShape|i(sotropic|m(Blend(InOut)?|C(urve(T(T|U|L|A)|U(T|U|L|A))?|lip)))|gleBetween)|tt(ach(Surface|Curve)|rHierarchyTest)|i(rField|mConstraint)|dd(Matrix|DoubleLinear)|udio|vg(SurfacePoints|NurbsSurfacePoints|Curves)|lign(Manip|Surface|Curve)|r(cLengthDimension|tAttrPaintTest|eaLight|rayMapper)|mbientLight|bstractBase(NurbsConversion|Create))|r(igid(Body|Solver|Constraint)|o(ck|undConstantRadius)|e(s(olution|ultCurve(TimeTo(Time|Unitless|Linear|Angular))?)|nder(Rect|Globals(List)?|Box|Sphere|Cone|Quality|L(ight|ayer(Manager)?))|cord|v(olve(dPrimitive)?|erse(Surface|Curve)?)|f(erence|lect)|map(Hsv|Color|Value)|build(Surface|Curve))|a(dialField|mp(Shader)?)|gbToHsv|bfSrf)|g(uide|eo(Connect(or|able)|metry(Shape|Constraint|VarGroup|Filter))|lobal(Stitch|CacheControl)|ammaCorrect|r(id|oup(Id|Parts)|a(nite|vityField)))|Fur(Globals|Description|Feedback|Attractors)|xformManip|m(o(tionPath|untain|vie)|u(te|lt(Matrix|i(plyDivide|listerLight)|DoubleLinear))|pBirailSrf|e(sh(VarGroup)?|ntalray(Texture|IblShape))|a(terialInfo|ke(Group|Nurb(sSquare|Sphere|C(ylinder|ircle|one|ube)|Torus|Plane)|CircularArc|T(hreePointCircularArc|extCurves|woPointCircularArc))|rble))|b(irailSrf|o(neLattice|olean|undary(Base)?)|u(lge|mp(2d|3d))|evel(Plus)?|l(in(n|dDataTemplate)|end(Shape|Color(s|Sets)|TwoAttr|Device|Weighted)?)|a(se(GeometryVarGroup|ShadingSwitch|Lattice)|keSet)|r(ownian|ush)))\\b' }, - { caseInsensitive: true, - token: 'keyword.control.mel', - regex: '\\b(if|in|else|for|while|break|continue|case|default|do|switch|return|switch|case|source|catch|alias)\\b' }, - { token: 'keyword.other.mel', regex: '\\b(global)\\b' }, - { caseInsensitive: true, - token: 'constant.language.mel', - regex: '\\b(null|undefined)\\b' }, - { token: 'constant.numeric.mel', - regex: '\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f)?\\b' }, - { token: 'punctuation.definition.string.begin.mel', - regex: '"', - push: - [ { token: 'constant.character.escape.mel', regex: '\\\\.' }, - { token: 'punctuation.definition.string.end.mel', - regex: '"', - next: 'pop' }, - { defaultToken: 'string.quoted.double.mel' } ] }, - - { token: [ 'variable.other.mel', 'punctuation.definition.variable.mel' ], - regex: '(\\$)([a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*?\\b)' }, - - { token: 'punctuation.definition.string.begin.mel', - regex: '\'', - push: - [ { token: 'constant.character.escape.mel', regex: '\\\\.' }, - { token: 'punctuation.definition.string.end.mel', - regex: '\'', - next: 'pop' }, - { defaultToken: 'string.quoted.single.mel' } ] }, - - { token: 'constant.language.mel', - regex: '\\b(false|true|yes|no|on|off)\\b' }, - - { token: 'punctuation.definition.comment.mel', - regex: '/\\*', - push: - [ { token: 'punctuation.definition.comment.mel', - regex: '\\*/', - next: 'pop' }, - { defaultToken: 'comment.block.mel' } ] }, - - { token: [ 'comment.line.double-slash.mel', 'punctuation.definition.comment.mel' ], - regex: '(//)(.*$\\n?)' }, - - { caseInsensitive: true, - token: 'keyword.operator.mel', - regex: '\\b(instanceof)\\b' }, - { token: 'keyword.operator.symbolic.mel', - regex: '[-\\!\\%\\&\\*\\+\\=\\/\\?\\:]' }, - - { token: [ 'meta.preprocessor.mel', 'punctuation.definition.preprocessor.mel' ], - regex: '(^[ \\t]*)((?:#)[a-zA-Z]+)' }, - - { token: [ 'meta.function.mel', 'keyword.other.mel', 'storage.type.mel', 'entity.name.function.mel', 'punctuation.section.function.mel' ], - regex: '((?:global\\s*)?proc)\\s*(\\w+\\s*\\[?\\]?\\s+|\\s+)([A-Za-z_][A-Za-z0-9_\\.]*)(\\s*(\\())', - push: - [ { include: '$self' }, - { token: 'punctuation.section.function.mel', - regex: '\\)', - next: 'pop' }, - { defaultToken: 'meta.function.mel' } ] } - - ] } - - this.normalizeRules(); -}; - -oop.inherits(MELHighlightRules, TextHighlightRules); - -exports.MELHighlightRules = MELHighlightRules; -}); \ No newline at end of file diff --git a/lib/ace/mode/mushcode.js b/lib/ace/mode/mushcode.js deleted file mode 100644 index ec145b6e..00000000 --- a/lib/ace/mode/mushcode.js +++ /dev/null @@ -1,116 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var MushCodeRules = require("./mushcode_highlight_rules").MushCodeRules; -var PythonFoldMode = require("./folding/pythonic").FoldMode; -var Range = require("../range").Range; - -var Mode = function() { - this.HighlightRules = MushCodeRules; - this.foldingRules = new PythonFoldMode("\\:"); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "#"; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start") { - var match = line.match(/^.*[\{\(\[\:]\s*$/); - 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.getTokenizer().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)); - }; - - this.$id = "ace/mode/mushcode"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); - - - diff --git a/lib/ace/mode/mushcode_highlight_rules.js b/lib/ace/mode/mushcode_highlight_rules.js deleted file mode 100644 index e3197bee..00000000 --- a/lib/ace/mode/mushcode_highlight_rules.js +++ /dev/null @@ -1,569 +0,0 @@ -/* - * MUSHCodeMode - */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var MushCodeRules = function() { - - - var keywords = ( - "@if|"+ - "@ifelse|"+ - "@switch|"+ - "@halt|"+ - "@dolist|"+ - "@create|"+ - "@scent|"+ - "@sound|"+ - "@touch|"+ - "@ataste|"+ - "@osound|"+ - "@ahear|"+ - "@aahear|"+ - "@amhear|"+ - "@otouch|"+ - "@otaste|"+ - "@drop|"+ - "@odrop|"+ - "@adrop|"+ - "@dropfail|"+ - "@odropfail|"+ - "@smell|"+ - "@oemit|"+ - "@emit|"+ - "@pemit|"+ - "@parent|"+ - "@clone|"+ - "@taste|"+ - "whisper|"+ - "page|"+ - "say|"+ - "pose|"+ - "semipose|"+ - "teach|"+ - "touch|"+ - "taste|"+ - "smell|"+ - "listen|"+ - "look|"+ - "move|"+ - "go|"+ - "home|"+ - "follow|"+ - "unfollow|"+ - "desert|"+ - "dismiss|"+ - "@tel" - ); - - var builtinConstants = ( - "=#0" - ); - - var builtinFunctions = ( - "default|"+ - "edefault|"+ - "eval|"+ - "get_eval|"+ - "get|"+ - "grep|"+ - "grepi|"+ - "hasattr|"+ - "hasattrp|"+ - "hasattrval|"+ - "hasattrpval|"+ - "lattr|"+ - "nattr|"+ - "poss|"+ - "udefault|"+ - "ufun|"+ - "u|"+ - "v|"+ - "uldefault|"+ - "xget|"+ - "zfun|"+ - "band|"+ - "bnand|"+ - "bnot|"+ - "bor|"+ - "bxor|"+ - "shl|"+ - "shr|"+ - "and|"+ - "cand|"+ - "cor|"+ - "eq|"+ - "gt|"+ - "gte|"+ - "lt|"+ - "lte|"+ - "nand|"+ - "neq|"+ - "nor|"+ - "not|"+ - "or|"+ - "t|"+ - "xor|"+ - "con|"+ - "entrances|"+ - "exit|"+ - "followers|"+ - "home|"+ - "lcon|"+ - "lexits|"+ - "loc|"+ - "locate|"+ - "lparent|"+ - "lsearch|"+ - "next|"+ - "num|"+ - "owner|"+ - "parent|"+ - "pmatch|"+ - "rloc|"+ - "rnum|"+ - "room|"+ - "where|"+ - "zone|"+ - "worn|"+ - "held|"+ - "carried|"+ - "acos|"+ - "asin|"+ - "atan|"+ - "ceil|"+ - "cos|"+ - "e|"+ - "exp|"+ - "fdiv|"+ - "fmod|"+ - "floor|"+ - "log|"+ - "ln|"+ - "pi|"+ - "power|"+ - "round|"+ - "sin|"+ - "sqrt|"+ - "tan|"+ - "aposs|"+ - "andflags|"+ - "conn|"+ - "commandssent|"+ - "controls|"+ - "doing|"+ - "elock|"+ - "findable|"+ - "flags|"+ - "fullname|"+ - "hasflag|"+ - "haspower|"+ - "hastype|"+ - "hidden|"+ - "idle|"+ - "isbaker|"+ - "lock|"+ - "lstats|"+ - "money|"+ - "who|"+ - "name|"+ - "nearby|"+ - "obj|"+ - "objflags|"+ - "photo|"+ - "poll|"+ - "powers|"+ - "pendingtext|"+ - "receivedtext|"+ - "restarts|"+ - "restarttime|"+ - "subj|"+ - "shortestpath|"+ - "tmoney|"+ - "type|"+ - "visible|"+ - "cat|"+ - "element|"+ - "elements|"+ - "extract|"+ - "filter|"+ - "filterbool|"+ - "first|"+ - "foreach|"+ - "fold|"+ - "grab|"+ - "graball|"+ - "index|"+ - "insert|"+ - "itemize|"+ - "items|"+ - "iter|"+ - "last|"+ - "ldelete|"+ - "map|"+ - "match|"+ - "matchall|"+ - "member|"+ - "mix|"+ - "munge|"+ - "pick|"+ - "remove|"+ - "replace|"+ - "rest|"+ - "revwords|"+ - "setdiff|"+ - "setinter|"+ - "setunion|"+ - "shuffle|"+ - "sort|"+ - "sortby|"+ - "splice|"+ - "step|"+ - "wordpos|"+ - "words|"+ - "add|"+ - "lmath|"+ - "max|"+ - "mean|"+ - "median|"+ - "min|"+ - "mul|"+ - "percent|"+ - "sign|"+ - "stddev|"+ - "sub|"+ - "val|"+ - "bound|"+ - "abs|"+ - "inc|"+ - "dec|"+ - "dist2d|"+ - "dist3d|"+ - "div|"+ - "floordiv|"+ - "mod|"+ - "modulo|"+ - "remainder|"+ - "vadd|"+ - "vdim|"+ - "vdot|"+ - "vmag|"+ - "vmax|"+ - "vmin|"+ - "vmul|"+ - "vsub|"+ - "vunit|"+ - "regedit|"+ - "regeditall|"+ - "regeditalli|"+ - "regediti|"+ - "regmatch|"+ - "regmatchi|"+ - "regrab|"+ - "regraball|"+ - "regraballi|"+ - "regrabi|"+ - "regrep|"+ - "regrepi|"+ - "after|"+ - "alphamin|"+ - "alphamax|"+ - "art|"+ - "before|"+ - "brackets|"+ - "capstr|"+ - "case|"+ - "caseall|"+ - "center|"+ - "containsfansi|"+ - "comp|"+ - "decompose|"+ - "decrypt|"+ - "delete|"+ - "edit|"+ - "encrypt|"+ - "escape|"+ - "if|"+ - "ifelse|"+ - "lcstr|"+ - "left|"+ - "lit|"+ - "ljust|"+ - "merge|"+ - "mid|"+ - "ostrlen|"+ - "pos|"+ - "repeat|"+ - "reverse|"+ - "right|"+ - "rjust|"+ - "scramble|"+ - "secure|"+ - "space|"+ - "spellnum|"+ - "squish|"+ - "strcat|"+ - "strmatch|"+ - "strinsert|"+ - "stripansi|"+ - "stripfansi|"+ - "strlen|"+ - "switch|"+ - "switchall|"+ - "table|"+ - "tr|"+ - "trim|"+ - "ucstr|"+ - "unsafe|"+ - "wrap|"+ - "ctitle|"+ - "cwho|"+ - "channels|"+ - "clock|"+ - "cflags|"+ - "ilev|"+ - "itext|"+ - "inum|"+ - "convsecs|"+ - "convutcsecs|"+ - "convtime|"+ - "ctime|"+ - "etimefmt|"+ - "isdaylight|"+ - "mtime|"+ - "secs|"+ - "msecs|"+ - "starttime|"+ - "time|"+ - "timefmt|"+ - "timestring|"+ - "utctime|"+ - "atrlock|"+ - "clone|"+ - "create|"+ - "cook|"+ - "dig|"+ - "emit|"+ - "lemit|"+ - "link|"+ - "oemit|"+ - "open|"+ - "pemit|"+ - "remit|"+ - "set|"+ - "tel|"+ - "wipe|"+ - "zemit|"+ - "fbcreate|"+ - "fbdestroy|"+ - "fbwrite|"+ - "fbclear|"+ - "fbcopy|"+ - "fbcopyto|"+ - "fbclip|"+ - "fbdump|"+ - "fbflush|"+ - "fbhset|"+ - "fblist|"+ - "fbstats|"+ - "qentries|"+ - "qentry|"+ - "play|"+ - "ansi|"+ - "break|"+ - "c|"+ - "asc|"+ - "die|"+ - "isdbref|"+ - "isint|"+ - "isnum|"+ - "isletters|"+ - "linecoords|"+ - "localize|"+ - "lnum|"+ - "nameshort|"+ - "null|"+ - "objeval|"+ - "r|"+ - "rand|"+ - "s|"+ - "setq|"+ - "setr|"+ - "soundex|"+ - "soundslike|"+ - "valid|"+ - "vchart|"+ - "vchart2|"+ - "vlabel|"+ - "@@|"+ - "bakerdays|"+ - "bodybuild|"+ - "box|"+ - "capall|"+ - "catalog|"+ - "children|"+ - "ctrailer|"+ - "darttime|"+ - "debt|"+ - "detailbar|"+ - "exploredroom|"+ - "fansitoansi|"+ - "fansitoxansi|"+ - "fullbar|"+ - "halfbar|"+ - "isdarted|"+ - "isnewbie|"+ - "isword|"+ - "lambda|"+ - "lobjects|"+ - "lplayers|"+ - "lthings|"+ - "lvexits|"+ - "lvobjects|"+ - "lvplayers|"+ - "lvthings|"+ - "newswrap|"+ - "numsuffix|"+ - "playerson|"+ - "playersthisweek|"+ - "randomad|"+ - "randword|"+ - "realrandword|"+ - "replacechr|"+ - "second|"+ - "splitamount|"+ - "strlenall|"+ - "text|"+ - "third|"+ - "tofansi|"+ - "totalac|"+ - "unique|"+ - "getaddressroom|"+ - "listpropertycomm|"+ - "listpropertyres|"+ - "lotowner|"+ - "lotrating|"+ - "lotratingcount|"+ - "lotvalue|"+ - "boughtproduct|"+ - "companyabb|"+ - "companyicon|"+ - "companylist|"+ - "companyname|"+ - "companyowners|"+ - "companyvalue|"+ - "employees|"+ - "invested|"+ - "productlist|"+ - "productname|"+ - "productowners|"+ - "productrating|"+ - "productratingcount|"+ - "productsoldat|"+ - "producttype|"+ - "ratedproduct|"+ - "soldproduct|"+ - "topproducts|"+ - "totalspentonproduct|"+ - "totalstock|"+ - "transfermoney|"+ - "uniquebuyercount|"+ - "uniqueproductsbought|"+ - "validcompany|"+ - "deletepicture|"+ - "fbsave|"+ - "getpicturesecurity|"+ - "haspicture|"+ - "listpictures|"+ - "picturesize|"+ - "replacecolor|"+ - "rgbtocolor|"+ - "savepicture|"+ - "setpicturesecurity|"+ - "showpicture|"+ - "piechart|"+ - "piechartlabel|"+ - "createmaze|"+ - "drawmaze|"+ - "drawwireframe" - ); - var keywordMapper = this.createKeywordMapper({ - "invalid.deprecated": "debugger", - "support.function": builtinFunctions, - "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 : "variable", // mush substitution register - regex : "%[0-9]{1}" - }, - { - token : "variable", // mush substitution register - regex : "%q[0-9A-Za-z]{1}" - }, - { - token : "variable", // mush special character register - regex : "%[a-zA-Z]{1}" - }, - { - token: "variable.language", - regex: "%[a-z0-9-_]+" - }, - { - 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+" - } ] - }; -}; - -oop.inherits(MushCodeRules, TextHighlightRules); - -exports.MushCodeRules = MushCodeRules; -}); diff --git a/lib/ace/mode/mysql.js b/lib/ace/mode/mysql.js deleted file mode 100644 index d0f7c123..00000000 --- a/lib/ace/mode/mysql.js +++ /dev/null @@ -1,51 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -var oop = require("../lib/oop"); -var TextMode = require("../mode/text").Mode; -var MysqlHighlightRules = require("./mysql_highlight_rules").MysqlHighlightRules; -var Range = require("../range").Range; - -var Mode = function() { - this.HighlightRules = MysqlHighlightRules; -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = ["--", "#"]; // todo space - this.blockComment = {start: "/*", end: "*/"}; - - this.$id = "ace/mode/mysql"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); diff --git a/lib/ace/mode/mysql_highlight_rules.js b/lib/ace/mode/mysql_highlight_rules.js deleted file mode 100644 index 7f428bc8..00000000 --- a/lib/ace/mode/mysql_highlight_rules.js +++ /dev/null @@ -1,122 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(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 MysqlHighlightRules = function() { - - var mySqlKeywords = /*sql*/ "alter|and|as|asc|between|count|create|delete|desc|distinct|drop|from|having|in|insert|into|is|join|like|not|on|or|order|select|set|table|union|update|values|where" - /*mysql*/ + "|accessible|action|add|after|algorithm|all|analyze|asensitive|at|authors|auto_increment|autocommit|avg|avg_row_length|before|binary|binlog|both|btree|cache|call|cascade|cascaded|case|catalog_name|chain|change|changed|character|check|checkpoint|checksum|class_origin|client_statistics|close|coalesce|code|collate|collation|collations|column|columns|comment|commit|committed|completion|concurrent|condition|connection|consistent|constraint|contains|continue|contributors|convert|cross|current_date|current_time|current_timestamp|current_user|cursor|data|database|databases|day_hour|day_microsecond|day_minute|day_second|deallocate|dec|declare|default|delay_key_write|delayed|delimiter|des_key_file|describe|deterministic|dev_pop|dev_samp|deviance|directory|disable|discard|distinctrow|div|dual|dumpfile|each|elseif|enable|enclosed|end|ends|engine|engines|enum|errors|escape|escaped|even|event|events|every|execute|exists|exit|explain|extended|fast|fetch|field|fields|first|flush|for|force|foreign|found_rows|full|fulltext|function|general|global|grant|grants|group|groupby_concat|handler|hash|help|high_priority|hosts|hour_microsecond|hour_minute|hour_second|if|ignore|ignore_server_ids|import|index|index_statistics|infile|inner|innodb|inout|insensitive|insert_method|install|interval|invoker|isolation|iterate|key|keys|kill|language|last|leading|leave|left|level|limit|linear|lines|list|load|local|localtime|localtimestamp|lock|logs|low_priority|master|master_heartbeat_period|master_ssl_verify_server_cert|masters|match|max|max_rows|maxvalue|message_text|middleint|migrate|min|min_rows|minute_microsecond|minute_second|mod|mode|modifies|modify|mutex|mysql_errno|natural|next|no|no_write_to_binlog|offline|offset|one|online|open|optimize|option|optionally|out|outer|outfile|pack_keys|parser|partition|partitions|password|phase|plugin|plugins|prepare|preserve|prev|primary|privileges|procedure|processlist|profile|profiles|purge|query|quick|range|read|read_write|reads|real|rebuild|recover|references|regexp|relaylog|release|remove|rename|reorganize|repair|repeatable|replace|require|resignal|restrict|resume|return|returns|revoke|right|rlike|rollback|rollup|row|row_format|rtree|savepoint|schedule|schema|schema_name|schemas|second_microsecond|security|sensitive|separator|serializable|server|session|share|show|signal|slave|slow|smallint|snapshot|soname|spatial|specific|sql|sql_big_result|sql_buffer_result|sql_cache|sql_calc_found_rows|sql_no_cache|sql_small_result|sqlexception|sqlstate|sqlwarning|ssl|start|starting|starts|status|std|stddev|stddev_pop|stddev_samp|storage|straight_join|subclass_origin|sum|suspend|table_name|table_statistics|tables|tablespace|temporary|terminated|to|trailing|transaction|trigger|triggers|truncate|uncommitted|undo|uninstall|unique|unlock|upgrade|usage|use|use_frm|user|user_resources|user_statistics|using|utc_date|utc_time|utc_timestamp|value|variables|varying|view|views|warnings|when|while|with|work|write|xa|xor|year_month|zerofill|begin|do|then|else|loop|repeat"; - var builtins = "by|bool|boolean|bit|blob|decimal|double|enum|float|long|longblob|longtext|medium|mediumblob|mediumint|mediumtext|time|timestamp|tinyblob|tinyint|tinytext|text|bigint|int|int1|int2|int3|int4|int8|integer|float|float4|float8|double|char|varbinary|varchar|varcharacter|precision|date|datetime|year|unsigned|signed|numeric" - var variable = "charset|clear|connect|edit|ego|exit|go|help|nopager|notee|nowarning|pager|print|prompt|quit|rehash|source|status|system|tee" - - //operatorChars: /^[*+\-%<>!=&|^]/, - - var keywordMapper = this.createKeywordMapper({ - "support.function": builtins, - "keyword": mySqlKeywords, - "constant": "false|true|null|unknown|date|time|timestamp|ODBCdotTable|zerolessFloat", - "variable.language": variable - }, "identifier", true); - - - function string(rule) { - var start = rule.start; - var escapeSeq = rule.escape; - return { - token: "string.start", - regex: start, - next: [ - {token: "constant.language.escape", regex: escapeSeq}, - {token: "string.end", next: "start", regex: start}, - {defaultToken: "string"} - ] - }; - } - - this.$rules = { - "start" : [ { - token : "comment", regex : "(?:-- |#).*$" - }, - string({start: '"', escape: /\\[0'"bnrtZ\\%_]?/}), - string({start: "'", escape: /\\[0'"bnrtZ\\%_]?/}), - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : /\/\*/, - next : "comment" - }, { - token : "constant.numeric", // hex - regex : /0[xX][0-9a-fA-F]+|[xX]'[0-9a-fA-F]+'|0[bB][01]+|[bB]'[01]+'/ - }, { - token : "constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" - }, { - token : keywordMapper, - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "constant.class", - regex : "@@?[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, { - token : "constant.buildin", - regex : "`[^`]*`" - }, { - token : "keyword.operator", - regex : "\\+|\\-|\\/|\\/\\/|%|<@>|@>|<@|&|\\^|~|<|>|<=|=>|==|!=|<>|=" - }, { - token : "paren.lparen", - regex : "[\\(]" - }, { - token : "paren.rparen", - regex : "[\\)]" - }, { - token : "text", - regex : "\\s+" - } ], - "comment" : [ - {token : "comment", regex : "\\*\\/", next : "start"}, - {defaultToken : "comment"} - ] - }; - - this.embedRules(DocCommentHighlightRules, "doc-", [ DocCommentHighlightRules.getEndRule("start") ]); - this.normalizeRules(); -}; - -oop.inherits(MysqlHighlightRules, TextHighlightRules); - -exports.MysqlHighlightRules = MysqlHighlightRules; -}); - diff --git a/lib/ace/mode/nim.js b/lib/ace/mode/nim.js deleted file mode 100644 index cbf48ef2..00000000 --- a/lib/ace/mode/nim.js +++ /dev/null @@ -1,113 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var NimHighlightRules = require("./nim_highlight_rules").NimHighlightRules; -var NimFoldMode = require("./folding/pythonic").FoldMode; -var Range = require("../range").Range; - -var Mode = function() { - this.HighlightRules = NimHighlightRules; - this.foldingRules = new NimFoldMode("\\:|="); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = "#"; - - this.getNextLineIndent = function(state, line, tab) { - var indent = this.$getIndent(line); - - var tokenizedLine = this.getTokenizer().getLineTokens(line, state); - var tokens = tokenizedLine.tokens; - - if (tokens.length && tokens[tokens.length-1].type == "comment") { - return indent; - } - - if (state == "start") { - var match = line.match(/^.*[\{\(\[\:=]\s*$/); - if (match) { - indent += tab; - } - } - - return indent; - }; - - var outdents = { - "discard": 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.getTokenizer().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)); - }; - - this.$id = "ace/mode/nim"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); diff --git a/lib/ace/mode/nim_highlight_rules.js b/lib/ace/mode/nim_highlight_rules.js deleted file mode 100644 index e762a636..00000000 --- a/lib/ace/mode/nim_highlight_rules.js +++ /dev/null @@ -1,238 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ -/* - * TODO: nim delimiters - */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var num_suffix = "(\'[Ff]32|\'[Ff]64|\'[IiUu]8|\'[IiUu]16|\'[IiUu]32|\'[IiUu]64)"; - -var NimHighlightRules = function() { - - var keywords = ( - "addr|and|as|asm|atomic|bind|block|break|case|cast|const|continue|" + - "converter|defer|discard|distinct|div|do|elif|else|end|enum|except|" + - "export|finally|for|from|func|generic|if|import|in|include|interface|" + - "is|isnot|iterator|let|macro|method|mixin|mod|nil|not|notin|object|of|" + - "or|out|proc|ptr|raise|ref|return|shl|shr|static|template|try|tuple|" + - "type|using|var|when|while|with|without|xor|yield" - ); - - var builtinConstants = ( - "true|false|nil|NotImplemented|Ellipsis" - ); - - var storageType = ( - "string|seq|array|expr|stmt|typed|untyped|any|auto|bool|cdouble|cfloat|"+ - "cchar|clongdouble|clong|clonglong|cshort|csize|cstring|cstringarray|"+ - "culong|culonglong|cushort|guarded|natural|openarray|ordinal|pointer|"+ - "range|set|shared|static|typedesc|varargs|void" - ); - - var builtinFunctions = ( - "defined|declared|declaredInScope|echo|$" - ); - - //var futureReserved = ""; - var keywordMapper = this.createKeywordMapper({ - "invalid.deprecated": "debugger", - "support.function": builtinFunctions, - //"invalid.illegal": futureReserved, - "constant.language": builtinConstants, - "storage.type" : storageType, - "keyword": keywords - }, "identifier"); - - var strPre = "(?:r|R)?"; - - var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))"; - var octInteger = "(?:0[o]?[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 + ")"; - - var stringEscape = "\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'\"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})"; - - this.$rules = { - "start" : [ { - token : "comment", - regex : "#.*$" - }, { - token : "keyword", - regex : "(proc|method|temdplate|macro|macromethod|converter|func|iterator) ", - next : "qproc_name" - }, { - token : "storage.type", - regex : "(c|cu|u)?int(8|16|32|64)?", - }, { - token : "storage.type", - regex : "(c|cu|u|cs)?char", - }, { - token : "storage.type", - regex : "float(32|64)?", - }, { - token : "docstring", - regex : "##.*$" - }, { - token : "string", // multi line """ string start - regex : strPre + '"{3}', - next : "qqstring3" - }, { - token : "string", // " string - regex : strPre + '"(?=.)', - next : "qqstring" - }, { - token : "string", // multi line ''' string start - regex : strPre + "'{3}", - next : "qstring3" - }, { - token : "backtick", // ` string - regex : strPre + "`(?=.)", - next : "qxstring" - }, { - token : "string", // ' string - regex : strPre + "'(?=.)", - next : "qstring" - }, { - 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+" - } ], - "qqstring3" : [ { - token : "constant.language.escape", - regex : stringEscape - }, { - token : "string", // multi line """ string end - regex : '"{3}', - next : "start" - }, { - defaultToken : "string" - } ], - "qstring3" : [ { - token : "constant.language.escape", - regex : stringEscape - }, { - token : "string", // multi line ''' string end - regex : "'{3}", - next : "start" - }, { - defaultToken : "string" - } ], - "qqstring" : [{ - token : "constant.language.escape", - regex : stringEscape - }, { - token : "string", - regex : "\\\\$", - next : "qqstring" - }, { - token : "string", - regex : '"|$', - next : "start" - }, { - defaultToken: "string" - }], - "qstring" : [{ - token : "constant.language.escape", - regex : stringEscape - }, { - token : "string", - regex : "\\\\$", - next : "qstring" - }, { - token : "string", - regex : "'|$", - next : "start" - }, { - defaultToken: "string" - }], - "qxstring" : [{ - token : "constant.language.escape", - regex : stringEscape - }, { - token : "backtick", - regex : "\\\\$", - next : "qxstring" - }, { - token : "backtick", - regex : "`|$", - next : "start" - }, { - defaultToken: "backtick" - }], - "qproc_name":[{ - token : "proc_name", - regex : "\\w+", - },{ - token : "start_bracket", - regex : "(\\(|=|$)", - next : "start" - }], - }; -}; - -oop.inherits(NimHighlightRules, TextHighlightRules); - -exports.NimHighlightRules = NimHighlightRules; -}); diff --git a/lib/ace/mode/nix.js b/lib/ace/mode/nix.js deleted file mode 100644 index c8e62a08..00000000 --- a/lib/ace/mode/nix.js +++ /dev/null @@ -1,62 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * Zef Hemel - * - * ***** END LICENSE BLOCK ***** */ - -/* - THIS FILE WAS AUTOGENERATED BY mode.tmpl.js -*/ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var CMode = require("./c_cpp").Mode; -var NixHighlightRules = require("./nix_highlight_rules").NixHighlightRules; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - CMode.call(this); - this.HighlightRules = NixHighlightRules; - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, CMode); - -(function() { - this.lineCommentStart = "#"; - this.blockComment = {start: "/*", end: "*/"}; - this.$id = "ace/mode/nix"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); \ No newline at end of file diff --git a/lib/ace/mode/nix_highlight_rules.js b/lib/ace/mode/nix_highlight_rules.js deleted file mode 100644 index 986ccefd..00000000 --- a/lib/ace/mode/nix_highlight_rules.js +++ /dev/null @@ -1,119 +0,0 @@ -define(function(require, exports, module) { - "use strict"; - - var oop = require("../lib/oop"); - var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - - var NixHighlightRules = function() { - - var constantLanguage = "true|false"; - var keywordControl = "with|import|if|else|then|inherit"; - var keywordDeclaration = "let|in|rec"; - - var keywordMapper = this.createKeywordMapper({ - "constant.language.nix": constantLanguage, - "keyword.control.nix": keywordControl, - "keyword.declaration.nix": keywordDeclaration - }, "identifier"); - - this.$rules = { - "start": [{ - token: "comment", - regex: /#.*$/ - }, { - token: "comment", - regex: /\/\*/, - next: "comment" - }, { - token: "constant", - regex: "<[^>]+>" - }, { - regex: "(==|!=|<=?|>=?)", - token: ["keyword.operator.comparison.nix"] - }, { - regex: "((?:[+*/%-]|\\~)=)", - token: ["keyword.operator.assignment.arithmetic.nix"] - }, { - regex: "=", - token: "keyword.operator.assignment.nix" - }, { - token: "string", - regex: "''", - next: "qqdoc" - }, { - token: "string", - regex: "'", - next: "qstring" - }, { - token: "string", - regex: '"', - push: "qqstring" - }, { - token: "constant.numeric", // hex - regex: "0[xX][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" - }, { - regex: "}", - token: function(val, start, stack) { - return stack[1] && stack[1].charAt(0) == "q" ? "constant.language.escape" : "text"; - }, - next: "pop" - }], - "comment": [{ - token: "comment", // closing comment - regex: ".*?\\*\\/", - next: "start" - }, { - token: "comment", // comment spanning whole line - regex: ".+" - }], - "qqdoc": [ - { - token: "constant.language.escape", - regex: /\$\{/, - push: "start" - }, { - token: "string", - regex: "''", - next: "pop" - }, { - defaultToken: "string" - }], - "qqstring": [ - { - token: "constant.language.escape", - regex: /\$\{/, - push: "start" - }, { - token: "string", - regex: '"', - next: "pop" - }, { - defaultToken: "string" - }], - "qstring": [ - { - token: "constant.language.escape", - regex: /\$\{/, - push: "start" - }, { - token: "string", - regex: "'", - next: "pop" - }, { - defaultToken: "string" - }] - }; - - this.normalizeRules(); - }; - - oop.inherits(NixHighlightRules, TextHighlightRules); - - exports.NixHighlightRules = NixHighlightRules; -}); \ No newline at end of file diff --git a/lib/ace/mode/objectivec.js b/lib/ace/mode/objectivec.js deleted file mode 100644 index 99fdb410..00000000 --- a/lib/ace/mode/objectivec.js +++ /dev/null @@ -1,61 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * - * - * ***** END LICENSE BLOCK ***** */ - -/* - THIS FILE WAS AUTOGENERATED BY mode.tmpl.js -*/ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var ObjectiveCHighlightRules = require("./objectivec_highlight_rules").ObjectiveCHighlightRules; -var CStyleFoldMode = require("./folding/cstyle").FoldMode; - -var Mode = function() { - this.HighlightRules = ObjectiveCHighlightRules; - this.foldingRules = new CStyleFoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - this.lineCommentStart = "//"; - this.blockComment = {start: "/*", end: "*/"}; - this.$id = "ace/mode/objectivec"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); \ No newline at end of file diff --git a/lib/ace/mode/objectivec_highlight_rules.js b/lib/ace/mode/objectivec_highlight_rules.js deleted file mode 100644 index 7a581c28..00000000 --- a/lib/ace/mode/objectivec_highlight_rules.js +++ /dev/null @@ -1,331 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; -var C_Highlight_File = require("./c_cpp_highlight_rules"); -var CHighlightRules = C_Highlight_File.c_cppHighlightRules; - -var ObjectiveCHighlightRules = function() { - - // regexp must not have capturing parentheses. Use (?:) instead. - // regexps are ordered -> the first match is used - - var escapedConstRe = "\\\\(?:[abefnrtv'\"?\\\\]|" + - "[0-3]\\d{1,2}|" + - "[4-7]\\d?|" + - "222|" + - "x[a-zA-Z0-9]+)"; - - var specialVariables = [{ - regex: "\\b_cmd\\b", - token: "variable.other.selector.objc" - }, { - regex: "\\b(?:self|super)\\b", - token: "variable.language.objc" - } - ]; - - var cObj = new CHighlightRules(); - var cRules = cObj.getRules(); - - this.$rules = { - "start": [ - { - token : "comment", - regex : "\\/\\/.*$" - }, - DocCommentHighlightRules.getStartRule("doc-start"), - { - token : "comment", // multi line comment - regex : "\\/\\*", - next : "comment" - }, - { - token: [ "storage.type.objc", "punctuation.definition.storage.type.objc", - "entity.name.type.objc", "text", "entity.other.inherited-class.objc" - ], - regex: "(@)(interface|protocol)(?!.+;)(\\s+[A-Za-z_][A-Za-z0-9_]*)(\\s*:\\s*)([A-Za-z]+)" - }, - { - token: [ "storage.type.objc" ], - regex: "(@end)" - }, - { - token: [ "storage.type.objc", "entity.name.type.objc", - "entity.other.inherited-class.objc" - ], - regex: "(@implementation)(\\s+[A-Za-z_][A-Za-z0-9_]*)(\\s*?::\\s*(?:[A-Za-z][A-Za-z0-9]*))?" - }, - { - token: "string.begin.objc", - regex: '@"', - next: "constant_NSString" - }, - { - token: "storage.type.objc", - regex: "\\bid\\s*<", - next: "protocol_list" - }, - { - token: "keyword.control.macro.objc", - regex: "\\bNS_DURING|NS_HANDLER|NS_ENDHANDLER\\b" - }, - { - token: ["punctuation.definition.keyword.objc", "keyword.control.exception.objc"], - regex: "(@)(try|catch|finally|throw)\\b" - }, - { - token: ["punctuation.definition.keyword.objc", "keyword.other.objc"], - regex: "(@)(defs|encode)\\b" - }, - { - token: ["storage.type.id.objc", "text"], - regex: "(\\bid\\b)(\\s|\\n)?" - }, - { - token: "storage.type.objc", - regex: "\\bIBOutlet|IBAction|BOOL|SEL|id|unichar|IMP|Class\\b" - }, - { - token: [ "punctuation.definition.storage.type.objc", "storage.type.objc"], - regex: "(@)(class|protocol)\\b" - }, - { - token: [ "punctuation.definition.storage.type.objc", "punctuation"], - regex: "(@selector)(\\s*\\()", - next: "selectors" - }, - { - token: [ "punctuation.definition.storage.modifier.objc", "storage.modifier.objc"], - regex: "(@)(synchronized|public|private|protected|package)\\b" - }, - { - token: "constant.language.objc", - regex: "\\bYES|NO|Nil|nil\\b" - }, - { - token: "support.variable.foundation", - regex: "\\bNSApp\\b" - }, - { - token: [ "support.function.cocoa.leopard"], - regex: "(?:\\b)(NS(?:Rect(?:ToCGRect|FromCGRect)|MakeCollectable|S(?:tringFromProtocol|ize(?:ToCGSize|FromCGSize))|Draw(?:NinePartImage|ThreePartImage)|P(?:oint(?:ToCGPoint|FromCGPoint)|rotocolFromString)|EventMaskFromType|Value))(?:\\b)" - }, - { - token: ["support.function.cocoa"], - regex: "(?:\\b)(NS(?:R(?:ound(?:DownToMultipleOfPageSize|UpToMultipleOfPageSize)|un(?:CriticalAlertPanel(?:RelativeToWindow)?|InformationalAlertPanel(?:RelativeToWindow)?|AlertPanel(?:RelativeToWindow)?)|e(?:set(?:MapTable|HashTable)|c(?:ycleZone|t(?:Clip(?:List)?|F(?:ill(?:UsingOperation|List(?:UsingOperation|With(?:Grays|Colors(?:UsingOperation)?))?)?|romString))|ordAllocationEvent)|turnAddress|leaseAlertPanel|a(?:dPixel|l(?:MemoryAvailable|locateCollectable))|gisterServicesProvider)|angeFromString)|Get(?:SizeAndAlignment|CriticalAlertPanel|InformationalAlertPanel|UncaughtExceptionHandler|FileType(?:s)?|WindowServerMemory|AlertPanel)|M(?:i(?:n(?:X|Y)|d(?:X|Y))|ouseInRect|a(?:p(?:Remove|Get|Member|Insert(?:IfAbsent|KnownAbsent)?)|ke(?:R(?:ect|ange)|Size|Point)|x(?:Range|X|Y)))|B(?:itsPer(?:SampleFromDepth|PixelFromDepth)|e(?:stDepth|ep|gin(?:CriticalAlertSheet|InformationalAlertSheet|AlertSheet)))|S(?:ho(?:uldRetainWithZone|w(?:sServicesMenuItem|AnimationEffect))|tringFrom(?:R(?:ect|ange)|MapTable|S(?:ize|elector)|HashTable|Class|Point)|izeFromString|e(?:t(?:ShowsServicesMenuItem|ZoneName|UncaughtExceptionHandler|FocusRingStyle)|lectorFromString|archPathForDirectoriesInDomains)|wap(?:Big(?:ShortToHost|IntToHost|DoubleToHost|FloatToHost|Long(?:ToHost|LongToHost))|Short|Host(?:ShortTo(?:Big|Little)|IntTo(?:Big|Little)|DoubleTo(?:Big|Little)|FloatTo(?:Big|Little)|Long(?:To(?:Big|Little)|LongTo(?:Big|Little)))|Int|Double|Float|L(?:ittle(?:ShortToHost|IntToHost|DoubleToHost|FloatToHost|Long(?:ToHost|LongToHost))|ong(?:Long)?)))|H(?:ighlightRect|o(?:stByteOrder|meDirectory(?:ForUser)?)|eight|ash(?:Remove|Get|Insert(?:IfAbsent|KnownAbsent)?)|FSType(?:CodeFromFileType|OfFile))|N(?:umberOfColorComponents|ext(?:MapEnumeratorPair|HashEnumeratorItem))|C(?:o(?:n(?:tainsRect|vert(?:GlyphsToPackedGlyphs|Swapped(?:DoubleToHost|FloatToHost)|Host(?:DoubleToSwapped|FloatToSwapped)))|unt(?:MapTable|HashTable|Frames|Windows(?:ForContext)?)|py(?:M(?:emoryPages|apTableWithZone)|Bits|HashTableWithZone|Object)|lorSpaceFromDepth|mpare(?:MapTables|HashTables))|lassFromString|reate(?:MapTable(?:WithZone)?|HashTable(?:WithZone)?|Zone|File(?:namePboardType|ContentsPboardType)))|TemporaryDirectory|I(?:s(?:ControllerMarker|EmptyRect|FreedObject)|n(?:setRect|crementExtraRefCount|te(?:r(?:sect(?:sRect|ionR(?:ect|ange))|faceStyleForKey)|gralRect)))|Zone(?:Realloc|Malloc|Name|Calloc|Fr(?:omPointer|ee))|O(?:penStepRootDirectory|ffsetRect)|D(?:i(?:sableScreenUpdates|videRect)|ottedFrameRect|e(?:c(?:imal(?:Round|Multiply|S(?:tring|ubtract)|Normalize|Co(?:py|mpa(?:ct|re))|IsNotANumber|Divide|Power|Add)|rementExtraRefCountWasZero)|faultMallocZone|allocate(?:MemoryPages|Object))|raw(?:Gr(?:oove|ayBezel)|B(?:itmap|utton)|ColorTiledRects|TiledRects|DarkBezel|W(?:hiteBezel|indowBackground)|LightBezel))|U(?:serName|n(?:ionR(?:ect|ange)|registerServicesProvider)|pdateDynamicServices)|Java(?:Bundle(?:Setup|Cleanup)|Setup(?:VirtualMachine)?|Needs(?:ToLoadClasses|VirtualMachine)|ClassesF(?:orBundle|romPath)|ObjectNamedInPath|ProvidesClasses)|P(?:oint(?:InRect|FromString)|erformService|lanarFromDepth|ageSize)|E(?:n(?:d(?:MapTableEnumeration|HashTableEnumeration)|umerate(?:MapTable|HashTable)|ableScreenUpdates)|qual(?:R(?:ects|anges)|Sizes|Points)|raseRect|xtraRefCount)|F(?:ileTypeForHFSTypeCode|ullUserName|r(?:ee(?:MapTable|HashTable)|ame(?:Rect(?:WithWidth(?:UsingOperation)?)?|Address)))|Wi(?:ndowList(?:ForContext)?|dth)|Lo(?:cationInRange|g(?:v|PageSize)?)|A(?:ccessibility(?:R(?:oleDescription(?:ForUIElement)?|aiseBadArgumentException)|Unignored(?:Children(?:ForOnlyChild)?|Descendant|Ancestor)|PostNotification|ActionDescription)|pplication(?:Main|Load)|vailableWindowDepths|ll(?:MapTable(?:Values|Keys)|HashTableObjects|ocate(?:MemoryPages|Collectable|Object)))))(?:\\b)" - }, - { - token: ["support.class.cocoa.leopard"], - regex: "(?:\\b)(NS(?:RuleEditor|G(?:arbageCollector|radient)|MapTable|HashTable|Co(?:ndition|llectionView(?:Item)?)|T(?:oolbarItemGroup|extInputClient|r(?:eeNode|ackingArea))|InvocationOperation|Operation(?:Queue)?|D(?:ictionaryController|ockTile)|P(?:ointer(?:Functions|Array)|athC(?:o(?:ntrol(?:Delegate)?|mponentCell)|ell(?:Delegate)?)|r(?:intPanelAccessorizing|edicateEditor(?:RowTemplate)?))|ViewController|FastEnumeration|Animat(?:ionContext|ablePropertyContainer)))(?:\\b)" - }, - { - token: ["support.class.cocoa"], - regex: "(?:\\b)(NS(?:R(?:u(?:nLoop|ler(?:Marker|View))|e(?:sponder|cursiveLock|lativeSpecifier)|an(?:domSpecifier|geSpecifier))|G(?:etCommand|lyph(?:Generator|Storage|Info)|raphicsContext)|XML(?:Node|D(?:ocument|TD(?:Node)?)|Parser|Element)|M(?:iddleSpecifier|ov(?:ie(?:View)?|eCommand)|utable(?:S(?:tring|et)|C(?:haracterSet|opying)|IndexSet|D(?:ictionary|ata)|URLRequest|ParagraphStyle|A(?:ttributedString|rray))|e(?:ssagePort(?:NameServer)?|nu(?:Item(?:Cell)?|View)?|t(?:hodSignature|adata(?:Item|Query(?:ResultGroup|AttributeValueTuple)?)))|a(?:ch(?:BootstrapServer|Port)|trix))|B(?:itmapImageRep|ox|u(?:ndle|tton(?:Cell)?)|ezierPath|rowser(?:Cell)?)|S(?:hadow|c(?:anner|r(?:ipt(?:SuiteRegistry|C(?:o(?:ercionHandler|mmand(?:Description)?)|lassDescription)|ObjectSpecifier|ExecutionContext|WhoseTest)|oll(?:er|View)|een))|t(?:epper(?:Cell)?|atus(?:Bar|Item)|r(?:ing|eam))|imple(?:HorizontalTypesetter|CString)|o(?:cketPort(?:NameServer)?|und|rtDescriptor)|p(?:e(?:cifierTest|ech(?:Recognizer|Synthesizer)|ll(?:Server|Checker))|litView)|e(?:cureTextField(?:Cell)?|t(?:Command)?|archField(?:Cell)?|rializer|gmentedC(?:ontrol|ell))|lider(?:Cell)?|avePanel)|H(?:ost|TTP(?:Cookie(?:Storage)?|URLResponse)|elpManager)|N(?:ib(?:Con(?:nector|trolConnector)|OutletConnector)?|otification(?:Center|Queue)?|u(?:ll|mber(?:Formatter)?)|etService(?:Browser)?|ameSpecifier)|C(?:ha(?:ngeSpelling|racterSet)|o(?:n(?:stantString|nection|trol(?:ler)?|ditionLock)|d(?:ing|er)|unt(?:Command|edSet)|pying|lor(?:Space|P(?:ick(?:ing(?:Custom|Default)|er)|anel)|Well|List)?|m(?:p(?:oundPredicate|arisonPredicate)|boBox(?:Cell)?))|u(?:stomImageRep|rsor)|IImageRep|ell|l(?:ipView|o(?:seCommand|neCommand)|assDescription)|a(?:ched(?:ImageRep|URLResponse)|lendar(?:Date)?)|reateCommand)|T(?:hread|ypesetter|ime(?:Zone|r)|o(?:olbar(?:Item(?:Validations)?)?|kenField(?:Cell)?)|ext(?:Block|Storage|Container|Tab(?:le(?:Block)?)?|Input|View|Field(?:Cell)?|List|Attachment(?:Cell)?)?|a(?:sk|b(?:le(?:Header(?:Cell|View)|Column|View)|View(?:Item)?))|reeController)|I(?:n(?:dex(?:S(?:pecifier|et)|Path)|put(?:Manager|S(?:tream|erv(?:iceProvider|er(?:MouseTracker)?)))|vocation)|gnoreMisspelledWords|mage(?:Rep|Cell|View)?)|O(?:ut(?:putStream|lineView)|pen(?:GL(?:Context|Pixel(?:Buffer|Format)|View)|Panel)|bj(?:CTypeSerializationCallBack|ect(?:Controller)?))|D(?:i(?:st(?:antObject(?:Request)?|ributed(?:NotificationCenter|Lock))|ctionary|rectoryEnumerator)|ocument(?:Controller)?|e(?:serializer|cimalNumber(?:Behaviors|Handler)?|leteCommand)|at(?:e(?:Components|Picker(?:Cell)?|Formatter)?|a)|ra(?:wer|ggingInfo))|U(?:ser(?:InterfaceValidations|Defaults(?:Controller)?)|RL(?:Re(?:sponse|quest)|Handle(?:Client)?|C(?:onnection|ache|redential(?:Storage)?)|Download(?:Delegate)?|Prot(?:ocol(?:Client)?|ectionSpace)|AuthenticationChallenge(?:Sender)?)?|n(?:iqueIDSpecifier|doManager|archiver))|P(?:ipe|o(?:sitionalSpecifier|pUpButton(?:Cell)?|rt(?:Message|NameServer|Coder)?)|ICTImageRep|ersistentDocument|DFImageRep|a(?:steboard|nel|ragraphStyle|geLayout)|r(?:int(?:Info|er|Operation|Panel)|o(?:cessInfo|tocolChecker|perty(?:Specifier|ListSerialization)|gressIndicator|xy)|edicate))|E(?:numerator|vent|PSImageRep|rror|x(?:ception|istsCommand|pression))|V(?:iew(?:Animation)?|al(?:idated(?:ToobarItem|UserInterfaceItem)|ue(?:Transformer)?))|Keyed(?:Unarchiver|Archiver)|Qui(?:ckDrawView|tCommand)|F(?:ile(?:Manager|Handle|Wrapper)|o(?:nt(?:Manager|Descriptor|Panel)?|rm(?:Cell|atter)))|W(?:hoseSpecifier|indow(?:Controller)?|orkspace)|L(?:o(?:c(?:k(?:ing)?|ale)|gicalTest)|evelIndicator(?:Cell)?|ayoutManager)|A(?:ssertionHandler|nimation|ctionCell|ttributedString|utoreleasePool|TSTypesetter|ppl(?:ication|e(?:Script|Event(?:Manager|Descriptor)))|ffineTransform|lert|r(?:chiver|ray(?:Controller)?))))(?:\\b)" - }, - { - token: ["support.type.cocoa.leopard"], - regex: "(?:\\b)(NS(?:R(?:u(?:nLoop|ler(?:Marker|View))|e(?:sponder|cursiveLock|lativeSpecifier)|an(?:domSpecifier|geSpecifier))|G(?:etCommand|lyph(?:Generator|Storage|Info)|raphicsContext)|XML(?:Node|D(?:ocument|TD(?:Node)?)|Parser|Element)|M(?:iddleSpecifier|ov(?:ie(?:View)?|eCommand)|utable(?:S(?:tring|et)|C(?:haracterSet|opying)|IndexSet|D(?:ictionary|ata)|URLRequest|ParagraphStyle|A(?:ttributedString|rray))|e(?:ssagePort(?:NameServer)?|nu(?:Item(?:Cell)?|View)?|t(?:hodSignature|adata(?:Item|Query(?:ResultGroup|AttributeValueTuple)?)))|a(?:ch(?:BootstrapServer|Port)|trix))|B(?:itmapImageRep|ox|u(?:ndle|tton(?:Cell)?)|ezierPath|rowser(?:Cell)?)|S(?:hadow|c(?:anner|r(?:ipt(?:SuiteRegistry|C(?:o(?:ercionHandler|mmand(?:Description)?)|lassDescription)|ObjectSpecifier|ExecutionContext|WhoseTest)|oll(?:er|View)|een))|t(?:epper(?:Cell)?|atus(?:Bar|Item)|r(?:ing|eam))|imple(?:HorizontalTypesetter|CString)|o(?:cketPort(?:NameServer)?|und|rtDescriptor)|p(?:e(?:cifierTest|ech(?:Recognizer|Synthesizer)|ll(?:Server|Checker))|litView)|e(?:cureTextField(?:Cell)?|t(?:Command)?|archField(?:Cell)?|rializer|gmentedC(?:ontrol|ell))|lider(?:Cell)?|avePanel)|H(?:ost|TTP(?:Cookie(?:Storage)?|URLResponse)|elpManager)|N(?:ib(?:Con(?:nector|trolConnector)|OutletConnector)?|otification(?:Center|Queue)?|u(?:ll|mber(?:Formatter)?)|etService(?:Browser)?|ameSpecifier)|C(?:ha(?:ngeSpelling|racterSet)|o(?:n(?:stantString|nection|trol(?:ler)?|ditionLock)|d(?:ing|er)|unt(?:Command|edSet)|pying|lor(?:Space|P(?:ick(?:ing(?:Custom|Default)|er)|anel)|Well|List)?|m(?:p(?:oundPredicate|arisonPredicate)|boBox(?:Cell)?))|u(?:stomImageRep|rsor)|IImageRep|ell|l(?:ipView|o(?:seCommand|neCommand)|assDescription)|a(?:ched(?:ImageRep|URLResponse)|lendar(?:Date)?)|reateCommand)|T(?:hread|ypesetter|ime(?:Zone|r)|o(?:olbar(?:Item(?:Validations)?)?|kenField(?:Cell)?)|ext(?:Block|Storage|Container|Tab(?:le(?:Block)?)?|Input|View|Field(?:Cell)?|List|Attachment(?:Cell)?)?|a(?:sk|b(?:le(?:Header(?:Cell|View)|Column|View)|View(?:Item)?))|reeController)|I(?:n(?:dex(?:S(?:pecifier|et)|Path)|put(?:Manager|S(?:tream|erv(?:iceProvider|er(?:MouseTracker)?)))|vocation)|gnoreMisspelledWords|mage(?:Rep|Cell|View)?)|O(?:ut(?:putStream|lineView)|pen(?:GL(?:Context|Pixel(?:Buffer|Format)|View)|Panel)|bj(?:CTypeSerializationCallBack|ect(?:Controller)?))|D(?:i(?:st(?:antObject(?:Request)?|ributed(?:NotificationCenter|Lock))|ctionary|rectoryEnumerator)|ocument(?:Controller)?|e(?:serializer|cimalNumber(?:Behaviors|Handler)?|leteCommand)|at(?:e(?:Components|Picker(?:Cell)?|Formatter)?|a)|ra(?:wer|ggingInfo))|U(?:ser(?:InterfaceValidations|Defaults(?:Controller)?)|RL(?:Re(?:sponse|quest)|Handle(?:Client)?|C(?:onnection|ache|redential(?:Storage)?)|Download(?:Delegate)?|Prot(?:ocol(?:Client)?|ectionSpace)|AuthenticationChallenge(?:Sender)?)?|n(?:iqueIDSpecifier|doManager|archiver))|P(?:ipe|o(?:sitionalSpecifier|pUpButton(?:Cell)?|rt(?:Message|NameServer|Coder)?)|ICTImageRep|ersistentDocument|DFImageRep|a(?:steboard|nel|ragraphStyle|geLayout)|r(?:int(?:Info|er|Operation|Panel)|o(?:cessInfo|tocolChecker|perty(?:Specifier|ListSerialization)|gressIndicator|xy)|edicate))|E(?:numerator|vent|PSImageRep|rror|x(?:ception|istsCommand|pression))|V(?:iew(?:Animation)?|al(?:idated(?:ToobarItem|UserInterfaceItem)|ue(?:Transformer)?))|Keyed(?:Unarchiver|Archiver)|Qui(?:ckDrawView|tCommand)|F(?:ile(?:Manager|Handle|Wrapper)|o(?:nt(?:Manager|Descriptor|Panel)?|rm(?:Cell|atter)))|W(?:hoseSpecifier|indow(?:Controller)?|orkspace)|L(?:o(?:c(?:k(?:ing)?|ale)|gicalTest)|evelIndicator(?:Cell)?|ayoutManager)|A(?:ssertionHandler|nimation|ctionCell|ttributedString|utoreleasePool|TSTypesetter|ppl(?:ication|e(?:Script|Event(?:Manager|Descriptor)))|ffineTransform|lert|r(?:chiver|ray(?:Controller)?))))(?:\\b)" - }, - { - token: ["support.class.quartz"], - regex: "(?:\\b)(C(?:I(?:Sampler|Co(?:ntext|lor)|Image(?:Accumulator)?|PlugIn(?:Registration)?|Vector|Kernel|Filter(?:Generator|Shape)?)|A(?:Renderer|MediaTiming(?:Function)?|BasicAnimation|ScrollLayer|Constraint(?:LayoutManager)?|T(?:iledLayer|extLayer|rans(?:ition|action))|OpenGLLayer|PropertyAnimation|KeyframeAnimation|Layer|A(?:nimation(?:Group)?|ction))))(?:\\b)" - }, - { - token: ["support.type.quartz"], - regex: "(?:\\b)(C(?:G(?:Float|Point|Size|Rect)|IFormat|AConstraintAttribute))(?:\\b)" - }, - { - token: ["support.type.cocoa"], - regex: "(?:\\b)(NS(?:R(?:ect(?:Edge)?|ange)|G(?:lyph(?:Relation|LayoutMode)?|radientType)|M(?:odalSession|a(?:trixMode|p(?:Table|Enumerator)))|B(?:itmapImageFileType|orderType|uttonType|ezelStyle|ackingStoreType|rowserColumnResizingType)|S(?:cr(?:oll(?:er(?:Part|Arrow)|ArrowPosition)|eenAuxiliaryOpaque)|tringEncoding|ize|ocketNativeHandle|election(?:Granularity|Direction|Affinity)|wapped(?:Double|Float)|aveOperationType)|Ha(?:sh(?:Table|Enumerator)|ndler(?:2)?)|C(?:o(?:ntrol(?:Size|Tint)|mp(?:ositingOperation|arisonResult))|ell(?:State|Type|ImagePosition|Attribute))|T(?:hreadPrivate|ypesetterGlyphInfo|i(?:ckMarkPosition|tlePosition|meInterval)|o(?:ol(?:TipTag|bar(?:SizeMode|DisplayMode))|kenStyle)|IFFCompression|ext(?:TabType|Alignment)|ab(?:State|leViewDropOperation|ViewType)|rackingRectTag)|ImageInterpolation|Zone|OpenGL(?:ContextAuxiliary|PixelFormatAuxiliary)|D(?:ocumentChangeType|atePickerElementFlags|ra(?:werState|gOperation))|UsableScrollerParts|P(?:oint|r(?:intingPageOrder|ogressIndicator(?:Style|Th(?:ickness|readInfo))))|EventType|KeyValueObservingOptions|Fo(?:nt(?:SymbolicTraits|TraitMask|Action)|cusRingType)|W(?:indow(?:OrderingMode|Depth)|orkspace(?:IconCreationOptions|LaunchOptions)|ritingDirection)|L(?:ineBreakMode|ayout(?:Status|Direction))|A(?:nimation(?:Progress|Effect)|ppl(?:ication(?:TerminateReply|DelegateReply|PrintReply)|eEventManagerSuspensionID)|ffineTransformStruct|lertStyle)))(?:\\b)" - }, - { - token: ["support.constant.cocoa"], - regex: "(?:\\b)(NS(?:NotFound|Ordered(?:Ascending|Descending|Same)))(?:\\b)" - }, - { - token: ["support.constant.notification.cocoa.leopard"], - regex: "(?:\\b)(NS(?:MenuDidBeginTracking|ViewDidUpdateTrackingAreas)?Notification)(?:\\b)" - }, - { - token: ["support.constant.notification.cocoa"], - regex: "(?:\\b)(NS(?:Menu(?:Did(?:RemoveItem|SendAction|ChangeItem|EndTracking|AddItem)|WillSendAction)|S(?:ystemColorsDidChange|plitView(?:DidResizeSubviews|WillResizeSubviews))|C(?:o(?:nt(?:extHelpModeDid(?:Deactivate|Activate)|rolT(?:intDidChange|extDid(?:BeginEditing|Change|EndEditing)))|lor(?:PanelColorDidChange|ListDidChange)|mboBox(?:Selection(?:IsChanging|DidChange)|Will(?:Dismiss|PopUp)))|lassDescriptionNeededForClass)|T(?:oolbar(?:DidRemoveItem|WillAddItem)|ext(?:Storage(?:DidProcessEditing|WillProcessEditing)|Did(?:BeginEditing|Change|EndEditing)|View(?:DidChange(?:Selection|TypingAttributes)|WillChangeNotifyingTextView))|ableView(?:Selection(?:IsChanging|DidChange)|ColumnDid(?:Resize|Move)))|ImageRepRegistryDidChange|OutlineView(?:Selection(?:IsChanging|DidChange)|ColumnDid(?:Resize|Move)|Item(?:Did(?:Collapse|Expand)|Will(?:Collapse|Expand)))|Drawer(?:Did(?:Close|Open)|Will(?:Close|Open))|PopUpButton(?:CellWillPopUp|WillPopUp)|View(?:GlobalFrameDidChange|BoundsDidChange|F(?:ocusDidChange|rameDidChange))|FontSetChanged|W(?:indow(?:Did(?:Resi(?:ze|gn(?:Main|Key))|M(?:iniaturize|ove)|Become(?:Main|Key)|ChangeScreen(?:|Profile)|Deminiaturize|Update|E(?:ndSheet|xpose))|Will(?:M(?:iniaturize|ove)|BeginSheet|Close))|orkspace(?:SessionDid(?:ResignActive|BecomeActive)|Did(?:Mount|TerminateApplication|Unmount|PerformFileOperation|Wake|LaunchApplication)|Will(?:Sleep|Unmount|PowerOff|LaunchApplication)))|A(?:ntialiasThresholdChanged|ppl(?:ication(?:Did(?:ResignActive|BecomeActive|Hide|ChangeScreenParameters|U(?:nhide|pdate)|FinishLaunching)|Will(?:ResignActive|BecomeActive|Hide|Terminate|U(?:nhide|pdate)|FinishLaunching))|eEventManagerWillProcessFirstEvent)))Notification)(?:\\b)" - }, - { - token: ["support.constant.cocoa.leopard"], - regex: "(?:\\b)(NS(?:RuleEditor(?:RowType(?:Simple|Compound)|NestingMode(?:Si(?:ngle|mple)|Compound|List))|GradientDraws(?:BeforeStartingLocation|AfterEndingLocation)|M(?:inusSetExpressionType|a(?:chPortDeallocate(?:ReceiveRight|SendRight|None)|pTable(?:StrongMemory|CopyIn|ZeroingWeakMemory|ObjectPointerPersonality)))|B(?:oxCustom|undleExecutableArchitecture(?:X86|I386|PPC(?:64)?)|etweenPredicateOperatorType|ackgroundStyle(?:Raised|Dark|L(?:ight|owered)))|S(?:tring(?:DrawingTruncatesLastVisibleLine|EncodingConversion(?:ExternalRepresentation|AllowLossy))|ubqueryExpressionType|p(?:e(?:ech(?:SentenceBoundary|ImmediateBoundary|WordBoundary)|llingState(?:GrammarFlag|SpellingFlag))|litViewDividerStyleThi(?:n|ck))|e(?:rvice(?:RequestTimedOutError|M(?:iscellaneousError|alformedServiceDictionaryError)|InvalidPasteboardDataError|ErrorM(?:inimum|aximum)|Application(?:NotFoundError|LaunchFailedError))|gmentStyle(?:Round(?:Rect|ed)|SmallSquare|Capsule|Textured(?:Rounded|Square)|Automatic)))|H(?:UDWindowMask|ashTable(?:StrongMemory|CopyIn|ZeroingWeakMemory|ObjectPointerPersonality))|N(?:oModeColorPanel|etServiceNoAutoRename)|C(?:hangeRedone|o(?:ntainsPredicateOperatorType|l(?:orRenderingIntent(?:RelativeColorimetric|Saturation|Default|Perceptual|AbsoluteColorimetric)|lectorDisabledOption))|ellHit(?:None|ContentArea|TrackableArea|EditableTextArea))|T(?:imeZoneNameStyle(?:S(?:hort(?:Standard|DaylightSaving)|tandard)|DaylightSaving)|extFieldDatePickerStyle|ableViewSelectionHighlightStyle(?:Regular|SourceList)|racking(?:Mouse(?:Moved|EnteredAndExited)|CursorUpdate|InVisibleRect|EnabledDuringMouseDrag|A(?:ssumeInside|ctive(?:In(?:KeyWindow|ActiveApp)|WhenFirstResponder|Always))))|I(?:n(?:tersectSetExpressionType|dexedColorSpaceModel)|mageScale(?:None|Proportionally(?:Down|UpOrDown)|AxesIndependently))|Ope(?:nGLPFAAllowOfflineRenderers|rationQueue(?:DefaultMaxConcurrentOperationCount|Priority(?:High|Normal|Very(?:High|Low)|Low)))|D(?:iacriticInsensitiveSearch|ownloadsDirectory)|U(?:nionSetExpressionType|TF(?:16(?:BigEndianStringEncoding|StringEncoding|LittleEndianStringEncoding)|32(?:BigEndianStringEncoding|StringEncoding|LittleEndianStringEncoding)))|P(?:ointerFunctions(?:Ma(?:chVirtualMemory|llocMemory)|Str(?:ongMemory|uctPersonality)|C(?:StringPersonality|opyIn)|IntegerPersonality|ZeroingWeakMemory|O(?:paque(?:Memory|Personality)|bjectP(?:ointerPersonality|ersonality)))|at(?:hStyle(?:Standard|NavigationBar|PopUp)|ternColorSpaceModel)|rintPanelShows(?:Scaling|Copies|Orientation|P(?:a(?:perSize|ge(?:Range|SetupAccessory))|review)))|Executable(?:RuntimeMismatchError|NotLoadableError|ErrorM(?:inimum|aximum)|L(?:inkError|oadError)|ArchitectureMismatchError)|KeyValueObservingOption(?:Initial|Prior)|F(?:i(?:ndPanelSubstringMatchType(?:StartsWith|Contains|EndsWith|FullWord)|leRead(?:TooLargeError|UnknownStringEncodingError))|orcedOrderingSearch)|Wi(?:ndow(?:BackingLocation(?:MainMemory|Default|VideoMemory)|Sharing(?:Read(?:Only|Write)|None)|CollectionBehavior(?:MoveToActiveSpace|CanJoinAllSpaces|Default))|dthInsensitiveSearch)|AggregateExpressionType))(?:\\b)" - }, - { - token: ["support.constant.cocoa"], - regex: "(?:\\b)(NS(?:R(?:GB(?:ModeColorPanel|ColorSpaceModel)|ight(?:Mouse(?:D(?:own(?:Mask)?|ragged(?:Mask)?)|Up(?:Mask)?)|T(?:ext(?:Movement|Alignment)|ab(?:sBezelBorder|StopType))|ArrowFunctionKey)|ound(?:RectBezelStyle|Bankers|ed(?:BezelStyle|TokenStyle|DisclosureBezelStyle)|Down|Up|Plain|Line(?:CapStyle|JoinStyle))|un(?:StoppedResponse|ContinuesResponse|AbortedResponse)|e(?:s(?:izableWindowMask|et(?:CursorRectsRunLoopOrdering|FunctionKey))|ce(?:ssedBezelStyle|iver(?:sCantHandleCommandScriptError|EvaluationScriptError))|turnTextMovement|doFunctionKey|quiredArgumentsMissingScriptError|l(?:evancyLevelIndicatorStyle|ative(?:Before|After))|gular(?:SquareBezelStyle|ControlSize)|moveTraitFontAction)|a(?:n(?:domSubelement|geDateMode)|tingLevelIndicatorStyle|dio(?:ModeMatrix|Button)))|G(?:IFFileType|lyph(?:Below|Inscribe(?:B(?:elow|ase)|Over(?:strike|Below)|Above)|Layout(?:WithPrevious|A(?:tAPoint|gainstAPoint))|A(?:ttribute(?:BidiLevel|Soft|Inscribe|Elastic)|bove))|r(?:ooveBorder|eaterThan(?:Comparison|OrEqualTo(?:Comparison|PredicateOperatorType)|PredicateOperatorType)|a(?:y(?:ModeColorPanel|ColorSpaceModel)|dient(?:None|Con(?:cave(?:Strong|Weak)|vex(?:Strong|Weak)))|phiteControlTint)))|XML(?:N(?:o(?:tationDeclarationKind|de(?:CompactEmptyElement|IsCDATA|OptionsNone|Use(?:SingleQuotes|DoubleQuotes)|Pre(?:serve(?:NamespaceOrder|C(?:haracterReferences|DATA)|DTD|Prefixes|E(?:ntities|mptyElements)|Quotes|Whitespace|A(?:ttributeOrder|ll))|ttyPrint)|ExpandEmptyElement))|amespaceKind)|CommentKind|TextKind|InvalidKind|D(?:ocument(?:X(?:MLKind|HTMLKind|Include)|HTMLKind|T(?:idy(?:XML|HTML)|extKind)|IncludeContentTypeDeclaration|Validate|Kind)|TDKind)|P(?:arser(?:GTRequiredError|XMLDeclNot(?:StartedError|FinishedError)|Mi(?:splaced(?:XMLDeclarationError|CDATAEndStringError)|xedContentDeclNot(?:StartedError|FinishedError))|S(?:t(?:andaloneValueError|ringNot(?:StartedError|ClosedError))|paceRequiredError|eparatorRequiredError)|N(?:MTOKENRequiredError|o(?:t(?:ationNot(?:StartedError|FinishedError)|WellBalancedError)|DTDError)|amespaceDeclarationError|AMERequiredError)|C(?:haracterRef(?:In(?:DTDError|PrologError|EpilogError)|AtEOFError)|o(?:nditionalSectionNot(?:StartedError|FinishedError)|mment(?:NotFinishedError|ContainsDoubleHyphenError))|DATANotFinishedError)|TagNameMismatchError|In(?:ternalError|valid(?:HexCharacterRefError|C(?:haracter(?:RefError|InEntityError|Error)|onditionalSectionError)|DecimalCharacterRefError|URIError|Encoding(?:NameError|Error)))|OutOfMemoryError|D(?:ocumentStartError|elegateAbortedParseError|OCTYPEDeclNotFinishedError)|U(?:RI(?:RequiredError|FragmentError)|n(?:declaredEntityError|parsedEntityError|knownEncodingError|finishedTagError))|P(?:CDATARequiredError|ublicIdentifierRequiredError|arsedEntityRef(?:MissingSemiError|NoNameError|In(?:Internal(?:SubsetError|Error)|PrologError|EpilogError)|AtEOFError)|r(?:ocessingInstructionNot(?:StartedError|FinishedError)|ematureDocumentEndError))|E(?:n(?:codingNotSupportedError|tity(?:Ref(?:In(?:DTDError|PrologError|EpilogError)|erence(?:MissingSemiError|WithoutNameError)|LoopError|AtEOFError)|BoundaryError|Not(?:StartedError|FinishedError)|Is(?:ParameterError|ExternalError)|ValueRequiredError))|qualExpectedError|lementContentDeclNot(?:StartedError|FinishedError)|xt(?:ernalS(?:tandaloneEntityError|ubsetNotFinishedError)|raContentError)|mptyDocumentError)|L(?:iteralNot(?:StartedError|FinishedError)|T(?:RequiredError|SlashRequiredError)|essThanSymbolInAttributeError)|Attribute(?:RedefinedError|HasNoValueError|Not(?:StartedError|FinishedError)|ListNot(?:StartedError|FinishedError)))|rocessingInstructionKind)|E(?:ntity(?:GeneralKind|DeclarationKind|UnparsedKind|P(?:ar(?:sedKind|ameterKind)|redefined))|lement(?:Declaration(?:MixedKind|UndefinedKind|E(?:lementKind|mptyKind)|Kind|AnyKind)|Kind))|Attribute(?:N(?:MToken(?:sKind|Kind)|otationKind)|CDATAKind|ID(?:Ref(?:sKind|Kind)|Kind)|DeclarationKind|En(?:tit(?:yKind|iesKind)|umerationKind)|Kind))|M(?:i(?:n(?:XEdge|iaturizableWindowMask|YEdge|uteCalendarUnit)|terLineJoinStyle|ddleSubelement|xedState)|o(?:nthCalendarUnit|deSwitchFunctionKey|use(?:Moved(?:Mask)?|E(?:ntered(?:Mask)?|ventSubtype|xited(?:Mask)?))|veToBezierPathElement|mentary(?:ChangeButton|Push(?:Button|InButton)|Light(?:Button)?))|enuFunctionKey|a(?:c(?:intoshInterfaceStyle|OSRomanStringEncoding)|tchesPredicateOperatorType|ppedRead|x(?:XEdge|YEdge))|ACHOperatingSystem)|B(?:MPFileType|o(?:ttomTabsBezelBorder|ldFontMask|rderlessWindowMask|x(?:Se(?:condary|parator)|OldStyle|Primary))|uttLineCapStyle|e(?:zelBorder|velLineJoinStyle|low(?:Bottom|Top)|gin(?:sWith(?:Comparison|PredicateOperatorType)|FunctionKey))|lueControlTint|ack(?:spaceCharacter|tabTextMovement|ingStore(?:Retained|Buffered|Nonretained)|TabCharacter|wardsSearch|groundTab)|r(?:owser(?:NoColumnResizing|UserColumnResizing|AutoColumnResizing)|eakFunctionKey))|S(?:h(?:ift(?:JISStringEncoding|KeyMask)|ow(?:ControlGlyphs|InvisibleGlyphs)|adowlessSquareBezelStyle)|y(?:s(?:ReqFunctionKey|tem(?:D(?:omainMask|efined(?:Mask)?)|FunctionKey))|mbolStringEncoding)|c(?:a(?:nnedOption|le(?:None|ToFit|Proportionally))|r(?:oll(?:er(?:NoPart|Increment(?:Page|Line|Arrow)|Decrement(?:Page|Line|Arrow)|Knob(?:Slot)?|Arrows(?:M(?:inEnd|axEnd)|None|DefaultSetting))|Wheel(?:Mask)?|LockFunctionKey)|eenChangedEventType))|t(?:opFunctionKey|r(?:ingDrawing(?:OneShot|DisableScreenFontSubstitution|Uses(?:DeviceMetrics|FontLeading|LineFragmentOrigin))|eam(?:Status(?:Reading|NotOpen|Closed|Open(?:ing)?|Error|Writing|AtEnd)|Event(?:Has(?:BytesAvailable|SpaceAvailable)|None|OpenCompleted|E(?:ndEncountered|rrorOccurred)))))|i(?:ngle(?:DateMode|UnderlineStyle)|ze(?:DownFontAction|UpFontAction))|olarisOperatingSystem|unOSOperatingSystem|pecialPageOrder|e(?:condCalendarUnit|lect(?:By(?:Character|Paragraph|Word)|i(?:ng(?:Next|Previous)|onAffinity(?:Downstream|Upstream))|edTab|FunctionKey)|gmentSwitchTracking(?:Momentary|Select(?:One|Any)))|quareLineCapStyle|witchButton|ave(?:ToOperation|Op(?:tions(?:Yes|No|Ask)|eration)|AsOperation)|mall(?:SquareBezelStyle|C(?:ontrolSize|apsFontMask)|IconButtonBezelStyle))|H(?:ighlightModeMatrix|SBModeColorPanel|o(?:ur(?:Minute(?:SecondDatePickerElementFlag|DatePickerElementFlag)|CalendarUnit)|rizontalRuler|meFunctionKey)|TTPCookieAcceptPolicy(?:Never|OnlyFromMainDocumentDomain|Always)|e(?:lp(?:ButtonBezelStyle|KeyMask|FunctionKey)|avierFontAction)|PUXOperatingSystem)|Year(?:MonthDa(?:yDatePickerElementFlag|tePickerElementFlag)|CalendarUnit)|N(?:o(?:n(?:StandardCharacterSetFontMask|ZeroWindingRule|activatingPanelMask|LossyASCIIStringEncoding)|Border|t(?:ification(?:SuspensionBehavior(?:Hold|Coalesce|D(?:eliverImmediately|rop))|NoCoalescing|CoalescingOn(?:Sender|Name)|DeliverImmediately|PostToAllSessions)|PredicateType|EqualToPredicateOperatorType)|S(?:cr(?:iptError|ollerParts)|ubelement|pecifierError)|CellMask|T(?:itle|opLevelContainersSpecifierError|abs(?:BezelBorder|NoBorder|LineBorder))|I(?:nterfaceStyle|mage)|UnderlineStyle|FontChangeAction)|u(?:ll(?:Glyph|CellType)|m(?:eric(?:Search|PadKeyMask)|berFormatter(?:Round(?:Half(?:Down|Up|Even)|Ceiling|Down|Up|Floor)|Behavior(?:10|Default)|S(?:cientificStyle|pellOutStyle)|NoStyle|CurrencyStyle|DecimalStyle|P(?:ercentStyle|ad(?:Before(?:Suffix|Prefix)|After(?:Suffix|Prefix))))))|e(?:t(?:Services(?:BadArgumentError|NotFoundError|C(?:ollisionError|ancelledError)|TimeoutError|InvalidError|UnknownError|ActivityInProgress)|workDomainMask)|wlineCharacter|xt(?:StepInterfaceStyle|FunctionKey))|EXTSTEPStringEncoding|a(?:t(?:iveShortGlyphPacking|uralTextAlignment)|rrowFontMask))|C(?:hange(?:ReadOtherContents|GrayCell(?:Mask)?|BackgroundCell(?:Mask)?|Cleared|Done|Undone|Autosaved)|MYK(?:ModeColorPanel|ColorSpaceModel)|ircular(?:BezelStyle|Slider)|o(?:n(?:stantValueExpressionType|t(?:inuousCapacityLevelIndicatorStyle|entsCellMask|ain(?:sComparison|erSpecifierError)|rol(?:Glyph|KeyMask))|densedFontMask)|lor(?:Panel(?:RGBModeMask|GrayModeMask|HSBModeMask|C(?:MYKModeMask|olorListModeMask|ustomPaletteModeMask|rayonModeMask)|WheelModeMask|AllModesMask)|ListModeColorPanel)|reServiceDirectory|m(?:p(?:osite(?:XOR|Source(?:In|O(?:ut|ver)|Atop)|Highlight|C(?:opy|lear)|Destination(?:In|O(?:ut|ver)|Atop)|Plus(?:Darker|Lighter))|ressedFontMask)|mandKeyMask))|u(?:stom(?:SelectorPredicateOperatorType|PaletteModeColorPanel)|r(?:sor(?:Update(?:Mask)?|PointingDevice)|veToBezierPathElement))|e(?:nterT(?:extAlignment|abStopType)|ll(?:State|H(?:ighlighted|as(?:Image(?:Horizontal|OnLeftOrBottom)|OverlappingImage))|ChangesContents|Is(?:Bordered|InsetButton)|Disabled|Editable|LightsBy(?:Gray|Background|Contents)|AllowsMixedState))|l(?:ipPagination|o(?:s(?:ePathBezierPathElement|ableWindowMask)|ckAndCalendarDatePickerStyle)|ear(?:ControlTint|DisplayFunctionKey|LineFunctionKey))|a(?:seInsensitive(?:Search|PredicateOption)|n(?:notCreateScriptCommandError|cel(?:Button|TextMovement))|chesDirectory|lculation(?:NoError|Overflow|DivideByZero|Underflow|LossOfPrecision)|rriageReturnCharacter)|r(?:itical(?:Request|AlertStyle)|ayonModeColorPanel))|T(?:hick(?:SquareBezelStyle|erSquareBezelStyle)|ypesetter(?:Behavior|HorizontalTabAction|ContainerBreakAction|ZeroAdvancementAction|OriginalBehavior|ParagraphBreakAction|WhitespaceAction|L(?:ineBreakAction|atestBehavior))|i(?:ckMark(?:Right|Below|Left|Above)|tledWindowMask|meZoneDatePickerElementFlag)|o(?:olbarItemVisibilityPriority(?:Standard|High|User|Low)|pTabsBezelBorder|ggleButton)|IFF(?:Compression(?:N(?:one|EXT)|CCITTFAX(?:3|4)|OldJPEG|JPEG|PackBits|LZW)|FileType)|e(?:rminate(?:Now|Cancel|Later)|xt(?:Read(?:InapplicableDocumentTypeError|WriteErrorM(?:inimum|aximum))|Block(?:M(?:i(?:nimum(?:Height|Width)|ddleAlignment)|a(?:rgin|ximum(?:Height|Width)))|B(?:o(?:ttomAlignment|rder)|aselineAlignment)|Height|TopAlignment|P(?:ercentageValueType|adding)|Width|AbsoluteValueType)|StorageEdited(?:Characters|Attributes)|CellType|ured(?:RoundedBezelStyle|BackgroundWindowMask|SquareBezelStyle)|Table(?:FixedLayoutAlgorithm|AutomaticLayoutAlgorithm)|Field(?:RoundedBezel|SquareBezel|AndStepperDatePickerStyle)|WriteInapplicableDocumentTypeError|ListPrependEnclosingMarker))|woByteGlyphPacking|ab(?:Character|TextMovement|le(?:tP(?:oint(?:Mask|EventSubtype)?|roximity(?:Mask|EventSubtype)?)|Column(?:NoResizing|UserResizingMask|AutoresizingMask)|View(?:ReverseSequentialColumnAutoresizingStyle|GridNone|S(?:olid(?:HorizontalGridLineMask|VerticalGridLineMask)|equentialColumnAutoresizingStyle)|NoColumnAutoresizing|UniformColumnAutoresizingStyle|FirstColumnOnlyAutoresizingStyle|LastColumnOnlyAutoresizingStyle)))|rackModeMatrix)|I(?:n(?:sert(?:CharFunctionKey|FunctionKey|LineFunctionKey)|t(?:Type|ernalS(?:criptError|pecifierError))|dexSubelement|validIndexSpecifierError|formational(?:Request|AlertStyle)|PredicateOperatorType)|talicFontMask|SO(?:2022JPStringEncoding|Latin(?:1StringEncoding|2StringEncoding))|dentityMappingCharacterCollection|llegalTextMovement|mage(?:R(?:ight|ep(?:MatchesDevice|LoadStatus(?:ReadingHeader|Completed|InvalidData|Un(?:expectedEOF|knownType)|WillNeedAllData)))|Below|C(?:ellType|ache(?:BySize|Never|Default|Always))|Interpolation(?:High|None|Default|Low)|O(?:nly|verlaps)|Frame(?:Gr(?:oove|ayBezel)|Button|None|Photo)|L(?:oadStatus(?:ReadError|C(?:ompleted|ancelled)|InvalidData|UnexpectedEOF)|eft)|A(?:lign(?:Right|Bottom(?:Right|Left)?|Center|Top(?:Right|Left)?|Left)|bove)))|O(?:n(?:State|eByteGlyphPacking|OffButton|lyScrollerArrows)|ther(?:Mouse(?:D(?:own(?:Mask)?|ragged(?:Mask)?)|Up(?:Mask)?)|TextMovement)|SF1OperatingSystem|pe(?:n(?:GL(?:GO(?:Re(?:setLibrary|tainRenderers)|ClearFormatCache|FormatCacheSize)|PFA(?:R(?:obust|endererID)|M(?:inimumPolicy|ulti(?:sample|Screen)|PSafe|aximumPolicy)|BackingStore|S(?:creenMask|te(?:ncilSize|reo)|ingleRenderer|upersample|ample(?:s|Buffers|Alpha))|NoRecovery|C(?:o(?:lor(?:Size|Float)|mpliant)|losestPolicy)|OffScreen|D(?:oubleBuffer|epthSize)|PixelBuffer|VirtualScreenCount|FullScreen|Window|A(?:cc(?:umSize|elerated)|ux(?:Buffers|DepthStencil)|l(?:phaSize|lRenderers))))|StepUnicodeReservedBase)|rationNotSupportedForKeyS(?:criptError|pecifierError))|ffState|KButton|rPredicateType|bjC(?:B(?:itfield|oolType)|S(?:hortType|tr(?:ingType|uctType)|electorType)|NoType|CharType|ObjectType|DoubleType|UnionType|PointerType|VoidType|FloatType|Long(?:Type|longType)|ArrayType))|D(?:i(?:s(?:c(?:losureBezelStyle|reteCapacityLevelIndicatorStyle)|playWindowRunLoopOrdering)|acriticInsensitivePredicateOption|rect(?:Selection|PredicateModifier))|o(?:c(?:ModalWindowMask|ument(?:Directory|ationDirectory))|ubleType|wn(?:TextMovement|ArrowFunctionKey))|e(?:s(?:cendingPageOrder|ktopDirectory)|cimalTabStopType|v(?:ice(?:NColorSpaceModel|IndependentModifierFlagsMask)|eloper(?:Directory|ApplicationDirectory))|fault(?:ControlTint|TokenStyle)|lete(?:Char(?:acter|FunctionKey)|FunctionKey|LineFunctionKey)|moApplicationDirectory)|a(?:yCalendarUnit|teFormatter(?:MediumStyle|Behavior(?:10|Default)|ShortStyle|NoStyle|FullStyle|LongStyle))|ra(?:wer(?:Clos(?:ingState|edState)|Open(?:ingState|State))|gOperation(?:Generic|Move|None|Copy|Delete|Private|Every|Link|All)))|U(?:ser(?:CancelledError|D(?:irectory|omainMask)|FunctionKey)|RL(?:Handle(?:NotLoaded|Load(?:Succeeded|InProgress|Failed))|CredentialPersistence(?:None|Permanent|ForSession))|n(?:scaledWindowMask|cachedRead|i(?:codeStringEncoding|talicFontMask|fiedTitleAndToolbarWindowMask)|d(?:o(?:CloseGroupingRunLoopOrdering|FunctionKey)|e(?:finedDateComponent|rline(?:Style(?:Single|None|Thick|Double)|Pattern(?:Solid|D(?:ot|ash(?:Dot(?:Dot)?)?)))))|known(?:ColorSpaceModel|P(?:ointingDevice|ageOrder)|KeyS(?:criptError|pecifierError))|boldFontMask)|tilityWindowMask|TF8StringEncoding|p(?:dateWindowsRunLoopOrdering|TextMovement|ArrowFunctionKey))|J(?:ustifiedTextAlignment|PEG(?:2000FileType|FileType)|apaneseEUC(?:GlyphPacking|StringEncoding))|P(?:o(?:s(?:t(?:Now|erFontMask|WhenIdle|ASAP)|iti(?:on(?:Replace|Be(?:fore|ginning)|End|After)|ve(?:IntType|DoubleType|FloatType)))|pUp(?:NoArrow|ArrowAt(?:Bottom|Center))|werOffEventType|rtraitOrientation)|NGFileType|ush(?:InCell(?:Mask)?|OnPushOffButton)|e(?:n(?:TipMask|UpperSideMask|PointingDevice|LowerSideMask)|riodic(?:Mask)?)|P(?:S(?:caleField|tatus(?:Title|Field)|aveButton)|N(?:ote(?:Title|Field)|ame(?:Title|Field))|CopiesField|TitleField|ImageButton|OptionsButton|P(?:a(?:perFeedButton|ge(?:Range(?:To|From)|ChoiceMatrix))|reviewButton)|LayoutButton)|lainTextTokenStyle|a(?:useFunctionKey|ragraphSeparatorCharacter|ge(?:DownFunctionKey|UpFunctionKey))|r(?:int(?:ing(?:ReplyLater|Success|Cancelled|Failure)|ScreenFunctionKey|erTable(?:NotFound|OK|Error)|FunctionKey)|o(?:p(?:ertyList(?:XMLFormat|MutableContainers(?:AndLeaves)?|BinaryFormat|Immutable|OpenStepFormat)|rietaryStringEncoding)|gressIndicator(?:BarStyle|SpinningStyle|Preferred(?:SmallThickness|Thickness|LargeThickness|AquaThickness)))|e(?:ssedTab|vFunctionKey))|L(?:HeightForm|CancelButton|TitleField|ImageButton|O(?:KButton|rientationMatrix)|UnitsButton|PaperNameButton|WidthForm))|E(?:n(?:terCharacter|d(?:sWith(?:Comparison|PredicateOperatorType)|FunctionKey))|v(?:e(?:nOddWindingRule|rySubelement)|aluatedObjectExpressionType)|qualTo(?:Comparison|PredicateOperatorType)|ra(?:serPointingDevice|CalendarUnit|DatePickerElementFlag)|x(?:clude(?:10|QuickDrawElementsIconCreationOption)|pandedFontMask|ecuteFunctionKey))|V(?:i(?:ew(?:M(?:in(?:XMargin|YMargin)|ax(?:XMargin|YMargin))|HeightSizable|NotSizable|WidthSizable)|aPanelFontAction)|erticalRuler|a(?:lidationErrorM(?:inimum|aximum)|riableExpressionType))|Key(?:SpecifierEvaluationScriptError|Down(?:Mask)?|Up(?:Mask)?|PathExpressionType|Value(?:MinusSetMutation|SetSetMutation|Change(?:Re(?:placement|moval)|Setting|Insertion)|IntersectSetMutation|ObservingOption(?:New|Old)|UnionSetMutation|ValidationError))|QTMovie(?:NormalPlayback|Looping(?:BackAndForthPlayback|Playback))|F(?:1(?:1FunctionKey|7FunctionKey|2FunctionKey|8FunctionKey|3FunctionKey|9FunctionKey|4FunctionKey|5FunctionKey|FunctionKey|0FunctionKey|6FunctionKey)|7FunctionKey|i(?:nd(?:PanelAction(?:Replace(?:A(?:ndFind|ll(?:InSelection)?))?|S(?:howFindPanel|e(?:tFindString|lectAll(?:InSelection)?))|Next|Previous)|FunctionKey)|tPagination|le(?:Read(?:No(?:SuchFileError|PermissionError)|CorruptFileError|In(?:validFileNameError|applicableStringEncodingError)|Un(?:supportedSchemeError|knownError))|HandlingPanel(?:CancelButton|OKButton)|NoSuchFileError|ErrorM(?:inimum|aximum)|Write(?:NoPermissionError|In(?:validFileNameError|applicableStringEncodingError)|OutOfSpaceError|Un(?:supportedSchemeError|knownError))|LockingError)|xedPitchFontMask)|2(?:1FunctionKey|7FunctionKey|2FunctionKey|8FunctionKey|3FunctionKey|9FunctionKey|4FunctionKey|5FunctionKey|FunctionKey|0FunctionKey|6FunctionKey)|o(?:nt(?:Mo(?:noSpaceTrait|dernSerifsClass)|BoldTrait|S(?:ymbolicClass|criptsClass|labSerifsClass|ansSerifClass)|C(?:o(?:ndensedTrait|llectionApplicationOnlyMask)|larendonSerifsClass)|TransitionalSerifsClass|I(?:ntegerAdvancementsRenderingMode|talicTrait)|O(?:ldStyleSerifsClass|rnamentalsClass)|DefaultRenderingMode|U(?:nknownClass|IOptimizedTrait)|Panel(?:S(?:hadowEffectModeMask|t(?:andardModesMask|rikethroughEffectModeMask)|izeModeMask)|CollectionModeMask|TextColorEffectModeMask|DocumentColorEffectModeMask|UnderlineEffectModeMask|FaceModeMask|All(?:ModesMask|EffectsModeMask))|ExpandedTrait|VerticalTrait|F(?:amilyClassMask|reeformSerifsClass)|Antialiased(?:RenderingMode|IntegerAdvancementsRenderingMode))|cusRing(?:Below|Type(?:None|Default|Exterior)|Only|Above)|urByteGlyphPacking|rm(?:attingError(?:M(?:inimum|aximum))?|FeedCharacter))|8FunctionKey|unction(?:ExpressionType|KeyMask)|3(?:1FunctionKey|2FunctionKey|3FunctionKey|4FunctionKey|5FunctionKey|FunctionKey|0FunctionKey)|9FunctionKey|4FunctionKey|P(?:RevertButton|S(?:ize(?:Title|Field)|etButton)|CurrentField|Preview(?:Button|Field))|l(?:oat(?:ingPointSamplesBitmapFormat|Type)|agsChanged(?:Mask)?)|axButton|5FunctionKey|6FunctionKey)|W(?:heelModeColorPanel|indow(?:s(?:NTOperatingSystem|CP125(?:1StringEncoding|2StringEncoding|3StringEncoding|4StringEncoding|0StringEncoding)|95(?:InterfaceStyle|OperatingSystem))|M(?:iniaturizeButton|ovedEventType)|Below|CloseButton|ToolbarButton|ZoomButton|Out|DocumentIconButton|ExposedEventType|Above)|orkspaceLaunch(?:NewInstance|InhibitingBackgroundOnly|Default|PreferringClassic|WithoutA(?:ctivation|ddingToRecents)|A(?:sync|nd(?:Hide(?:Others)?|Print)|llowingClassicStartup))|eek(?:day(?:CalendarUnit|OrdinalCalendarUnit)|CalendarUnit)|a(?:ntsBidiLevels|rningAlertStyle)|r(?:itingDirection(?:RightToLeft|Natural|LeftToRight)|apCalendarComponents))|L(?:i(?:stModeMatrix|ne(?:Moves(?:Right|Down|Up|Left)|B(?:order|reakBy(?:C(?:harWrapping|lipping)|Truncating(?:Middle|Head|Tail)|WordWrapping))|S(?:eparatorCharacter|weep(?:Right|Down|Up|Left))|ToBezierPathElement|DoesntMove|arSlider)|teralSearch|kePredicateOperatorType|ghterFontAction|braryDirectory)|ocalDomainMask|e(?:ssThan(?:Comparison|OrEqualTo(?:Comparison|PredicateOperatorType)|PredicateOperatorType)|ft(?:Mouse(?:D(?:own(?:Mask)?|ragged(?:Mask)?)|Up(?:Mask)?)|T(?:ext(?:Movement|Alignment)|ab(?:sBezelBorder|StopType))|ArrowFunctionKey))|a(?:yout(?:RightToLeft|NotDone|CantFit|OutOfGlyphs|Done|LeftToRight)|ndscapeOrientation)|ABColorSpaceModel)|A(?:sc(?:iiWithDoubleByteEUCGlyphPacking|endingPageOrder)|n(?:y(?:Type|PredicateModifier|EventMask)|choredSearch|imation(?:Blocking|Nonblocking(?:Threaded)?|E(?:ffect(?:DisappearingItemDefault|Poof)|ase(?:In(?:Out)?|Out))|Linear)|dPredicateType)|t(?:Bottom|tachmentCharacter|omicWrite|Top)|SCIIStringEncoding|d(?:obe(?:GB1CharacterCollection|CNS1CharacterCollection|Japan(?:1CharacterCollection|2CharacterCollection)|Korea1CharacterCollection)|dTraitFontAction|minApplicationDirectory)|uto(?:saveOperation|Pagination)|pp(?:lication(?:SupportDirectory|D(?:irectory|e(?:fined(?:Mask)?|legateReply(?:Success|Cancel|Failure)|activatedEventType))|ActivatedEventType)|KitDefined(?:Mask)?)|l(?:ternateKeyMask|pha(?:ShiftKeyMask|NonpremultipliedBitmapFormat|FirstBitmapFormat)|ert(?:SecondButtonReturn|ThirdButtonReturn|OtherReturn|DefaultReturn|ErrorReturn|FirstButtonReturn|AlternateReturn)|l(?:ScrollerParts|DomainsMask|PredicateModifier|LibrariesDirectory|ApplicationsDirectory))|rgument(?:sWrongScriptError|EvaluationScriptError)|bove(?:Bottom|Top)|WTEventType)))(?:\\b)" - }, - { - token: "support.function.C99.c", - regex: C_Highlight_File.cFunctions - }, - { - token : cObj.getKeywords(), - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" - }, - { - token: "punctuation.section.scope.begin.objc", - regex: "\\[", - next: "bracketed_content" - }, - { - token: "meta.function.objc", - regex: "^(?:-|\\+)\\s*" - } - ], - "constant_NSString": [ - { - token: "constant.character.escape.objc", - regex: escapedConstRe - }, - { - token: "invalid.illegal.unknown-escape.objc", - regex: "\\\\." - }, - { - token: "string", - regex: '[^"\\\\]+' - }, - { - token: "punctuation.definition.string.end", - regex: "\"", - next: "start" - } - ], - "protocol_list": [ - { - token: "punctuation.section.scope.end.objc", - regex: ">", - next: "start" - }, - { - token: "support.other.protocol.objc", - regex: "\bNS(?:GlyphStorage|M(?:utableCopying|enuItem)|C(?:hangeSpelling|o(?:ding|pying|lorPicking(?:Custom|Default)))|T(?:oolbarItemValidations|ext(?:Input|AttachmentCell))|I(?:nputServ(?:iceProvider|erMouseTracker)|gnoreMisspelledWords)|Obj(?:CTypeSerializationCallBack|ect)|D(?:ecimalNumberBehaviors|raggingInfo)|U(?:serInterfaceValidations|RL(?:HandleClient|DownloadDelegate|ProtocolClient|AuthenticationChallengeSender))|Validated(?:ToobarItem|UserInterfaceItem)|Locking)\b" - } - ], - "selectors": [ - { - token: "support.function.any-method.name-of-parameter.objc", - regex: "\\b(?:[a-zA-Z_:][\\w]*)+" - }, - { - token: "punctuation", - regex: "\\)", - next: "start" - } - ], - "bracketed_content": [ - { - token: "punctuation.section.scope.end.objc", - regex: "\]", - next: "start" - }, - { - token: ["support.function.any-method.objc"], - regex: "(?:predicateWithFormat:| NSPredicate predicateWithFormat:)", - next: "start" - }, - { - token: "support.function.any-method.objc", - regex: "\\w+(?::|(?=\]))", - next: "start" - } - ], - "bracketed_strings": [ - { - token: "punctuation.section.scope.end.objc", - regex: "\]", - next: "start" - }, - { - token: "keyword.operator.logical.predicate.cocoa", - regex: "\\b(?:AND|OR|NOT|IN)\\b" - }, - { - token: ["invalid.illegal.unknown-method.objc", "punctuation.separator.arguments.objc"], - regex: "\\b(\w+)(:)" - }, - { - regex: "\\b(?:ALL|ANY|SOME|NONE)\\b", - token: "constant.language.predicate.cocoa" - }, - { - regex: "\\b(?:NULL|NIL|SELF|TRUE|YES|FALSE|NO|FIRST|LAST|SIZE)\\b", - token: "constant.language.predicate.cocoa" - }, - { - regex: "\\b(?:MATCHES|CONTAINS|BEGINSWITH|ENDSWITH|BETWEEN)\\b", - token: "keyword.operator.comparison.predicate.cocoa" - }, - { - regex: "\\bC(?:ASEINSENSITIVE|I)\\b", - token: "keyword.other.modifier.predicate.cocoa" - }, - { - regex: "\\b(?:ANYKEY|SUBQUERY|CAST|TRUEPREDICATE|FALSEPREDICATE)\\b", - token: "keyword.other.predicate.cocoa" - }, - { - regex: escapedConstRe, - token: "constant.character.escape.objc" - }, - { - regex: "\\\\.", - token: "invalid.illegal.unknown-escape.objc" - }, - { - token: "string", - regex: '[^"\\\\]' - }, - { - token: "punctuation.definition.string.end.objc", - regex: "\"", - next: "predicates" - } - ], - "comment" : [ - { - token : "comment", // closing comment - regex : ".*?\\*\\/", - next : "start" - }, { - token : "comment", // comment spanning whole line - regex : ".+" - } - ], - "methods" : [ - { - token : "meta.function.objc", - regex : "(?=\\{|#)|;", - next : "start" - } - ] -} - - // copy in C-Rules directly - for (var r in cRules) { - if (this.$rules[r]) { - if (this.$rules[r].push) - this.$rules[r].push.apply(this.$rules[r], cRules[r]); - } else { - this.$rules[r] = cRules[r]; - } - } - - this.$rules.bracketed_content = this.$rules.bracketed_content.concat( - this.$rules.start, specialVariables - ); - - this.embedRules(DocCommentHighlightRules, "doc-", - [ DocCommentHighlightRules.getEndRule("start") ]); -}; - -oop.inherits(ObjectiveCHighlightRules, CHighlightRules); - -exports.ObjectiveCHighlightRules = ObjectiveCHighlightRules; -}); diff --git a/lib/ace/mode/ocaml.js b/lib/ace/mode/ocaml.js index 6313d3fb..e61aba55 100644 --- a/lib/ace/mode/ocaml.js +++ b/lib/ace/mode/ocaml.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Sergi Mansilla + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -33,13 +40,13 @@ define(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.HighlightRules = OcamlHighlightRules; - + this.$tokenizer = new Tokenizer(new OcamlHighlightRules().getRules()); this.$outdent = new MatchingBraceOutdent(); }; oop.inherits(Mode, TextMode); @@ -73,7 +80,7 @@ var indenter = /(?:[({[=:]|[-=]>|\b(?:else|try|with))\s*$/; this.getNextLineIndent = function(state, line, tab) { var indent = this.$getIndent(line); - var tokens = this.getTokenizer().getLineTokens(line, state).tokens; + var tokens = this.$tokenizer.getLineTokens(line, state).tokens; if (!(tokens.length && tokens[tokens.length - 1].type === 'comment') && state === 'start' && indenter.test(line)) @@ -89,7 +96,6 @@ var indenter = /(?:[({[=:]|[-=]>|\b(?:else|try|with))\s*$/; this.$outdent.autoOutdent(doc, row); }; - this.$id = "ace/mode/ocaml"; }).call(Mode.prototype); exports.Mode = Mode; diff --git a/lib/ace/mode/ocaml_highlight_rules.js b/lib/ace/mode/ocaml_highlight_rules.js index a17f034d..dca7b229 100644 --- a/lib/ace/mode/ocaml_highlight_rules.js +++ b/lib/ace/mode/ocaml_highlight_rules.js @@ -1,52 +1,64 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * ***** END LICENSE BLOCK ***** */ + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Sergi Mansilla + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** + * + */ define(function(require, exports, module) { "use strict"; var oop = require("../lib/oop"); +var lang = require("../lib/lang"); var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var OcamlHighlightRules = function() { - var keywords = ( + var keywords = lang.arrayToMap(( "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" + "virtual|when|while|with").split("|") ); - var builtinConstants = ("true|false"); + var builtinConstants = lang.arrayToMap( + ("true|false").split("|") + ); - var builtinFunctions = ( + var builtinFunctions = lang.arrayToMap(( "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|" + @@ -227,14 +239,7 @@ var OcamlHighlightRules = function() { "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"); + ).split("|")); var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))"; var octInteger = "(?:0[oO]?[0-7]+)"; @@ -257,6 +262,7 @@ var OcamlHighlightRules = function() { }, { token : "comment", + merge : true, regex : '\\(\\*.*', next : "comment" }, @@ -270,6 +276,7 @@ var OcamlHighlightRules = function() { }, { token : "string", // " string + merge : true, regex : '"', next : "qstring" }, @@ -286,7 +293,16 @@ var OcamlHighlightRules = function() { regex : integer + "\\b" }, { - token : keywordMapper, + token : function(value) { + if (keywords.hasOwnProperty(value)) + return "keyword"; + else if (builtinConstants.hasOwnProperty(value)) + return "constant.language"; + else if (builtinFunctions.hasOwnProperty(value)) + return "support.function"; + else + return "identifier"; + }, regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" }, { @@ -314,6 +330,7 @@ var OcamlHighlightRules = function() { }, { token : "comment", // comment spanning whole line + merge : true, regex : ".+" } ], @@ -325,6 +342,7 @@ var OcamlHighlightRules = function() { next : "start" }, { token : "string", + merge : true, regex : '.+' } ] diff --git a/lib/ace/mode/pascal.js b/lib/ace/mode/pascal.js deleted file mode 100644 index 944088ca..00000000 --- a/lib/ace/mode/pascal.js +++ /dev/null @@ -1,67 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * Contributor(s): - * - * - * - * ***** END LICENSE BLOCK ***** */ - -/* - THIS FILE WAS AUTOGENERATED BY mode.tmpl.js -*/ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextMode = require("./text").Mode; -var PascalHighlightRules = require("./pascal_highlight_rules").PascalHighlightRules; -// TODO: pick appropriate fold mode -var FoldMode = require("./folding/coffee").FoldMode; - -var Mode = function() { - this.HighlightRules = PascalHighlightRules; - this.foldingRules = new FoldMode(); -}; -oop.inherits(Mode, TextMode); - -(function() { - - this.lineCommentStart = ["--", "//"]; - this.blockComment = [ - {start: "(*", end: "*)"}, - {start: "{", end: "}"} - ]; - - this.$id = "ace/mode/pascal"; -}).call(Mode.prototype); - -exports.Mode = Mode; -}); \ No newline at end of file diff --git a/lib/ace/mode/pascal_highlight_rules.js b/lib/ace/mode/pascal_highlight_rules.js deleted file mode 100644 index ac8a4180..00000000 --- a/lib/ace/mode/pascal_highlight_rules.js +++ /dev/null @@ -1,127 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2012, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -/* THIS FILE WAS AUTOGENERATED FROM tool\tm bundles\pascal.tmbundle\Syntaxes\Pascal.plist (UUID: F42FA544-6B1C-11D9-9517-000D93589AF6) */ -/**************************************************************** - * IT MIGHT NOT BE PERFECT, PARTICULARLY: * - * IN DECIDING STATES TO TRANSITION TO, * - * IGNORING WHITESPACE, * - * IGNORING GROUPS WITH ?:, * - * EXTENDING EXISTING MODES, * - * GATHERING KEYWORDS, OR * - * DECIDING WHEN TO USE PUSH. * - * ...But it's a good start from an existing *.tmlanguage file. * - ****************************************************************/ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("../lib/oop"); -var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; - -var PascalHighlightRules = function() { - // regexp must not have capturing parentheses. Use (?:) instead. - // regexps are ordered -> the first match is used - - this.$rules = { start: - [ { caseInsensitive: true, - token: 'keyword.control.pascal', - regex: '\\b(?:(absolute|abstract|all|and|and_then|array|as|asm|attribute|begin|bindable|case|class|const|constructor|destructor|div|do|do|else|end|except|export|exports|external|far|file|finalization|finally|for|forward|goto|if|implementation|import|in|inherited|initialization|interface|interrupt|is|label|library|mod|module|name|near|nil|not|object|of|only|operator|or|or_else|otherwise|packed|pow|private|program|property|protected|public|published|qualified|record|repeat|resident|restricted|segment|set|shl|shr|then|to|try|type|unit|until|uses|value|var|view|virtual|while|with|xor))\\b' }, - { caseInsensitive: true, - token: - [ 'variable.pascal', "text", - 'storage.type.prototype.pascal', - 'entity.name.function.prototype.pascal' ], - regex: '\\b(function|procedure)(\\s+)(\\w+)(\\.\\w+)?(?=(?:\\(.*?\\))?;\\s*(?:attribute|forward|external))' }, - { caseInsensitive: true, - token: - [ 'variable.pascal', "text", - 'storage.type.function.pascal', - 'entity.name.function.pascal' ], - regex: '\\b(function|procedure)(\\s+)(\\w+)(\\.\\w+)?' }, - { token: 'constant.numeric.pascal', - regex: '\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b' }, - { token: 'punctuation.definition.comment.pascal', - regex: '--.*$', - push_: - [ { token: 'comment.line.double-dash.pascal.one', - regex: '$', - next: 'pop' }, - { defaultToken: 'comment.line.double-dash.pascal.one' } ] }, - { token: 'punctuation.definition.comment.pascal', - regex: '//.*$', - push_: - [ { token: 'comment.line.double-slash.pascal.two', - regex: '$', - next: 'pop' }, - { defaultToken: 'comment.line.double-slash.pascal.two' } ] }, - { token: 'punctuation.definition.comment.pascal', - regex: '\\(\\*', - push: - [ { token: 'punctuation.definition.comment.pascal', - regex: '\\*\\)', - next: 'pop' }, - { defaultToken: 'comment.block.pascal.one' } ] }, - { token: 'punctuation.definition.comment.pascal', - regex: '\\{', - push: - [ { token: 'punctuation.definition.comment.pascal', - regex: '\\}', - next: 'pop' }, - { defaultToken: 'comment.block.pascal.two' } ] }, - { token: 'punctuation.definition.string.begin.pascal', - regex: '"', - push: - [ { token: 'constant.character.escape.pascal', regex: '\\\\.' }, - { token: 'punctuation.definition.string.end.pascal', - regex: '"', - next: 'pop' }, - { defaultToken: 'string.quoted.double.pascal' } ], - //Double quoted strings are an extension and (generally) support C-style escape sequences. - }, - { token: 'punctuation.definition.string.begin.pascal', - regex: '\'', - push: - [ { token: 'constant.character.escape.apostrophe.pascal', - regex: '\'\'' }, - { token: 'punctuation.definition.string.end.pascal', - regex: '\'', - next: 'pop' }, - { defaultToken: 'string.quoted.single.pascal' } ] }, - { token: 'keyword.operator', - regex: '[+\\-;,/*%]|:=|=' } ] } - - this.normalizeRules(); -}; - -oop.inherits(PascalHighlightRules, TextHighlightRules); - -exports.PascalHighlightRules = PascalHighlightRules; -}); \ No newline at end of file diff --git a/lib/ace/mode/perl.js b/lib/ace/mode/perl.js index 69c4d27e..9c7b8de6 100644 --- a/lib/ace/mode/perl.js +++ b/lib/ace/mode/perl.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Panagiotis Astithas + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -33,32 +40,53 @@ define(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.HighlightRules = PerlHighlightRules; - + this.$tokenizer = new Tokenizer(new PerlHighlightRules().getRules()); this.$outdent = new MatchingBraceOutdent(); - this.foldingRules = new CStyleFoldMode({start: "^=(begin|item)\\b", end: "^=(cut)\\b"}); + this.foldingRules = new CStyleFoldMode(); }; oop.inherits(Mode, TextMode); (function() { - this.lineCommentStart = "#"; - this.blockComment = [ - {start: "=begin", end: "=cut"}, - {start: "=item", end: "=cut"} - ]; + 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.getTokenizer().getLineTokens(line, state); + var tokenizedLine = this.$tokenizer.getLineTokens(line, state); var tokens = tokenizedLine.tokens; if (tokens.length && tokens[tokens.length-1].type == "comment") { @@ -83,7 +111,6 @@ oop.inherits(Mode, TextMode); this.$outdent.autoOutdent(doc, row); }; - this.$id = "ace/mode/perl"; }).call(Mode.prototype); exports.Mode = Mode; diff --git a/lib/ace/mode/perl_highlight_rules.js b/lib/ace/mode/perl_highlight_rules.js index 7c183fe3..ed1e45c8 100644 --- a/lib/ace/mode/perl_highlight_rules.js +++ b/lib/ace/mode/perl_highlight_rules.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Panagiotis Astithas + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,19 +39,22 @@ define(function(require, exports, module) { "use strict"; var oop = require("../lib/oop"); +var lang = require("../lib/lang"); 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 keywords = lang.arrayToMap( + ("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").split("|") ); - var buildinConstants = ("ARGV|ENV|INC|SIG"); + var buildinConstants = lang.arrayToMap( + ("ARGV|ENV|INC|SIG").split("|") + ); - var builtinFunctions = ( - "getprotobynumber|getprotobyname|getservbyname|gethostbyaddr|" + + var builtinFunctions = lang.arrayToMap( + ("getprotobynumber|getprotobyname|getservbyname|gethostbyaddr|" + "gethostbyname|getservbyport|getnetbyaddr|getnetbyname|getsockname|" + "getpeername|setpriority|getprotoent|setprotoent|getpriority|" + "endprotoent|getservent|setservent|endservent|sethostent|socketpair|" + @@ -65,24 +75,17 @@ var PerlHighlightRules = function() { "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" + "map|die|uc|lc|do").split("|") ); - 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.doc", - regex : "^=(?:begin|item)\\b", - next : "block_comment" + token : "comment", + regex : "#.*$" }, { token : "string.regexp", regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" @@ -91,6 +94,7 @@ var PerlHighlightRules = function() { regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' }, { token : "string", // multi line string start + merge : true, regex : '["].*\\\\$', next : "qqstring" }, { @@ -98,6 +102,7 @@ var PerlHighlightRules = function() { regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" }, { token : "string", // multi line string start + merge : true, regex : "['].*\\\\$", next : "qstring" }, { @@ -107,14 +112,20 @@ var PerlHighlightRules = function() { token : "constant.numeric", // float regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" }, { - token : keywordMapper, + token : function(value) { + if (keywords.hasOwnProperty(value)) + return "keyword"; + else if (buildinConstants.hasOwnProperty(value)) + return "constant.language"; + else if (builtinFunctions.hasOwnProperty(value)) + return "support.function"; + else + return "identifier"; + }, 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 : "comment", - regex : "#.*$" + 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 : "[[({]" @@ -133,6 +144,7 @@ var PerlHighlightRules = function() { next : "start" }, { token : "string", + merge : true, regex : '.+' } ], @@ -143,18 +155,9 @@ var PerlHighlightRules = function() { next : "start" }, { token : "string", + merge : true, regex : '.+' } - ], - "block_comment": [ - { - token: "comment.doc", - regex: "^=cut\\b", - next: "start" - }, - { - defaultToken: "comment.doc" - } ] }; }; diff --git a/lib/ace/mode/pgsql.js b/lib/ace/mode/pgsql.js index d9775837..0ac91688 100755 --- a/lib/ace/mode/pgsql.js +++ b/lib/ace/mode/pgsql.js @@ -1,59 +1,78 @@ /* ***** 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 ***** */ +* The Original Code is Ajax.org Code Editor (ACE). +* +* Contributor(s): +* Jonathan Camile +* +* Alternatively, the contents of this file may be used under the terms of +* either the GNU General Public License Version 2 or later (the "GPL"), or +* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +* in which case the provisions of the GPL or the LGPL are applicable instead +* of those above. If you wish to allow use of your version of this file only +* under the terms of either the GPL or the LGPL, and not to allow others to +* use your version of this file under the terms of the MPL, indicate your +* decision by deleting the provisions above and replace them with the notice +* and other provisions required by the GPL or the LGPL. If you do not delete +* the provisions above, a recipient may use your version of this file under +* the terms of any one of the MPL, the GPL or the LGPL. +* +* ***** END LICENSE BLOCK ***** */ define(function(require, exports, module) { -var oop = require("../lib/oop"); -var TextMode = require("../mode/text").Mode; -var PgsqlHighlightRules = require("./pgsql_highlight_rules").PgsqlHighlightRules; -var Range = require("../range").Range; + var oop = require("ace/lib/oop"); + var TextMode = require("ace/mode/text").Mode; + var Tokenizer = require("ace/tokenizer").Tokenizer; + var PgsqlHighlightRules = require("ace/mode/pgsql_highlight_rules").PgsqlHighlightRules; + var Range = require("ace/range").Range; + // var EditSession = require("ace/edit_session").EditSession; -var Mode = function() { - this.HighlightRules = PgsqlHighlightRules; -}; -oop.inherits(Mode, TextMode); + var Mode = function() { + this.$tokenizer = new Tokenizer(new PgsqlHighlightRules().getRules()); + }; + oop.inherits(Mode, TextMode); -(function() { - this.lineCommentStart = "--"; - this.blockComment = {start: "/*", end: "*/"}; + (function() { - 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 + 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 + } } - } - this.$id = "ace/mode/pgsql"; -}).call(Mode.prototype); + }).call(Mode.prototype); -exports.Mode = Mode; + exports.Mode = Mode; }); diff --git a/lib/ace/mode/pgsql_highlight_rules.js b/lib/ace/mode/pgsql_highlight_rules.js index 15e8f06d..ca381b14 100755 --- a/lib/ace/mode/pgsql_highlight_rules.js +++ b/lib/ace/mode/pgsql_highlight_rules.js @@ -1,321 +1,290 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * The Original Code is Ajax.org Code Editor (ACE). * - * 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. + * Contributor(s): + * John DeSoi, Ph.D. * - * ***** END LICENSE BLOCK ***** */ + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** + * + */ + define(function(require, exports, module) { -var oop = require("../lib/oop"); -var lang = require("../lib/lang"); +var oop = require("ace/lib/oop"); +var lang = require("ace/lib/lang"); var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -// Syntax highlighting for pl/languages and json. +// 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 JsonHighlightRules = require("./json_highlight_rules").JsonHighlightRules; -var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; var PgsqlHighlightRules = function() { - - // Keywords, functions, operators last updated for pg 9.3. - var keywords = ( - "abort|absolute|abstime|access|aclitem|action|add|admin|after|aggregate|all|also|alter|always|" + - "analyse|analyze|and|any|anyarray|anyelement|anyenum|anynonarray|anyrange|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|" + + + // Keywords, functions, operators last updated for pg 9.1. + var keywords = lang.arrayToMap( + ("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|daterange|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|event|event_trigger|" + - "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|int4range|int8|int8range|integer|" + - "internal|intersect|interval|into|invoker|is|isnull|isolation|join|json|key|label|language|" + - "language_handler|large|last|lateral|lc_collate|lc_ctype|leading|leakproof|least|left|level|" + - "like|limit|line|listen|load|local|localtime|localtimestamp|location|lock|lseg|macaddr|" + - "mapping|match|materialized|maxvalue|minute|minvalue|mode|money|month|move|name|names|" + - "national|natural|nchar|next|no|none|not|nothing|notify|notnull|nowait|null|nullif|nulls|" + - "numeric|numrange|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|program|quote|range|read|real|" + - "reassign|recheck|record|recursive|ref|refcursor|references|refresh|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|snapshot|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|tsrange|tstzrange|tsvector|" + - "txid_snapshot|type|types|unbounded|uncommitted|unencrypted|union|unique|unknown|unlisten|" + + "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" + "xmlforest|xmlparse|xmlpi|xmlroot|xmlserialize|year|yes|zone").split("|") ); - - - var builtinFunctions = ( - "RI_FKey_cascade_del|RI_FKey_cascade_upd|RI_FKey_check_ins|RI_FKey_check_upd|" + + + + var builtinFunctions = lang.arrayToMap( + ("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|acldefault|" + - "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|anyrange_in|anyrange_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_remove|array_replace|array_send|array_smaller|" + - "array_to_json|array_to_string|array_typanalyze|array_upper|arraycontained|" + - "arraycontains|arraycontjoinsel|arraycontsel|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|btcanreturn|btcharcmp|btcostestimate|btendscan|btfloat48cmp|btfloat4cmp|" + - "btfloat4sortsupport|btfloat84cmp|btfloat8cmp|btfloat8sortsupport|btgetbitmap|" + - "btgettuple|btinsert|btint24cmp|btint28cmp|btint2cmp|btint2sortsupport|btint42cmp|" + - "btint48cmp|btint4cmp|btint4sortsupport|btint82cmp|btint84cmp|btint8cmp|" + - "btint8sortsupport|btmarkpos|btnamecmp|btnamesortsupport|btoidcmp|btoidsortsupport|" + - "btoidvectorcmp|btoptions|btrecordcmp|btreltimecmp|btrescan|btrestrpos|btrim|" + - "bttext_pattern_cmp|bttextcmp|bttidcmp|bttintervalcmp|btvacuumcleanup|" + - "bytea_string_agg_finalfn|bytea_string_agg_transfn|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_sortsupport|date_trunc|daterange|" + - "daterange_canonical|daterange_subdiff|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|elem_contained_by_range|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|event_trigger_in|event_trigger_out|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|" + + "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|has_type_privilege|hash_aclitem|hash_array|hash_numeric|" + - "hash_range|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|" + - "int4range|int4range_canonical|int4range_subdiff|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|" + - "int8range|int8range_canonical|int8range_subdiff|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_transform|" + - "interval_um|intervaltypmodin|intervaltypmodout|intinterval|isclosed|isempty|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|json_agg|" + - "json_agg_finalfn|json_agg_transfn|json_array_element|json_array_element_text|" + - "json_array_elements|json_array_length|json_each|json_each_text|json_extract_path|" + - "json_extract_path_op|json_extract_path_text|json_extract_path_text_op|json_in|" + - "json_object_field|json_object_field_text|json_object_keys|json_out|" + - "json_populate_record|json_populate_recordset|json_recv|json_send|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_lseek64|lo_open|lo_tell|lo_tell64|lo_truncate|" + - "lo_truncate64|lo_unlink|log|loread|lower|lower_inc|lower_inf|lowrite|lpad|lseg|lseg_center|" + + "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_and|macaddr_cmp|macaddr_eq|macaddr_ge|" + - "macaddr_gt|macaddr_in|macaddr_le|macaddr_lt|macaddr_ne|macaddr_not|macaddr_or|" + - "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_transform|numeric_uminus|numeric_uplus|numeric_var_pop|numeric_var_samp|" + - "numerictypmodin|numerictypmodout|numnode|numrange|numrange_subdiff|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|" + + "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_backup_start_time|pg_cancel_backend|pg_char_to_encoding|pg_client_encoding|" + - "pg_collation_for|pg_collation_is_visible|pg_column_is_updatable|pg_column_size|" + - "pg_conf_load_time|pg_conversion_is_visible|pg_create_restore_point|" + + "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_event_trigger_dropped_objects|pg_export_snapshot|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_multixact_members|pg_get_ruledef|pg_get_serial_sequence|pg_get_triggerdef|" + - "pg_get_userbyid|pg_get_viewdef|pg_has_role|pg_identify_object|pg_indexes_size|" + - "pg_is_in_backup|pg_is_in_recovery|pg_is_other_temp_schema|pg_is_xlog_replay_paused|" + + "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_opfamily_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_is_updatable|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_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_checkpoint_sync_time|" + - "pg_stat_get_checkpoint_write_time|pg_stat_get_db_blk_read_time|" + - "pg_stat_get_db_blk_write_time|pg_stat_get_db_blocks_fetched|" + + "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_deadlocks|" + - "pg_stat_get_db_numbackends|pg_stat_get_db_stat_reset_time|" + - "pg_stat_get_db_temp_bytes|pg_stat_get_db_temp_files|pg_stat_get_db_tuples_deleted|" + + "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_total_time|pg_stat_get_last_analyze_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|" + @@ -323,36 +292,30 @@ var PgsqlHighlightRules = function() { "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_total_time|" + + "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_location|pg_tablespace_size|" + - "pg_terminate_backend|pg_timezone_abbrevs|pg_timezone_names|pg_total_relation_size|" + - "pg_trigger_depth|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_location_diff|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|range_adjacent|" + - "range_after|range_before|range_cmp|range_contained_by|range_contains|" + - "range_contains_elem|range_eq|range_ge|range_gist_compress|range_gist_consistent|" + - "range_gist_decompress|range_gist_penalty|range_gist_picksplit|range_gist_same|" + - "range_gist_union|range_gt|range_in|range_intersect|range_le|range_lt|range_minus|" + - "range_ne|range_out|range_overlaps|range_overleft|range_overright|range_recv|range_send|" + - "range_typanalyze|range_union|rangesel|rank|record_eq|record_ge|record_gt|record_in|" + + "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|" + @@ -363,22 +326,14 @@ var PgsqlHighlightRules = function() { "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|row_to_json|rpad|" + - "rtrim|scalargtjoinsel|scalargtsel|scalarltjoinsel|scalarltsel|schema_to_xml|" + + "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|spg_kd_choose|spg_kd_config|spg_kd_inner_consistent|spg_kd_picksplit|" + - "spg_quad_choose|spg_quad_config|spg_quad_inner_consistent|spg_quad_leaf_consistent|" + - "spg_quad_picksplit|spg_range_quad_choose|spg_range_quad_config|" + - "spg_range_quad_inner_consistent|spg_range_quad_leaf_consistent|" + - "spg_range_quad_picksplit|spg_text_choose|spg_text_config|spg_text_inner_consistent|" + - "spg_text_leaf_consistent|spg_text_picksplit|spgbeginscan|spgbuild|spgbuildempty|" + - "spgbulkdelete|spgcanreturn|spgcostestimate|spgendscan|spggetbitmap|spggettuple|" + - "spginsert|spgmarkpos|spgoptions|spgrescan|spgrestrpos|spgvacuumcleanup|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|" + + "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|" + @@ -387,7 +342,7 @@ var PgsqlHighlightRules = function() { "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|time_transform|timedate_pl|timemi|timenow|timeofday|timepl|timestamp_cmp|" + + "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|" + @@ -395,9 +350,9 @@ var PgsqlHighlightRules = function() { "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|" + - "timestamp_sortsupport|timestamp_transform|timestamptypmodin|timestamptypmodout|" + - "timestamptz_cmp|timestamptz_cmp_date|timestamptz_cmp_timestamp|timestamptz_eq|" + - "timestamptz_eq_date|timestamptz_eq_timestamp|timestamptz_ge|timestamptz_ge_date|" + + "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|" + @@ -412,42 +367,36 @@ var PgsqlHighlightRules = function() { "tintervalleneq|tintervallenge|tintervallengt|tintervallenle|tintervallenlt|" + "tintervallenne|tintervallt|tintervalne|tintervalout|tintervalov|tintervalrecv|" + "tintervalrel|tintervalsame|tintervalsend|tintervalstart|to_ascii|to_char|to_date|to_hex|" + - "to_json|to_number|to_timestamp|to_tsquery|to_tsvector|transaction_timestamp|translate|" + + "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|tsrange|" + - "tsrange_subdiff|tstzrange|tstzrange_subdiff|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|upper_inc|upper_inf|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|varbit_transform|varbitcmp|varbiteq|varbitge|varbitgt|varbitle|" + - "varbitlt|varbitne|varbittypmodin|varbittypmodout|varchar_transform|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" + "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").split("|") ); - - var keywordMapper = this.createKeywordMapper({ - "support.function": builtinFunctions, - "keyword": keywords - }, "identifier", true); - - - var sqlRules = [{ + + var sqlRules = [ + { token : "string", // single line string -- assume dollar strings if multi-line for now regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" }, { @@ -457,35 +406,46 @@ var PgsqlHighlightRules = function() { 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+" - } + token : function(value) { + value = value.toLowerCase(); + if (keywords.hasOwnProperty(value)) { + return "keyword"; + } else if (builtinFunctions.hasOwnProperty(value)) { + return "support.function"; + } else { + return "identifier"; + } + }, + 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" : [{ + "start" : [ + { token : "comment", regex : "--.*$" - }, + }, DocCommentHighlightRules.getStartRule("doc-start"), { token : "comment", // multi-line comment + merge : true, regex : "\\/\\*", next : "comment" },{ @@ -497,12 +457,14 @@ var PgsqlHighlightRules = function() { regex : "^\\\\[\\S]+.*$" } ], - - "statement" : [{ + + "statement" : [ + { token : "comment", regex : "--.*$" }, { token : "comment", // multi-line comment + merge : true, regex : "\\/\\*", next : "commentStatement" }, { @@ -510,22 +472,14 @@ var PgsqlHighlightRules = function() { regex : ";", next : "start" }, { - token : "string", + 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 : "\\$json\\$", - next : "json-start" - }, { - token : "string", - regex : "\\$(js|javascript)\\$", - next : "javascript-start" - }, { + },{ token : "string", regex : "\\$[\\w_0-9]*\\$$", // dollar quote at the end of a line next : "dollarSql" @@ -535,12 +489,14 @@ var PgsqlHighlightRules = function() { next : "dollarStatementString" } ].concat(sqlRules), - - "dollarSql" : [{ + + "dollarSql" : [ + { token : "comment", regex : "--.*$" }, { token : "comment", // multi-line comment + merge : true, regex : "\\/\\*", next : "commentDollarSql" }, { @@ -553,63 +509,71 @@ var PgsqlHighlightRules = function() { next : "dollarSqlString" } ].concat(sqlRules), - - "comment" : [{ + + "comment" : [ + { token : "comment", // closing comment regex : ".*?\\*\\/", next : "start" }, { token : "comment", // comment spanning whole line + merge : true, regex : ".+" } ], - - "commentStatement" : [{ + + "commentStatement" : [ + { token : "comment", // closing comment regex : ".*?\\*\\/", next : "statement" }, { token : "comment", // comment spanning whole line + merge : true, regex : ".+" } ], - - "commentDollarSql" : [{ + + "commentDollarSql" : [ + { token : "comment", // closing comment regex : ".*?\\*\\/", next : "dollarSql" }, { token : "comment", // comment spanning whole line + merge : true, regex : ".+" } ], - - "dollarStatementString" : [{ + + "dollarStatementString" : [ + { token : "string", // closing dollarstring regex : ".*?\\$[\\w_0-9]*\\$", next : "statement" }, { token : "string", // dollarstring spanning whole line + merge : true, regex : ".+" } ], - - "dollarSqlString" : [{ + + "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"}]); - this.embedRules(JsonHighlightRules, "json-", [{token : "string", regex : "\\$json\\$", next : "statement"}]); - this.embedRules(JavaScriptHighlightRules, "javascript-", [{token : "string", regex : "\\$(js|javascript)\\$", next : "statement"}]); }; oop.inherits(PgsqlHighlightRules, TextHighlightRules); diff --git a/lib/ace/mode/php.js b/lib/ace/mode/php.js index 39119e22..09b1cb9e 100644 --- a/lib/ace/mode/php.js +++ b/lib/ace/mode/php.js @@ -1,84 +1,95 @@ /* ***** 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 ***** */ +* Version: MPL 1.1/GPL 2.0/LGPL 2.1 +* +* The contents of this file are subject to the Mozilla Public License Version +* 1.1 (the "License"); you may not use this file except in compliance with +* the License. You may obtain a copy of the License at +* http://www.mozilla.org/MPL/ +* +* Software distributed under the License is distributed on an "AS IS" basis, +* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +* for the specific language governing rights and limitations under the +* License. +* +* The Original Code is Ajax.org Code Editor (ACE). +* +* The Initial Developer of the Original Code is +* Ajax.org B.V. +* Portions created by the Initial Developer are Copyright (C) 2010 +* the Initial Developer. All Rights Reserved. +* +* Contributor(s): +* André Fiedler +* +* Alternatively, the contents of this file may be used under the terms of +* either the GNU General Public License Version 2 or later (the "GPL"), or +* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +* in which case the provisions of the GPL or the LGPL are applicable instead +* of those above. If you wish to allow use of your version of this file only +* under the terms of either the GPL or the LGPL, and not to allow others to +* use your version of this file under the terms of the MPL, indicate your +* decision by deleting the provisions above and replace them with the notice +* and other provisions required by the GPL or the LGPL. If you do not delete +* the provisions above, a recipient may use your version of this file under +* the terms of any one of the MPL, the GPL or the LGPL. +* +* ***** END LICENSE BLOCK ***** */ define(function(require, exports, module) { "use strict"; var oop = require("../lib/oop"); var TextMode = require("./text").Mode; +var Tokenizer = require("../tokenizer").Tokenizer; var PhpHighlightRules = require("./php_highlight_rules").PhpHighlightRules; -var PhpLangHighlightRules = require("./php_highlight_rules").PhpLangHighlightRules; 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 unicode = require("../unicode"); -var HtmlMode = require("./html").Mode; -var JavaScriptMode = require("./javascript").Mode; -var CssMode = require("./css").Mode; -var PhpMode = function(opts) { - this.HighlightRules = PhpLangHighlightRules; +var Mode = function() { + this.$tokenizer = new Tokenizer(new PhpHighlightRules().getRules()); this.$outdent = new MatchingBraceOutdent(); this.$behaviour = new CstyleBehaviour(); this.foldingRules = new CStyleFoldMode(); }; -oop.inherits(PhpMode, TextMode); +oop.inherits(Mode, TextMode); (function() { - this.tokenRe = new RegExp("^[" - + unicode.packages.L - + unicode.packages.Mn + unicode.packages.Mc - + unicode.packages.Nd - + unicode.packages.Pc + "\_]+", "g" - ); + this.toggleCommentLines = function(state, doc, startRow, endRow) { + var outdent = true; + var re = /^(\s*)#/; - this.nonTokenRe = new RegExp("^(?:[^" - + unicode.packages.L - + unicode.packages.Mn + unicode.packages.Mc - + unicode.packages.Nd - + unicode.packages.Pc + "\_]|\s])+", "g" - ); + for (var i=startRow; i<= endRow; i++) { + if (!re.test(doc.getLine(i))) { + outdent = false; + break; + } + } - - this.lineCommentStart = ["//", "#"]; - this.blockComment = {start: "/*", end: "*/"}; + 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.getTokenizer().getLineTokens(line, state); + 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; @@ -89,17 +100,6 @@ oop.inherits(PhpMode, TextMode); if (match) { indent += tab; } - } else if (state == "doc-start") { - if (endState != "doc-start") { - return ""; - } - var match = line.match(/^\s*(\/?)\*/); - if (match) { - if (match[1]) { - indent += " "; - } - indent += "* "; - } } return indent; @@ -113,48 +113,6 @@ oop.inherits(PhpMode, TextMode); this.$outdent.autoOutdent(doc, row); }; - this.$id = "ace/mode/php-inline"; -}).call(PhpMode.prototype); - -var Mode = function(opts) { - if (opts && opts.inline) { - var mode = new PhpMode(); - mode.createWorker = this.createWorker; - mode.inlinePhp = true; - return mode; - } - HtmlMode.call(this); - this.HighlightRules = PhpHighlightRules; - this.createModeDelegates({ - "js-": JavaScriptMode, - "css-": CssMode, - "php-": PhpMode - }); - this.foldingRules.subModes["php-"] = new CStyleFoldMode(); -}; -oop.inherits(Mode, HtmlMode); - -(function() { - - this.createWorker = function(session) { - var worker = new WorkerClient(["ace"], "ace/mode/php_worker", "PhpWorker"); - worker.attachToDocument(session.getDocument()); - - if (this.inlinePhp) - worker.call("setOptions", [{inline: true}]); - - worker.on("annotate", function(e) { - session.setAnnotations(e.data); - }); - - worker.on("terminate", function() { - session.clearAnnotations(); - }); - - return worker; - }; - - this.$id = "ace/mode/php"; }).call(Mode.prototype); exports.Mode = Mode; diff --git a/lib/ace/mode/php/php.js b/lib/ace/mode/php/php.js deleted file mode 100644 index fd703ae2..00000000 --- a/lib/ace/mode/php/php.js +++ /dev/null @@ -1,5031 +0,0 @@ -/* - php.js 0.1.0 - Copyright (c) 2013 Niklas von Hertzen - - Released under MIT License - - This file contains: - - [var PHP = {Constants:{}};] - - src/modules/tokenizer/constants.js - - src/parser/lexer.js - - src/parser/parser.js - - src/parser/yyn.js - - src/parser/yyn_stmt.js - - src/parser/yyn_expr.js - - src/parser/yyn_scalar.js -*/ - - - -define(function(require, exports, module) { - -var PHP = {Constants:{}}; - - - - -PHP.Constants.T_INCLUDE = 262; -PHP.Constants.T_INCLUDE_ONCE = 261; -PHP.Constants.T_EVAL = 260; -PHP.Constants.T_REQUIRE = 259; -PHP.Constants.T_REQUIRE_ONCE = 258; -PHP.Constants.T_LOGICAL_OR = 263; -PHP.Constants.T_LOGICAL_XOR = 264; -PHP.Constants.T_LOGICAL_AND = 265; -PHP.Constants.T_PRINT = 266; -PHP.Constants.T_PLUS_EQUAL = 277; -PHP.Constants.T_MINUS_EQUAL = 276; -PHP.Constants.T_MUL_EQUAL = 275; -PHP.Constants.T_DIV_EQUAL = 274; -PHP.Constants.T_CONCAT_EQUAL = 273; -PHP.Constants.T_MOD_EQUAL = 272; -PHP.Constants.T_AND_EQUAL = 271; -PHP.Constants.T_OR_EQUAL = 270; -PHP.Constants.T_XOR_EQUAL = 269; -PHP.Constants.T_SL_EQUAL = 268; -PHP.Constants.T_SR_EQUAL = 267; -PHP.Constants.T_BOOLEAN_OR = 278; -PHP.Constants.T_BOOLEAN_AND = 279; -PHP.Constants.T_IS_EQUAL = 283; -PHP.Constants.T_IS_NOT_EQUAL = 282; -PHP.Constants.T_IS_IDENTICAL = 281; -PHP.Constants.T_IS_NOT_IDENTICAL = 280; -PHP.Constants.T_IS_SMALLER_OR_EQUAL = 285; -PHP.Constants.T_IS_GREATER_OR_EQUAL = 284; -PHP.Constants.T_SL = 287; -PHP.Constants.T_SR = 286; -PHP.Constants.T_INSTANCEOF = 288; -PHP.Constants.T_INC = 297; -PHP.Constants.T_DEC = 296; -PHP.Constants.T_INT_CAST = 295; -PHP.Constants.T_DOUBLE_CAST = 294; -PHP.Constants.T_STRING_CAST = 293; -PHP.Constants.T_ARRAY_CAST = 292; -PHP.Constants.T_OBJECT_CAST = 291; -PHP.Constants.T_BOOL_CAST = 290; -PHP.Constants.T_UNSET_CAST = 289; -PHP.Constants.T_NEW = 299; -PHP.Constants.T_CLONE = 298; -PHP.Constants.T_EXIT = 300; -PHP.Constants.T_IF = 301; -PHP.Constants.T_ELSEIF = 302; -PHP.Constants.T_ELSE = 303; -PHP.Constants.T_ENDIF = 304; -PHP.Constants.T_LNUMBER = 305; -PHP.Constants.T_DNUMBER = 306; -PHP.Constants.T_STRING = 307; -PHP.Constants.T_STRING_VARNAME = 308; -PHP.Constants.T_VARIABLE = 309; -PHP.Constants.T_NUM_STRING = 310; -PHP.Constants.T_INLINE_HTML = 311; -PHP.Constants.T_CHARACTER = 312; -PHP.Constants.T_BAD_CHARACTER = 313; -PHP.Constants.T_ENCAPSED_AND_WHITESPACE = 314; -PHP.Constants.T_CONSTANT_ENCAPSED_STRING = 315; -PHP.Constants.T_ECHO = 316; -PHP.Constants.T_DO = 317; -PHP.Constants.T_WHILE = 318; -PHP.Constants.T_ENDWHILE = 319; -PHP.Constants.T_FOR = 320; -PHP.Constants.T_ENDFOR = 321; -PHP.Constants.T_FOREACH = 322; -PHP.Constants.T_ENDFOREACH = 323; -PHP.Constants.T_DECLARE = 324; -PHP.Constants.T_ENDDECLARE = 325; -PHP.Constants.T_AS = 326; -PHP.Constants.T_SWITCH = 327; -PHP.Constants.T_ENDSWITCH = 328; -PHP.Constants.T_CASE = 329; -PHP.Constants.T_DEFAULT = 330; -PHP.Constants.T_BREAK = 331; -PHP.Constants.T_CONTINUE = 332; -PHP.Constants.T_GOTO = 333; -PHP.Constants.T_FUNCTION = 334; -PHP.Constants.T_CONST = 335; -PHP.Constants.T_RETURN = 336; -PHP.Constants.T_TRY = 337; -PHP.Constants.T_CATCH = 338; -PHP.Constants.T_THROW = 339; -PHP.Constants.T_USE = 340; -//PHP.Constants.T_INSTEADOF = ; -PHP.Constants.T_GLOBAL = 341; -PHP.Constants.T_STATIC = 347; -PHP.Constants.T_ABSTRACT = 346; -PHP.Constants.T_FINAL = 345; -PHP.Constants.T_PRIVATE = 344; -PHP.Constants.T_PROTECTED = 343; -PHP.Constants.T_PUBLIC = 342; -PHP.Constants.T_VAR = 348; -PHP.Constants.T_UNSET = 349; -PHP.Constants.T_ISSET = 350; -PHP.Constants.T_EMPTY = 351; -PHP.Constants.T_HALT_COMPILER = 352; -PHP.Constants.T_CLASS = 353; -PHP.Constants.T_TRAIT = 382; -PHP.Constants.T_INTERFACE = 354; -PHP.Constants.T_EXTENDS = 355; -PHP.Constants.T_IMPLEMENTS = 356; -PHP.Constants.T_OBJECT_OPERATOR = 357; -PHP.Constants.T_DOUBLE_ARROW = 358; -PHP.Constants.T_LIST = 359; -PHP.Constants.T_ARRAY = 360; -//PHP.Constants.T_CALLABLE = ; -PHP.Constants.T_CLASS_C = 361; -PHP.Constants.T_TRAIT_C = 381; -PHP.Constants.T_METHOD_C = 362; -PHP.Constants.T_FUNC_C = 363; -PHP.Constants.T_LINE = 364; -PHP.Constants.T_FILE = 365; -PHP.Constants.T_COMMENT = 366; -PHP.Constants.T_DOC_COMMENT = 367; -PHP.Constants.T_OPEN_TAG = 368; -PHP.Constants.T_OPEN_TAG_WITH_ECHO = 369; -PHP.Constants.T_CLOSE_TAG = 370; -PHP.Constants.T_WHITESPACE = 371; -PHP.Constants.T_START_HEREDOC = 372; -PHP.Constants.T_END_HEREDOC = 373; -PHP.Constants.T_DOLLAR_OPEN_CURLY_BRACES = 374; -PHP.Constants.T_CURLY_OPEN = 375; -PHP.Constants.T_PAAMAYIM_NEKUDOTAYIM = 376; -PHP.Constants.T_DOUBLE_COLON = 376; -PHP.Constants.T_NAMESPACE = 377; -PHP.Constants.T_NS_C = 378; -PHP.Constants.T_DIR = 379; -PHP.Constants.T_NS_SEPARATOR = 380; -PHP.Lexer = function( src, ini ) { - - - var heredoc, - lineBreaker = function( result ) { - if (result.match(/\n/) !== null) { - var quote = result.substring(0, 1); - result = '[' + result.split(/\n/).join( quote + "," + quote ) + '].join("\\n")'; - - } - - return result; - }, - prev, - - openTag = (ini === undefined || (/^(on|true|1)$/i.test(ini.short_open_tag) ) ? /(\<\?php\s|\<\?|\<\%|\ -snippet scriptsrc - -snippet section -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - ${1} -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -snippet section. -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - ${2} -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -snippet section# -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - ${2} -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -snippet select - -snippet select. - -snippet small - ${1} -snippet source - -snippet span - ${1} -snippet strong - ${1} -snippet style - -snippet sub - ${1} -snippet summary - - ${1} - -snippet sup - ${1} -snippet table - - ${2} -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -snippet table. - - ${3} -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -snippet table# - - ${3} -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -snippet tbody - - ${1} - -snippet td - ${1} -snippet td. - ${2} -snippet td# - ${2} -snippet td+ - ${1} - td+${2} -snippet textarea - ${6} -snippet tfoot - - ${1} - -snippet th - ${1} -snippet th. - ${2} -snippet th# - ${2} -snippet th+ - ${1} - th+${2} -snippet thead - - ${1} - -snippet time -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ${3} -snippet curl+ - - - cparam+${6} - - ${3} -snippet credirect - -snippet contains - ${fn:contains(${1:string}, ${2:substr})} -snippet contains:i - ${fn:containsIgnoreCase(${1:string}, ${2:substr})} -snippet endswith - ${fn:endsWith(${1:string}, ${2:suffix})} -snippet escape - ${fn:escapeXml(${1:string})} -snippet indexof - ${fn:indexOf(${1:string}, ${2:substr})} -snippet join - ${fn:join(${1:collection}, ${2:delims})} -snippet length - ${fn:length(${1:collection_or_string})} -snippet replace - ${fn:replace(${1:string}, ${2:substr}, ${3:replace})} -snippet split - ${fn:split(${1:string}, ${2:delims})} -snippet startswith - ${fn:startsWith(${1:string}, ${2:prefix})} -snippet substr - ${fn:substring(${1:string}, ${2:begin}, ${3:end})} -snippet substr:a - ${fn:substringAfter(${1:string}, ${2:substr})} -snippet substr:b - ${fn:substringBefore(${1:string}, ${2:substr})} -snippet lc - ${fn:toLowerCase(${1:string})} -snippet uc - ${fn:toUpperCase(${1:string})} -snippet trim - ${fn:trim(${1:string})} diff --git a/lib/ace/snippets/jsx.js b/lib/ace/snippets/jsx.js deleted file mode 100644 index 9792a7a0..00000000 --- a/lib/ace/snippets/jsx.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./jsx.snippets"); -exports.scope = "jsx"; - -}); diff --git a/lib/ace/snippets/jsx.snippets b/lib/ace/snippets/jsx.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/julia.js b/lib/ace/snippets/julia.js deleted file mode 100644 index f83777ef..00000000 --- a/lib/ace/snippets/julia.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./julia.snippets"); -exports.scope = "julia"; - -}); diff --git a/lib/ace/snippets/julia.snippets b/lib/ace/snippets/julia.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/latex.js b/lib/ace/snippets/latex.js deleted file mode 100644 index 44bef369..00000000 --- a/lib/ace/snippets/latex.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./latex.snippets"); -exports.scope = "latex"; - -}); diff --git a/lib/ace/snippets/latex.snippets b/lib/ace/snippets/latex.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/lean.js b/lib/ace/snippets/lean.js deleted file mode 100644 index a3c01639..00000000 --- a/lib/ace/snippets/lean.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./lean.snippets"); -exports.scope = "lean"; - -}); diff --git a/lib/ace/snippets/lean.snippets b/lib/ace/snippets/lean.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/ledger.snippets b/lib/ace/snippets/ledger.snippets deleted file mode 100644 index 293d4b65..00000000 --- a/lib/ace/snippets/ledger.snippets +++ /dev/null @@ -1,5 +0,0 @@ -# Ledger -snippet ent - `strftime("%Y/%m/%d")` ${1:transaction} - ${2:account} ${3:value} - ${4:account} diff --git a/lib/ace/snippets/less.js b/lib/ace/snippets/less.js deleted file mode 100644 index 7acf02f2..00000000 --- a/lib/ace/snippets/less.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./less.snippets"); -exports.scope = "less"; - -}); diff --git a/lib/ace/snippets/less.snippets b/lib/ace/snippets/less.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/liquid.js b/lib/ace/snippets/liquid.js deleted file mode 100644 index 2e320755..00000000 --- a/lib/ace/snippets/liquid.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./liquid.snippets"); -exports.scope = "liquid"; - -}); diff --git a/lib/ace/snippets/liquid.snippets b/lib/ace/snippets/liquid.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/lisp.js b/lib/ace/snippets/lisp.js deleted file mode 100644 index 2b6870bc..00000000 --- a/lib/ace/snippets/lisp.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./lisp.snippets"); -exports.scope = "lisp"; - -}); diff --git a/lib/ace/snippets/lisp.snippets b/lib/ace/snippets/lisp.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/livescript.js b/lib/ace/snippets/livescript.js deleted file mode 100644 index ba20e7e4..00000000 --- a/lib/ace/snippets/livescript.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./livescript.snippets"); -exports.scope = "livescript"; - -}); diff --git a/lib/ace/snippets/livescript.snippets b/lib/ace/snippets/livescript.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/logiql.js b/lib/ace/snippets/logiql.js deleted file mode 100644 index 7d0167da..00000000 --- a/lib/ace/snippets/logiql.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./logiql.snippets"); -exports.scope = "logiql"; - -}); diff --git a/lib/ace/snippets/logiql.snippets b/lib/ace/snippets/logiql.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/lsl.js b/lib/ace/snippets/lsl.js deleted file mode 100644 index 678ba41f..00000000 --- a/lib/ace/snippets/lsl.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./lsl.snippets"); -exports.scope = "lsl"; - -}); diff --git a/lib/ace/snippets/lsl.snippets b/lib/ace/snippets/lsl.snippets deleted file mode 100644 index bc0d2eb9..00000000 --- a/lib/ace/snippets/lsl.snippets +++ /dev/null @@ -1,1066 +0,0 @@ -snippet @ - @${1:label}; -snippet CAMERA_ACTIVE - CAMERA_ACTIVE, ${1:integer isActive}, $0 -snippet CAMERA_BEHINDNESS_ANGLE - CAMERA_BEHINDNESS_ANGLE, ${1:float degrees}, $0 -snippet CAMERA_BEHINDNESS_LAG - CAMERA_BEHINDNESS_LAG, ${1:float seconds}, $0 -snippet CAMERA_DISTANCE - CAMERA_DISTANCE, ${1:float meters}, $0 -snippet CAMERA_FOCUS - CAMERA_FOCUS, ${1:vector position}, $0 -snippet CAMERA_FOCUS_LAG - CAMERA_FOCUS_LAG, ${1:float seconds}, $0 -snippet CAMERA_FOCUS_LOCKED - CAMERA_FOCUS_LOCKED, ${1:integer isLocked}, $0 -snippet CAMERA_FOCUS_OFFSET - CAMERA_FOCUS_OFFSET, ${1:vector meters}, $0 -snippet CAMERA_FOCUS_THRESHOLD - CAMERA_FOCUS_THRESHOLD, ${1:float meters}, $0 -snippet CAMERA_PITCH - CAMERA_PITCH, ${1:float degrees}, $0 -snippet CAMERA_POSITION - CAMERA_POSITION, ${1:vector position}, $0 -snippet CAMERA_POSITION_LAG - CAMERA_POSITION_LAG, ${1:float seconds}, $0 -snippet CAMERA_POSITION_LOCKED - CAMERA_POSITION_LOCKED, ${1:integer isLocked}, $0 -snippet CAMERA_POSITION_THRESHOLD - CAMERA_POSITION_THRESHOLD, ${1:float meters}, $0 -snippet CHARACTER_AVOIDANCE_MODE - CHARACTER_AVOIDANCE_MODE, ${1:integer flags}, $0 -snippet CHARACTER_DESIRED_SPEED - CHARACTER_DESIRED_SPEED, ${1:float speed}, $0 -snippet CHARACTER_DESIRED_TURN_SPEED - CHARACTER_DESIRED_TURN_SPEED, ${1:float speed}, $0 -snippet CHARACTER_LENGTH - CHARACTER_LENGTH, ${1:float length}, $0 -snippet CHARACTER_MAX_TURN_RADIUS - CHARACTER_MAX_TURN_RADIUS, ${1:float radius}, $0 -snippet CHARACTER_ORIENTATION - CHARACTER_ORIENTATION, ${1:integer orientation}, $0 -snippet CHARACTER_RADIUS - CHARACTER_RADIUS, ${1:float radius}, $0 -snippet CHARACTER_STAY_WITHIN_PARCEL - CHARACTER_STAY_WITHIN_PARCEL, ${1:boolean stay}, $0 -snippet CHARACTER_TYPE - CHARACTER_TYPE, ${1:integer type}, $0 -snippet HTTP_BODY_MAXLENGTH - HTTP_BODY_MAXLENGTH, ${1:integer length}, $0 -snippet HTTP_CUSTOM_HEADER - HTTP_CUSTOM_HEADER, ${1:string name}, ${2:string value}, $0 -snippet HTTP_METHOD - HTTP_METHOD, ${1:string method}, $0 -snippet HTTP_MIMETYPE - HTTP_MIMETYPE, ${1:string mimeType}, $0 -snippet HTTP_PRAGMA_NO_CACHE - HTTP_PRAGMA_NO_CACHE, ${1:integer send_header}, $0 -snippet HTTP_VERBOSE_THROTTLE - HTTP_VERBOSE_THROTTLE, ${1:integer noisy}, $0 -snippet HTTP_VERIFY_CERT - HTTP_VERIFY_CERT, ${1:integer verify}, $0 -snippet RC_DATA_FLAGS - RC_DATA_FLAGS, ${1:integer flags}, $0 -snippet RC_DETECT_PHANTOM - RC_DETECT_PHANTOM, ${1:integer dectedPhantom}, $0 -snippet RC_MAX_HITS - RC_MAX_HITS, ${1:integer maxHits}, $0 -snippet RC_REJECT_TYPES - RC_REJECT_TYPES, ${1:integer filterMask}, $0 -snippet at_rot_target - at_rot_target(${1:integer handle}, ${2:rotation targetrot}, ${3:rotation ourrot}) - { - $0 - } -snippet at_target - at_target(${1:integer tnum}, ${2:vector targetpos}, ${3:vector ourpos}) - { - $0 - } -snippet attach - attach(${1:key id}) - { - $0 - } -snippet changed - changed(${1:integer change}) - { - $0 - } -snippet collision - collision(${1:integer index}) - { - $0 - } -snippet collision_end - collision_end(${1:integer index}) - { - $0 - } -snippet collision_start - collision_start(${1:integer index}) - { - $0 - } -snippet control - control(${1:key id}, ${2:integer level}, ${3:integer edge}) - { - $0 - } -snippet dataserver - dataserver(${1:key query_id}, ${2:string data}) - { - $0 - } -snippet do - do - { - $0 - } - while (${1:condition}); -snippet else - else - { - $0 - } -snippet email - email(${1:string time}, ${2:string address}, ${3:string subject}, ${4:string message}, ${5:integer num_left}) - { - $0 - } -snippet experience_permissions - experience_permissions(${1:key agent_id}) - { - $0 - } -snippet experience_permissions_denied - experience_permissions_denied(${1:key agent_id}, ${2:integer reason}) - { - $0 - } -snippet for - for (${1:start}; ${3:condition}; ${3:step}) - { - $0 - } -snippet http_request - http_request(${1:key request_id}, ${2:string method}, ${3:string body}) - { - $0 - } -snippet http_response - http_response(${1:key request_id}, ${2:integer status}, ${3:list metadata}, ${4:string body}) - { - $0 - } -snippet if - if (${1:condition}) - { - $0 - } -snippet jump - jump ${1:label}; -snippet land_collision - land_collision(${1:vector pos}) - { - $0 - } -snippet land_collision_end - land_collision_end(${1:vector pos}) - { - $0 - } -snippet land_collision_start - land_collision_start(${1:vector pos}) - { - $0 - } -snippet link_message - link_message(${1:integer sender_num}, ${2:integer num}, ${3:string str}, ${4:key id}) - { - $0 - } -snippet listen - listen(${1:integer channel}, ${2:string name}, ${3:key id}, ${4:string message}) - { - $0 - } -snippet llAbs - llAbs(${1:integer val}) -snippet llAcos - llAcos(${1:float val}) -snippet llAddToLandBanList - llAddToLandBanList(${1:key agent}, ${2:float hours}); -snippet llAddToLandPassList - llAddToLandPassList(${1:key agent}, ${2:float hours}); -snippet llAdjustSoundVolume - llAdjustSoundVolume(${1:float volume}); -snippet llAgentInExperience - llAgentInExperience(${1:key agent}) -snippet llAllowInventoryDrop - llAllowInventoryDrop(${1:integer add}); -snippet llAngleBetween - llAngleBetween(${1:rotation a}, ${2:rotation b}) -snippet llApplyImpulse - llApplyImpulse(${1:vector force}, ${2:integer local}); -snippet llApplyRotationalImpulse - llApplyRotationalImpulse(${1:vector force}, ${2:integer local}); -snippet llAsin - llAsin(${1:float val}) -snippet llAtan2 - llAtan2(${1:float y}, ${2:float x}) -snippet llAttachToAvatar - llAttachToAvatar(${1:integer attach_point}); -snippet llAttachToAvatarTemp - llAttachToAvatarTemp(${1:integer attach_point}); -snippet llAvatarOnLinkSitTarget - llAvatarOnLinkSitTarget(${1:integer link}) -snippet llAvatarOnSitTarget - llAvatarOnSitTarget() -snippet llAxes2Rot - llAxes2Rot(${1:vector fwd}, ${2:vector left}, ${3:vector up}) -snippet llAxisAngle2Rot - llAxisAngle2Rot(${1:vector axis}, ${2:float angle}) -snippet llBase64ToInteger - llBase64ToInteger(${1:string str}) -snippet llBase64ToString - llBase64ToString(${1:string str}) -snippet llBreakAllLinks - llBreakAllLinks(); -snippet llBreakLink - llBreakLink(${1:integer link}); -snippet llCastRay - llCastRay(${1:vector start}, ${2:vector end}, ${3:list options}); -snippet llCeil - llCeil(${1:float val}) -snippet llClearCameraParams - llClearCameraParams(); -snippet llClearLinkMedia - llClearLinkMedia(${1:integer link}, ${2:integer face}); -snippet llClearPrimMedia - llClearPrimMedia(${1:integer face}); -snippet llCloseRemoteDataChannel - llCloseRemoteDataChannel(${1:key channel}); -snippet llCollisionFilter - llCollisionFilter(${1:string name}, ${2:key id}, ${3:integer accept}); -snippet llCollisionSound - llCollisionSound(${1:string impact_sound}, ${2:float impact_volume}); -snippet llCos - llCos(${1:float theta}) -snippet llCreateCharacter - llCreateCharacter(${1:list options}); -snippet llCreateKeyValue - llCreateKeyValue(${1:string k}) -snippet llCreateLink - llCreateLink(${1:key target}, ${2:integer parent}); -snippet llCSV2List - llCSV2List(${1:string src}) -snippet llDataSizeKeyValue - llDataSizeKeyValue() -snippet llDeleteCharacter - llDeleteCharacter(); -snippet llDeleteKeyValue - llDeleteKeyValue(${1:string k}) -snippet llDeleteSubList - llDeleteSubList(${1:list src}, ${2:integer start}, ${3:integer end}) -snippet llDeleteSubString - llDeleteSubString(${1:string src}, ${2:integer start}, ${3:integer end}) -snippet llDetachFromAvatar - llDetachFromAvatar(); -snippet llDetectedGrab - llDetectedGrab(${1:integer number}) -snippet llDetectedGroup - llDetectedGroup(${1:integer number}) -snippet llDetectedKey - llDetectedKey(${1:integer number}) -snippet llDetectedLinkNumber - llDetectedLinkNumber(${1:integer number}) -snippet llDetectedName - llDetectedName(${1:integer number}) -snippet llDetectedOwner - llDetectedOwner(${1:integer number}) -snippet llDetectedPos - llDetectedPosl(${1:integer number}) -snippet llDetectedRot - llDetectedRot(${1:integer number}) -snippet llDetectedTouchBinormal - llDetectedTouchBinormal(${1:integer number}) -snippet llDetectedTouchFace - llDetectedTouchFace(${1:integer number}) -snippet llDetectedTouchNormal - llDetectedTouchNormal(${1:integer number}) -snippet llDetectedTouchPos - llDetectedTouchPos(${1:integer number}) -snippet llDetectedTouchST - llDetectedTouchST(${1:integer number}) -snippet llDetectedTouchUV - llDetectedTouchUV(${1:integer number}) -snippet llDetectedType - llDetectedType(${1:integer number}) -snippet llDetectedVel - llDetectedVel(${1:integer number}) -snippet llDialog - llDialog(${1:key agent}, ${2:string message}, ${3:list buttons}, ${4:integer channel}); -snippet llDie - llDie(); -snippet llDumpList2String - llDumpList2String(${1:list src}, ${2:string separator}) -snippet llEdgeOfWorld - llEdgeOfWorld(${1:vector pos}, ${2:vector dir}) -snippet llEjectFromLand - llEjectFromLand(${1:key agent}); -snippet llEmail - llEmail(${1:string address}, ${2:string subject}, ${3:string message}); -snippet llEscapeURL - llEscapeURL(${1:string url}) -snippet llEuler2Rot - llEuler2Rot(${1:vector v}) -snippet llExecCharacterCmd - llExecCharacterCmd(${1:integer command}, ${2:list options}); -snippet llEvade - llEvade(${1:key target}, ${2:list options}); -snippet llFabs - llFabs(${1:float val}) -snippet llFleeFrom - llFleeFrom(${1:vector position}, ${2:float distance}, ${3:list options}); -snippet llFloor - llFloor(${1:float val}) -snippet llForceMouselook - llForceMouselook(${1:integer mouselook}); -snippet llFrand - llFrand(${1:float mag}) -snippet llGenerateKey - llGenerateKey() -snippet llGetAccel - llGetAccel() -snippet llGetAgentInfo - llGetAgentInfo(${1:key id}) -snippet llGetAgentLanguage - llGetAgentLanguage(${1:key agent}) -snippet llGetAgentList - llGetAgentList(${1:integer scope}, ${2:list options}) -snippet llGetAgentSize - llGetAgentSize(${1:key agent}) -snippet llGetAlpha - llGetAlpha(${1:integer face}) -snippet llGetAndResetTime - llGetAndResetTime() -snippet llGetAnimation - llGetAnimation(${1:key id}) -snippet llGetAnimationList - llGetAnimationList(${1:key agent}) -snippet llGetAnimationOverride - llGetAnimationOverride(${1:string anim_state}) -snippet llGetAttached - llGetAttached() -snippet llGetBoundingBox - llGetBoundingBox(${1:key object}) -snippet llGetCameraPos - llGetCameraPos() -snippet llGetCameraRot - llGetCameraRot() -snippet llGetCenterOfMass - llGetCenterOfMass() -snippet llGetClosestNavPoint - llGetClosestNavPoint(${1:vector point}, ${2:list options}) -snippet llGetColor - llGetColor(${1:integer face}) -snippet llGetCreator - llGetCreator() -snippet llGetDate - llGetDate() -snippet llGetDisplayName - llGetDisplayName(${1:key id}) -snippet llGetEnergy - llGetEnergy() -snippet llGetEnv - llGetEnv(${1:string name}) -snippet llGetExperienceDetails - llGetExperienceDetails(${1:key experience_id}) -snippet llGetExperienceErrorMessage - llGetExperienceErrorMessage(${1:integer error}) -snippet llGetForce - llGetForce() -snippet llGetFreeMemory - llGetFreeMemory() -snippet llGetFreeURLs - llGetFreeURLs() -snippet llGetGeometricCenter - llGetGeometricCenter() -snippet llGetGMTclock - llGetGMTclock() -snippet llGetHTTPHeader - llGetHTTPHeader(${1:key request_id}, ${2:string header}) -snippet llGetInventoryCreator - llGetInventoryCreator(${1:string item}) -snippet llGetInventoryKey - llGetInventoryKey(${1:string name}) -snippet llGetInventoryName - llGetInventoryName(${1:integer type}, ${2:integer number}) -snippet llGetInventoryNumber - llGetInventoryNumber(${1:integer type}) -snippet llGetInventoryPermMask - llGetInventoryPermMask(${1:string item}, ${2:integer mask}) -snippet llGetInventoryType - llGetInventoryType(${1:string name}) -snippet llGetKey - llGetKey() -snippet llGetLandOwnerAt - llGetLandOwnerAt(${1:vector pos}) -snippet llGetLinkKey - llGetLinkKey(${1:integer link}) -snippet llGetLinkMedia - llGetLinkMedia(${1:integer link}, ${2:integer face}, ${3:list params}) -snippet llGetLinkName - llGetLinkName(${1:integer link}) -snippet llGetLinkNumber - llGetLinkNumber() -snippet llGetLinkNumberOfSides - llGetLinkNumberOfSides(${1:integer link}) -snippet llGetLinkPrimitiveParams - llGetLinkPrimitiveParams(${1:integer link}, ${2:list params}) -snippet llGetListEntryType - llGetListEntryType(${1:list src}, ${2:integer index}) -snippet llGetListLength - llGetListLength(${1:list src}) -snippet llGetLocalPos - llGetLocalPos() -snippet llGetLocalRot - llGetLocalRot() -snippet llGetMass - llGetMass() -snippet llGetMassMKS - llGetMassMKS() -snippet llGetMaxScaleFactor - llGetMaxScaleFactor() -snippet llGetMemoryLimit - llGetMemoryLimit() -snippet llGetMinScaleFactor - llGetMinScaleFactor() -snippet llGetNextEmail - llGetNextEmail(${1:string address}, ${2:string subject}); -snippet llGetNotecardLine - llGetNotecardLine(${1:string name}, ${2:integer line}) -snippet llGetNumberOfNotecardLines - llGetNumberOfNotecardLines(${1:string name}) -snippet llGetNumberOfPrims - llGetNumberOfPrims() -snippet llGetNumberOfSides - llGetNumberOfSides() -snippet llGetObjectDesc - llGetObjectDesc() -snippet llGetObjectDetails - llGetObjectDetails(${1:key id}, ${2:list params}) -snippet llGetObjectMass - llGetObjectMass(${1:key id}) -snippet llGetObjectName - llGetObjectName() -snippet llGetObjectPermMask - llGetObjectPermMask(${1:integer mask}) -snippet llGetObjectPrimCount - llGetObjectPrimCount(${1:key prim}) -snippet llGetOmega - llGetOmega() -snippet llGetOwner - llGetOwner() -snippet llGetOwnerKey - llGetOwnerKey(${1:key id}) -snippet llGetParcelDetails - llGetParcelDetails(${1:vector pos}, ${2:list params}) -snippet llGetParcelFlags - llGetParcelFlags(${1:vector pos}) -snippet llGetParcelMaxPrims - llGetParcelMaxPrims(${1:vector pos}, ${2:integer sim_wide}) -snippet llGetParcelMusicURL - llGetParcelMusicURL() -snippet llGetParcelPrimCount - llGetParcelPrimCount(${1:vector pos}, ${2:integer category}, ${3:integer sim_wide}) -snippet llGetParcelPrimOwners - llGetParcelPrimOwners(${1:vector pos}) -snippet llGetPermissions - llGetPermissions() -snippet llGetPermissionsKey - llGetPermissionsKey() -snippet llGetPhysicsMaterial - llGetPhysicsMaterial() -snippet llGetPos - llGetPos() -snippet llGetPrimitiveParams - llGetPrimitiveParams(${1:list params}) -snippet llGetPrimMediaParams - llGetPrimMediaParams(${1:integer face}, ${2:list params}) -snippet llGetRegionAgentCount - llGetRegionAgentCount() -snippet llGetRegionCorner - llGetRegionCorner() -snippet llGetRegionFlags - llGetRegionFlags() -snippet llGetRegionFPS - llGetRegionFPS() -snippet llGetRegionName - llGetRegionName() -snippet llGetRegionTimeDilation - llGetRegionTimeDilation() -snippet llGetRootPosition - llGetRootPosition() -snippet llGetRootRotation - llGetRootRotation() -snippet llGetRot - llGetRot() -snippet llGetScale - llGetScale() -snippet llGetScriptName - llGetScriptName() -snippet llGetScriptState - llGetScriptState(${1:string script}) -snippet llGetSimStats - llGetSimStats(${1:integer stat_type}) -snippet llGetSimulatorHostname - llGetSimulatorHostname() -snippet llGetSPMaxMemory - llGetSPMaxMemory() -snippet llGetStartParameter - llGetStartParameter() -snippet llGetStaticPath - llGetStaticPath(${1:vector start}, ${2:vector end}, ${3:float radius}, ${4:list params}) -snippet llGetStatus - llGetStatus(${1:integer status}) -snippet llGetSubString - llGetSubString(${1:string src}, ${2:integer start}, ${3:integer end}) -snippet llGetSunDirection - llGetSunDirection() -snippet llGetTexture - llGetTexture(${1:integer face}) -snippet llGetTextureOffset - llGetTextureOffset(${1:integer face}) -snippet llGetTextureRot - llGetTextureRot(${1:integer face}) -snippet llGetTextureScale - llGetTextureScale(${1:integer face}) -snippet llGetTime - llGetTime() -snippet llGetTimeOfDay - llGetTimeOfDay() -snippet llGetTimestamp - llGetTimestamp() -snippet llGetTorque - llGetTorque() -snippet llGetUnixTime - llGetUnixTime() -snippet llGetUsedMemory - llGetUsedMemory() -snippet llGetUsername - llGetUsername(${1:key id}) -snippet llGetVel - llGetVel() -snippet llGetWallclock - llGetWallclock() -snippet llGiveInventory - llGiveInventory(${1:key destination}, ${2:string inventory}); -snippet llGiveInventoryList - llGiveInventoryList(${1:key target}, ${2:string folder}, ${3:list inventory}); -snippet llGiveMoney - llGiveMoney(${1:key destination}, ${2:integer amount}) -snippet llGround - llGround(${1:vector offset}) -snippet llGroundContour - llGroundContour(${1:vector offset}) -snippet llGroundNormal - llGroundNormal(${1:vector offset}) -snippet llGroundRepel - llGroundRepel(${1:float height}, ${2:integer water}, ${3:float tau}); -snippet llGroundSlope - llGroundSlope(${1:vector offset}) -snippet llHTTPRequest - llHTTPRequest(${1:string url}, ${2:list parameters}, ${3:string body}) -snippet llHTTPResponse - llHTTPResponse(${1:key request_id}, ${2:integer status}, ${3:string body}); -snippet llInsertString - llInsertString(${1:string dst}, ${2:integer pos}, ${3:string src}) -snippet llInstantMessage - llInstantMessage(${1:key user}, ${2:string message}); -snippet llIntegerToBase64 - llIntegerToBase64(${1:integer number}) -snippet llJson2List - llJson2List(${1:string json}) -snippet llJsonGetValue - llJsonGetValue(${1:string json}, ${2:list specifiers}) -snippet llJsonSetValue - llJsonSetValue(${1:string json}, ${2:list specifiers}, ${3:string newValue}) -snippet llJsonValueType - llJsonValueType(${1:string json}, ${2:list specifiers}) -snippet llKey2Name - llKey2Name(${1:key id}) -snippet llKeyCountKeyValue - llKeyCountKeyValue() -snippet llKeysKeyValue - llKeysKeyValue(${1:integer first}, ${2:integer count}) -snippet llLinkParticleSystem - llLinkParticleSystem(${1:integer link}, ${2:list rules}); -snippet llLinkSitTarget - llLinkSitTarget(${1:integer link}, ${2:vector offset}, ${3:rotation rot}); -snippet llList2CSV - llList2CSV(${1:list src}) -snippet llList2Float - llList2Float(${1:list src}, ${2:integer index}) -snippet llList2Integer - llList2Integer(${1:list src}, ${2:integer index}) -snippet llList2Json - llList2Json(${1:string type}, ${2:list values}) -snippet llList2Key - llList2Key(${1:list src}, ${2:integer index}) -snippet llList2List - llList2List(${1:list src}, ${2:integer start}, ${3:integer end}) -snippet llList2ListStrided - llList2ListStrided(${1:list src}, ${2:integer start}, ${3:integer end}, ${4:integer stride}) -snippet llList2Rot - llList2Rot(${1:list src}, ${2:integer index}) -snippet llList2String - llList2String(${1:list src}, ${2:integer index}) -snippet llList2Vector - llList2Vector(${1:list src}, ${2:integer index}) -snippet llListen - llListen(${1:integer channel}, ${2:string name}, ${3:key id}, ${4:string msg}) -snippet llListenControl - llListenControl(${1:integer handle}, ${2:integer active}); -snippet llListenRemove - llListenRemove(${1:integer handle}); -snippet llListFindList - llListFindList(${1:list src}, ${2:list test}) -snippet llListInsertList - llListInsertList(${1:list dest}, ${2:list src}, ${3:integer start}) -snippet llListRandomize - llListRandomize(${1:list src}, ${2:integer stride}) -snippet llListReplaceList - llListReplaceList(${1:list dest}, ${2:list src}, ${3:integer start}, ${4:integer end}) -snippet llListSort - llListSort(${1:list src}, ${2:integer stride}, ${3:integer ascending}) -snippet llListStatistics - llListStatistics(${1:integer operation}, ${2:list src}) -snippet llLoadURL - llLoadURL(${1:key agent}, ${2:string message}, ${3:string url}); -snippet llLog - llLog(${1:float val}) -snippet llLog10 - llLog10(${1:float val}) -snippet llLookAt - llLookAt(${1:vector target}, ${2:float strength}, ${3:float damping}); -snippet llLoopSound - llLoopSound(${1:string sound}, ${2:float volume}); -snippet llLoopSoundMaster - llLoopSoundMaster(${1:string sound}, ${2:float volume}); -snippet llLoopSoundSlave - llLoopSoundSlave(${1:string sound}, ${2:float volume}); -snippet llManageEstateAccess - llManageEstateAccess(${1:integer action}, ${2:key agent}) -snippet llMapDestination - llMapDestination(${1:string simname}, ${2:vector pos}, ${3:vector look_at}); -snippet llMD5String - llMD5String(${1:string src}, ${2:integer nonce}) -snippet llMessageLinked - llMessageLinked(${1:integer link}, ${2:integer num}, ${3:string str}, ${4:key id}); -snippet llMinEventDelay - llMinEventDelay(${1:float delay}); -snippet llModifyLand - llModifyLand(${1:integer action}, ${2:integer brush}); -snippet llModPow - llModPow(${1:integer a}, ${2:integer b}, ${3:integer c}) -snippet llMoveToTarget - llMoveToTarget(${1:vector target}, ${2:float tau}); -snippet llNavigateTo - llNavigateTo(${1:vector pos}, ${2:list options}); -snippet llOffsetTexture - llOffsetTexture(${1:float u}, ${2:float v}, ${3:integer face}); -snippet llOpenRemoteDataChannel - llOpenRemoteDataChannel(); -snippet llOverMyLand - llOverMyLand(${1:key id}) -snippet llOwnerSay - llOwnerSay(${1:string msg}); -snippet llParcelMediaCommandList - llParcelMediaCommandList(${1:list commandList}); -snippet llParcelMediaQuery - llParcelMediaQuery(${1:list query}) -snippet llParseString2List - llParseString2List(${1:string src}, ${2:list separators}, ${3:list spacers}) -snippet llParseStringKeepNulls - llParseStringKeepNulls(${1:string src}, ${2:list separators}, ${3:list spacers}) -snippet llParticleSystem - llParticleSystem(${1:list rules}); -snippet llPassCollisions - llPassCollisions(${1:integer pass}); -snippet llPassTouches - llPassTouches(${1:integer pass}); -snippet llPatrolPoints - llPatrolPoints(${1:list patrolPoints}, ${2:list options}); -snippet llPlaySound - llPlaySound(${1:string sound}, ${2:float volume}); -snippet llPlaySoundSlave - llPlaySoundSlave(${1:string sound}, ${2:float volume}); -snippet llPow - llPow(${1:float base}, ${2:float exponent}) -snippet llPreloadSound - llPreloadSound(${1:string sound}); -snippet llPursue - llPursue(${1:key target}, ${2:list options}); -snippet llPushObject - llPushObject(${1:key target}, ${2:vector impulse}, ${3:vector ang_impulse}, ${4:integer local}); -snippet llReadKeyValue - llReadKeyValue(${1:string k}) -snippet llRegionSay - llRegionSay(${1:integer channel}, ${2:string msg}); -snippet llRegionSayTo - llRegionSayTo(${1:key target}, ${2:integer channel}, ${3:string msg}); -snippet llReleaseControls - llReleaseControls(); -snippet llReleaseURL - llReleaseURL(${1:string url}); -snippet llRemoteDataReply - llRemoteDataReply(${1:key channel}, ${2:key message_id}, ${3:string sdata}, ${4:integer idata}); -snippet llRemoteLoadScriptPin - llRemoteLoadScriptPin(${1:key target}, ${2:string name}, ${3:integer pin}, ${4:integer running}, ${5:integer start_param}); -snippet llRemoveFromLandBanList - llRemoveFromLandBanList(${1:key agent}); -snippet llRemoveFromLandPassList - llRemoveFromLandPassList(${1:key agent}); -snippet llRemoveInventory - llRemoveInventory(${1:string item}); -snippet llRemoveVehicleFlags - llRemoveVehicleFlags(${1:integer flags}); -snippet llRequestAgentData - llRequestAgentData(${1:key id}, ${2:integer data}) -snippet llRequestDisplayName - llRequestDisplayName(${1:key id}) -snippet llRequestExperiencePermissions - llRequestExperiencePermissions(${1:key agent}, ${2:string name}) -snippet llRequestInventoryData - llRequestInventoryData(${1:string name}) -snippet llRequestPermissions - llRequestPermissions(${1:key agent}, ${2:integer permissions}) -snippet llRequestSecureURL - llRequestSecureURL() -snippet llRequestSimulatorData - llRequestSimulatorData(${1:string region}, ${2:integer data}) -snippet llRequestURL - llRequestURL() -snippet llRequestUsername - llRequestUsername(${1:key id}) -snippet llResetAnimationOverride - llResetAnimationOverride(${1:string anim_state}); -snippet llResetLandBanList - llResetLandBanList(); -snippet llResetLandPassList - llResetLandPassList(); -snippet llResetOtherScript - llResetOtherScript(${1:string name}); -snippet llResetScript - llResetScript(); -snippet llResetTime - llResetTime(); -snippet llReturnObjectsByID - llReturnObjectsByID(${1:list objects}) -snippet llReturnObjectsByOwner - llReturnObjectsByOwner(${1:key owner}, ${2:integer scope}) -snippet llRezAtRoot - llRezAtRoot(${1:string inventory}, ${2:vector position}, ${3:vector velocity}, ${4:rotation rot}, ${5:integer param}); -snippet llRezObject - llRezObject(${1:string inventory}, ${2:vector pos}, ${3:vector vel}, ${4:rotation rot}, ${5:integer param}); -snippet llRot2Angle - llRot2Angle(${1:rotation rot}) -snippet llRot2Axis - llRot2Axis(${1:rotation rot}) -snippet llRot2Euler - llRot2Euler(${1:rotation quat}) -snippet llRot2Fwd - llRot2Fwd(${1:rotation q}) -snippet llRot2Left - llRot2Left(${1:rotation q}) -snippet llRot2Up - llRot2Up(${1:rotation q}) -snippet llRotateTexture - llRotateTexture(${1:float angle}, ${2:integer face}); -snippet llRotBetween - llRotBetween(${1:vector start}, ${2:vector end}) -snippet llRotLookAt - llRotLookAt(${1:rotation target_direction}, ${2:float strength}, ${3:float damping}); -snippet llRotTarget - llRotTarget(${1:rotation rot}, ${2:float error}) -snippet llRotTargetRemove - llRotTargetRemove(${1:integer handle}); -snippet llRound - llRound(${1:float val}) -snippet llSameGroup - llSameGroup(${1:key group}) -snippet llSay - llSay(${1:integer channel}, ${2:string msg}); -snippet llScaleByFactor - llScaleByFactor(${1:float scaling_factor}) -snippet llScaleTexture - llScaleTexture(${1:float u}, ${2:float v}, ${3:integer face}); -snippet llScriptDanger - llScriptDanger(${1:vector pos}) -snippet llScriptProfiler - llScriptProfiler(${1:integer flags}); -snippet llSendRemoteData - llSendRemoteData(${1:key channel}, ${2:string dest}, ${3:integer idata}, ${4:string sdata}) -snippet llSensor - llSensor(${1:string name}, ${2:key id}, ${3:integer type}, ${4:float range}, ${5:float arc}); -snippet llSensorRepeat - llSensorRepeat(${1:string name}, ${2:key id}, ${3:integer type}, ${4:float range}, ${5:float arc}, ${6:float rate}); -snippet llSetAlpha - llSetAlpha(${1:float alpha}, ${2:integer face}); -snippet llSetAngularVelocity - llSetAngularVelocity(${1:vector force}, ${2:integer local}); -snippet llSetAnimationOverride - llSetAnimationOverride(${1:string anim_state}, ${2:string anim}) -snippet llSetBuoyancy - llSetBuoyancy(${1:float buoyancy}); -snippet llSetCameraAtOffset - llSetCameraAtOffset(${1:vector offset}); -snippet llSetCameraEyeOffset - llSetCameraEyeOffset(${1:vector offset}); -snippet llSetCameraParams - llSetCameraParams(${1:list rules}); -snippet llSetClickAction - llSetClickAction(${1:integer action}); -snippet llSetColor - llSetColor(${1:vector color}, ${2:integer face}); -snippet llSetContentType - llSetContentType(${1:key request_id}, ${2:integer content_type}); -snippet llSetDamage - llSetDamage(${1:float damage}); -snippet llSetForce - llSetForce(${1:vector force}, ${2:integer local}); -snippet llSetForceAndTorque - llSetForceAndTorque(${1:vector force}, ${2:vector torque}, ${3:integer local}); -snippet llSetHoverHeight - llSetHoverHeight(${1:float height}, ${2:integer water}, ${3:float tau}); -snippet llSetKeyframedMotion - llSetKeyframedMotion(${1:list keyframes}, ${2:list options}); -snippet llSetLinkAlpha - llSetLinkAlpha(${1:integer link}, ${2:float alpha}, ${3:integer face}); -snippet llSetLinkCamera - llSetLinkCamera(${1:integer link}, ${2:vector eye}, ${3:vector at}); -snippet llSetLinkColor - llSetLinkColor(${1:integer link}, ${2:vector color}, ${3:integer face}); -snippet llSetLinkMedia - llSetLinkMedia(${1:integer link}, ${2:integer face}, ${3:list params}); -snippet llSetLinkPrimitiveParams - llSetLinkPrimitiveParams(${1:integer link}, ${2:list rules}); -snippet llSetLinkPrimitiveParamsFast - llSetLinkPrimitiveParamsFast(${1:integer link}, ${2:list rules}); -snippet llSetLinkTexture - llSetLinkTexture(${1:integer link}, ${2:string texture}, ${3:integer face}); -snippet llSetLinkTextureAnim - llSetLinkTextureAnim(${1:integer link}, ${2:integer mode}, ${3:integer face}, ${4:integer sizex}, ${5:integer sizey}, ${6:float start}, ${7:float length}, ${8:float rate}); -snippet llSetLocalRot - llSetLocalRot(${1:rotation rot}); -snippet llSetMemoryLimit - llSetMemoryLimit(${1:integer limit}) -snippet llSetObjectDesc - llSetObjectDesc(${1:string description}); -snippet llSetObjectName - llSetObjectName(${1:string name}); -snippet llSetParcelMusicURL - llSetParcelMusicURL(${1:string url}); -snippet llSetPayPrice - llSetPayPrice(${1:integer price}, [${2:integer price_button_a}, ${3:integer price_button_b}, ${4:integer price_button_c}, ${5:integer price_button_d}]); -snippet llSetPhysicsMaterial - llSetPhysicsMaterial(${1:integer mask}, ${2:float gravity_multiplier}, ${3:float restitution}, ${4:float friction}, ${5:float density}); -snippet llSetPos - llSetPos(${1:vector pos}); -snippet llSetPrimitiveParams - llSetPrimitiveParams(${1:list rules}); -snippet llSetPrimMediaParams - llSetPrimMediaParams(${1:integer face}, ${2:list params}); -snippet llSetRegionPos - llSetRegionPos(${1:vector position}) -snippet llSetRemoteScriptAccessPin - llSetRemoteScriptAccessPin(${1:integer pin}); -snippet llSetRot - llSetRot(${1:rotation rot}); -snippet llSetScale - llSetScale(${1:vector size}); -snippet llSetScriptState - llSetScriptState(${1:string name}, ${2:integer run}); -snippet llSetSitText - llSetSitText(${1:string text}); -snippet llSetSoundQueueing - llSetSoundQueueing(${1:integer queue}); -snippet llSetSoundRadius - llSetSoundRadius(${1:float radius}); -snippet llSetStatus - llSetStatus(${1:integer status}, ${2:integer value}); -snippet llSetText - llSetText(${1:string text}, ${2:vector color}, ${3:float alpha}); -snippet llSetTexture - llSetTexture(${1:string texture}, ${2:integer face}); -snippet llSetTextureAnim - llSetTextureAnim(${1:integer mode}, ${2:integer face}, ${3:integer sizex}, ${4:integer sizey}, ${5:float start}, ${6:float length}, ${7:float rate}); -snippet llSetTimerEvent - llSetTimerEvent(${1:float sec}); -snippet llSetTorque - llSetTorque(${1:vector torque}, ${2:integer local}); -snippet llSetTouchText - llSetTouchText(${1:string text}); -snippet llSetVehicleFlags - llSetVehicleFlags(${1:integer flags}); -snippet llSetVehicleFloatParam - llSetVehicleFloatParam(${1:integer param}, ${2:float value}); -snippet llSetVehicleRotationParam - llSetVehicleRotationParam(${1:integer param}, ${2:rotation rot}); -snippet llSetVehicleType - llSetVehicleType(${1:integer type}); -snippet llSetVehicleVectorParam - llSetVehicleVectorParam(${1:integer param}, ${2:vector vec}); -snippet llSetVelocity - llSetVelocity(${1:vector force}, ${2:integer local}); -snippet llSHA1String - llSHA1String(${1:string src}) -snippet llShout - llShout(${1:integer channel}, ${2:string msg}); -snippet llSin - llSin(${1:float theta}) -snippet llSitTarget - llSitTarget(${1:vector offset}, ${2:rotation rot}); -snippet llSleep - llSleep(${1:float sec}); -snippet llSqrt - llSqrt(${1:float val}) -snippet llStartAnimation - llStartAnimation(${1:string anim}); -snippet llStopAnimation - llStopAnimation(${1:string anim}); -snippet llStopHover - llStopHover(); -snippet llStopLookAt - llStopLookAt(); -snippet llStopMoveToTarget - llStopMoveToTarget(); -snippet llStopSound - llStopSound(); -snippet llStringLength - llStringLength(${1:string str}) -snippet llStringToBase64 - llStringToBase64(${1:string str}) -snippet llStringTrim - llStringTrim(${1:string src}, ${2:integer type}) -snippet llSubStringIndex - llSubStringIndex(${1:string source}, ${2:string pattern}) -snippet llTakeControls - llTakeControls(${1:integer controls}, ${2:integer accept}, ${3:integer pass_on}); -snippet llTan - llTan(${1:float theta}) -snippet llTarget - llTarget(${1:vector position}, ${2:float range}) -snippet llTargetOmega - llTargetOmega(${1:vector axis}, ${2:float spinrate}, ${3:float gain}); -snippet llTargetRemove - llTargetRemove(${1:integer handle}); -snippet llTeleportAgent - llTeleportAgent(${1:key agent}, ${2:string landmark}, ${3:vector position}, ${4:vector look_at}); -snippet llTeleportAgentGlobalCoords - llTeleportAgentGlobalCoords(${1:key agent}, ${2:vector global_coordinates}, ${3:vector region_coordinates}, ${4:vector look_at}); -snippet llTeleportAgentHome - llTeleportAgentHome(${1:key agent}); -snippet llTextBox - llTextBox(${1:key agent}, ${2:string message}, ${3:integer channel}); -snippet llToLower - llToLower(${1:string src}) -snippet llToUpper - llToUpper(${1:string src}) -snippet llTransferLindenDollars - llTransferLindenDollars(${1:key destination}, ${2:integer amount}) -snippet llTriggerSound - llTriggerSound(${1:string sound}, ${2:float volume}); -snippet llTriggerSoundLimited - llTriggerSoundLimited(${1:string sound}, ${2:float volume}, ${3:vector top_north_east}, ${4:vector bottom_south_west}); -snippet llUnescapeURL - llUnescapeURL(${1:string url}) -snippet llUnSit - llUnSit(${1:key id}); -snippet llUpdateCharacter - llUpdateCharacter(${1:list options}) -snippet llUpdateKeyValue - llUpdateKeyValue(${1:string k}, ${2:string v}, ${3:integer checked}, ${4:string ov}) -snippet llVecDist - llVecDist(${1:vector vec_a}, ${2:vector vec_b}) -snippet llVecMag - llVecMag(${1:vector vec}) -snippet llVecNorm - llVecNorm(${1:vector vec}) -snippet llVolumeDetect - llVolumeDetect(${1:integer detect}); -snippet llWanderWithin - llWanderWithin(${1:vector origin}, ${2:vector dist}, ${3:list options}); -snippet llWater - llWater(${1:vector offset}); -snippet llWhisper - llWhisper(${1:integer channel}, ${2:string msg}); -snippet llWind - llWind(${1:vector offset}); -snippet llXorBase64 - llXorBase64(${1:string str1}, ${2:string str2}) -snippet money - money(${1:key id}, ${2:integer amount}) - { - $0 - } -snippet object_rez - object_rez(${1:key id}) - { - $0 - } -snippet on_rez - on_rez(${1:integer start_param}) - { - $0 - } -snippet path_update - path_update(${1:integer type}, ${2:list reserved}) - { - $0 - } -snippet remote_data - remote_data(${1:integer event_type}, ${2:key channel}, ${3:key message_id}, ${4:string sender}, ${5:integer idata}, ${6:string sdata}) - { - $0 - } -snippet run_time_permissions - run_time_permissions(${1:integer perm}) - { - $0 - } -snippet sensor - sensor(${1:integer index}) - { - $0 - } -snippet state - state ${1:name} -snippet touch - touch(${1:integer index}) - { - $0 - } -snippet touch_end - touch_end(${1:integer index}) - { - $0 - } -snippet touch_start - touch_start(${1:integer index}) - { - $0 - } -snippet transaction_result - transaction_result(${1:key id}, ${2:integer success}, ${3:string data}) - { - $0 - } -snippet while - while (${1:condition}) - { - $0 - } diff --git a/lib/ace/snippets/lua.js b/lib/ace/snippets/lua.js deleted file mode 100644 index 0ab6fdcd..00000000 --- a/lib/ace/snippets/lua.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./lua.snippets"); -exports.scope = "lua"; - -}); diff --git a/lib/ace/snippets/lua.snippets b/lib/ace/snippets/lua.snippets deleted file mode 100644 index 34ae25eb..00000000 --- a/lib/ace/snippets/lua.snippets +++ /dev/null @@ -1,21 +0,0 @@ -snippet #! - #!/usr/bin/env lua - $1 -snippet local - local ${1:x} = ${2:1} -snippet fun - function ${1:fname}(${2:...}) - ${3:-- body} - end -snippet for - for ${1:i}=${2:1},${3:10} do - ${4:print(i)} - end -snippet forp - for ${1:i},${2:v} in pairs(${3:table_name}) do - ${4:-- body} - end -snippet fori - for ${1:i},${2:v} in ipairs(${3:table_name}) do - ${4:-- body} - end diff --git a/lib/ace/snippets/luapage.js b/lib/ace/snippets/luapage.js deleted file mode 100644 index 86b22842..00000000 --- a/lib/ace/snippets/luapage.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./luapage.snippets"); -exports.scope = "luapage"; - -}); diff --git a/lib/ace/snippets/luapage.snippets b/lib/ace/snippets/luapage.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/lucene.js b/lib/ace/snippets/lucene.js deleted file mode 100644 index 01edb07d..00000000 --- a/lib/ace/snippets/lucene.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./lucene.snippets"); -exports.scope = "lucene"; - -}); diff --git a/lib/ace/snippets/lucene.snippets b/lib/ace/snippets/lucene.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/makefile.js b/lib/ace/snippets/makefile.js deleted file mode 100644 index 0ec05ac0..00000000 --- a/lib/ace/snippets/makefile.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./makefile.snippets"); -exports.scope = "makefile"; - -}); diff --git a/lib/ace/snippets/makefile.snippets b/lib/ace/snippets/makefile.snippets deleted file mode 100644 index 43648136..00000000 --- a/lib/ace/snippets/makefile.snippets +++ /dev/null @@ -1,4 +0,0 @@ -snippet ifeq - ifeq (${1:cond0},${2:cond1}) - ${3:code} - endif diff --git a/lib/ace/snippets/mako.snippets b/lib/ace/snippets/mako.snippets deleted file mode 100644 index 2a0aef9c..00000000 --- a/lib/ace/snippets/mako.snippets +++ /dev/null @@ -1,54 +0,0 @@ -snippet def - <%def name="${1:name}"> - ${2:} - -snippet call - <%call expr="${1:name}"> - ${2:} - -snippet doc - <%doc> - ${1:} - -snippet text - <%text> - ${1:} - -snippet for - % for ${1:i} in ${2:iter}: - ${3:} - % endfor -snippet if if - % if ${1:condition}: - ${2:} - % endif -snippet if if/else - % if ${1:condition}: - ${2:} - % else: - ${3:} - % endif -snippet try - % try: - ${1:} - % except${2:}: - ${3:pass} - % endtry -snippet wh - % while ${1:}: - ${2:} - % endwhile -snippet $ - ${ ${1:} } -snippet <% - <% ${1:} %> -snippet -snippet inherit - <%inherit file="${1:filename}" /> -snippet include - <%include file="${1:filename}" /> -snippet namespace - <%namespace file="${1:name}" /> -snippet page - <%page args="${1:}" /> diff --git a/lib/ace/snippets/markdown.js b/lib/ace/snippets/markdown.js deleted file mode 100644 index 3940bc90..00000000 --- a/lib/ace/snippets/markdown.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./markdown.snippets"); -exports.scope = "markdown"; - -}); diff --git a/lib/ace/snippets/markdown.snippets b/lib/ace/snippets/markdown.snippets deleted file mode 100644 index a5110fc9..00000000 --- a/lib/ace/snippets/markdown.snippets +++ /dev/null @@ -1,88 +0,0 @@ -# Markdown - -# Includes octopress (http://octopress.org/) snippets - -snippet [ - [${1:text}](http://${2:address} "${3:title}") -snippet [* - [${1:link}](${2:`@*`} "${3:title}")${4} - -snippet [: - [${1:id}]: http://${2:url} "${3:title}" -snippet [:* - [${1:id}]: ${2:`@*`} "${3:title}" - -snippet ![ - ![${1:alttext}](${2:/images/image.jpg} "${3:title}") -snippet ![* - ![${1:alt}](${2:`@*`} "${3:title}")${4} - -snippet ![: - ![${1:id}]: ${2:url} "${3:title}" -snippet ![:* - ![${1:id}]: ${2:`@*`} "${3:title}" - -snippet === -regex /^/=+/=*// - ${PREV_LINE/./=/g} - - ${0} -snippet --- -regex /^/-+/-*// - ${PREV_LINE/./-/g} - - ${0} -snippet blockquote - {% blockquote %} - ${1:quote} - {% endblockquote %} - -snippet blockquote-author - {% blockquote ${1:author}, ${2:title} %} - ${3:quote} - {% endblockquote %} - -snippet blockquote-link - {% blockquote ${1:author} ${2:URL} ${3:link_text} %} - ${4:quote} - {% endblockquote %} - -snippet bt-codeblock-short - ``` - ${1:code_snippet} - ``` - -snippet bt-codeblock-full - ``` ${1:language} ${2:title} ${3:URL} ${4:link_text} - ${5:code_snippet} - ``` - -snippet codeblock-short - {% codeblock %} - ${1:code_snippet} - {% endcodeblock %} - -snippet codeblock-full - {% codeblock ${1:title} lang:${2:language} ${3:URL} ${4:link_text} %} - ${5:code_snippet} - {% endcodeblock %} - -snippet gist-full - {% gist ${1:gist_id} ${2:filename} %} - -snippet gist-short - {% gist ${1:gist_id} %} - -snippet img - {% img ${1:class} ${2:URL} ${3:width} ${4:height} ${5:title_text} ${6:alt_text} %} - -snippet youtube - {% youtube ${1:video_id} %} - -# The quote should appear only once in the text. It is inherently part of it. -# See http://octopress.org/docs/plugins/pullquote/ for more info. - -snippet pullquote - {% pullquote %} - ${1:text} {" ${2:quote} "} ${3:text} - {% endpullquote %} diff --git a/lib/ace/snippets/mask.js b/lib/ace/snippets/mask.js deleted file mode 100644 index 7fbca678..00000000 --- a/lib/ace/snippets/mask.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./mask.snippets"); -exports.scope = "mask"; - -}); diff --git a/lib/ace/snippets/mask.snippets b/lib/ace/snippets/mask.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/matlab.js b/lib/ace/snippets/matlab.js deleted file mode 100644 index 698366ba..00000000 --- a/lib/ace/snippets/matlab.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./matlab.snippets"); -exports.scope = "matlab"; - -}); diff --git a/lib/ace/snippets/matlab.snippets b/lib/ace/snippets/matlab.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/mel.js b/lib/ace/snippets/mel.js deleted file mode 100644 index 090d79b3..00000000 --- a/lib/ace/snippets/mel.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./mel.snippets"); -exports.scope = "mel"; - -}); diff --git a/lib/ace/snippets/mel.snippets b/lib/ace/snippets/mel.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/mushcode.js b/lib/ace/snippets/mushcode.js deleted file mode 100644 index 8b0d2dcb..00000000 --- a/lib/ace/snippets/mushcode.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./mushcode.snippets"); -exports.scope = "mushcode"; - -}); diff --git a/lib/ace/snippets/mushcode.snippets b/lib/ace/snippets/mushcode.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/mushcode_high_rules.js b/lib/ace/snippets/mushcode_high_rules.js deleted file mode 100644 index 25d42827..00000000 --- a/lib/ace/snippets/mushcode_high_rules.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./mushcode_high_rules.snippets"); -exports.scope = "mushcode_high_rules"; - -}); diff --git a/lib/ace/snippets/mushcode_high_rules.snippets b/lib/ace/snippets/mushcode_high_rules.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/mysql.js b/lib/ace/snippets/mysql.js deleted file mode 100644 index e5462390..00000000 --- a/lib/ace/snippets/mysql.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./mysql.snippets"); -exports.scope = "mysql"; - -}); diff --git a/lib/ace/snippets/mysql.snippets b/lib/ace/snippets/mysql.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/nim.js b/lib/ace/snippets/nim.js deleted file mode 100644 index 6e6d02bb..00000000 --- a/lib/ace/snippets/nim.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./nim.snippets"); -exports.scope = "nim"; - -}); diff --git a/lib/ace/snippets/nim.snippets b/lib/ace/snippets/nim.snippets deleted file mode 100644 index a8a20a00..00000000 --- a/lib/ace/snippets/nim.snippets +++ /dev/null @@ -1,130 +0,0 @@ -snippet #! - #!/usr/bin/env nim -snippet imp - import ${1:module} -snippet from - from ${1:package} import ${2:module} -# Module Docstring -snippet docs - ## File: ${1:FILENAME:file_name} - ## Author: ${2:author} - ## Description: ${3} -snippet wh - while ${1:condition}: - ${2:# TODO: write code...} -# dowh - does the same as do...while in other languages -snippet dowh - while true: - ${1:# TODO: write code...} - if ${2:condition}: - break -snippet with - with ${1:expr} as ${2:var}: - ${3:# TODO: write code...} -# New Function -snippet proc - proc ${1:fname}(${2:`indent('.') ? 'self' : ''`}): ${3: return type} = - ##${4:docstring for $1} - ${5:# TODO: write code...} -snippet deff - def ${1:fname}(${2:`indent('.') ? 'self' : ''`}): - ${3:# TODO: write code...} -# New Method -snippet defs - def ${1:mname}(self, ${2:arg}): - ${3:# TODO: write code...} -# New Property -snippet property - def ${1:foo}(): - doc = "${2:The $1 property.}" - def fget(self): - ${3:return self._$1} - def fset(self, value): - ${4:self._$1 = value} -# Ifs -snippet if - if ${1:condition}: - ${2:# TODO: write code...} -snippet el - else: - ${1:# TODO: write code...} -snippet ei - elif ${1:condition}: - ${2:# TODO: write code...} -# For -snippet for - for ${1:item} in ${2:items}: - ${3:# TODO: write code...} -# Encodes -snippet cutf8 - # -*- coding: utf-8 -*- -snippet clatin1 - # -*- coding: latin-1 -*- -snippet cascii - # -*- coding: ascii -*- -# Lambda -snippet ld - ${1:var} = lambda ${2:vars} : ${3:action} -snippet . - self. -snippet try Try/Except - try: - ${1:# TODO: write code...} - except ${2:Exception}, ${3:e}: - ${4:raise $3} -snippet try Try/Except/Else - try: - ${1:# TODO: write code...} - except ${2:Exception}, ${3:e}: - ${4:raise $3} - else: - ${5:# TODO: write code...} -snippet try Try/Except/Finally - try: - ${1:# TODO: write code...} - except ${2:Exception}, ${3:e}: - ${4:raise $3} - finally: - ${5:# TODO: write code...} -snippet try Try/Except/Else/Finally - try: - ${1:# TODO: write code...} - except ${2:Exception}, ${3:e}: - ${4:raise $3} - else: - ${5:# TODO: write code...} - finally: - ${6:# TODO: write code...} -# if __name__ == '__main__': -snippet ifmain - if isMainModule: - ${1:main()} -snippet " - ## ${1:doc} -# test function/method -snippet test - def test_${1:description}(${2:self}): - ${3:# TODO: write code...} -# test case -snippet testcase - class ${1:ExampleCase}(unittest.TestCase): - - def test_${2:description}(self): - ${3:# TODO: write code...} -#getopt -snippet getopt - try: - # Short option syntax: "hv:" - # Long option syntax: "help" or "verbose=" - opts, args = getopt.getopt(sys.argv[1:], "${1:short_options}", [${2:long_options}]) - - except getopt.GetoptError, err: - # Print debug info - print str(err) - ${3:error_action} - - for option, argument in opts: - if option in ("-h", "--help"): - ${4} - elif option in ("-v", "--verbose"): - verbose = argument diff --git a/lib/ace/snippets/nix.js b/lib/ace/snippets/nix.js deleted file mode 100644 index 583abf85..00000000 --- a/lib/ace/snippets/nix.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./nix.snippets"); -exports.scope = "nix"; - -}); diff --git a/lib/ace/snippets/nix.snippets b/lib/ace/snippets/nix.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/objc.snippets b/lib/ace/snippets/objc.snippets deleted file mode 100644 index 5517b062..00000000 --- a/lib/ace/snippets/objc.snippets +++ /dev/null @@ -1,247 +0,0 @@ -# #import <...> -snippet Imp - #import <${1:Cocoa/Cocoa.h}>${2} -# #import "..." -snippet imp - #import "${1:`Filename()`.h}"${2} -# @selector(...) -snippet sel - @selector(${1:method}:)${3} -# @"..." string -snippet s - @"${1}"${2} -# Object -snippet o - ${1:NSObject} *${2:foo} = [${3:$1 alloc}]${4};${5} -# NSLog(...) -snippet log - NSLog(@"${1:%@}"${2});${3} -# Class -snippet objc - @interface ${1:`Filename('', 'someClass')`} : ${2:NSObject} - { - } - @end - - @implementation $1 - ${3} - @end -# Class Interface -snippet int - @interface ${1:`Filename('', 'someClass')`} : ${2:NSObject} - {${3} - } - ${4} - @end -snippet @interface - @interface ${1:`Filename('', 'someClass')`} : ${2:NSObject} - {${3} - } - ${4} - @end -# Class Implementation -snippet impl - @implementation ${1:`Filename('', 'someClass')`} - ${2} - @end -snippet @implementation - @implementation ${1:`Filename('', 'someClass')`} - ${2} - @end -# Protocol -snippet pro - @protocol ${1:`Filename('$1Delegate', 'MyProtocol')`} ${2:} - ${3} - @end -snippet @protocol - @protocol ${1:`Filename('$1Delegate', 'MyProtocol')`} ${2:} - ${3} - @end -# init Definition -snippet init - - (id)init - { - if (self = [super init]) { - ${1} - } - return self; - } -# dealloc Definition -snippet dealloc - - (void) dealloc - { - ${1:deallocations} - [super dealloc]; - } -snippet su - [super ${1:init}]${2} -snippet ibo - IBOutlet ${1:NSSomeClass} *${2:$1};${3} -# Category -snippet cat - @interface ${1:NSObject} (${2:MyCategory}) - @end - - @implementation $1 ($2) - ${3} - @end -# Category Interface -snippet cath - @interface ${1:`Filename('$1', 'NSObject')`} (${2:MyCategory}) - ${3} - @end -# Method -snippet m - - (${1:id})${2:method} - { - ${3} - } -# Method declaration -snippet md - - (${1:id})${2:method};${3} -# IBAction declaration -snippet ibad - - (IBAction)${1:method}:(${2:id})sender;${3} -# IBAction method -snippet iba - - (IBAction)${1:method}:(${2:id})sender - { - ${3} - } -# awakeFromNib method -snippet wake - - (void)awakeFromNib - { - ${1} - } -# Class Method -snippet M - + (${1:id})${2:method} - { - ${3:return nil;} - } -# Sub-method (Call super) -snippet sm - - (${1:id})${2:method} - { - [super $2];${3} - return self; - } -# Accessor Methods For: -# Object -snippet objacc - - (${1:id})${2:thing} - { - return $2; - } - - - (void)set$2:($1)${3:new$2} - { - [$3 retain]; - [$2 release]; - $2 = $3; - }${4} -# for (object in array) -snippet forin - for (${1:Class} *${2:some$1} in ${3:array}) { - ${4} - } -snippet fore - for (${1:object} in ${2:array}) { - ${3:statements} - } -snippet forarray - unsigned int ${1:object}Count = [${2:array} count]; - - for (unsigned int index = 0; index < $1Count; index++) { - ${3:id} $1 = [$2 $1AtIndex:index]; - ${4} - } -snippet fora - unsigned int ${1:object}Count = [${2:array} count]; - - for (unsigned int index = 0; index < $1Count; index++) { - ${3:id} $1 = [$2 $1AtIndex:index]; - ${4} - } -# Try / Catch Block -snippet @try - @try { - ${1:statements} - } - @catch (NSException * e) { - ${2:handler} - } - @finally { - ${3:statements} - } -snippet @catch - @catch (${1:exception}) { - ${2:handler} - } -snippet @finally - @finally { - ${1:statements} - } -# IBOutlet -# @property (Objective-C 2.0) -snippet prop - @property (${1:retain}) ${2:NSSomeClass} ${3:*$2};${4} -# @synthesize (Objective-C 2.0) -snippet syn - @synthesize ${1:property};${2} -# [[ alloc] init] -snippet alloc - [[${1:foo} alloc] init${2}];${3} -snippet a - [[${1:foo} alloc] init${2}];${3} -# retain -snippet ret - [${1:foo} retain];${2} -# release -snippet rel - [${1:foo} release]; -# autorelease -snippet arel - [${1:foo} autorelease]; -# autorelease pool -snippet pool - NSAutoreleasePool *${1:pool} = [[NSAutoreleasePool alloc] init]; - ${2:/* code */} - [$1 drain]; -# Throw an exception -snippet except - NSException *${1:badness}; - $1 = [NSException exceptionWithName:@"${2:$1Name}" - reason:@"${3}" - userInfo:nil]; - [$1 raise]; -snippet prag - #pragma mark ${1:-} -snippet cl - @class ${1:Foo};${2} -snippet color - [[NSColor ${1:blackColor}] set]; -# NSArray -snippet array - NSMutableArray *${1:array} = [NSMutable array];${2} -snippet nsa - NSArray ${1} -snippet nsma - NSMutableArray ${1} -snippet aa - NSArray * array;${1} -snippet ma - NSMutableArray * array;${1} -# NSDictionary -snippet dict - NSMutableDictionary *${1:dict} = [NSMutableDictionary dictionary];${2} -snippet nsd - NSDictionary ${1} -snippet nsmd - NSMutableDictionary ${1} -# NSString -snippet nss - NSString ${1} -snippet nsms - NSMutableString ${1} diff --git a/lib/ace/snippets/objectivec.js b/lib/ace/snippets/objectivec.js deleted file mode 100644 index ed5d5fa8..00000000 --- a/lib/ace/snippets/objectivec.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./objectivec.snippets"); -exports.scope = "objectivec"; - -}); diff --git a/lib/ace/snippets/objectivec.snippets b/lib/ace/snippets/objectivec.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/ocaml.js b/lib/ace/snippets/ocaml.js deleted file mode 100644 index a6e6842e..00000000 --- a/lib/ace/snippets/ocaml.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./ocaml.snippets"); -exports.scope = "ocaml"; - -}); diff --git a/lib/ace/snippets/ocaml.snippets b/lib/ace/snippets/ocaml.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/pascal.js b/lib/ace/snippets/pascal.js deleted file mode 100644 index cd8f19fe..00000000 --- a/lib/ace/snippets/pascal.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./pascal.snippets"); -exports.scope = "pascal"; - -}); diff --git a/lib/ace/snippets/pascal.snippets b/lib/ace/snippets/pascal.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/perl.js b/lib/ace/snippets/perl.js deleted file mode 100644 index 9b1fbe8d..00000000 --- a/lib/ace/snippets/perl.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./perl.snippets"); -exports.scope = "perl"; - -}); diff --git a/lib/ace/snippets/perl.snippets b/lib/ace/snippets/perl.snippets deleted file mode 100644 index 9cebedea..00000000 --- a/lib/ace/snippets/perl.snippets +++ /dev/null @@ -1,347 +0,0 @@ -# #!/usr/bin/perl -snippet #! - #!/usr/bin/env perl - -# Hash Pointer -snippet . - => -# Function -snippet sub - sub ${1:function_name} { - ${2:#body ...} - } -# Conditional -snippet if - if (${1}) { - ${2:# body...} - } -# Conditional if..else -snippet ife - if (${1}) { - ${2:# body...} - } - else { - ${3:# else...} - } -# Conditional if..elsif..else -snippet ifee - if (${1}) { - ${2:# body...} - } - elsif (${3}) { - ${4:# elsif...} - } - else { - ${5:# else...} - } -# Conditional One-line -snippet xif - ${1:expression} if ${2:condition};${3} -# Unless conditional -snippet unless - unless (${1}) { - ${2:# body...} - } -# Unless conditional One-line -snippet xunless - ${1:expression} unless ${2:condition};${3} -# Try/Except -snippet eval - local $@; - eval { - ${1:# do something risky...} - }; - if (my $e = $@) { - ${2:# handle failure...} - } -# While Loop -snippet wh - while (${1}) { - ${2:# body...} - } -# While Loop One-line -snippet xwh - ${1:expression} while ${2:condition};${3} -# C-style For Loop -snippet cfor - for (my $${2:var} = 0; $$2 < ${1:count}; $$2${3:++}) { - ${4:# body...} - } -# For loop one-line -snippet xfor - ${1:expression} for @${2:array};${3} -# Foreach Loop -snippet for - foreach my $${1:x} (@${2:array}) { - ${3:# body...} - } -# Foreach Loop One-line -snippet fore - ${1:expression} foreach @${2:array};${3} -# Package -snippet package - package ${1:`substitute(Filename('', 'Page Title'), '^.', '\u&', '')`}; - - ${2} - - 1; - - __END__ -# Package syntax perl >= 5.14 -snippet packagev514 - package ${1:`substitute(Filename('', 'Page Title'), '^.', '\u&', '')`} ${2:0.99}; - - ${3} - - 1; - - __END__ -#moose -snippet moose - use Moose; - use namespace::autoclean; - ${1:#}BEGIN {extends '${2:ParentClass}'}; - - ${3} -# parent -snippet parent - use parent qw(${1:Parent Class}); -# Read File -snippet slurp - my $${1:var} = do { local $/; open my $file, '<', "${2:file}"; <$file> }; - ${3} -# strict warnings -snippet strwar - use strict; - use warnings; -# older versioning with perlcritic bypass -snippet vers - ## no critic - our $VERSION = '${1:version}'; - eval $VERSION; - ## use critic -# new 'switch' like feature -snippet switch - use feature 'switch'; - -# Anonymous subroutine -snippet asub - sub { - ${1:# body } - } - - - -# Begin block -snippet begin - BEGIN { - ${1:# begin body} - } - -# call package function with some parameter -snippet pkgmv - __PACKAGE__->${1:package_method}(${2:var}) - -# call package function without a parameter -snippet pkgm - __PACKAGE__->${1:package_method}() - -# call package "get_" function without a parameter -snippet pkget - __PACKAGE__->get_${1:package_method}() - -# call package function with a parameter -snippet pkgetv - __PACKAGE__->get_${1:package_method}(${2:var}) - -# complex regex -snippet qrx - qr/ - ${1:regex} - /xms - -#simpler regex -snippet qr/ - qr/${1:regex}/x - -#given -snippet given - given ($${1:var}) { - ${2:# cases} - ${3:# default} - } - -# switch-like case -snippet when - when (${1:case}) { - ${2:# body} - } - -# hash slice -snippet hslice - @{ ${1:hash} }{ ${2:array} } - - -# map -snippet map - map { ${2: body } } ${1: @array } ; - - - -# Pod stub -snippet ppod - =head1 NAME - - ${1:ClassName} - ${2:ShortDesc} - - =head1 SYNOPSIS - - use $1; - - ${3:# synopsis...} - - =head1 DESCRIPTION - - ${4:# longer description...} - - - =head1 INTERFACE - - - =head1 DEPENDENCIES - - - =head1 SEE ALSO - - -# Heading for a subroutine stub -snippet psub - =head2 ${1:MethodName} - - ${2:Summary....} - -# Heading for inline subroutine pod -snippet psubi - =head2 ${1:MethodName} - - ${2:Summary...} - - - =cut -# inline documented subroutine -snippet subpod - =head2 $1 - - Summary of $1 - - =cut - - sub ${1:subroutine_name} { - ${2:# body...} - } -# Subroutine signature -snippet parg - =over 2 - - =item - Arguments - - - =over 3 - - =item - C<${1:DataStructure}> - - ${2:Sample} - - - =back - - - =item - Return - - =over 3 - - - =item - C<${3:...return data}> - - - =back - - - =back - - - -# Moose has -snippet has - has ${1:attribute} => ( - is => '${2:ro|rw}', - isa => '${3:Str|Int|HashRef|ArrayRef|etc}', - default => sub { - ${4:defaultvalue} - }, - ${5:# other attributes} - ); - - -# override -snippet override - override ${1:attribute} => sub { - ${2:# my $self = shift;}; - ${3:# my ($self, $args) = @_;}; - }; - - -# use test classes -snippet tuse - use Test::More; - use Test::Deep; # (); # uncomment to stop prototype errors - use Test::Exception; - -# local test lib -snippet tlib - use lib qw{ ./t/lib }; - -#test methods -snippet tmeths - $ENV{TEST_METHOD} = '${1:regex}'; - -# runtestclass -snippet trunner - use ${1:test_class}; - $1->runtests(); - -# Test::Class-style test -snippet tsub - sub t${1:number}_${2:test_case} :Test(${3:num_of_tests}) { - my $self = shift; - ${4:# body} - - } - -# Test::Routine-style test -snippet trsub - test ${1:test_name} => { description => '${2:Description of test.}'} => sub { - my ($self) = @_; - ${3:# test code} - }; - -#prep test method -snippet tprep - sub prep${1:number}_${2:test_case} :Test(startup) { - my $self = shift; - ${4:# body} - } - -# cause failures to print stack trace -snippet debug_trace - use Carp; # 'verbose'; - # cloak "die" - # warn "warning" - $SIG{'__DIE__'} = sub { - require Carp; Carp::confess - }; - diff --git a/lib/ace/snippets/pgsql.js b/lib/ace/snippets/pgsql.js deleted file mode 100644 index 9bbd9012..00000000 --- a/lib/ace/snippets/pgsql.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./pgsql.snippets"); -exports.scope = "pgsql"; - -}); diff --git a/lib/ace/snippets/pgsql.snippets b/lib/ace/snippets/pgsql.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/php.js b/lib/ace/snippets/php.js deleted file mode 100644 index b8f8ce0e..00000000 --- a/lib/ace/snippets/php.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./php.snippets"); -exports.scope = "php"; - -}); diff --git a/lib/ace/snippets/php.snippets b/lib/ace/snippets/php.snippets deleted file mode 100644 index 8d11a281..00000000 --- a/lib/ace/snippets/php.snippets +++ /dev/null @@ -1,377 +0,0 @@ -snippet -# this one is for php5.4 -snippet -snippet ns - namespace ${1:Foo\Bar\Baz}; - ${2} -snippet use - use ${1:Foo\Bar\Baz}; - ${2} -snippet c - ${1:abstract }class ${2:$FILENAME} - { - ${3} - } -snippet i - interface ${1:$FILENAME} - { - ${2} - } -snippet t. - $this->${1} -snippet f - function ${1:foo}(${2:array }${3:$bar}) - { - ${4} - } -# method -snippet m - ${1:abstract }${2:protected}${3: static} function ${4:foo}(${5:array }${6:$bar}) - { - ${7} - } -# setter method -snippet sm - /** - * Sets the value of ${1:foo} - * - * @param ${2:$1} $$1 ${3:description} - * - * @return ${4:$FILENAME} - */ - ${5:public} function set${6:$2}(${7:$2 }$$1) - { - $this->${8:$1} = $$1; - return $this; - }${9} -# getter method -snippet gm - /** - * Gets the value of ${1:foo} - * - * @return ${2:$1} - */ - ${3:public} function get${4:$2}() - { - return $this->${5:$1}; - }${6} -#setter -snippet $s - ${1:$foo}->set${2:Bar}(${3}); -#getter -snippet $g - ${1:$foo}->get${2:Bar}(); - -# Tertiary conditional -snippet =?: - $${1:foo} = ${2:true} ? ${3:a} : ${4}; -snippet ?: - ${1:true} ? ${2:a} : ${3} - -snippet C - $_COOKIE['${1:variable}']${2} -snippet E - $_ENV['${1:variable}']${2} -snippet F - $_FILES['${1:variable}']${2} -snippet G - $_GET['${1:variable}']${2} -snippet P - $_POST['${1:variable}']${2} -snippet R - $_REQUEST['${1:variable}']${2} -snippet S - $_SERVER['${1:variable}']${2} -snippet SS - $_SESSION['${1:variable}']${2} - -# the following are old ones -snippet inc - include '${1:file}';${2} -snippet inc1 - include_once '${1:file}';${2} -snippet req - require '${1:file}';${2} -snippet req1 - require_once '${1:file}';${2} -# Start Docblock -snippet /* - /** - * ${1} - */ -# Class - post doc -snippet doc_cp - /** - * ${1:undocumented class} - * - * @package ${2:default} - * @subpackage ${3:default} - * @author ${4:`g:snips_author`} - */${5} -# Class Variable - post doc -snippet doc_vp - /** - * ${1:undocumented class variable} - * - * @var ${2:string} - */${3} -# Class Variable -snippet doc_v - /** - * ${3:undocumented class variable} - * - * @var ${4:string} - */ - ${1:var} $${2};${5} -# Class -snippet doc_c - /** - * ${3:undocumented class} - * - * @package ${4:default} - * @subpackage ${5:default} - * @author ${6:`g:snips_author`} - */ - ${1:}class ${2:} - { - ${7} - } // END $1class $2 -# Constant Definition - post doc -snippet doc_dp - /** - * ${1:undocumented constant} - */${2} -# Constant Definition -snippet doc_d - /** - * ${3:undocumented constant} - */ - define(${1}, ${2});${4} -# Function - post doc -snippet doc_fp - /** - * ${1:undocumented function} - * - * @return ${2:void} - * @author ${3:`g:snips_author`} - */${4} -# Function signature -snippet doc_s - /** - * ${4:undocumented function} - * - * @return ${5:void} - * @author ${6:`g:snips_author`} - */ - ${1}function ${2}(${3});${7} -# Function -snippet doc_f - /** - * ${4:undocumented function} - * - * @return ${5:void} - * @author ${6:`g:snips_author`} - */ - ${1}function ${2}(${3}) - {${7} - } -# Header -snippet doc_h - /** - * ${1} - * - * @author ${2:`g:snips_author`} - * @version ${3:$Id$} - * @copyright ${4:$2}, `strftime('%d %B, %Y')` - * @package ${5:default} - */ - -# Interface -snippet interface - /** - * ${2:undocumented class} - * - * @package ${3:default} - * @author ${4:`g:snips_author`} - */ - interface ${1:$FILENAME} - { - ${5} - } -# class ... -snippet class - /** - * ${1} - */ - class ${2:$FILENAME} - { - ${3} - /** - * ${4} - */ - ${5:public} function ${6:__construct}(${7:argument}) - { - ${8:// code...} - } - } -# define(...) -snippet def - define('${1}'${2});${3} -# defined(...) -snippet def? - ${1}defined('${2}')${3} -snippet wh - while (${1:/* condition */}) { - ${2:// code...} - } -# do ... while -snippet do - do { - ${2:// code... } - } while (${1:/* condition */}); -snippet if - if (${1:/* condition */}) { - ${2:// code...} - } -snippet ifil - - ${2:} - -snippet ife - if (${1:/* condition */}) { - ${2:// code...} - } else { - ${3:// code...} - } - ${4} -snippet ifeil - - ${2:} - - ${3:} - - ${4} -snippet else - else { - ${1:// code...} - } -snippet elseif - elseif (${1:/* condition */}) { - ${2:// code...} - } -snippet switch - switch ($${1:variable}) { - case '${2:value}': - ${3:// code...} - break; - ${5} - default: - ${4:// code...} - break; - } -snippet case - case '${1:value}': - ${2:// code...} - break;${3} -snippet for - for ($${2:i} = 0; $$2 < ${1:count}; $$2${3:++}) { - ${4: // code...} - } -snippet foreach - foreach ($${1:variable} as $${2:value}) { - ${3:// code...} - } -snippet foreachil - - ${3:} - -snippet foreachk - foreach ($${1:variable} as $${2:key} => $${3:value}) { - ${4:// code...} - } -snippet foreachkil - $${3:value}): ?> - ${4:} - -# $... = array (...) -snippet array - $${1:arrayName} = array('${2}' => ${3});${4} -snippet try - try { - ${2} - } catch (${1:Exception} $e) { - } -# lambda with closure -snippet lambda - ${1:static }function (${2:args}) use (${3:&$x, $y /*put vars in scope (closure) */}) { - ${4} - }; -# pre_dump(); -snippet pd - echo '
                                                                                                                                                                                                                                                                                                                                                                                                                                                              '; var_dump(${1}); echo '
                                                                                                                                                                                                                                                                                                                                                                                                                                                              '; -# pre_dump(); die(); -snippet pdd - echo '
                                                                                                                                                                                                                                                                                                                                                                                                                                                              '; var_dump(${1}); echo '
                                                                                                                                                                                                                                                                                                                                                                                                                                                              '; die(${2:}); -snippet vd - var_dump(${1}); -snippet vdd - var_dump(${1}); die(${2:}); -snippet http_redirect - header ("HTTP/1.1 301 Moved Permanently"); - header ("Location: ".URL); - exit(); -# Getters & Setters -snippet gs - /** - * Gets the value of ${1:foo} - * - * @return ${2:$1} - */ - public function get${3:$2}() - { - return $this->${4:$1}; - } - - /** - * Sets the value of $1 - * - * @param $2 $$1 ${5:description} - * - * @return ${6:$FILENAME} - */ - public function set$3(${7:$2 }$$1) - { - $this->$4 = $$1; - return $this; - }${8} -# anotation, get, and set, useful for doctrine -snippet ags - /** - * ${1:description} - * - * @${7} - */ - ${2:protected} $${3:foo}; - - public function get${4:$3}() - { - return $this->$3; - } - - public function set$4(${5:$4 }$${6:$3}) - { - $this->$3 = $$6; - return $this; - } -snippet rett - return true; -snippet retf - return false; diff --git a/lib/ace/snippets/plain_text.js b/lib/ace/snippets/plain_text.js deleted file mode 100644 index 4b4dad55..00000000 --- a/lib/ace/snippets/plain_text.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./plain_text.snippets"); -exports.scope = "plain_text"; - -}); diff --git a/lib/ace/snippets/plain_text.snippets b/lib/ace/snippets/plain_text.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/powershell.js b/lib/ace/snippets/powershell.js deleted file mode 100644 index 4639a304..00000000 --- a/lib/ace/snippets/powershell.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./powershell.snippets"); -exports.scope = "powershell"; - -}); diff --git a/lib/ace/snippets/powershell.snippets b/lib/ace/snippets/powershell.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/praat.js b/lib/ace/snippets/praat.js deleted file mode 100644 index 18afa87f..00000000 --- a/lib/ace/snippets/praat.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./praat.snippets"); -exports.scope = "praat"; - -}); diff --git a/lib/ace/snippets/praat.snippets b/lib/ace/snippets/praat.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/prolog.js b/lib/ace/snippets/prolog.js deleted file mode 100644 index 7c9d0fbc..00000000 --- a/lib/ace/snippets/prolog.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./prolog.snippets"); -exports.scope = "prolog"; - -}); diff --git a/lib/ace/snippets/prolog.snippets b/lib/ace/snippets/prolog.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/properties.js b/lib/ace/snippets/properties.js deleted file mode 100644 index 18bd3883..00000000 --- a/lib/ace/snippets/properties.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./properties.snippets"); -exports.scope = "properties"; - -}); diff --git a/lib/ace/snippets/properties.snippets b/lib/ace/snippets/properties.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/protobuf.js b/lib/ace/snippets/protobuf.js deleted file mode 100644 index 24855545..00000000 --- a/lib/ace/snippets/protobuf.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = ""; -exports.scope = "protobuf"; - -}); \ No newline at end of file diff --git a/lib/ace/snippets/protobuf.snippets b/lib/ace/snippets/protobuf.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/python.js b/lib/ace/snippets/python.js deleted file mode 100644 index 48ddba28..00000000 --- a/lib/ace/snippets/python.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./python.snippets"); -exports.scope = "python"; - -}); diff --git a/lib/ace/snippets/python.snippets b/lib/ace/snippets/python.snippets deleted file mode 100644 index 347bbdeb..00000000 --- a/lib/ace/snippets/python.snippets +++ /dev/null @@ -1,158 +0,0 @@ -snippet #! - #!/usr/bin/env python -snippet imp - import ${1:module} -snippet from - from ${1:package} import ${2:module} -# Module Docstring -snippet docs - ''' - File: ${1:FILENAME:file_name} - Author: ${2:author} - Description: ${3} - ''' -snippet wh - while ${1:condition}: - ${2:# TODO: write code...} -# dowh - does the same as do...while in other languages -snippet dowh - while True: - ${1:# TODO: write code...} - if ${2:condition}: - break -snippet with - with ${1:expr} as ${2:var}: - ${3:# TODO: write code...} -# New Class -snippet cl - class ${1:ClassName}(${2:object}): - """${3:docstring for $1}""" - def __init__(self, ${4:arg}): - ${5:super($1, self).__init__()} - self.$4 = $4 - ${6} -# New Function -snippet def - def ${1:fname}(${2:`indent('.') ? 'self' : ''`}): - """${3:docstring for $1}""" - ${4:# TODO: write code...} -snippet deff - def ${1:fname}(${2:`indent('.') ? 'self' : ''`}): - ${3:# TODO: write code...} -# New Method -snippet defs - def ${1:mname}(self, ${2:arg}): - ${3:# TODO: write code...} -# New Property -snippet property - def ${1:foo}(): - doc = "${2:The $1 property.}" - def fget(self): - ${3:return self._$1} - def fset(self, value): - ${4:self._$1 = value} -# Ifs -snippet if - if ${1:condition}: - ${2:# TODO: write code...} -snippet el - else: - ${1:# TODO: write code...} -snippet ei - elif ${1:condition}: - ${2:# TODO: write code...} -# For -snippet for - for ${1:item} in ${2:items}: - ${3:# TODO: write code...} -# Encodes -snippet cutf8 - # -*- coding: utf-8 -*- -snippet clatin1 - # -*- coding: latin-1 -*- -snippet cascii - # -*- coding: ascii -*- -# Lambda -snippet ld - ${1:var} = lambda ${2:vars} : ${3:action} -snippet . - self. -snippet try Try/Except - try: - ${1:# TODO: write code...} - except ${2:Exception}, ${3:e}: - ${4:raise $3} -snippet try Try/Except/Else - try: - ${1:# TODO: write code...} - except ${2:Exception}, ${3:e}: - ${4:raise $3} - else: - ${5:# TODO: write code...} -snippet try Try/Except/Finally - try: - ${1:# TODO: write code...} - except ${2:Exception}, ${3:e}: - ${4:raise $3} - finally: - ${5:# TODO: write code...} -snippet try Try/Except/Else/Finally - try: - ${1:# TODO: write code...} - except ${2:Exception}, ${3:e}: - ${4:raise $3} - else: - ${5:# TODO: write code...} - finally: - ${6:# TODO: write code...} -# if __name__ == '__main__': -snippet ifmain - if __name__ == '__main__': - ${1:main()} -# __magic__ -snippet _ - __${1:init}__${2} -# python debugger (pdb) -snippet pdb - import pdb; pdb.set_trace() -# ipython debugger (ipdb) -snippet ipdb - import ipdb; ipdb.set_trace() -# ipython debugger (pdbbb) -snippet pdbbb - import pdbpp; pdbpp.set_trace() -snippet pprint - import pprint; pprint.pprint(${1})${2} -snippet " - """ - ${1:doc} - """ -# test function/method -snippet test - def test_${1:description}(${2:self}): - ${3:# TODO: write code...} -# test case -snippet testcase - class ${1:ExampleCase}(unittest.TestCase): - - def test_${2:description}(self): - ${3:# TODO: write code...} -snippet fut - from __future__ import ${1} -#getopt -snippet getopt - try: - # Short option syntax: "hv:" - # Long option syntax: "help" or "verbose=" - opts, args = getopt.getopt(sys.argv[1:], "${1:short_options}", [${2:long_options}]) - - except getopt.GetoptError, err: - # Print debug info - print str(err) - ${3:error_action} - - for option, argument in opts: - if option in ("-h", "--help"): - ${4} - elif option in ("-v", "--verbose"): - verbose = argument diff --git a/lib/ace/snippets/r.js b/lib/ace/snippets/r.js deleted file mode 100644 index 6b319194..00000000 --- a/lib/ace/snippets/r.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./r.snippets"); -exports.scope = "r"; - -}); diff --git a/lib/ace/snippets/r.snippets b/lib/ace/snippets/r.snippets deleted file mode 100644 index 948542f5..00000000 --- a/lib/ace/snippets/r.snippets +++ /dev/null @@ -1,121 +0,0 @@ -snippet #! - #!/usr/bin/env Rscript - -# includes -snippet lib - library(${1:package}) -snippet req - require(${1:package}) -snippet source - source('${1:file}') - -# conditionals -snippet if - if (${1:condition}) { - ${2:code} - } -snippet el - else { - ${1:code} - } -snippet ei - else if (${1:condition}) { - ${2:code} - } - -# functions -snippet fun - ${1:name} = function (${2:variables}) { - ${3:code} - } -snippet ret - return(${1:code}) - -# dataframes, lists, etc -snippet df - ${1:name}[${2:rows}, ${3:cols}] -snippet c - c(${1:items}) -snippet li - list(${1:items}) -snippet mat - matrix(${1:data}, nrow=${2:rows}, ncol=${3:cols}) - -# apply functions -snippet apply - apply(${1:array}, ${2:margin}, ${3:function}) -snippet lapply - lapply(${1:list}, ${2:function}) -snippet sapply - sapply(${1:list}, ${2:function}) -snippet vapply - vapply(${1:list}, ${2:function}, ${3:type}) -snippet mapply - mapply(${1:function}, ${2:...}) -snippet tapply - tapply(${1:vector}, ${2:index}, ${3:function}) -snippet rapply - rapply(${1:list}, ${2:function}) - -# plyr functions -snippet dd - ddply(${1:frame}, ${2:variables}, ${3:function}) -snippet dl - dlply(${1:frame}, ${2:variables}, ${3:function}) -snippet da - daply(${1:frame}, ${2:variables}, ${3:function}) -snippet d_ - d_ply(${1:frame}, ${2:variables}, ${3:function}) - -snippet ad - adply(${1:array}, ${2:margin}, ${3:function}) -snippet al - alply(${1:array}, ${2:margin}, ${3:function}) -snippet aa - aaply(${1:array}, ${2:margin}, ${3:function}) -snippet a_ - a_ply(${1:array}, ${2:margin}, ${3:function}) - -snippet ld - ldply(${1:list}, ${2:function}) -snippet ll - llply(${1:list}, ${2:function}) -snippet la - laply(${1:list}, ${2:function}) -snippet l_ - l_ply(${1:list}, ${2:function}) - -snippet md - mdply(${1:matrix}, ${2:function}) -snippet ml - mlply(${1:matrix}, ${2:function}) -snippet ma - maply(${1:matrix}, ${2:function}) -snippet m_ - m_ply(${1:matrix}, ${2:function}) - -# plot functions -snippet pl - plot(${1:x}, ${2:y}) -snippet ggp - ggplot(${1:data}, aes(${2:aesthetics})) -snippet img - ${1:(jpeg,bmp,png,tiff)}(filename="${2:filename}", width=${3}, height=${4}, unit="${5}") - ${6:plot} - dev.off() - -# statistical test functions -snippet fis - fisher.test(${1:x}, ${2:y}) -snippet chi - chisq.test(${1:x}, ${2:y}) -snippet tt - t.test(${1:x}, ${2:y}) -snippet wil - wilcox.test(${1:x}, ${2:y}) -snippet cor - cor.test(${1:x}, ${2:y}) -snippet fte - var.test(${1:x}, ${2:y}) -snippet kvt - kv.test(${1:x}, ${2:y}) diff --git a/lib/ace/snippets/rdoc.js b/lib/ace/snippets/rdoc.js deleted file mode 100644 index 0d9e6c95..00000000 --- a/lib/ace/snippets/rdoc.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./rdoc.snippets"); -exports.scope = "rdoc"; - -}); diff --git a/lib/ace/snippets/rdoc.snippets b/lib/ace/snippets/rdoc.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/rhtml.js b/lib/ace/snippets/rhtml.js deleted file mode 100644 index 96707f21..00000000 --- a/lib/ace/snippets/rhtml.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./rhtml.snippets"); -exports.scope = "rhtml"; - -}); diff --git a/lib/ace/snippets/rhtml.snippets b/lib/ace/snippets/rhtml.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/rst.snippets b/lib/ace/snippets/rst.snippets deleted file mode 100644 index 97845de3..00000000 --- a/lib/ace/snippets/rst.snippets +++ /dev/null @@ -1,22 +0,0 @@ -# rst - -snippet : - :${1:field name}: ${2:field body} -snippet * - *${1:Emphasis}* -snippet ** - **${1:Strong emphasis}** -snippet _ - \`${1:hyperlink-name}\`_ - .. _\`$1\`: ${2:link-block} -snippet = - ${1:Title} - =====${2:=} - ${3} -snippet - - ${1:Title} - -----${2:-} - ${3} -snippet cont: - .. contents:: - diff --git a/lib/ace/snippets/ruby.js b/lib/ace/snippets/ruby.js deleted file mode 100644 index f7050449..00000000 --- a/lib/ace/snippets/ruby.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./ruby.snippets"); -exports.scope = "ruby"; - -}); diff --git a/lib/ace/snippets/ruby.snippets b/lib/ace/snippets/ruby.snippets deleted file mode 100644 index 0500aaa1..00000000 --- a/lib/ace/snippets/ruby.snippets +++ /dev/null @@ -1,928 +0,0 @@ -######################################## -# Ruby snippets - for Rails, see below # -######################################## - -# encoding for Ruby 1.9 -snippet enc - # encoding: utf-8 - -# #!/usr/bin/env ruby -snippet #! - #!/usr/bin/env ruby - # encoding: utf-8 - -# New Block -snippet =b - =begin rdoc - ${1} - =end -snippet y - :yields: ${1:arguments} -snippet rb - #!/usr/bin/env ruby -wKU -snippet beg - begin - ${3} - rescue ${1:Exception} => ${2:e} - end - -snippet req require - require "${1}"${2} -snippet # - # => -snippet end - __END__ -snippet case - case ${1:object} - when ${2:condition} - ${3} - end -snippet when - when ${1:condition} - ${2} -snippet def - def ${1:method_name} - ${2} - end -snippet deft - def test_${1:case_name} - ${2} - end -snippet if - if ${1:condition} - ${2} - end -snippet ife - if ${1:condition} - ${2} - else - ${3} - end -snippet elsif - elsif ${1:condition} - ${2} -snippet unless - unless ${1:condition} - ${2} - end -snippet while - while ${1:condition} - ${2} - end -snippet for - for ${1:e} in ${2:c} - ${3} - end -snippet until - until ${1:condition} - ${2} - end -snippet cla class .. end - class ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} - ${2} - end -snippet cla class .. initialize .. end - class ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} - def initialize(${2:args}) - ${3} - end - end -snippet cla class .. < ParentClass .. initialize .. end - class ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} < ${2:ParentClass} - def initialize(${3:args}) - ${4} - end - end -snippet cla ClassName = Struct .. do .. end - ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} = Struct.new(:${2:attr_names}) do - def ${3:method_name} - ${4} - end - end -snippet cla class BlankSlate .. initialize .. end - class ${1:BlankSlate} - instance_methods.each { |meth| undef_method(meth) unless meth =~ /\A__/ } - end -snippet cla class << self .. end - class << ${1:self} - ${2} - end -# class .. < DelegateClass .. initialize .. end -snippet cla- - class ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} < DelegateClass(${2:ParentClass}) - def initialize(${3:args}) - super(${4:del_obj}) - - ${5} - end - end -snippet mod module .. end - module ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} - ${2} - end -snippet mod module .. module_function .. end - module ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} - module_function - - ${2} - end -snippet mod module .. ClassMethods .. end - module ${1:`substitute(Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} - module ClassMethods - ${2} - end - - module InstanceMethods - - end - - def self.included(receiver) - receiver.extend ClassMethods - receiver.send :include, InstanceMethods - end - end -# attr_reader -snippet r - attr_reader :${1:attr_names} -# attr_writer -snippet w - attr_writer :${1:attr_names} -# attr_accessor -snippet rw - attr_accessor :${1:attr_names} -snippet atp - attr_protected :${1:attr_names} -snippet ata - attr_accessible :${1:attr_names} -# include Enumerable -snippet Enum - include Enumerable - - def each(&block) - ${1} - end -# include Comparable -snippet Comp - include Comparable - - def <=>(other) - ${1} - end -# extend Forwardable -snippet Forw- - extend Forwardable -# def self -snippet defs - def self.${1:class_method_name} - ${2} - end -# def method_missing -snippet defmm - def method_missing(meth, *args, &blk) - ${1} - end -snippet defd - def_delegator :${1:@del_obj}, :${2:del_meth}, :${3:new_name} -snippet defds - def_delegators :${1:@del_obj}, :${2:del_methods} -snippet am - alias_method :${1:new_name}, :${2:old_name} -snippet app - if __FILE__ == $PROGRAM_NAME - ${1} - end -# usage_if() -snippet usai - if ARGV.${1} - abort "Usage: #{$PROGRAM_NAME} ${2:ARGS_GO_HERE}"${3} - end -# usage_unless() -snippet usau - unless ARGV.${1} - abort "Usage: #{$PROGRAM_NAME} ${2:ARGS_GO_HERE}"${3} - end -snippet array - Array.new(${1:10}) { |${2:i}| ${3} } -snippet hash - Hash.new { |${1:hash}, ${2:key}| $1[$2] = ${3} } -snippet file File.foreach() { |line| .. } - File.foreach(${1:"path/to/file"}) { |${2:line}| ${3} } -snippet file File.read() - File.read(${1:"path/to/file"})${2} -snippet Dir Dir.global() { |file| .. } - Dir.glob(${1:"dir/glob/*"}) { |${2:file}| ${3} } -snippet Dir Dir[".."] - Dir[${1:"glob/**/*.rb"}]${2} -snippet dir - Filename.dirname(__FILE__) -snippet deli - delete_if { |${1:e}| ${2} } -snippet fil - fill(${1:range}) { |${2:i}| ${3} } -# flatten_once() -snippet flao - inject(Array.new) { |${1:arr}, ${2:a}| $1.push(*$2)}${3} -snippet zip - zip(${1:enums}) { |${2:row}| ${3} } -# downto(0) { |n| .. } -snippet dow - downto(${1:0}) { |${2:n}| ${3} } -snippet ste - step(${1:2}) { |${2:n}| ${3} } -snippet tim - times { |${1:n}| ${2} } -snippet upt - upto(${1:1.0/0.0}) { |${2:n}| ${3} } -snippet loo - loop { ${1} } -snippet ea - each { |${1:e}| ${2} } -snippet ead - each do |${1:e}| - ${2} - end -snippet eab - each_byte { |${1:byte}| ${2} } -snippet eac- each_char { |chr| .. } - each_char { |${1:chr}| ${2} } -snippet eac- each_cons(..) { |group| .. } - each_cons(${1:2}) { |${2:group}| ${3} } -snippet eai - each_index { |${1:i}| ${2} } -snippet eaid - each_index do |${1:i}| - ${2} - end -snippet eak - each_key { |${1:key}| ${2} } -snippet eakd - each_key do |${1:key}| - ${2} - end -snippet eal - each_line { |${1:line}| ${2} } -snippet eald - each_line do |${1:line}| - ${2} - end -snippet eap - each_pair { |${1:name}, ${2:val}| ${3} } -snippet eapd - each_pair do |${1:name}, ${2:val}| - ${3} - end -snippet eas- - each_slice(${1:2}) { |${2:group}| ${3} } -snippet easd- - each_slice(${1:2}) do |${2:group}| - ${3} - end -snippet eav - each_value { |${1:val}| ${2} } -snippet eavd - each_value do |${1:val}| - ${2} - end -snippet eawi - each_with_index { |${1:e}, ${2:i}| ${3} } -snippet eawid - each_with_index do |${1:e},${2:i}| - ${3} - end -snippet reve - reverse_each { |${1:e}| ${2} } -snippet reved - reverse_each do |${1:e}| - ${2} - end -snippet inj - inject(${1:init}) { |${2:mem}, ${3:var}| ${4} } -snippet injd - inject(${1:init}) do |${2:mem}, ${3:var}| - ${4} - end -snippet map - map { |${1:e}| ${2} } -snippet mapd - map do |${1:e}| - ${2} - end -snippet mapwi- - enum_with_index.map { |${1:e}, ${2:i}| ${3} } -snippet sor - sort { |a, b| ${1} } -snippet sorb - sort_by { |${1:e}| ${2} } -snippet ran - sort_by { rand } -snippet all - all? { |${1:e}| ${2} } -snippet any - any? { |${1:e}| ${2} } -snippet cl - classify { |${1:e}| ${2} } -snippet col - collect { |${1:e}| ${2} } -snippet cold - collect do |${1:e}| - ${2} - end -snippet det - detect { |${1:e}| ${2} } -snippet detd - detect do |${1:e}| - ${2} - end -snippet fet - fetch(${1:name}) { |${2:key}| ${3} } -snippet fin - find { |${1:e}| ${2} } -snippet find - find do |${1:e}| - ${2} - end -snippet fina - find_all { |${1:e}| ${2} } -snippet finad - find_all do |${1:e}| - ${2} - end -snippet gre - grep(${1:/pattern/}) { |${2:match}| ${3} } -snippet sub - ${1:g}sub(${2:/pattern/}) { |${3:match}| ${4} } -snippet sca - scan(${1:/pattern/}) { |${2:match}| ${3} } -snippet scad - scan(${1:/pattern/}) do |${2:match}| - ${3} - end -snippet max - max { |a, b| ${1} } -snippet min - min { |a, b| ${1} } -snippet par - partition { |${1:e}| ${2} } -snippet pard - partition do |${1:e}| - ${2} - end -snippet rej - reject { |${1:e}| ${2} } -snippet rejd - reject do |${1:e}| - ${2} - end -snippet sel - select { |${1:e}| ${2} } -snippet seld - select do |${1:e}| - ${2} - end -snippet lam - lambda { |${1:args}| ${2} } -snippet doo - do - ${1} - end -snippet dov - do |${1:variable}| - ${2} - end -snippet : - :${1:key} => ${2:"value"}${3} -snippet ope - open(${1:"path/or/url/or/pipe"}, "${2:w}") { |${3:io}| ${4} } -# path_from_here() -snippet fpath - File.join(File.dirname(__FILE__), *%2[${1:rel path here}])${2} -# unix_filter {} -snippet unif - ARGF.each_line${1} do |${2:line}| - ${3} - end -# option_parse {} -snippet optp - require "optparse" - - options = {${1:default => "args"}} - - ARGV.options do |opts| - opts.banner = "Usage: #{File.basename($PROGRAM_NAME)} -snippet opt - opts.on( "-${1:o}", "--${2:long-option-name}", ${3:String}, - "${4:Option description.}") do |${5:opt}| - ${6} - end -snippet tc - require "test/unit" - - require "${1:library_file_name}" - - class Test${2:$1} < Test::Unit::TestCase - def test_${3:case_name} - ${4} - end - end -snippet ts - require "test/unit" - - require "tc_${1:test_case_file}" - require "tc_${2:test_case_file}"${3} -snippet as - assert ${1:test}, "${2:Failure message.}"${3} -snippet ase - assert_equal ${1:expected}, ${2:actual}${3} -snippet asne - assert_not_equal ${1:unexpected}, ${2:actual}${3} -snippet asid - assert_in_delta ${1:expected_float}, ${2:actual_float}, ${3:2 ** -20}${4} -snippet asio - assert_instance_of ${1:ExpectedClass}, ${2:actual_instance}${3} -snippet asko - assert_kind_of ${1:ExpectedKind}, ${2:actual_instance}${3} -snippet asn - assert_nil ${1:instance}${2} -snippet asnn - assert_not_nil ${1:instance}${2} -snippet asm - assert_match /${1:expected_pattern}/, ${2:actual_string}${3} -snippet asnm - assert_no_match /${1:unexpected_pattern}/, ${2:actual_string}${3} -snippet aso - assert_operator ${1:left}, :${2:operator}, ${3:right}${4} -snippet asr - assert_raise ${1:Exception} { ${2} } -snippet asrd - assert_raise ${1:Exception} do - ${2} - end -snippet asnr - assert_nothing_raised ${1:Exception} { ${2} } -snippet asnrd - assert_nothing_raised ${1:Exception} do - ${2} - end -snippet asrt - assert_respond_to ${1:object}, :${2:method}${3} -snippet ass assert_same(..) - assert_same ${1:expected}, ${2:actual}${3} -snippet ass assert_send(..) - assert_send [${1:object}, :${2:message}, ${3:args}]${4} -snippet asns - assert_not_same ${1:unexpected}, ${2:actual}${3} -snippet ast - assert_throws :${1:expected} { ${2} } -snippet astd - assert_throws :${1:expected} do - ${2} - end -snippet asnt - assert_nothing_thrown { ${1} } -snippet asntd - assert_nothing_thrown do - ${1} - end -snippet fl - flunk "${1:Failure message.}"${2} -# Benchmark.bmbm do .. end -snippet bm- - TESTS = ${1:10_000} - Benchmark.bmbm do |results| - ${2} - end -snippet rep - results.report("${1:name}:") { TESTS.times { ${2} }} -# Marshal.dump(.., file) -snippet Md - File.open(${1:"path/to/file.dump"}, "wb") { |${2:file}| Marshal.dump(${3:obj}, $2) }${4} -# Mashal.load(obj) -snippet Ml - File.open(${1:"path/to/file.dump"}, "rb") { |${2:file}| Marshal.load($2) }${3} -# deep_copy(..) -snippet deec - Marshal.load(Marshal.dump(${1:obj_to_copy}))${2} -snippet Pn- - PStore.new(${1:"file_name.pstore"})${2} -snippet tra - transaction(${1:true}) { ${2} } -# xmlread(..) -snippet xml- - REXML::Document.new(File.read(${1:"path/to/file"}))${2} -# xpath(..) { .. } -snippet xpa - elements.each(${1:"//Xpath"}) do |${2:node}| - ${3} - end -# class_from_name() -snippet clafn - split("::").inject(Object) { |par, const| par.const_get(const) } -# singleton_class() -snippet sinc - class << self; self end -snippet nam - namespace :${1:`Filename()`} do - ${2} - end -snippet tas - desc "${1:Task description}" - task :${2:task_name => [:dependent, :tasks]} do - ${3} - end -# block -snippet b - { |${1:var}| ${2} } -snippet begin - begin - raise 'A test exception.' - rescue Exception => e - puts e.message - puts e.backtrace.inspect - else - # other exception - ensure - # always executed - end - -#debugging -snippet debug - require 'ruby-debug'; debugger; true; -snippet pry - require 'pry'; binding.pry - -############################################# -# Rails snippets - for pure Ruby, see above # -############################################# -snippet art - assert_redirected_to ${1::action => "${2:index}"} -snippet artnp - assert_redirected_to ${1:parent}_${2:child}_path(${3:@$1}, ${4:@$2}) -snippet artnpp - assert_redirected_to ${1:parent}_${2:child}_path(${3:@$1}) -snippet artp - assert_redirected_to ${1:model}_path(${2:@$1}) -snippet artpp - assert_redirected_to ${1:model}s_path -snippet asd - assert_difference "${1:Model}.${2:count}", $1 do - ${3} - end -snippet asnd - assert_no_difference "${1:Model}.${2:count}" do - ${3} - end -snippet asre - assert_response :${1:success}, @response.body${2} -snippet asrj - assert_rjs :${1:replace}, "${2:dom id}" -snippet ass assert_select(..) - assert_select '${1:path}', :${2:text} => '${3:inner_html' ${4:do} -snippet bf - before_filter :${1:method} -snippet bt - belongs_to :${1:association} -snippet crw - cattr_accessor :${1:attr_names} -snippet defcreate - def create - @${1:model_class_name} = ${2:ModelClassName}.new(params[:$1]) - - respond_to do |wants| - if @$1.save - flash[:notice] = '$2 was successfully created.' - wants.html { redirect_to(@$1) } - wants.xml { render :xml => @$1, :status => :created, :location => @$1 } - else - wants.html { render :action => "new" } - wants.xml { render :xml => @$1.errors, :status => :unprocessable_entity } - end - end - end${3} -snippet defdestroy - def destroy - @${1:model_class_name} = ${2:ModelClassName}.find(params[:id]) - @$1.destroy - - respond_to do |wants| - wants.html { redirect_to($1s_url) } - wants.xml { head :ok } - end - end${3} -snippet defedit - def edit - @${1:model_class_name} = ${2:ModelClassName}.find(params[:id]) - end -snippet defindex - def index - @${1:model_class_name} = ${2:ModelClassName}.all - - respond_to do |wants| - wants.html # index.html.erb - wants.xml { render :xml => @$1s } - end - end${3} -snippet defnew - def new - @${1:model_class_name} = ${2:ModelClassName}.new - - respond_to do |wants| - wants.html # new.html.erb - wants.xml { render :xml => @$1 } - end - end${3} -snippet defshow - def show - @${1:model_class_name} = ${2:ModelClassName}.find(params[:id]) - - respond_to do |wants| - wants.html # show.html.erb - wants.xml { render :xml => @$1 } - end - end${3} -snippet defupdate - def update - @${1:model_class_name} = ${2:ModelClassName}.find(params[:id]) - - respond_to do |wants| - if @$1.update_attributes(params[:$1]) - flash[:notice] = '$2 was successfully updated.' - wants.html { redirect_to(@$1) } - wants.xml { head :ok } - else - wants.html { render :action => "edit" } - wants.xml { render :xml => @$1.errors, :status => :unprocessable_entity } - end - end - end${3} -snippet flash - flash[:${1:notice}] = "${2}" -snippet habtm - has_and_belongs_to_many :${1:object}, :join_table => "${2:table_name}", :foreign_key => "${3}_id"${4} -snippet hm - has_many :${1:object} -snippet hmd - has_many :${1:other}s, :class_name => "${2:$1}", :foreign_key => "${3:$1}_id", :dependent => :destroy${4} -snippet hmt - has_many :${1:object}, :through => :${2:object} -snippet ho - has_one :${1:object} -snippet i18 - I18n.t('${1:type.key}')${2} -snippet ist - <%= image_submit_tag("${1:agree.png}", :id => "${2:id}"${3} %> -snippet log - Rails.logger.${1:debug} ${2} -snippet log2 - RAILS_DEFAULT_LOGGER.${1:debug} ${2} -snippet logd - logger.debug { "${1:message}" }${2} -snippet loge - logger.error { "${1:message}" }${2} -snippet logf - logger.fatal { "${1:message}" }${2} -snippet logi - logger.info { "${1:message}" }${2} -snippet logw - logger.warn { "${1:message}" }${2} -snippet mapc - ${1:map}.${2:connect} '${3:controller/:action/:id}' -snippet mapca - ${1:map}.catch_all "*${2:anything}", :controller => "${3:default}", :action => "${4:error}"${5} -snippet mapr - ${1:map}.resource :${2:resource} -snippet maprs - ${1:map}.resources :${2:resource} -snippet mapwo - ${1:map}.with_options :${2:controller} => '${3:thing}' do |$3| - ${4} - end -snippet mbs - before_save :${1:method} -snippet mcht - change_table :${1:table_name} do |t| - ${2} - end -snippet mp - map(&:${1:id}) -snippet mrw - mattr_accessor :${1:attr_names} -snippet oa - order("${1:field}") -snippet od - order("${1:field} DESC") -snippet pa - params[:${1:id}]${2} -snippet ra - render :action => "${1:action}" -snippet ral - render :action => "${1:action}", :layout => "${2:layoutname}" -snippet rest - respond_to do |wants| - wants.${1:html} { ${2} } - end -snippet rf - render :file => "${1:filepath}" -snippet rfu - render :file => "${1:filepath}", :use_full_path => ${2:false} -snippet ri - render :inline => "${1:<%= 'hello' %>}" -snippet ril - render :inline => "${1:<%= 'hello' %>}", :locals => { ${2::name} => "${3:value}"${4} } -snippet rit - render :inline => "${1:<%= 'hello' %>}", :type => ${2::rxml} -snippet rjson - render :json => ${1:text to render} -snippet rl - render :layout => "${1:layoutname}" -snippet rn - render :nothing => ${1:true} -snippet rns - render :nothing => ${1:true}, :status => ${2:401} -snippet rp - render :partial => "${1:item}" -snippet rpc - render :partial => "${1:item}", :collection => ${2:@$1s} -snippet rpl - render :partial => "${1:item}", :locals => { :${2:$1} => ${3:@$1} -snippet rpo - render :partial => "${1:item}", :object => ${2:@$1} -snippet rps - render :partial => "${1:item}", :status => ${2:500} -snippet rt - render :text => "${1:text to render}" -snippet rtl - render :text => "${1:text to render}", :layout => "${2:layoutname}" -snippet rtlt - render :text => "${1:text to render}", :layout => ${2:true} -snippet rts - render :text => "${1:text to render}", :status => ${2:401} -snippet ru - render :update do |${1:page}| - $1.${2} - end -snippet rxml - render :xml => ${1:text to render} -snippet sc - scope :${1:name}, :where(:@${2:field} => ${3:value}) -snippet sl - scope :${1:name}, lambda do |${2:value}| - where("${3:field = ?}", ${4:bind var}) - end -snippet sha1 - Digest::SHA1.hexdigest(${1:string}) -snippet sweeper - class ${1:ModelClassName}Sweeper < ActionController::Caching::Sweeper - observe $1 - - def after_save(${2:model_class_name}) - expire_cache($2) - end - - def after_destroy($2) - expire_cache($2) - end - - def expire_cache($2) - expire_page - end - end -snippet tcb - t.boolean :${1:title} - ${2} -snippet tcbi - t.binary :${1:title}, :limit => ${2:2}.megabytes - ${3} -snippet tcd - t.decimal :${1:title}, :precision => ${2:10}, :scale => ${3:2} - ${4} -snippet tcda - t.date :${1:title} - ${2} -snippet tcdt - t.datetime :${1:title} - ${2} -snippet tcf - t.float :${1:title} - ${2} -snippet tch - t.change :${1:name}, :${2:string}, :${3:limit} => ${4:80} - ${5} -snippet tci - t.integer :${1:title} - ${2} -snippet tcl - t.integer :lock_version, :null => false, :default => 0 - ${1} -snippet tcr - t.references :${1:taggable}, :polymorphic => { :default => '${2:Photo}' } - ${3} -snippet tcs - t.string :${1:title} - ${2} -snippet tct - t.text :${1:title} - ${2} -snippet tcti - t.time :${1:title} - ${2} -snippet tcts - t.timestamp :${1:title} - ${2} -snippet tctss - t.timestamps - ${1} -snippet va - validates_associated :${1:attribute} -snippet vao - validates_acceptance_of :${1:terms} -snippet vc - validates_confirmation_of :${1:attribute} -snippet ve - validates_exclusion_of :${1:attribute}, :in => ${2:%w( mov avi )} -snippet vf - validates_format_of :${1:attribute}, :with => /${2:regex}/ -snippet vi - validates_inclusion_of :${1:attribute}, :in => %w(${2: mov avi }) -snippet vl - validates_length_of :${1:attribute}, :within => ${2:3}..${3:20} -snippet vn - validates_numericality_of :${1:attribute} -snippet vpo - validates_presence_of :${1:attribute} -snippet vu - validates_uniqueness_of :${1:attribute} -snippet wants - wants.${1:js|xml|html} { ${2} } -snippet wc - where(${1:"conditions"}${2:, bind_var}) -snippet wh - where(${1:field} => ${2:value}) -snippet xdelete - xhr :delete, :${1:destroy}, :id => ${2:1}${3} -snippet xget - xhr :get, :${1:show}, :id => ${2:1}${3} -snippet xpost - xhr :post, :${1:create}, :${2:object} => { ${3} } -snippet xput - xhr :put, :${1:update}, :id => ${2:1}, :${3:object} => { ${4} }${5} -snippet test - test "should ${1:do something}" do - ${2} - end -#migrations -snippet mac - add_column :${1:table_name}, :${2:column_name}, :${3:data_type} -snippet mrc - remove_column :${1:table_name}, :${2:column_name} -snippet mrnc - rename_column :${1:table_name}, :${2:old_column_name}, :${3:new_column_name} -snippet mcc - change_column :${1:table}, :${2:column}, :${3:type} -snippet mccc - t.column :${1:title}, :${2:string} -snippet mct - create_table :${1:table_name} do |t| - t.column :${2:name}, :${3:type} - end -snippet migration - class ${1:class_name} < ActiveRecord::Migration - def self.up - ${2} - end - - def self.down - end - end - -snippet trc - t.remove :${1:column} -snippet tre - t.rename :${1:old_column_name}, :${2:new_column_name} - ${3} -snippet tref - t.references :${1:model} - -#rspec -snippet it - it "${1:spec_name}" do - ${2} - end -snippet itp - it "${1:spec_name}" - ${2} -snippet desc - describe ${1:class_name} do - ${2} - end -snippet cont - context "${1:message}" do - ${2} - end -snippet bef - before :${1:each} do - ${2} - end -snippet aft - after :${1:each} do - ${2} - end diff --git a/lib/ace/snippets/rust.js b/lib/ace/snippets/rust.js deleted file mode 100644 index 556d9a6b..00000000 --- a/lib/ace/snippets/rust.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./rust.snippets"); -exports.scope = "rust"; - -}); diff --git a/lib/ace/snippets/rust.snippets b/lib/ace/snippets/rust.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/sass.js b/lib/ace/snippets/sass.js deleted file mode 100644 index ba728ac2..00000000 --- a/lib/ace/snippets/sass.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./sass.snippets"); -exports.scope = "sass"; - -}); diff --git a/lib/ace/snippets/sass.snippets b/lib/ace/snippets/sass.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/scad.js b/lib/ace/snippets/scad.js deleted file mode 100644 index 28db2155..00000000 --- a/lib/ace/snippets/scad.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./scad.snippets"); -exports.scope = "scad"; - -}); diff --git a/lib/ace/snippets/scad.snippets b/lib/ace/snippets/scad.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/scala.js b/lib/ace/snippets/scala.js deleted file mode 100644 index 2e5a8c57..00000000 --- a/lib/ace/snippets/scala.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./scala.snippets"); -exports.scope = "scala"; - -}); diff --git a/lib/ace/snippets/scala.snippets b/lib/ace/snippets/scala.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/scheme.js b/lib/ace/snippets/scheme.js deleted file mode 100644 index 7d3c6f65..00000000 --- a/lib/ace/snippets/scheme.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./scheme.snippets"); -exports.scope = "scheme"; - -}); diff --git a/lib/ace/snippets/scheme.snippets b/lib/ace/snippets/scheme.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/scss.js b/lib/ace/snippets/scss.js deleted file mode 100644 index a940eabd..00000000 --- a/lib/ace/snippets/scss.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./scss.snippets"); -exports.scope = "scss"; - -}); diff --git a/lib/ace/snippets/scss.snippets b/lib/ace/snippets/scss.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/sh.js b/lib/ace/snippets/sh.js deleted file mode 100644 index c48dc17f..00000000 --- a/lib/ace/snippets/sh.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./sh.snippets"); -exports.scope = "sh"; - -}); diff --git a/lib/ace/snippets/sh.snippets b/lib/ace/snippets/sh.snippets deleted file mode 100644 index 9a48eb51..00000000 --- a/lib/ace/snippets/sh.snippets +++ /dev/null @@ -1,83 +0,0 @@ -# Shebang. Executing bash via /usr/bin/env makes scripts more portable. -snippet #! - #!/usr/bin/env bash - -snippet if - if [[ ${1:condition} ]]; then - ${2:#statements} - fi -snippet elif - elif [[ ${1:condition} ]]; then - ${2:#statements} -snippet for - for (( ${2:i} = 0; $2 < ${1:count}; $2++ )); do - ${3:#statements} - done -snippet fori - for ${1:needle} in ${2:haystack} ; do - ${3:#statements} - done -snippet wh - while [[ ${1:condition} ]]; do - ${2:#statements} - done -snippet until - until [[ ${1:condition} ]]; do - ${2:#statements} - done -snippet case - case ${1:word} in - ${2:pattern}) - ${3};; - esac -snippet go - while getopts '${1:o}' ${2:opts} - do - case $$2 in - ${3:o0}) - ${4:#staments};; - esac - done -# Set SCRIPT_DIR variable to directory script is located. -snippet sdir - SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -# getopt -snippet getopt - __ScriptVersion="${1:version}" - - #=== FUNCTION ================================================================ - # NAME: usage - # DESCRIPTION: Display usage information. - #=============================================================================== - function usage () - { - cat <<- EOT - - Usage : $${0:0} [options] [--] - - Options: - -h|help Display this message - -v|version Display script version - - EOT - } # ---------- end of function usage ---------- - - #----------------------------------------------------------------------- - # Handle command line arguments - #----------------------------------------------------------------------- - - while getopts ":hv" opt - do - case $opt in - - h|help ) usage; exit 0 ;; - - v|version ) echo "$${0:0} -- Version $__ScriptVersion"; exit 0 ;; - - \? ) echo -e "\n Option does not exist : $OPTARG\n" - usage; exit 1 ;; - - esac # --- end of case --- - done - shift $(($OPTIND-1)) - diff --git a/lib/ace/snippets/sjs.js b/lib/ace/snippets/sjs.js deleted file mode 100644 index a88cfc90..00000000 --- a/lib/ace/snippets/sjs.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./sjs.snippets"); -exports.scope = "sjs"; - -}); diff --git a/lib/ace/snippets/sjs.snippets b/lib/ace/snippets/sjs.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/smarty.js b/lib/ace/snippets/smarty.js deleted file mode 100644 index 121d0b7c..00000000 --- a/lib/ace/snippets/smarty.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./smarty.snippets"); -exports.scope = "smarty"; - -}); diff --git a/lib/ace/snippets/smarty.snippets b/lib/ace/snippets/smarty.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/snippets.js b/lib/ace/snippets/snippets.js deleted file mode 100644 index 0927805b..00000000 --- a/lib/ace/snippets/snippets.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./snippets.snippets"); -exports.scope = "snippets"; - -}); diff --git a/lib/ace/snippets/snippets.snippets b/lib/ace/snippets/snippets.snippets deleted file mode 100644 index 4223fa39..00000000 --- a/lib/ace/snippets/snippets.snippets +++ /dev/null @@ -1,9 +0,0 @@ -# snippets for making snippets :) -snippet snip - snippet ${1:trigger} - ${2} -snippet msnip - snippet ${1:trigger} ${2:description} - ${3} -snippet v - {VISUAL} diff --git a/lib/ace/snippets/soy_template.js b/lib/ace/snippets/soy_template.js deleted file mode 100644 index 194da757..00000000 --- a/lib/ace/snippets/soy_template.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./soy_template.snippets"); -exports.scope = "soy_template"; - -}); diff --git a/lib/ace/snippets/soy_template.snippets b/lib/ace/snippets/soy_template.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/space.js b/lib/ace/snippets/space.js deleted file mode 100644 index 766d493e..00000000 --- a/lib/ace/snippets/space.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./space.snippets"); -exports.scope = "space"; - -}); diff --git a/lib/ace/snippets/space.snippets b/lib/ace/snippets/space.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/sql.js b/lib/ace/snippets/sql.js deleted file mode 100644 index c96f6cb2..00000000 --- a/lib/ace/snippets/sql.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./sql.snippets"); -exports.scope = "sql"; - -}); diff --git a/lib/ace/snippets/sql.snippets b/lib/ace/snippets/sql.snippets deleted file mode 100644 index eb4b37ca..00000000 --- a/lib/ace/snippets/sql.snippets +++ /dev/null @@ -1,26 +0,0 @@ -snippet tbl - create table ${1:table} ( - ${2:columns} - ); -snippet col - ${1:name} ${2:type} ${3:default ''} ${4:not null} -snippet ccol - ${1:name} varchar2(${2:size}) ${3:default ''} ${4:not null} -snippet ncol - ${1:name} number ${3:default 0} ${4:not null} -snippet dcol - ${1:name} date ${3:default sysdate} ${4:not null} -snippet ind - create index ${3:$1_$2} on ${1:table}(${2:column}); -snippet uind - create unique index ${1:name} on ${2:table}(${3:column}); -snippet tblcom - comment on table ${1:table} is '${2:comment}'; -snippet colcom - comment on column ${1:table}.${2:column} is '${3:comment}'; -snippet addcol - alter table ${1:table} add (${2:column} ${3:type}); -snippet seq - create sequence ${1:name} start with ${2:1} increment by ${3:1} minvalue ${4:1}; -snippet s* - select * from ${1:table} diff --git a/lib/ace/snippets/sqlserver.js b/lib/ace/snippets/sqlserver.js deleted file mode 100644 index f84694dc..00000000 --- a/lib/ace/snippets/sqlserver.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./sqlserver.snippets"); -exports.scope = "sqlserver"; - -}); diff --git a/lib/ace/snippets/sqlserver.snippets b/lib/ace/snippets/sqlserver.snippets deleted file mode 100644 index 403bd6bc..00000000 --- a/lib/ace/snippets/sqlserver.snippets +++ /dev/null @@ -1,70 +0,0 @@ -# ISNULL -snippet isnull - ISNULL(${1:check_expression}, ${2:replacement_value}) -# FORMAT -snippet format - FORMAT(${1:value}, ${2:format}) -# CAST -snippet cast - CAST(${1:expression} AS ${2:data_type}) -# CONVERT -snippet convert - CONVERT(${1:data_type}, ${2:expression}) -# DATEPART -snippet datepart - DATEPART(${1:datepart}, ${2:date}) -# DATEDIFF -snippet datediff - DATEDIFF(${1:datepart}, ${2:startdate}, ${3:enddate}) -# DATEADD -snippet dateadd - DATEADD(${1:datepart}, ${2:number}, ${3:date}) -# DATEFROMPARTS -snippet datefromparts - DATEFROMPARTS(${1:year}, ${2:month}, ${3:day}) -# OBJECT_DEFINITION -snippet objectdef - SELECT OBJECT_DEFINITION(OBJECT_ID('${1:sys.server_permissions /*object name*/}')) -# STUFF XML -snippet stuffxml - STUFF((SELECT ', ' + ${1:ColumnName} - FROM ${2:TableName} - WHERE ${3:WhereClause} - FOR XML PATH('')), 1, 1, '') AS ${4:Alias} - ${5:/*https://msdn.microsoft.com/en-us/library/ms188043.aspx*/} -# Create Procedure -snippet createproc - -- ============================================= - -- Author: ${1:Author} - -- Create date: ${2:Date} - -- Description: ${3:Description} - -- ============================================= - CREATE PROCEDURE ${4:Procedure_Name} - ${5:/*Add the parameters for the stored procedure here*/} - AS - BEGIN - -- SET NOCOUNT ON added to prevent extra result sets from interfering with SELECT statements. - SET NOCOUNT ON; - - ${6:/*Add the T-SQL statements to compute the return value here*/} - - END - GO -# Create Scalar Function -snippet createfn - -- ============================================= - -- Author: ${1:Author} - -- Create date: ${2:Date} - -- Description: ${3:Description} - -- ============================================= - CREATE FUNCTION ${4:Scalar_Function_Name} - -- Add the parameters for the function here - RETURNS ${5:Function_Data_Type} - AS - BEGIN - DECLARE @Result ${5:Function_Data_Type} - - ${6:/*Add the T-SQL statements to compute the return value here*/} - - END - GO \ No newline at end of file diff --git a/lib/ace/snippets/stylus.js b/lib/ace/snippets/stylus.js deleted file mode 100644 index 86a79f7a..00000000 --- a/lib/ace/snippets/stylus.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./stylus.snippets"); -exports.scope = "stylus"; - -}); diff --git a/lib/ace/snippets/stylus.snippets b/lib/ace/snippets/stylus.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/svg.js b/lib/ace/snippets/svg.js deleted file mode 100644 index aeb62456..00000000 --- a/lib/ace/snippets/svg.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./svg.snippets"); -exports.scope = "svg"; - -}); diff --git a/lib/ace/snippets/svg.snippets b/lib/ace/snippets/svg.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/tcl.js b/lib/ace/snippets/tcl.js deleted file mode 100644 index 53482fc7..00000000 --- a/lib/ace/snippets/tcl.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./tcl.snippets"); -exports.scope = "tcl"; - -}); diff --git a/lib/ace/snippets/tcl.snippets b/lib/ace/snippets/tcl.snippets deleted file mode 100644 index 1fe1cb96..00000000 --- a/lib/ace/snippets/tcl.snippets +++ /dev/null @@ -1,92 +0,0 @@ -# #!/usr/bin/env tclsh -snippet #! - #!/usr/bin/env tclsh - -# Process -snippet pro - proc ${1:function_name} {${2:args}} { - ${3:#body ...} - } -#xif -snippet xif - ${1:expr}? ${2:true} : ${3:false} -# Conditional -snippet if - if {${1}} { - ${2:# body...} - } -# Conditional if..else -snippet ife - if {${1}} { - ${2:# body...} - } else { - ${3:# else...} - } -# Conditional if..elsif..else -snippet ifee - if {${1}} { - ${2:# body...} - } elseif {${3}} { - ${4:# elsif...} - } else { - ${5:# else...} - } -# If catch then -snippet ifc - if { [catch {${1:#do something...}} ${2:err}] } { - ${3:# handle failure...} - } -# Catch -snippet catch - catch {${1}} ${2:err} ${3:options} -# While Loop -snippet wh - while {${1}} { - ${2:# body...} - } -# For Loop -snippet for - for {set ${2:var} 0} {$$2 < ${1:count}} {${3:incr} $2} { - ${4:# body...} - } -# Foreach Loop -snippet fore - foreach ${1:x} {${2:#list}} { - ${3:# body...} - } -# after ms script... -snippet af - after ${1:ms} ${2:#do something} -# after cancel id -snippet afc - after cancel ${1:id or script} -# after idle -snippet afi - after idle ${1:script} -# after info id -snippet afin - after info ${1:id} -# Expr -snippet exp - expr {${1:#expression here}} -# Switch -snippet sw - switch ${1:var} { - ${3:pattern 1} { - ${4:#do something} - } - default { - ${2:#do something} - } - } -# Case -snippet ca - ${1:pattern} { - ${2:#do something} - }${3} -# Namespace eval -snippet ns - namespace eval ${1:path} {${2:#script...}} -# Namespace current -snippet nsc - namespace current diff --git a/lib/ace/snippets/tex.js b/lib/ace/snippets/tex.js deleted file mode 100644 index 267b6b69..00000000 --- a/lib/ace/snippets/tex.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./tex.snippets"); -exports.scope = "tex"; - -}); diff --git a/lib/ace/snippets/tex.snippets b/lib/ace/snippets/tex.snippets deleted file mode 100644 index 10fa82ef..00000000 --- a/lib/ace/snippets/tex.snippets +++ /dev/null @@ -1,191 +0,0 @@ -#PREAMBLE -#newcommand -snippet nc - \newcommand{\${1:cmd}}[${2:opt}]{${3:realcmd}}${4} -#usepackage -snippet up - \usepackage[${1:[options}]{${2:package}} -#newunicodechar -snippet nuc - \newunicodechar{${1}}{${2:\ensuremath}${3:tex-substitute}}} -#DeclareMathOperator -snippet dmo - \DeclareMathOperator{${1}}{${2}} - -#DOCUMENT -# \begin{}...\end{} -snippet begin - \begin{${1:env}} - ${2} - \end{$1} -# Tabular -snippet tab - \begin{${1:tabular}}{${2:c}} - ${3} - \end{$1} -snippet thm - \begin[${1:author}]{${2:thm}} - ${3} - \end{$1} -snippet center - \begin{center} - ${1} - \end{center} -# Align(ed) -snippet ali - \begin{align${1:ed}} - ${2} - \end{align$1} -# Gather(ed) -snippet gat - \begin{gather${1:ed}} - ${2} - \end{gather$1} -# Equation -snippet eq - \begin{equation} - ${1} - \end{equation} -# Equation -snippet eq* - \begin{equation*} - ${1} - \end{equation*} -# Unnumbered Equation -snippet \ - \[ - ${1} - \] -# Enumerate -snippet enum - \begin{enumerate} - \item ${1} - \end{enumerate} -# Itemize -snippet itemize - \begin{itemize} - \item ${1} - \end{itemize} -# Description -snippet desc - \begin{description} - \item[${1}] ${2} - \end{description} -# Matrix -snippet mat - \begin{${1:p/b/v/V/B/small}matrix} - ${2} - \end{$1matrix} -# Cases -snippet cas - \begin{cases} - ${1:equation}, &\text{ if }${2:case}\\ - ${3} - \end{cases} -# Split -snippet spl - \begin{split} - ${1} - \end{split} -# Part -snippet part - \part{${1:part name}} % (fold) - \label{prt:${2:$1}} - ${3} - % part $2 (end) -# Chapter -snippet cha - \chapter{${1:chapter name}} - \label{cha:${2:$1}} - ${3} -# Section -snippet sec - \section{${1:section name}} - \label{sec:${2:$1}} - ${3} -# Sub Section -snippet sub - \subsection{${1:subsection name}} - \label{sub:${2:$1}} - ${3} -# Sub Sub Section -snippet subs - \subsubsection{${1:subsubsection name}} - \label{ssub:${2:$1}} - ${3} -# Paragraph -snippet par - \paragraph{${1:paragraph name}} - \label{par:${2:$1}} - ${3} -# Sub Paragraph -snippet subp - \subparagraph{${1:subparagraph name}} - \label{subp:${2:$1}} - ${3} -#References -snippet itd - \item[${1:description}] ${2:item} -snippet figure - ${1:Figure}~\ref{${2:fig:}}${3} -snippet table - ${1:Table}~\ref{${2:tab:}}${3} -snippet listing - ${1:Listing}~\ref{${2:list}}${3} -snippet section - ${1:Section}~\ref{${2:sec:}}${3} -snippet page - ${1:page}~\pageref{${2}}${3} -snippet index - \index{${1:index}}${2} -#Citations -snippet cite - \cite[${1}]{${2}}${3} -snippet fcite - \footcite[${1}]{${2}}${3} -#Formating text: italic, bold, underline, small capital, emphase .. -snippet it - \textit{${1:text}} -snippet bf - \textbf{${1:text}} -snippet under - \underline{${1:text}} -snippet emp - \emph{${1:text}} -snippet sc - \textsc{${1:text}} -#Choosing font -snippet sf - \textsf{${1:text}} -snippet rm - \textrm{${1:text}} -snippet tt - \texttt{${1:text}} -#misc -snippet ft - \footnote{${1:text}} -snippet fig - \begin{figure} - \begin{center} - \includegraphics[scale=${1}]{Figures/${2}} - \end{center} - \caption{${3}} - \label{fig:${4}} - \end{figure} -snippet tikz - \begin{figure} - \begin{center} - \begin{tikzpicture}[scale=${1:1}] - ${2} - \end{tikzpicture} - \end{center} - \caption{${3}} - \label{fig:${4}} - \end{figure} -#math -snippet stackrel - \stackrel{${1:above}}{${2:below}} ${3} -snippet frac - \frac{${1:num}}{${2:denom}} -snippet sum - \sum^{${1:n}}_{${2:i=1}}{${3}} \ No newline at end of file diff --git a/lib/ace/snippets/text.js b/lib/ace/snippets/text.js deleted file mode 100644 index 434d75be..00000000 --- a/lib/ace/snippets/text.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./text.snippets"); -exports.scope = "text"; - -}); diff --git a/lib/ace/snippets/text.snippets b/lib/ace/snippets/text.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/textile.js b/lib/ace/snippets/textile.js deleted file mode 100644 index f2622e05..00000000 --- a/lib/ace/snippets/textile.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./textile.snippets"); -exports.scope = "textile"; - -}); diff --git a/lib/ace/snippets/textile.snippets b/lib/ace/snippets/textile.snippets deleted file mode 100644 index c78d6ec8..00000000 --- a/lib/ace/snippets/textile.snippets +++ /dev/null @@ -1,30 +0,0 @@ -# Jekyll post header -snippet header - --- - title: ${1:title} - layout: post - date: ${2:date} ${3:hour:minute:second} -05:00 - --- - -# Image -snippet img - !${1:url}(${2:title}):${3:link}! - -# Table -snippet | - |${1}|${2} - -# Link -snippet link - "${1:link text}":${2:url} - -# Acronym -snippet ( - (${1:Expand acronym})${2} - -# Footnote -snippet fn - [${1:ref number}] ${3} - - fn$1. ${2:footnote} - diff --git a/lib/ace/snippets/tmsnippet.snippets b/lib/ace/snippets/tmsnippet.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/toml.js b/lib/ace/snippets/toml.js deleted file mode 100644 index 419b06d8..00000000 --- a/lib/ace/snippets/toml.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./toml.snippets"); -exports.scope = "toml"; - -}); diff --git a/lib/ace/snippets/toml.snippets b/lib/ace/snippets/toml.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/twig.js b/lib/ace/snippets/twig.js deleted file mode 100644 index b08b884c..00000000 --- a/lib/ace/snippets/twig.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./twig.snippets"); -exports.scope = "twig"; - -}); diff --git a/lib/ace/snippets/twig.snippets b/lib/ace/snippets/twig.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/typescript.js b/lib/ace/snippets/typescript.js deleted file mode 100644 index 495da3f3..00000000 --- a/lib/ace/snippets/typescript.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./typescript.snippets"); -exports.scope = "typescript"; - -}); diff --git a/lib/ace/snippets/typescript.snippets b/lib/ace/snippets/typescript.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/vala.js b/lib/ace/snippets/vala.js deleted file mode 100644 index 6092d3c1..00000000 --- a/lib/ace/snippets/vala.js +++ /dev/null @@ -1,195 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -// exports.snippetText = require("../requirejs/text!./.snippets"); -exports.snippets = [ - { - "content": "case ${1:condition}:\n\t$0\n\tbreak;\n", - "name": "case", - "scope": "vala", - "tabTrigger": "case" - }, - { - "content": "/**\n * ${6}\n */\n${1:public} class ${2:MethodName}${3: : GLib.Object} {\n\n\t/**\n\t * ${7}\n\t */\n\tpublic ${2}(${4}) {\n\t\t${5}\n\t}\n\n\t$0\n}", - "name": "class", - "scope": "vala", - "tabTrigger": "class" - }, - { - "content": "(${1}) => {\n\t${0}\n}\n", - "name": "closure", - "scope": "vala", - "tabTrigger": "=>" - }, - { - "content": "/*\n * $0\n */", - "name": "Comment (multiline)", - "scope": "vala", - "tabTrigger": "/*" - }, - { - "content": "Console.WriteLine($1);\n$0", - "name": "Console.WriteLine (writeline)", - "scope": "vala", - "tabTrigger": "writeline" - }, - { - "content": "[DBus(name = \"$0\")]", - "name": "DBus annotation", - "scope": "vala", - "tabTrigger": "[DBus" - }, - { - "content": "delegate ${1:void} ${2:DelegateName}($0);", - "name": "delegate", - "scope": "vala", - "tabTrigger": "delegate" - }, - { - "content": "do {\n\t$0\n} while ($1);\n", - "name": "do while", - "scope": "vala", - "tabTrigger": "dowhile" - }, - { - "content": "/**\n * $0\n */", - "name": "DocBlock", - "scope": "vala", - "tabTrigger": "/**" - }, - { - "content": "else if ($1) {\n\t$0\n}\n", - "name": "else if (elseif)", - "scope": "vala", - "tabTrigger": "elseif" - }, - { - "content": "else {\n\t$0\n}", - "name": "else", - "scope": "vala", - "tabTrigger": "else" - }, - { - "content": "enum {$1:EnumName} {\n\t$0\n}", - "name": "enum", - "scope": "vala", - "tabTrigger": "enum" - }, - { - "content": "public errordomain ${1:Error} {\n\t$0\n}", - "name": "error domain", - "scope": "vala", - "tabTrigger": "errordomain" - }, - { - "content": "for ($1;$2;$3) {\n\t$0\n}", - "name": "for", - "scope": "vala", - "tabTrigger": "for" - }, - { - "content": "foreach ($1 in $2) {\n\t$0\n}", - "name": "foreach", - "scope": "vala", - "tabTrigger": "foreach" - }, - { - "content": "Gee.ArrayList<${1:G}>($0);", - "name": "Gee.ArrayList", - "scope": "vala", - "tabTrigger": "ArrayList" - }, - { - "content": "Gee.HashMap<${1:K},${2:V}>($0);", - "name": "Gee.HashMap", - "scope": "vala", - "tabTrigger": "HashMap" - }, - { - "content": "Gee.HashSet<${1:G}>($0);", - "name": "Gee.HashSet", - "scope": "vala", - "tabTrigger": "HashSet" - }, - { - "content": "if ($1) {\n\t$0\n}", - "name": "if", - "scope": "vala", - "tabTrigger": "if" - }, - { - "content": "interface ${1:InterfaceName}{$2: : SuperInterface} {\n\t$0\n}", - "name": "interface", - "scope": "vala", - "tabTrigger": "interface" - }, - { - "content": "public static int main(string [] argv) {\n\t${0}\n\treturn 0;\n}", - "name": "Main function", - "scope": "vala", - "tabTrigger": "main" - }, - { - "content": "namespace $1 {\n\t$0\n}\n", - "name": "namespace (ns)", - "scope": "vala", - "tabTrigger": "ns" - }, - { - "content": "stdout.printf($0);", - "name": "printf", - "scope": "vala", - "tabTrigger": "printf" - }, - { - "content": "${1:public} ${2:Type} ${3:Name} {\n\tset {\n\t\t$0\n\t}\n\tget {\n\n\t}\n}", - "name": "property (prop)", - "scope": "vala", - "tabTrigger": "prop" - }, - { - "content": "${1:public} ${2:Type} ${3:Name} {\n\tget {\n\t\t$0\n\t}\n}", - "name": "read-only property (roprop)", - "scope": "vala", - "tabTrigger": "roprop" - }, - { - "content": "@\"${1:\\$var}\"", - "name": "String template (@)", - "scope": "vala", - "tabTrigger": "@" - }, - { - "content": "struct ${1:StructName} {\n\t$0\n}", - "name": "struct", - "scope": "vala", - "tabTrigger": "struct" - }, - { - "content": "switch ($1) {\n\t$0\n}", - "name": "switch", - "scope": "vala", - "tabTrigger": "switch" - }, - { - "content": "try {\n\t$2\n} catch (${1:Error} e) {\n\t$0\n}", - "name": "try/catch", - "scope": "vala", - "tabTrigger": "try" - }, - { - "content": "\"\"\"$0\"\"\";", - "name": "Verbatim string (\"\"\")", - "scope": "vala", - "tabTrigger": "verbatim" - }, - { - "content": "while ($1) {\n\t$0\n}", - "name": "while", - "scope": "vala", - "tabTrigger": "while" - } -]; -exports.scope = ""; - -}); diff --git a/lib/ace/snippets/vala.snippets b/lib/ace/snippets/vala.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/vbscript.js b/lib/ace/snippets/vbscript.js deleted file mode 100644 index 5ab8e650..00000000 --- a/lib/ace/snippets/vbscript.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./vbscript.snippets"); -exports.scope = "vbscript"; - -}); diff --git a/lib/ace/snippets/vbscript.snippets b/lib/ace/snippets/vbscript.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/velocity.js b/lib/ace/snippets/velocity.js deleted file mode 100644 index ba522dd2..00000000 --- a/lib/ace/snippets/velocity.js +++ /dev/null @@ -1,8 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./velocity.snippets"); -exports.scope = "velocity"; -exports.includeScopes = ["html", "javascript", "css"]; - -}); diff --git a/lib/ace/snippets/velocity.snippets b/lib/ace/snippets/velocity.snippets deleted file mode 100644 index dedca589..00000000 --- a/lib/ace/snippets/velocity.snippets +++ /dev/null @@ -1,28 +0,0 @@ -# macro -snippet #macro - #macro ( ${1:macroName} ${2:\$var1, [\$var2, ...]} ) - ${3:## macro code} - #end -# foreach -snippet #foreach - #foreach ( ${1:\$item} in ${2:\$collection} ) - ${3:## foreach code} - #end -# if -snippet #if - #if ( ${1:true} ) - ${0} - #end -# if ... else -snippet #ife - #if ( ${1:true} ) - ${2} - #else - ${0} - #end -#import -snippet #import - #import ( "${1:path/to/velocity/format}" ) -# set -snippet #set - #set ( $${1:var} = ${0} ) diff --git a/lib/ace/snippets/verilog.js b/lib/ace/snippets/verilog.js deleted file mode 100644 index 7360341e..00000000 --- a/lib/ace/snippets/verilog.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./verilog.snippets"); -exports.scope = "verilog"; - -}); diff --git a/lib/ace/snippets/verilog.snippets b/lib/ace/snippets/verilog.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/vhdl.js b/lib/ace/snippets/vhdl.js deleted file mode 100644 index fe5e708f..00000000 --- a/lib/ace/snippets/vhdl.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./vhdl.snippets"); -exports.scope = "vhdl"; - -}); \ No newline at end of file diff --git a/lib/ace/snippets/vhdl.snippets b/lib/ace/snippets/vhdl.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/xml.js b/lib/ace/snippets/xml.js deleted file mode 100644 index 83b1870c..00000000 --- a/lib/ace/snippets/xml.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./xml.snippets"); -exports.scope = "xml"; - -}); diff --git a/lib/ace/snippets/xml.snippets b/lib/ace/snippets/xml.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets/xquery.js b/lib/ace/snippets/xquery.js deleted file mode 100644 index d96a0619..00000000 --- a/lib/ace/snippets/xquery.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./xquery.snippets"); -exports.scope = "xquery"; - -}); diff --git a/lib/ace/snippets/xquery.snippets b/lib/ace/snippets/xquery.snippets deleted file mode 100644 index 965034b7..00000000 --- a/lib/ace/snippets/xquery.snippets +++ /dev/null @@ -1,61 +0,0 @@ -snippet for - for $${1:item} in ${2:expr} -snippet return - return ${1:expr} -snippet import - import module namespace ${1:ns} = "${2:http://www.example.com/}"; -snippet some - some $${1:varname} in ${2:expr} satisfies ${3:expr} -snippet every - every $${1:varname} in ${2:expr} satisfies ${3:expr} -snippet if - if(${1:true}) then ${2:expr} else ${3:true} -snippet switch - switch(${1:"foo"}) - case ${2:"foo"} - return ${3:true} - default return ${4:false} -snippet try - try { ${1:expr} } catch ${2:*} { ${3:expr} } -snippet tumbling - for tumbling window $${1:varname} in ${2:expr} - start at $${3:start} when ${4:expr} - end at $${5:end} when ${6:expr} - return ${7:expr} -snippet sliding - for sliding window $${1:varname} in ${2:expr} - start at $${3:start} when ${4:expr} - end at $${5:end} when ${6:expr} - return ${7:expr} -snippet let - let $${1:varname} := ${2:expr} -snippet group - group by $${1:varname} := ${2:expr} -snippet order - order by ${1:expr} ${2:descending} -snippet stable - stable order by ${1:expr} -snippet count - count $${1:varname} -snippet ordered - ordered { ${1:expr} } -snippet unordered - unordered { ${1:expr} } -snippet treat - treat as ${1:expr} -snippet castable - castable as ${1:atomicType} -snippet cast - cast as ${1:atomicType} -snippet typeswitch - typeswitch(${1:expr}) - case ${2:type} return ${3:expr} - default return ${4:expr} -snippet var - declare variable $${1:varname} := ${2:expr}; -snippet fn - declare function ${1:ns}:${2:name}(){ - ${3:expr} - }; -snippet module - module namespace ${1:ns} = "${2:http://www.example.com}"; diff --git a/lib/ace/snippets/xslt.snippets b/lib/ace/snippets/xslt.snippets deleted file mode 100644 index e7abdf3f..00000000 --- a/lib/ace/snippets/xslt.snippets +++ /dev/null @@ -1,97 +0,0 @@ -snippet apply-templates with-param - - ${3}${4} - ${5} - -snippet apply-templates sort-by - - ${5} - ${6} - -snippet apply-templates plain - ${2} - -snippet attribute blank - ${2}${3} - -snippet attribute value-of - - - ${3} - -snippet call-template - - -snippet call-template with-param - - ${3}${4} - ${5} - -snippet choose - - - ${2} - ${3} - - -snippet copy-of - ${2} - -snippet for-each - ${2} - ${3} - -snippet if - ${2} - ${3} - -snippet import - ${2} - -snippet include - ${2} - -snippet otherwise - ${1} - - -snippet param - ${2} - ${3} - -snippet stylesheet - ${1} - - -snippet template - ${3} - - -snippet template named - ${2} - - -snippet text - ${1} - -snippet value-of - ${2} - -snippet variable blank - ${2} - - -snippet variable select - ${2} - -snippet when - ${2} - - -snippet with-param - ${2} - -snippet with-param select - - diff --git a/lib/ace/snippets/yaml.js b/lib/ace/snippets/yaml.js deleted file mode 100644 index 17e70a3c..00000000 --- a/lib/ace/snippets/yaml.js +++ /dev/null @@ -1,7 +0,0 @@ -define(function(require, exports, module) { -"use strict"; - -exports.snippetText = require("../requirejs/text!./yaml.snippets"); -exports.scope = "yaml"; - -}); diff --git a/lib/ace/snippets/yaml.snippets b/lib/ace/snippets/yaml.snippets deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/ace/snippets_test.js b/lib/ace/snippets_test.js deleted file mode 100644 index 1870d950..00000000 --- a/lib/ace/snippets_test.js +++ /dev/null @@ -1,131 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -if (typeof process !== "undefined") { - require("amd-loader"); -} - -define(function(require, exports, module) { -"use strict"; -var EditSession = require("./edit_session").EditSession; -var Editor = require("./editor").Editor; -var MockRenderer = require("./test/mockrenderer").MockRenderer; -var MultiSelect = require("./multi_select").MultiSelect; - -var snippetManager = require("./snippets").snippetManager; -var assert = require("./test/assertions"); - -module.exports = { - setUp : function(next) { - this.editor = new Editor(new MockRenderer()); - next(); - }, - - "test: textmate style format strings" : function() { - var fmt = snippetManager.tmStrFormat; - snippetManager.tmStrFormat("hello", { - guard: "(..)(.)(.)", - flag:"g", - fmt: "a\\UO\\l$1\\E$2" - }) == "aOHElo"; - }, - "test: parse snipmate file" : function() { - var expected = [{ - name: "a", - guard: "(?:(=)|(:))?s*)", - trigger: "\\(?f", - endTrigger: "\\)", - endGuard: "", - content: "{$0}\n" - }, { - tabTrigger: "f", - name: "f function", - content: "function" - }]; - - - - var parsed = snippetManager.parseSnippetFile( - "name a\nregex /(?:(=)|(:))?\s*)/\\(?f/\\)/\n\t{$0}" + - "\n\t\n\n#function\nsnippet f function\n\tfunction" - ); - - assert.equal(JSON.stringify(expected, null, 4), JSON.stringify(parsed, null, 4)) - }, - "test: parse snippet": function() { - var content = "-\\$$2a${1:x${$2:y$3\\}\\n\\}$TM_SELECTION}"; - var tokens = snippetManager.tokenizeTmSnippet(content); - assert.equal(tokens.length, 15); - assert.equal(tokens[4], tokens[14]); - assert.equal(tokens[2].tabstopId, 2); - - var content = "\\}${var/as\\/d/\\ul\\//g:s}" - var tokens = snippetManager.tokenizeTmSnippet(content); - assert.equal(tokens.length, 4); - assert.equal(tokens[1], tokens[3]); - assert.equal(tokens[2], "s"); - assert.equal(tokens[1].text, "var"); - assert.equal(tokens[1].fmt, "\\ul\\/"); - assert.equal(tokens[1].guard, "as\\/d"); - assert.equal(tokens[1].flag, "g"); - }, - "test: expand snippet with nested tabstops": function() { - var content = "-${1}-${1:1}--${2:2 ${3} 2}-${3:3 $1 3}-${4:4 $2 4}"; - this.editor.setValue(""); - snippetManager.insertSnippet(this.editor, content); - assert.equal(this.editor.getValue(), "-1-1--2 3 1 3 2-3 1 3-4 2 3 1 3 2 4"); - - assert.equal(this.editor.getSelectedText(), "1\n1\n1\n1\n1"); - this.editor.tabstopManager.tabNext(); - assert.equal(this.editor.getSelectedText(), "2 3 1 3 2\n2 3 1 3 2"); - this.editor.tabstopManager.tabNext(); - assert.equal(this.editor.getSelectedText(), "3 1 3\n3 1 3\n3 1 3"); - this.editor.tabstopManager.tabNext(); - assert.equal(this.editor.getSelectedText(), "4 2 3 1 3 2 4"); - this.editor.tabstopManager.tabNext(); - assert.equal(this.editor.getSelectedText(), ""); - - this.editor.setValue(""); - snippetManager.insertSnippet(this.editor, "-${1:a$2}-${2:b$1}"); - assert.equal(this.editor.getValue(), "-ab-ba"); - - assert.equal(this.editor.getSelectedText(), "ab\na"); - this.editor.tabstopManager.tabNext(); - assert.equal(this.editor.getSelectedText(), "b\nba"); - this.editor.tabstopManager.tabNext(); - assert.equal(this.editor.getSelectedText(), ""); - } -}; - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec() -} diff --git a/lib/ace/split.js b/lib/ace/split.js index 878b0dc3..7d0e5902 100644 --- a/lib/ace/split.js +++ b/lib/ace/split.js @@ -1,30 +1,38 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: +/* vim:ts=4:sts=4:sw=4: + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Julian Viereck + * + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -39,13 +47,22 @@ var Editor = require("./editor").Editor; var Renderer = require("./virtual_renderer").VirtualRenderer; var EditSession = require("./edit_session").EditSession; -/** - * @class Split +/** internal, hide + * class Split * * * **/ +/** internal, hide + * new Split(container, theme, splits) + * - container (Document): The document to associate with the split + * - theme (String): The name of the initial theme + * - splits (Number): The number of initial splits + * + * + * + **/ var Split = function(container, theme, splits) { this.BELOW = 1; @@ -87,6 +104,13 @@ var Split = function(container, theme, splits) { return editor; }; + /** internal, hide + * Split.setSplits(splits) -> Void + * - splits (Number): The new number of splits + * + * + * + **/ this.setSplits = function(splits) { var editor; if (splits < 1) { @@ -117,16 +141,18 @@ var Split = function(container, theme, splits) { }; /** - * + * Split.getSplits() -> Number + * * Returns the number of splits. - * @returns {Number} + * **/ this.getSplits = function() { return this.$splits; }; /** - * @param {Number} idx The index of the editor you want + * Split.getEditor(idx) -> Editor + * -idx (Number): The index of the editor you want * * Returns the editor identified by the index `idx`. * @@ -136,36 +162,40 @@ var Split = function(container, theme, splits) { }; /** - * + * Split.getCurrentEditor() -> Editor + * * Returns the current editor. - * @returns {Editor} + * **/ this.getCurrentEditor = function() { return this.$cEditor; }; - /** + /** related to: Editor.focus + * Split.focus() -> Void + * * Focuses the current editor. - * @related Editor.focus + * **/ this.focus = function() { this.$cEditor.focus(); }; - /** + /** related to: Editor.blur + * Split.blur() -> Void + * * Blurs the current editor. - * @related Editor.blur + * **/ this.blur = function() { this.$cEditor.blur(); }; - /** - * - * @param {String} theme The name of the theme to set + /** related to: Editor.setTheme + * Split.setTheme(theme) -> Void + * - theme (String): The name of the theme to set * * Sets a theme for each of the available editors. - * @related Editor.setTheme **/ this.setTheme = function(theme) { this.$editors.forEach(function(editor) { @@ -173,12 +203,11 @@ var Split = function(container, theme, splits) { }); }; - /** + /** internal, hide + * Split.setKeyboardHandler(keybinding) -> Void + * - keybinding (String): * - * @param {String} keybinding - * - * Sets the keyboard handler for the editor. - * @related editor.setKeyboardHandler + * **/ this.setKeyboardHandler = function(keybinding) { this.$editors.forEach(function(editor) { @@ -186,10 +215,10 @@ var Split = function(container, theme, splits) { }); }; - /** - * - * @param {Function} callback A callback function to execute - * @param {String} scope The default scope for the callback + /** internal, hide + * Split.forEach(callback, scope) -> Void + * - callback (Function): A callback function to execute + * - scope (String): * * Executes `callback` on all of the available editors. * @@ -198,14 +227,14 @@ var Split = function(container, theme, splits) { this.$editors.forEach(callback, scope); }; - - this.$fontSize = ""; - /** - * @param {Number} size The new font size + /** related to: Editor.setFontSize + * Split.setFontSize(size) -> Void + * - size (Number): The new font size * * Sets the font size, in pixels, for all the available editors. * **/ + this.$fontSize = ""; this.setFontSize = function(size) { this.$fontSize = size; this.forEach(function(editor) { @@ -224,7 +253,7 @@ var Split = function(container, theme, splits) { // Overwrite the default $informUndoManager function such that new delas // aren't added to the undo manager from the new and the old session. - s.$informUndoManager = lang.delayedCall(function() { s.$deltas = []; }); + s.$informUndoManager = lang.deferredCall(function() { s.$deltas = []; }); // Copy over 'settings' from the session. s.setTabSize(session.getTabSize()); @@ -240,13 +269,13 @@ var Split = function(container, theme, splits) { return s; }; - /** - * - * @param {EditSession} session The new edit session - * @param {Number} idx The editor's index you're interested in + /** related to: Editor.setSession + * Split.setSession(session, idx) -> Void + * - session (EditSession): The new edit session + * - idx (Number): The editor's index you're interested in * * Sets a new [[EditSession `EditSession`]] for the indicated editor. - * @related Editor.setSession + * **/ this.setSession = function(session, idx) { var editor; @@ -274,20 +303,21 @@ var Split = function(container, theme, splits) { return session; }; - /** + /** internal, hide + * Split.getOrientation() -> Number * * Returns the orientation. - * @returns {Number} + * **/ this.getOrientation = function() { return this.$orientation; }; - /** - * - * Sets the orientation. - * @param {Number} orientation The new orientation value + /** internal, hide + * Split.setOrientation(oriantation) -> Void + * - oriantation (Number): * + * Sets the orientation. * **/ this.setOrientation = function(orientation) { @@ -298,8 +328,11 @@ var Split = function(container, theme, splits) { this.resize(); }; - /** - * Resizes the editor. + /** internal + * Split.resize() -> Void + * + * + * **/ this.resize = function() { var width = this.$container.clientWidth; @@ -331,7 +364,12 @@ var Split = function(container, theme, splits) { }).call(Split.prototype); - + /** internal + * Split.UndoManagerProxy() -> Void + * + * + * + **/ function UndoManagerProxy(undoManager, session) { this.$u = undoManager; this.$doc = session; diff --git a/lib/ace/test/all.js b/lib/ace/test/all.js index e437d6f0..340f903d 100644 --- a/lib/ace/test/all.js +++ b/lib/ace/test/all.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ diff --git a/lib/ace/test/all_browser.js b/lib/ace/test/all_browser.js index 7ac5092e..f1f68c81 100644 --- a/lib/ace/test/all_browser.js +++ b/lib/ace/test/all_browser.js @@ -13,7 +13,6 @@ var testNames = [ "ace/anchor_test", "ace/background_tokenizer_test", "ace/commands/command_manager_test", - "ace/config_test", "ace/document_test", "ace/edit_session_test", "ace/editor_change_document_test", @@ -21,40 +20,35 @@ var testNames = [ "ace/editor_navigation_test", "ace/editor_text_edit_test", "ace/ext/static_highlight_test", - "ace/incremental_search_test", - "ace/keyboard/emacs_test", - "ace/keyboard/keybinding_test", - "ace/keyboard/vim_test", "ace/layer/text_test", "ace/lib/event_emitter_test", "ace/mode/coffee/parser_test", + "ace/mode/coffee_highlight_rules_test", "ace/mode/coldfusion_test", "ace/mode/css_test", + "ace/mode/css_highlight_rules_test", "ace/mode/css_worker", "ace/mode/html_test", + "ace/mode/html_highlight_rules_test", "ace/mode/javascript_test", + "ace/mode/javascript_highlight_rules_test", "ace/mode/javascript_worker_test", - "ace/mode/logiql_test", "ace/mode/python_test", + "ace/mode/ruby_highlight_rules_test", "ace/mode/text_test", "ace/mode/xml_test", + "ace/mode/xml_highlight_rules_test", "ace/mode/folding/cstyle_test", "ace/mode/folding/html_test", "ace/mode/folding/pythonic_test", "ace/mode/folding/xml_test", "ace/mode/folding/coffee_test", - "ace/mode/behaviour/behaviour_test", "ace/multi_select_test", - "ace/mouse/mouse_handler_test", - "ace/occur_test", - "ace/placeholder_test", "ace/range_test", "ace/range_list_test", "ace/search_test", "ace/selection_test", - "ace/snippets_test", "ace/token_iterator_test", - "ace/tokenizer_test", "ace/virtual_renderer_test" ]; @@ -66,29 +60,21 @@ for (var i in testNames) { var nav = document.createElement("div"); nav.innerHTML = html.join(""); -nav.style.cssText = "position:absolute;right:0;top:0"; +nav.style.cssText = "position:absolute;right:0;top:0"; document.body.appendChild(nav); if (location.search) testNames = location.search.substr(1).split(",") -var filter = location.hash.substr(1); - require(testNames, function() { var tests = testNames.map(function(x) { var module = require(x); module.href = x; return module; }); - + async.list(tests) .expand(function(test) { - if (filter) { - Object.keys(test).forEach(function(method) { - if (method.match(/^>?test/) && !method.match(filter)) - test[method] = undefined; - }); - } return AsyncTest.testcase(test) }, AsyncTest.TestGenerator) .run() diff --git a/lib/ace/test/assertions.js b/lib/ace/test/assertions.js index 3a521003..861dbddc 100644 --- a/lib/ace/test/assertions.js +++ b/lib/ace/test/assertions.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ diff --git a/lib/ace/test/asyncjs/assert.js b/lib/ace/test/asyncjs/assert.js index 96e3f6e2..6cdc611a 100644 --- a/lib/ace/test/asyncjs/assert.js +++ b/lib/ace/test/asyncjs/assert.js @@ -1,5 +1,5 @@ define(function(require, exports, module) { - + // http://wiki.commonjs.org/wiki/Unit_Testing/1.0 // // THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8! @@ -141,7 +141,7 @@ function _deepEqual(actual, expected) { if (actual === expected) { return true; - } else if (typeof Buffer !== "undefined" && Buffer.isBuffer(actual) && Buffer.isBuffer(expected)) { + } else if (Buffer.isBuffer(actual) && Buffer.isBuffer(expected)) { if (actual.length != expected.length) return false; for (var i = 0; i < actual.length; i++) { diff --git a/lib/ace/test/benchmark.js b/lib/ace/test/benchmark.js index cd3953c8..28adfcde 100644 --- a/lib/ace/test/benchmark.js +++ b/lib/ace/test/benchmark.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ diff --git a/lib/ace/test/mockrenderer.js b/lib/ace/test/mockrenderer.js index ba4c9563..a0f031a9 100644 --- a/lib/ace/test/mockrenderer.js +++ b/lib/ace/test/mockrenderer.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -33,7 +40,6 @@ define(function(require, exports, module) { var MockRenderer = exports.MockRenderer = function(visibleRowCount) { this.container = document.createElement("div"); - this.scroller = document.createElement("div"); this.visibleRowCount = visibleRowCount || 20; this.layerConfig = { @@ -194,13 +200,6 @@ MockRenderer.prototype.textToScreenCoordinates = function() { } }; -MockRenderer.prototype.screenToTextCoordinates = function() { - return { - row: 0, - column: 0 - } -}; - MockRenderer.prototype.adjustWrapLimit = function () { }; diff --git a/lib/ace/theme/ambiance.css b/lib/ace/theme/ambiance.css deleted file mode 100644 index 9f9f7afa..00000000 --- a/lib/ace/theme/ambiance.css +++ /dev/null @@ -1,221 +0,0 @@ -.ace-ambiance .ace_gutter { - background-color: #3d3d3d; - 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; - border-right: 1px solid #4d4d4d; - text-shadow: 0px 1px 1px #4d4d4d; - color: #222; -} - -.ace-ambiance .ace_gutter-layer { - background: repeat left top; -} - -.ace-ambiance .ace_gutter-active-line { - background-color: #3F3F3F; -} - -.ace-ambiance .ace_fold-widget { - text-align: center; -} - -.ace-ambiance .ace_fold-widget:hover { - color: #777; -} - -.ace-ambiance .ace_fold-widget.ace_start, -.ace-ambiance .ace_fold-widget.ace_end, -.ace-ambiance .ace_fold-widget.ace_closed{ - background: none; - border: none; - box-shadow: none; -} - -.ace-ambiance .ace_fold-widget.ace_start:after { - content: '▾' -} - -.ace-ambiance .ace_fold-widget.ace_end:after { - content: '▴' -} - -.ace-ambiance .ace_fold-widget.ace_closed:after { - content: '‣' -} - -.ace-ambiance .ace_print-margin { - border-left: 1px dotted #2D2D2D; - right: 0; - background: #262626; -} - -.ace-ambiance .ace_scroller { - -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 { - color: #E6E1DC; - background-color: #202020; -} - -.ace-ambiance .ace_cursor { - border-left: 1px solid #7991E8; -} - -.ace-ambiance .ace_overwrite-cursors .ace_cursor { - 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; -} \ No newline at end of file diff --git a/lib/ace/theme/ambiance.js b/lib/ace/theme/ambiance.js deleted file mode 100644 index 475c2e87..00000000 --- a/lib/ace/theme/ambiance.js +++ /dev/null @@ -1,33 +0,0 @@ -/* ***** 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 ***** */ - -define(function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-ambiance"; -exports.cssText = require("../requirejs/text!./ambiance.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); - -}); diff --git a/lib/ace/theme/chaos.css b/lib/ace/theme/chaos.css deleted file mode 100644 index f57e59b3..00000000 --- a/lib/ace/theme/chaos.css +++ /dev/null @@ -1,154 +0,0 @@ -.ace-chaos .ace_gutter { - background: #141414; - color: #595959; - border-right: 1px solid #282828; -} -.ace-chaos .ace_gutter-cell.ace_warning { - background-image: none; - background: #FC0; - border-left: none; - padding-left: 0; - color: #000; -} -.ace-chaos .ace_gutter-cell.ace_error { - background-position: -6px center; - background-image: none; - background: #F10; - border-left: none; - padding-left: 0; - color: #000; -} -.ace-chaos .ace_print-margin { - border-left: 1px solid #555; - right: 0; - background: #1D1D1D; -} -.ace-chaos { - background-color: #161616; - color: #E6E1DC; -} - -.ace-chaos .ace_cursor { - border-left: 2px solid #FFFFFF; -} -.ace-chaos .ace_cursor.ace_overwrite { - border-left: 0px; - border-bottom: 1px solid #FFFFFF; -} -.ace-chaos .ace_marker-layer .ace_selection { - background: #494836; -} -.ace-chaos .ace_marker-layer .ace_step { - background: rgb(198, 219, 174); -} -.ace-chaos .ace_marker-layer .ace_bracket { - margin: -1px 0 0 -1px; - border: 1px solid #FCE94F; -} -.ace-chaos .ace_marker-layer .ace_active-line { - background: #333; -} -.ace-chaos .ace_gutter-active-line { - background-color: #222; -} -.ace-chaos .ace_invisible { - color: #404040; -} -.ace-chaos .ace_keyword { - color:#00698F; -} -.ace-chaos .ace_keyword.ace_operator { - color:#FF308F; -} -.ace-chaos .ace_constant { - color:#1EDAFB; -} -.ace-chaos .ace_constant.ace_language { - color:#FDC251; -} -.ace-chaos .ace_constant.ace_library { - color:#8DFF0A; -} -.ace-chaos .ace_constant.ace_numeric { - color:#58C554; -} -.ace-chaos .ace_invalid { - color:#FFFFFF; - background-color:#990000; -} -.ace-chaos .ace_invalid.ace_deprecated { - color:#FFFFFF; - background-color:#990000; -} -.ace-chaos .ace_support { - color: #999; -} -.ace-chaos .ace_support.ace_function { - color:#00AEEF; -} -.ace-chaos .ace_function { - color:#00AEEF; -} -.ace-chaos .ace_string { - color:#58C554; -} -.ace-chaos .ace_comment { - color:#555; - font-style:italic; - padding-bottom: 0px; -} -.ace-chaos .ace_variable { - color:#997744; -} -.ace-chaos .ace_meta.ace_tag { - color:#BE53E6; -} -.ace-chaos .ace_entity.ace_other.ace_attribute-name { - color:#FFFF89; -} -.ace-chaos .ace_markup.ace_underline { - text-decoration: underline; -} -.ace-chaos .ace_fold-widget { - text-align: center; -} - -.ace-chaos .ace_fold-widget:hover { - color: #777; -} - -.ace-chaos .ace_fold-widget.ace_start, -.ace-chaos .ace_fold-widget.ace_end, -.ace-chaos .ace_fold-widget.ace_closed{ - background: none; - border: none; - box-shadow: none; -} - -.ace-chaos .ace_fold-widget.ace_start:after { - content: '▾' -} - -.ace-chaos .ace_fold-widget.ace_end:after { - content: '▴' -} - -.ace-chaos .ace_fold-widget.ace_closed:after { - content: '‣' -} - -.ace-chaos .ace_indent-guide { - border-right:1px dotted #333; - margin-right:-1px; -} - -.ace-chaos .ace_fold { - background: #222; - border-radius: 3px; - color: #7AF; - border: none; -} -.ace-chaos .ace_fold:hover { - background: #CCC; - color: #000; -} diff --git a/lib/ace/theme/chaos.js b/lib/ace/theme/chaos.js deleted file mode 100644 index 9ee83720..00000000 --- a/lib/ace/theme/chaos.js +++ /dev/null @@ -1,33 +0,0 @@ -/* ***** 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 ***** */ - -define(function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-chaos"; -exports.cssText = require("../requirejs/text!./chaos.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); - -}); \ No newline at end of file diff --git a/lib/ace/theme/chrome.css b/lib/ace/theme/chrome.css index c91e802a..000c4e53 100644 --- a/lib/ace/theme/chrome.css +++ b/lib/ace/theme/chrome.css @@ -1,90 +1,100 @@ +.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 { +.ace-chrome .ace_print_margin { width: 1px; background: #e8e8e8; } -.ace-chrome { - background-color: #FFFFFF; - color: black; +.ace-chrome .ace_text-layer { } .ace-chrome .ace_cursor { - color: black; + border-left: 2px solid black; } -.ace-chrome .ace_invisible { +.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_constant.ace_buildin { +.ace-chrome .ace_line .ace_constant.ace_buildin { color: rgb(88, 72, 246); } -.ace-chrome .ace_constant.ace_language { +.ace-chrome .ace_line .ace_constant.ace_language { color: rgb(88, 92, 246); } -.ace-chrome .ace_constant.ace_library { +.ace-chrome .ace_line .ace_constant.ace_library { color: rgb(6, 150, 14); } -.ace-chrome .ace_invalid { +.ace-chrome .ace_line .ace_invalid { background-color: rgb(153, 0, 0); color: white; } -.ace-chrome .ace_fold { +.ace-chrome .ace_line .ace_fold { } -.ace-chrome .ace_support.ace_function { +.ace-chrome .ace_line .ace_support.ace_function { color: rgb(60, 76, 114); } -.ace-chrome .ace_support.ace_constant { +.ace-chrome .ace_line .ace_support.ace_constant { color: rgb(6, 150, 14); } -.ace-chrome .ace_support.ace_type, -.ace-chrome .ace_support.ace_class -.ace-chrome .ace_support.ace_other { +.ace-chrome .ace_line .ace_support.ace_type, +.ace-chrome .ace_line .ace_support.ace_class { color: rgb(109, 121, 222); } .ace-chrome .ace_variable.ace_parameter { font-style:italic; - color:#FD971F; +color:#FD971F; } -.ace-chrome .ace_keyword.ace_operator { +.ace-chrome .ace_line .ace_keyword.ace_operator { color: rgb(104, 118, 135); } -.ace-chrome .ace_comment { +.ace-chrome .ace_line .ace_comment { color: #236e24; } -.ace-chrome .ace_comment.ace_doc { +.ace-chrome .ace_line .ace_comment.ace_doc { color: #236e24; } -.ace-chrome .ace_comment.ace_doc.ace_tag { +.ace-chrome .ace_line .ace_comment.ace_doc.ace_tag { color: #236e24; } -.ace-chrome .ace_constant.ace_numeric { +.ace-chrome .ace_line .ace_constant.ace_numeric { color: rgb(0, 0, 205); } -.ace-chrome .ace_variable { +.ace-chrome .ace_line .ace_variable { color: rgb(49, 132, 149); } -.ace-chrome .ace_xml-pe { +.ace-chrome .ace_line .ace_xml_pe { color: rgb(104, 104, 91); } @@ -92,12 +102,15 @@ color: #0000A2; } +.ace-chrome .ace_markup.ace_markupine { + text-decoration:underline; +} -.ace-chrome .ace_heading { +.ace-chrome .ace_markup.ace_heading { color: rgb(12, 7, 255); } -.ace-chrome .ace_list { +.ace-chrome .ace_markup.ace_list { color:rgb(185, 6, 144); } @@ -118,21 +131,21 @@ border: 1px solid rgb(192, 192, 192); } -.ace-chrome .ace_marker-layer .ace_active-line { +.ace-chrome .ace_marker-layer .ace_active_line { background: rgba(0, 0, 0, 0.07); } -.ace-chrome .ace_gutter-active-line { +.ace-chrome .ace_gutter_active_line { background-color : #dcdcdc; } -.ace-chrome .ace_marker-layer .ace_selected-word { +.ace-chrome .ace_marker-layer .ace_selected_word { background: rgb(250, 250, 255); border: 1px solid rgb(200, 200, 250); } .ace-chrome .ace_storage, -.ace-chrome .ace_keyword, +.ace-chrome .ace_line .ace_keyword, .ace-chrome .ace_meta.ace_tag { color: rgb(147, 15, 128); } @@ -141,11 +154,11 @@ color: rgb(255, 0, 0) } -.ace-chrome .ace_string { +.ace-chrome .ace_line .ace_string{ color: #1A1AA6; } -.ace-chrome .ace_entity.ace_other.ace_attribute-name { +.ace-chrome .ace_entity.ace_other.ace_attribute-name{ color: #994409; } diff --git a/lib/ace/theme/chrome.js b/lib/ace/theme/chrome.js index dafa99c2..fd64f72d 100644 --- a/lib/ace/theme/chrome.js +++ b/lib/ace/theme/chrome.js @@ -1,39 +1,46 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ define(function(require, exports, module) { -exports.isDark = false; exports.cssClass = "ace-chrome"; -exports.cssText = require("../requirejs/text!./chrome.css"); +exports.cssText = require('ace/requirejs/text!./chrome.css'); var dom = require("../lib/dom"); dom.importCssString(exports.cssText, exports.cssClass); + }); diff --git a/lib/ace/theme/clouds.css b/lib/ace/theme/clouds.css index c11308d4..80364f41 100644 --- a/lib/ace/theme/clouds.css +++ b/lib/ace/theme/clouds.css @@ -1,111 +1,122 @@ + +.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 + color: #333; } -.ace-clouds .ace_print-margin { +.ace-clouds .ace_print_margin { width: 1px; - background: #e8e8e8 + background: #e8e8e8; } -.ace-clouds { +.ace-clouds .ace_scroller { background-color: #FFFFFF; - color: #000000 +} + +.ace-clouds .ace_text-layer { + color: #000000; } .ace-clouds .ace_cursor { - color: #000000 + 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 + background: #BDD5FC; } -.ace-clouds.ace_multiselect .ace_selection.ace_start { +.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) + background: rgb(255, 255, 0); } .ace-clouds .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; - border: 1px solid #BFBFBF + border: 1px solid #BFBFBF; } -.ace-clouds .ace_marker-layer .ace_active-line { - background: #FFFBD1 +.ace-clouds .ace_marker-layer .ace_active_line { + background: #FFFBD1; } -.ace-clouds .ace_gutter-active-line { - background-color : #dcdcdc +.ace-clouds .ace_gutter_active_line { + background-color : #dcdcdc; } -.ace-clouds .ace_marker-layer .ace_selected-word { - border: 1px solid #BDD5FC +.ace-clouds .ace_marker-layer .ace_selected_word { + border: 1px solid #BDD5FC; } .ace-clouds .ace_invisible { - color: #BFBFBF + 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-clouds .ace_meta { + color:#AF956F; } .ace-clouds .ace_keyword.ace_operator { - color: #484848 -} - -.ace-clouds .ace_keyword.ace_other.ace_unit { - color: #96DC5F + color:#484848; } .ace-clouds .ace_constant.ace_language { - color: #39946A + color:#39946A; } .ace-clouds .ace_constant.ace_numeric { - color: #46A609 -} - -.ace-clouds .ace_constant.ace_character.ace_entity { - color: #BF78CC + color:#46A609; } .ace-clouds .ace_invalid { - background-color: #FF002A + background-color:#FF002A; } .ace-clouds .ace_fold { - background-color: #AF956F; - border-color: #000000 + 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_support.ace_function { + color:#C52727; +} + +.ace-clouds .ace_storage { + color:#C52727; } .ace-clouds .ace_string { - color: #5D90CD + color:#5D90CD; } .ace-clouds .ace_comment { - color: #BCC8BA + color:#BCC8BA; } -.ace-clouds .ace_entity.ace_name.ace_tag, .ace-clouds .ace_entity.ace_other.ace_attribute-name { - color: #606060 + 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 + background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y; } \ No newline at end of file diff --git a/lib/ace/theme/clouds.js b/lib/ace/theme/clouds.js index aa36edcf..cc8bafce 100644 --- a/lib/ace/theme/clouds.js +++ b/lib/ace/theme/clouds.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,8 +39,8 @@ define(function(require, exports, module) { exports.isDark = false; exports.cssClass = "ace-clouds"; -exports.cssText = require("../requirejs/text!./clouds.css"); +exports.cssText = require('ace/requirejs/text!./clouds.css'); -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); + var dom = require("../lib/dom"); + dom.importCssString(exports.cssText, exports.cssClass); }); diff --git a/lib/ace/theme/clouds_midnight.css b/lib/ace/theme/clouds_midnight.css index 08ee089d..22b52c99 100644 --- a/lib/ace/theme/clouds_midnight.css +++ b/lib/ace/theme/clouds_midnight.css @@ -1,112 +1,123 @@ + +.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 + color: #929292; } -.ace-clouds-midnight .ace_print-margin { +.ace-clouds-midnight .ace_print_margin { width: 1px; - background: #232323 + background: #232323; } -.ace-clouds-midnight { +.ace-clouds-midnight .ace_scroller { background-color: #191919; - color: #929292 +} + +.ace-clouds-midnight .ace_text-layer { + color: #929292; } .ace-clouds-midnight .ace_cursor { - color: #7DA5DC + 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 + background: #000000; } -.ace-clouds-midnight.ace_multiselect .ace_selection.ace_start { +.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) + background: rgb(102, 82, 0); } .ace-clouds-midnight .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; - border: 1px solid #BFBFBF + border: 1px solid #BFBFBF; } -.ace-clouds-midnight .ace_marker-layer .ace_active-line { - background: rgba(215, 215, 215, 0.031) +.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_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_marker-layer .ace_selected_word { + border: 1px solid #000000; } .ace-clouds-midnight .ace_invisible { - color: #666 + 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-clouds-midnight .ace_meta { + color:#927C5D; } .ace-clouds-midnight .ace_keyword.ace_operator { - color: #4B4B4B -} - -.ace-clouds-midnight .ace_keyword.ace_other.ace_unit { - color: #366F1A + color:#4B4B4B; } .ace-clouds-midnight .ace_constant.ace_language { - color: #39946A + color:#39946A; } .ace-clouds-midnight .ace_constant.ace_numeric { - color: #46A609 -} - -.ace-clouds-midnight .ace_constant.ace_character.ace_entity { - color: #A165AC + color:#46A609; } .ace-clouds-midnight .ace_invalid { - color: #FFFFFF; - background-color: #E92E2E + color:#FFFFFF; +background-color:#E92E2E; } .ace-clouds-midnight .ace_fold { - background-color: #927C5D; - border-color: #929292 + 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_support.ace_function { + color:#E92E2E; +} + +.ace-clouds-midnight .ace_storage { + color:#E92E2E; } .ace-clouds-midnight .ace_string { - color: #5D90CD + color:#5D90CD; } .ace-clouds-midnight .ace_comment { - color: #3C403B + color:#3C403B; } -.ace-clouds-midnight .ace_entity.ace_name.ace_tag, .ace-clouds-midnight .ace_entity.ace_other.ace_attribute-name { - color: #606060 + color:#606060; +} + +.ace-clouds-midnight .ace_markup.ace_underline { + text-decoration:underline; } .ace-clouds-midnight .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHB3d/8PAAOIAdULw8qMAAAAAElFTkSuQmCC) right repeat-y + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWOQlJT8z1BeXv4fAA2KA6+h9Z+2AAAAAElFTkSuQmCC) right repeat-y; } \ No newline at end of file diff --git a/lib/ace/theme/clouds_midnight.js b/lib/ace/theme/clouds_midnight.js index e704d57c..5ce5dbf0 100644 --- a/lib/ace/theme/clouds_midnight.js +++ b/lib/ace/theme/clouds_midnight.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,8 +39,8 @@ define(function(require, exports, module) { exports.isDark = true; exports.cssClass = "ace-clouds-midnight"; -exports.cssText = require("../requirejs/text!./clouds_midnight.css"); +exports.cssText = require('ace/requirejs/text!./clouds_midnight.css'); -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); + var dom = require("../lib/dom"); + dom.importCssString(exports.cssText, exports.cssClass); }); diff --git a/lib/ace/theme/cobalt.css b/lib/ace/theme/cobalt.css index b883ba97..60fda700 100644 --- a/lib/ace/theme/cobalt.css +++ b/lib/ace/theme/cobalt.css @@ -1,133 +1,149 @@ + +.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: rgb(128,145,160) + color: #fff; } -.ace-cobalt .ace_print-margin { +.ace-cobalt .ace_print_margin { width: 1px; - background: #555555 + background: #011e3a; } -.ace-cobalt { +.ace-cobalt .ace_scroller { background-color: #002240; - color: #FFFFFF +} + +.ace-cobalt .ace_text-layer { + color: #FFFFFF; } .ace-cobalt .ace_cursor { - color: #FFFFFF + 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) + background: rgba(179, 101, 57, 0.75); } -.ace-cobalt.ace_multiselect .ace_selection.ace_start { +.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) + 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) + 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_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_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_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) + color: rgba(255, 255, 255, 0.15); } -.ace-cobalt .ace_keyword, -.ace-cobalt .ace_meta { - color: #FF9D00 +.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_constant, .ace-cobalt .ace_constant.ace_other { + color:#FF628C; +} + +.ace-cobalt .ace_constant.ace_character, { + color:#FF628C; +} + +.ace-cobalt .ace_constant.ace_character.ace_escape, { + color:#FF628C; } .ace-cobalt .ace_invalid { - color: #F8F8F8; - background-color: #800F00 + color:#F8F8F8; +background-color:#800F00; } .ace-cobalt .ace_support { - color: #80FFBB + color:#80FFBB; } .ace-cobalt .ace_support.ace_constant { - color: #EB939A + color:#EB939A; } .ace-cobalt .ace_fold { - background-color: #FF9D00; - border-color: #FFFFFF + background-color: #FF9D00; + border-color: #FFFFFF; } .ace-cobalt .ace_support.ace_function { - color: #FFB054 + color:#FFB054; } .ace-cobalt .ace_storage { - color: #FFEE80 -} - -.ace-cobalt .ace_entity { - color: #FFDD00 -} - -.ace-cobalt .ace_string { - color: #3AD900 + color:#FFEE80; } .ace-cobalt .ace_string.ace_regexp { - color: #80FFC2 + color:#80FFC2; } .ace-cobalt .ace_comment { - font-style: italic; - color: #0088FF -} - -.ace-cobalt .ace_heading, -.ace-cobalt .ace_markup.ace_heading { - color: #C8E4FD; - background-color: #001221 -} - -.ace-cobalt .ace_list, -.ace-cobalt .ace_markup.ace_list { - background-color: #130D26 + font-style:italic; +color:#0088FF; } .ace-cobalt .ace_variable { - color: #CCCCCC + color:#CCCCCC; } .ace-cobalt .ace_variable.ace_language { - color: #FF80E1 + color:#FF80E1; } .ace-cobalt .ace_meta.ace_tag { - color: #9EFFFF + 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,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHCLSvkPAAP3AgSDTRd4AAAAAElFTkSuQmCC) right repeat-y -} + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgUHL4zzBz5sz/AA80BCzv+WXhAAAAAElFTkSuQmCC) right repeat-y; +} \ No newline at end of file diff --git a/lib/ace/theme/cobalt.js b/lib/ace/theme/cobalt.js index a466dd6c..f88f10df 100644 --- a/lib/ace/theme/cobalt.js +++ b/lib/ace/theme/cobalt.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,8 +39,8 @@ define(function(require, exports, module) { exports.isDark = true; exports.cssClass = "ace-cobalt"; -exports.cssText = require("../requirejs/text!./cobalt.css"); +exports.cssText = require('ace/requirejs/text!./cobalt.css'); -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); + var dom = require("../lib/dom"); + dom.importCssString(exports.cssText, exports.cssClass); }); diff --git a/lib/ace/theme/crimson_editor.css b/lib/ace/theme/crimson_editor.css index e84292b4..433ed071 100644 --- a/lib/ace/theme/crimson_editor.css +++ b/lib/ace/theme/crimson_editor.css @@ -1,3 +1,11 @@ +.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; @@ -9,94 +17,98 @@ text-align: right; } -.ace-crimson-editor .ace_print-margin { +.ace-crimson-editor .ace_print_margin { width: 1px; background: #e8e8e8; } -.ace-crimson-editor { - background-color: #FFFFFF; +.ace-crimson-editor .ace_text-layer { color: rgb(64, 64, 64); } .ace-crimson-editor .ace_cursor { - color: black; + border-left: 2px solid black; } -.ace-crimson-editor .ace_invisible { +.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_identifier { +.ace-crimson-editor .ace_line .ace_identifier { color: black; } -.ace-crimson-editor .ace_keyword { +.ace-crimson-editor .ace_line .ace_keyword { color: blue; } -.ace-crimson-editor .ace_constant.ace_buildin { +.ace-crimson-editor .ace_line .ace_constant.ace_buildin { color: rgb(88, 72, 246); } -.ace-crimson-editor .ace_constant.ace_language { +.ace-crimson-editor .ace_line .ace_constant.ace_language { color: rgb(255, 156, 0); } -.ace-crimson-editor .ace_constant.ace_library { +.ace-crimson-editor .ace_line .ace_constant.ace_library { color: rgb(6, 150, 14); } -.ace-crimson-editor .ace_invalid { +.ace-crimson-editor .ace_line .ace_invalid { text-decoration: line-through; color: rgb(224, 0, 0); } -.ace-crimson-editor .ace_fold { +.ace-crimson-editor .ace_line .ace_fold { } -.ace-crimson-editor .ace_support.ace_function { +.ace-crimson-editor .ace_line .ace_support.ace_function { color: rgb(192, 0, 0); } -.ace-crimson-editor .ace_support.ace_constant { +.ace-crimson-editor .ace_line .ace_support.ace_constant { color: rgb(6, 150, 14); } -.ace-crimson-editor .ace_support.ace_type, -.ace-crimson-editor .ace_support.ace_class { +.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_keyword.ace_operator { +.ace-crimson-editor .ace_line .ace_keyword.ace_operator { color: rgb(49, 132, 149); } -.ace-crimson-editor .ace_string { +.ace-crimson-editor .ace_line .ace_string { color: rgb(128, 0, 128); } -.ace-crimson-editor .ace_comment { +.ace-crimson-editor .ace_line .ace_comment { color: rgb(76, 136, 107); } -.ace-crimson-editor .ace_comment.ace_doc { +.ace-crimson-editor .ace_line .ace_comment.ace_doc { color: rgb(0, 102, 255); } -.ace-crimson-editor .ace_comment.ace_doc.ace_tag { +.ace-crimson-editor .ace_line .ace_comment.ace_doc.ace_tag { color: rgb(128, 159, 191); } -.ace-crimson-editor .ace_constant.ace_numeric { +.ace-crimson-editor .ace_line .ace_constant.ace_numeric { color: rgb(0, 0, 64); } -.ace-crimson-editor .ace_variable { +.ace-crimson-editor .ace_line .ace_variable { color: rgb(0, 64, 128); } -.ace-crimson-editor .ace_xml-pe { +.ace-crimson-editor .ace_line .ace_xml_pe { color: rgb(104, 104, 91); } @@ -117,11 +129,11 @@ border: 1px solid rgb(192, 192, 192); } -.ace-crimson-editor .ace_marker-layer .ace_active-line { +.ace-crimson-editor .ace_marker-layer .ace_active_line { background: rgb(232, 242, 254); } -.ace-crimson-editor .ace_gutter-active-line { +.ace-crimson-editor .ace_gutter_active_line { background-color : #dcdcdc; } @@ -129,7 +141,7 @@ color:rgb(28, 2, 255); } -.ace-crimson-editor .ace_marker-layer .ace_selected-word { +.ace-crimson-editor .ace_marker-layer .ace_selected_word { background: rgb(250, 250, 255); border: 1px solid rgb(200, 200, 250); } diff --git a/lib/ace/theme/crimson_editor.js b/lib/ace/theme/crimson_editor.js index a5971075..fcee36a5 100644 --- a/lib/ace/theme/crimson_editor.js +++ b/lib/ace/theme/crimson_editor.js @@ -1,36 +1,43 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ define(function(require, exports, module) { exports.isDark = false; -exports.cssText = require("../requirejs/text!./crimson_editor.css"); +exports.cssText = require('ace/requirejs/text!./crimson_editor.css'); exports.cssClass = "ace-crimson-editor"; diff --git a/lib/ace/theme/dawn.css b/lib/ace/theme/dawn.css index 3c2884e1..d26edebf 100644 --- a/lib/ace/theme/dawn.css +++ b/lib/ace/theme/dawn.css @@ -1,126 +1,153 @@ + +.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 + color: #333; } -.ace-dawn .ace_print-margin { +.ace-dawn .ace_print_margin { width: 1px; - background: #e8e8e8 + background: #e8e8e8; } -.ace-dawn { +.ace-dawn .ace_scroller { background-color: #F9F9F9; - color: #080808 +} + +.ace-dawn .ace_text-layer { + color: #080808; } .ace-dawn .ace_cursor { - color: #000000 + 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) + background: rgba(39, 95, 255, 0.30); } -.ace-dawn.ace_multiselect .ace_selection.ace_start { +.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) + 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) + 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_marker-layer .ace_active_line { + background: rgba(36, 99, 180, 0.12); } -.ace-dawn .ace_gutter-active-line { - background-color : #dcdcdc +.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_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) + color: rgba(75, 75, 126, 0.50); } -.ace-dawn .ace_keyword, -.ace-dawn .ace_meta { - color: #794938 +.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_constant, .ace-dawn .ace_constant.ace_other { + color:#811F24; +} + +.ace-dawn .ace_constant.ace_character, { + color:#811F24; +} + +.ace-dawn .ace_constant.ace_character.ace_escape, { + color:#811F24; } .ace-dawn .ace_invalid.ace_illegal { - text-decoration: underline; - font-style: italic; - color: #F8F8F8; - background-color: #B52A1D + 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 + text-decoration:underline; +font-style:italic; +color:#B52A1D; } .ace-dawn .ace_support { - color: #691C97 + color:#691C97; } .ace-dawn .ace_support.ace_constant { - color: #B4371F + color:#B4371F; } .ace-dawn .ace_fold { - background-color: #794938; - border-color: #080808 + background-color: #794938; + border-color: #080808; } -.ace-dawn .ace_list, -.ace-dawn .ace_markup.ace_list, .ace-dawn .ace_support.ace_function { - color: #693A17 + color:#693A17; } .ace-dawn .ace_storage { - font-style: italic; - color: #A71D5D + font-style:italic; +color:#A71D5D; } .ace-dawn .ace_string { - color: #0B6125 + color:#0B6125; } .ace-dawn .ace_string.ace_regexp { - color: #CF5628 + color:#CF5628; } .ace-dawn .ace_comment { - font-style: italic; - color: #5A525F -} - -.ace-dawn .ace_heading, -.ace-dawn .ace_markup.ace_heading { - color: #19356D + font-style:italic; +color:#5A525F; } .ace-dawn .ace_variable { - color: #234A97 + color:#234A97; +} + +.ace-dawn .ace_markup.ace_underline { + text-decoration:underline; +} + +.ace-dawn .ace_markup.ace_heading { + color:#19356D; +} + +.ace-dawn .ace_markup.ace_list { + color:#693A17; } .ace-dawn .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYLh/5+x/AAizA4hxNNsZAAAAAElFTkSuQmCC) right repeat-y + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4+fPnf4ZVq1b9BwAkVQboFQv98gAAAABJRU5ErkJggg==) right repeat-y; } \ No newline at end of file diff --git a/lib/ace/theme/dawn.js b/lib/ace/theme/dawn.js index 2498aa3b..f8f3b181 100644 --- a/lib/ace/theme/dawn.js +++ b/lib/ace/theme/dawn.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,8 +39,8 @@ define(function(require, exports, module) { exports.isDark = false; exports.cssClass = "ace-dawn"; -exports.cssText = require("../requirejs/text!./dawn.css"); +exports.cssText = require('ace/requirejs/text!./dawn.css'); -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); + var dom = require("../lib/dom"); + dom.importCssString(exports.cssText, exports.cssClass); }); diff --git a/lib/ace/theme/dreamweaver.css b/lib/ace/theme/dreamweaver.css index 84865a1c..428b587a 100644 --- a/lib/ace/theme/dreamweaver.css +++ b/lib/ace/theme/dreamweaver.css @@ -1,98 +1,109 @@ +.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 { +.ace-dreamweaver .ace_print_margin { width: 1px; background: #e8e8e8; } -.ace-dreamweaver { - background-color: #FFFFFF; - color: black; -} - .ace-dreamweaver .ace_fold { background-color: #757AD8; } +.ace-dreamweaver .ace_text-layer { +} + .ace-dreamweaver .ace_cursor { - color: black; + border-left: 2px solid black; +} + +.ace-dreamweaver .ace_cursor.ace_overwrite { + border-left: 0px; + border-bottom: 1px solid black; } -.ace-dreamweaver .ace_invisible { +.ace-dreamweaver .ace_line .ace_invisible { color: rgb(191, 191, 191); } -.ace-dreamweaver .ace_storage, -.ace-dreamweaver .ace_keyword { +.ace-dreamweaver .ace_line .ace_storage, +.ace-dreamweaver .ace_line .ace_keyword { color: blue; } -.ace-dreamweaver .ace_constant.ace_buildin { +.ace-dreamweaver .ace_line .ace_constant.ace_buildin { color: rgb(88, 72, 246); } -.ace-dreamweaver .ace_constant.ace_language { +.ace-dreamweaver .ace_line .ace_constant.ace_language { color: rgb(88, 92, 246); } -.ace-dreamweaver .ace_constant.ace_library { +.ace-dreamweaver .ace_line .ace_constant.ace_library { color: rgb(6, 150, 14); } -.ace-dreamweaver .ace_invalid { +.ace-dreamweaver .ace_line .ace_invalid { background-color: rgb(153, 0, 0); color: white; } -.ace-dreamweaver .ace_support.ace_function { +.ace-dreamweaver .ace_line .ace_support.ace_function { color: rgb(60, 76, 114); } -.ace-dreamweaver .ace_support.ace_constant { +.ace-dreamweaver .ace_line .ace_support.ace_constant { color: rgb(6, 150, 14); } -.ace-dreamweaver .ace_support.ace_type, -.ace-dreamweaver .ace_support.ace_class { +.ace-dreamweaver .ace_line .ace_support.ace_type, +.ace-dreamweaver .ace_line .ace_support.ace_class { color: #009; } -.ace-dreamweaver .ace_support.ace_php_tag { +.ace-dreamweaver .ace_line .ace_support.ace_php_tag { color: #f00; } -.ace-dreamweaver .ace_keyword.ace_operator { +.ace-dreamweaver .ace_line .ace_keyword.ace_operator { color: rgb(104, 118, 135); } -.ace-dreamweaver .ace_string { +.ace-dreamweaver .ace_line .ace_string { color: #00F; } -.ace-dreamweaver .ace_comment { +.ace-dreamweaver .ace_line .ace_comment { color: rgb(76, 136, 107); } -.ace-dreamweaver .ace_comment.ace_doc { +.ace-dreamweaver .ace_line .ace_comment.ace_doc { color: rgb(0, 102, 255); } -.ace-dreamweaver .ace_comment.ace_doc.ace_tag { +.ace-dreamweaver .ace_line .ace_comment.ace_doc.ace_tag { color: rgb(128, 159, 191); } -.ace-dreamweaver .ace_constant.ace_numeric { +.ace-dreamweaver .ace_line .ace_constant.ace_numeric { color: rgb(0, 0, 205); } -.ace-dreamweaver .ace_variable { +.ace-dreamweaver .ace_line .ace_variable { color: #06F } -.ace-dreamweaver .ace_xml-pe { +.ace-dreamweaver .ace_line .ace_xml_pe { color: rgb(104, 104, 91); } @@ -100,12 +111,15 @@ color: #00F; } +.ace-dreamweaver .ace_markup.ace_markupine { + text-decoration:underline; +} -.ace-dreamweaver .ace_heading { +.ace-dreamweaver .ace_markup.ace_heading { color: rgb(12, 7, 255); } -.ace-dreamweaver .ace_list { +.ace-dreamweaver .ace_markup.ace_list { color:rgb(185, 6, 144); } @@ -126,15 +140,11 @@ border: 1px solid rgb(192, 192, 192); } -.ace-dreamweaver .ace_marker-layer .ace_active-line { +.ace-dreamweaver .ace_marker-layer .ace_active_line { background: rgba(0, 0, 0, 0.07); } -.ace-dreamweaver .ace_gutter-active-line { - background-color : #DCDCDC; -} - -.ace-dreamweaver .ace_marker-layer .ace_selected-word { +.ace-dreamweaver .ace_marker-layer .ace_selected_word { background: rgb(250, 250, 255); border: 1px solid rgb(200, 200, 250); } diff --git a/lib/ace/theme/dreamweaver.js b/lib/ace/theme/dreamweaver.js index 943dc692..73239ea6 100644 --- a/lib/ace/theme/dreamweaver.js +++ b/lib/ace/theme/dreamweaver.js @@ -1,37 +1,44 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Adam Jimenez + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ define(function(require, exports, module) { exports.isDark = false; exports.cssClass = "ace-dreamweaver"; -exports.cssText = require("../requirejs/text!./dreamweaver.css"); +exports.cssText = require('ace/requirejs/text!./dreamweaver.css'); var dom = require("../lib/dom"); dom.importCssString(exports.cssText, exports.cssClass); diff --git a/lib/ace/theme/eclipse.css b/lib/ace/theme/eclipse.css index c83d07a3..af613b34 100644 --- a/lib/ace/theme/eclipse.css +++ b/lib/ace/theme/eclipse.css @@ -1,74 +1,79 @@ +.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 { +.ace-eclipse .ace_print_margin { width: 1px; background: #ebebeb; } -.ace-eclipse { - background-color: #FFFFFF; - color: black; -} - .ace-eclipse .ace_fold { background-color: rgb(60, 76, 114); } -.ace-eclipse .ace_cursor { - color: black; +.ace-eclipse .ace_text-layer { } -.ace-eclipse .ace_storage, -.ace-eclipse .ace_keyword, -.ace-eclipse .ace_variable { +.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_constant.ace_buildin { +.ace-eclipse .ace_line .ace_constant.ace_buildin { color: rgb(88, 72, 246); } -.ace-eclipse .ace_constant.ace_library { +.ace-eclipse .ace_line .ace_constant.ace_library { color: rgb(6, 150, 14); } -.ace-eclipse .ace_function { +.ace-eclipse .ace_line .ace_function { color: rgb(60, 76, 114); } -.ace-eclipse .ace_string { +.ace-eclipse .ace_line .ace_string { color: rgb(42, 0, 255); } -.ace-eclipse .ace_comment { - color: rgb(113, 150, 130); +.ace-eclipse .ace_line .ace_comment { + color: rgb(63, 127, 95); } -.ace-eclipse .ace_comment.ace_doc { +.ace-eclipse .ace_line .ace_comment.ace_doc { color: rgb(63, 95, 191); } -.ace-eclipse .ace_comment.ace_doc.ace_tag { +.ace-eclipse .ace_line .ace_comment.ace_doc.ace_tag { color: rgb(127, 159, 191); } -.ace-eclipse .ace_constant.ace_numeric { - color: darkblue; +.ace-eclipse .ace_line .ace_constant.ace_numeric { } -.ace-eclipse .ace_tag { - color: rgb(25, 118, 116); +.ace-eclipse .ace_line .ace_tag { + color: rgb(63, 127, 127); } -.ace-eclipse .ace_type { +.ace-eclipse .ace_line .ace_type { color: rgb(127, 0, 127); } -.ace-eclipse .ace_xml-pe { +.ace-eclipse .ace_line .ace_xml_pe { color: rgb(104, 104, 91); } @@ -81,12 +86,8 @@ border: 1px solid rgb(192, 192, 192); } -.ace-eclipse .ace_meta.ace_tag { - color:rgb(25, 118, 116); -} - -.ace-eclipse .ace_invisible { - color: #ddd; +.ace-eclipse .ace_line .ace_meta.ace_tag { + color:rgb(63, 127, 127); } .ace-eclipse .ace_entity.ace_other.ace_attribute-name { @@ -96,15 +97,11 @@ background: rgb(255, 255, 0); } -.ace-eclipse .ace_active-line { +.ace-eclipse .ace_marker-layer .ace_active_line { background: rgb(232, 242, 254); } -.ace-eclipse .ace_gutter-active-line { - background-color : #DADADA; -} - -.ace-eclipse .ace_marker-layer .ace_selected-word { +.ace-eclipse .ace_marker-layer .ace_selected_word { border: 1px solid rgb(181, 213, 255); } diff --git a/lib/ace/theme/eclipse.js b/lib/ace/theme/eclipse.js index 329b8b79..25eaf27b 100644 --- a/lib/ace/theme/eclipse.js +++ b/lib/ace/theme/eclipse.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,7 +39,7 @@ define(function(require, exports, module) { "use strict"; exports.isDark = false; -exports.cssText = require("../requirejs/text!./eclipse.css"); +exports.cssText = require('ace/requirejs/text!./eclipse.css'); exports.cssClass = "ace-eclipse"; diff --git a/lib/ace/theme/github.css b/lib/ace/theme/github.css index 213d3fd3..ac4f29ac 100644 --- a/lib/ace/theme/github.css +++ b/lib/ace/theme/github.css @@ -1,13 +1,25 @@ /* 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-github .ace_scroller { background: #fff; - color: #000; } .ace-github .ace_keyword { @@ -56,7 +68,7 @@ font-weight: normal; } -.ace-github .ace_variable.ace_instance { +.ace-github .ace_variable.ace_instancce { color: teal; } @@ -64,28 +76,31 @@ font-weight: bold; } -.ace-github .ace_cursor { - color: black; +.ace-github .ace_text-layer { } -.ace-github.ace_focus .ace_marker-layer .ace_active-line { +.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_active-line { - background: rgb(245, 245, 245); -} - .ace-github .ace_marker-layer .ace_selection { background: rgb(181, 213, 255); } - -.ace-github.ace_multiselect .ace_selection.ace_start { +.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_nobold .ace_line > span { +.ace-github.ace_editor .ace_line > span { font-weight: normal !important; } @@ -102,20 +117,17 @@ border: 1px solid rgb(192, 192, 192); } -.ace-github .ace_gutter-active-line { +.ace-github .ace_gutter_active_line{ background-color : rgba(0, 0, 0, 0.07); } -.ace-github .ace_marker-layer .ace_selected-word { +.ace-github .ace_marker-layer .ace_selected_word { background: rgb(250, 250, 255); border: 1px solid rgb(200, 200, 250); + } -.ace-github .ace_invisible { - color: #BFBFBF -} - -.ace-github .ace_print-margin { +.ace-github .ace_print_margin { width: 1px; background: #e8e8e8; } diff --git a/lib/ace/theme/github.js b/lib/ace/theme/github.js index de013c8c..a655724e 100644 --- a/lib/ace/theme/github.js +++ b/lib/ace/theme/github.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,7 +39,7 @@ define(function(require, exports, module) { exports.isDark = false; exports.cssClass = "ace-github"; -exports.cssText = require("../requirejs/text!./github.css"); +exports.cssText = require('ace/requirejs/text!./github.css'); var dom = require("../lib/dom"); dom.importCssString(exports.cssText, exports.cssClass); diff --git a/lib/ace/theme/idle_fingers.css b/lib/ace/theme/idle_fingers.css index b5e1bff2..00e8a81e 100644 --- a/lib/ace/theme/idle_fingers.css +++ b/lib/ace/theme/idle_fingers.css @@ -1,112 +1,141 @@ + +.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: rgb(153,153,153) + color: #fff; } -.ace-idle-fingers .ace_print-margin { +.ace-idle-fingers .ace_print_margin { width: 1px; - background: #3b3b3b + background: #3b3b3b; } -.ace-idle-fingers { +.ace-idle-fingers .ace_scroller { background-color: #323232; - color: #FFFFFF +} + +.ace-idle-fingers .ace_text-layer { + color: #FFFFFF; } .ace-idle-fingers .ace_cursor { - color: #91FF00 + 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) + background: rgba(90, 100, 126, 0.88); } -.ace-idle-fingers.ace_multiselect .ace_selection.ace_start { +.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) + background: rgb(102, 82, 0); } .ace-idle-fingers .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; - border: 1px solid #404040 + border: 1px solid #404040; } -.ace-idle-fingers .ace_marker-layer .ace_active-line { - background: #353637 +.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_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_marker-layer .ace_selected_word { + border: 1px solid rgba(90, 100, 126, 0.88); } .ace-idle-fingers .ace_invisible { - color: #404040 + color: #404040; } -.ace-idle-fingers .ace_keyword, -.ace-idle-fingers .ace_meta { - color: #CC7833 +.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_constant, .ace-idle-fingers .ace_constant.ace_other { + color:#6C99BB; +} + +.ace-idle-fingers .ace_constant.ace_character, { + color:#6C99BB; +} + +.ace-idle-fingers .ace_constant.ace_character.ace_escape, { + color:#6C99BB; } .ace-idle-fingers .ace_invalid { - color: #FFFFFF; - background-color: #FF0000 + color:#FFFFFF; +background-color:#FF0000; +} + +.ace-idle-fingers .ace_support.ace_constant { + color:#6C99BB; } .ace-idle-fingers .ace_fold { - background-color: #CC7833; - border-color: #FFFFFF + background-color: #CC7833; + border-color: #FFFFFF; } .ace-idle-fingers .ace_support.ace_function { - color: #B83426 + color:#B83426; } .ace-idle-fingers .ace_variable.ace_parameter { - font-style: italic + font-style:italic; } .ace-idle-fingers .ace_string { - color: #A5C261 + color:#A5C261; } .ace-idle-fingers .ace_string.ace_regexp { - color: #CCCC33 + color:#CCCC33; } .ace-idle-fingers .ace_comment { - font-style: italic; - color: #BC9458 + font-style:italic; +color:#BC9458; } .ace-idle-fingers .ace_meta.ace_tag { - color: #FFE5BB + color:#FFE5BB; } .ace-idle-fingers .ace_entity.ace_name { - color: #FFC66D + color:#FFC66D; +} + +.ace-idle-fingers .ace_markup.ace_underline { + text-decoration:underline; } .ace-idle-fingers .ace_collab.ace_user1 { - color: #323232; - background-color: #FFF980 + color:#323232; + background-color:#FFF980; } .ace-idle-fingers .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMwMjLyZYiPj/8PAAreAwAI1+g0AAAAAElFTkSuQmCC) right repeat-y + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMwMjL6zzBz5sz/ABEUBGCqhK6UAAAAAElFTkSuQmCC) right repeat-y; } \ No newline at end of file diff --git a/lib/ace/theme/idle_fingers.js b/lib/ace/theme/idle_fingers.js index 096a2314..e8606835 100644 --- a/lib/ace/theme/idle_fingers.js +++ b/lib/ace/theme/idle_fingers.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,8 +39,8 @@ define(function(require, exports, module) { exports.isDark = true; exports.cssClass = "ace-idle-fingers"; -exports.cssText = require("../requirejs/text!./idle_fingers.css"); +exports.cssText = require('ace/requirejs/text!./idle_fingers.css'); -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); + var dom = require("../lib/dom"); + dom.importCssString(exports.cssText, exports.cssClass); }); diff --git a/lib/ace/theme/iplastic.css b/lib/ace/theme/iplastic.css deleted file mode 100644 index b07dc8f9..00000000 --- a/lib/ace/theme/iplastic.css +++ /dev/null @@ -1,140 +0,0 @@ -.ace-iplastic .ace_gutter { - background: #dddddd; - color: #666666 -} - -.ace-iplastic .ace_print-margin { - width: 1px; - background: #bbbbbb -} - -.ace-iplastic { - background-color: #eeeeee; - color: #333333 -} - -.ace-iplastic .ace_cursor { - color: #333 -} - -.ace-iplastic .ace_marker-layer .ace_selection { - background: #BAD6FD; -} - -.ace-iplastic.ace_multiselect .ace_selection.ace_start { - border-radius: 4px -} - -.ace-iplastic .ace_marker-layer .ace_step { - background: #444444 -} - -.ace-iplastic .ace_marker-layer .ace_bracket { - margin: -1px 0 0 -1px; - border: 1px solid #49483E; - background: #FFF799 -} - -.ace-iplastic .ace_marker-layer .ace_active-line { - background: #e5e5e5 -} - -.ace-iplastic .ace_gutter-active-line { - background-color: #eeeeee -} - -.ace-iplastic .ace_marker-layer .ace_selected-word { - border: 1px solid #555555; - border-radius:4px -} - -.ace-iplastic .ace_invisible { - color: #999999 -} - -.ace-iplastic .ace_entity.ace_name.ace_tag, -.ace-iplastic .ace_keyword, -.ace-iplastic .ace_meta.ace_tag, -.ace-iplastic .ace_storage { - color: #0000FF -} - -.ace-iplastic .ace_punctuation, -.ace-iplastic .ace_punctuation.ace_tag { - color: #000 -} - -.ace-iplastic .ace_constant { - color: #333333; - font-weight: 700 -} - -.ace-iplastic .ace_constant.ace_character, -.ace-iplastic .ace_constant.ace_language, -.ace-iplastic .ace_constant.ace_numeric, -.ace-iplastic .ace_constant.ace_other { - color: #0066FF; - font-weight: 700 -} - -.ace-iplastic .ace_constant.ace_numeric{ - font-weight: 100 -} - -.ace-iplastic .ace_invalid { - color: #F8F8F0; - background-color: #F92672 -} - -.ace-iplastic .ace_invalid.ace_deprecated { - color: #F8F8F0; - background-color: #AE81FF -} - -.ace-iplastic .ace_support.ace_constant, -.ace-iplastic .ace_support.ace_function { - color: #333333; - font-weight: 700 -} - -.ace-iplastic .ace_fold { - background-color: #464646; - border-color: #F8F8F2 -} - -.ace-iplastic .ace_storage.ace_type, -.ace-iplastic .ace_support.ace_class, -.ace-iplastic .ace_support.ace_type { - color: #3333fc; - font-weight: 700 -} - -.ace-iplastic .ace_entity.ace_name.ace_function, -.ace-iplastic .ace_entity.ace_other, -.ace-iplastic .ace_entity.ace_other.ace_attribute-name, -.ace-iplastic .ace_variable { - color: #3366cc; - font-style: italic -} - -.ace-iplastic .ace_variable.ace_parameter { - font-style: italic; - color: #2469E0 -} - -.ace-iplastic .ace_string { - color: #a55f03 -} - -.ace-iplastic .ace_comment { - color: #777777; - font-style: italic -} - -.ace-iplastic .ace_fold-widget { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==); -} - -.ace-iplastic .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAABlJREFUeNpi+P//PwMzMzPzfwAAAAD//wMAGRsECSML/RIAAAAASUVORK5CYII=) right repeat-y -} \ No newline at end of file diff --git a/lib/ace/theme/iplastic.js b/lib/ace/theme/iplastic.js deleted file mode 100644 index ff784196..00000000 --- a/lib/ace/theme/iplastic.js +++ /dev/null @@ -1,40 +0,0 @@ - -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.isDark = false; -exports.cssClass = "ace-iplastic"; -exports.cssText = require("../requirejs/text!./iplastic.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/ace/theme/katzenmilch.css b/lib/ace/theme/katzenmilch.css deleted file mode 100644 index bf1569fb..00000000 --- a/lib/ace/theme/katzenmilch.css +++ /dev/null @@ -1,143 +0,0 @@ -.ace-katzenmilch .ace_gutter, -/* THIS THEME WAS AUTOGENERATED BY Theme.tmpl.css (UUID: ) */ - -.ace-katzenmilch .ace_gutter { - background: #e8e8e8; - color: #333 -} - -.ace-katzenmilch .ace_print-margin { - width: 1px; - background: #e8e8e8 -} - -.ace-katzenmilch { - background-color: #f3f2f3; - color: rgba(15, 0, 9, 1.0) -} - -.ace-katzenmilch .ace_cursor { - border-left: 2px solid #100011 -} - -.ace-katzenmilch .ace_overwrite-cursors .ace_cursor { - border-left: 0px; - border-bottom: 1px solid #100011 -} - -.ace-katzenmilch .ace_marker-layer .ace_selection { - background: rgba(100, 5, 208, 0.27) -} - -.ace-katzenmilch.ace_multiselect .ace_selection.ace_start { - box-shadow: 0 0 3px 0px #f3f2f3; -} - -.ace-katzenmilch .ace_marker-layer .ace_step { - background: rgb(198, 219, 174) -} - -.ace-katzenmilch .ace_marker-layer .ace_bracket { - margin: -1px 0 0 -1px; - border: 1px solid #000000 -} - -.ace-katzenmilch .ace_marker-layer .ace_active-line { - background: rgb(232, 242, 254) -} - -.ace-katzenmilch .ace_gutter-active-line { - background-color: rgb(232, 242, 254) -} - -.ace-katzenmilch .ace_marker-layer .ace_selected-word { - border: 1px solid rgba(100, 5, 208, 0.27) -} - -.ace-katzenmilch .ace_invisible { - color: #BFBFBF -} - -.ace-katzenmilch .ace_fold { - background-color: rgba(2, 95, 73, 0.97); - border-color: rgba(15, 0, 9, 1.0) -} - -.ace-katzenmilch .ace_keyword { - color: #674Aa8; - rbackground-color: rgba(163, 170, 216, 0.055) -} - -.ace-katzenmilch .ace_constant.ace_language { - color: #7D7e52; - rbackground-color: rgba(189, 190, 130, 0.059) -} - -.ace-katzenmilch .ace_constant.ace_numeric { - color: rgba(79, 130, 123, 0.93); - rbackground-color: rgba(119, 194, 187, 0.059) -} - -.ace-katzenmilch .ace_constant.ace_character, -.ace-katzenmilch .ace_constant.ace_other { - color: rgba(2, 95, 105, 1.0); - rbackground-color: rgba(127, 34, 153, 0.063) -} - -.ace-katzenmilch .ace_support.ace_function { - color: #9D7e62; - rbackground-color: rgba(189, 190, 130, 0.039) -} - -.ace-katzenmilch .ace_support.ace_class { - color: rgba(239, 106, 167, 1.0); - rbackground-color: rgba(239, 106, 167, 0.063) -} - -.ace-katzenmilch .ace_storage { - color: rgba(123, 92, 191, 1.0); - rbackground-color: rgba(139, 93, 223, 0.051) -} - -.ace-katzenmilch .ace_invalid { - color: #DFDFD5; - rbackground-color: #CC1B27 -} - -.ace-katzenmilch .ace_string { - color: #5a5f9b; - rbackground-color: rgba(170, 175, 219, 0.035) -} - -.ace-katzenmilch .ace_comment { - font-style: italic; - color: rgba(64, 79, 80, 0.67); - rbackground-color: rgba(95, 15, 255, 0.0078) -} - -.ace-katzenmilch .ace_entity.ace_name.ace_function, -.ace-katzenmilch .ace_variable { - color: rgba(2, 95, 73, 0.97); - rbackground-color: rgba(34, 255, 73, 0.12) -} - -.ace-katzenmilch .ace_variable.ace_language { - color: #316fcf; - rbackground-color: rgba(58, 175, 255, 0.039) -} - -.ace-katzenmilch .ace_variable.ace_parameter { - font-style: italic; - color: rgba(51, 150, 159, 0.87); - rbackground-color: rgba(5, 214, 249, 0.043) -} - -.ace-katzenmilch .ace_entity.ace_other.ace_attribute-name { - color: rgba(73, 70, 194, 0.93); - rbackground-color: rgba(73, 134, 194, 0.035) -} - -.ace-katzenmilch .ace_entity.ace_name.ace_tag { - color: #3976a2; - rbackground-color: rgba(73, 166, 210, 0.039) -} \ No newline at end of file diff --git a/lib/ace/theme/katzenmilch.js b/lib/ace/theme/katzenmilch.js deleted file mode 100644 index 4787483d..00000000 --- a/lib/ace/theme/katzenmilch.js +++ /dev/null @@ -1,39 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.isDark = false; -exports.cssClass = "ace-katzenmilch"; -exports.cssText = require("../requirejs/text!./katzenmilch.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/ace/theme/kr_theme.css b/lib/ace/theme/kr_theme.css index e232de47..ede07375 100644 --- a/lib/ace/theme/kr_theme.css +++ b/lib/ace/theme/kr_theme.css @@ -1,123 +1,144 @@ + +.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 + color: #FCFFE0; } -.ace-kr-theme .ace_print-margin { +.ace-kr-theme .ace_print_margin { width: 1px; - background: #1c1917 + background: #1c1917; } -.ace-kr-theme { +.ace-kr-theme .ace_scroller { background-color: #0B0A09; - color: #FCFFE0 +} + +.ace-kr-theme .ace_text-layer { + color: #FCFFE0; } .ace-kr-theme .ace_cursor { - color: #FF9900 + 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) + background: rgba(170, 0, 255, 0.45); } -.ace-kr-theme.ace_multiselect .ace_selection.ace_start { +.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) + 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) + border: 1px solid rgba(255, 177, 111, 0.32); } -.ace-kr-theme .ace_marker-layer .ace_active-line { - background: #38403D +.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_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_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) + color: rgba(255, 177, 111, 0.32); } -.ace-kr-theme .ace_keyword, -.ace-kr-theme .ace_meta { - color: #949C8B +.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_constant, .ace-kr-theme .ace_constant.ace_other { + color:rgba(210, 117, 24, 0.76); +} + +.ace-kr-theme .ace_constant.ace_character, { + color:rgba(210, 117, 24, 0.76); +} + +.ace-kr-theme .ace_constant.ace_character.ace_escape, { + color:rgba(210, 117, 24, 0.76); } .ace-kr-theme .ace_invalid { - color: #F8F8F8; - background-color: #A41300 + color:#F8F8F8; +background-color:#A41300; } .ace-kr-theme .ace_support { - color: #9FC28A + color:#9FC28A; } .ace-kr-theme .ace_support.ace_constant { - color: #C27E66 + color:#C27E66; } .ace-kr-theme .ace_fold { - background-color: #949C8B; - border-color: #FCFFE0 + background-color: #949C8B; + border-color: #FCFFE0; } .ace-kr-theme .ace_support.ace_function { - color: #85873A + color:#85873A; } .ace-kr-theme .ace_storage { - color: #FFEE80 -} - -.ace-kr-theme .ace_string { - color: rgba(164, 161, 181, 0.8) + color:#FFEE80; } .ace-kr-theme .ace_string.ace_regexp { - color: rgba(125, 255, 192, 0.65) + color:rgba(125, 255, 192, 0.65); } .ace-kr-theme .ace_comment { - font-style: italic; - color: #706D5B + font-style:italic; +color:#706D5B; } .ace-kr-theme .ace_variable { - color: #D1A796 -} - -.ace-kr-theme .ace_list, -.ace-kr-theme .ace_markup.ace_list { - background-color: #0F0040 + color:#D1A796; } .ace-kr-theme .ace_variable.ace_language { - color: #FF80E1 + color:#FF80E1; } .ace-kr-theme .ace_meta.ace_tag { - color: #BABD9C + 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,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYFBXV/8PAAJoAXX4kT2EAAAAAElFTkSuQmCC) right repeat-y + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPg5uL8zzBz5sz/AA1WA+hUYIqjAAAAAElFTkSuQmCC) right repeat-y; } \ No newline at end of file diff --git a/lib/ace/theme/kr_theme.js b/lib/ace/theme/kr_theme.js index fb6a5abe..2c3d6672 100644 --- a/lib/ace/theme/kr_theme.js +++ b/lib/ace/theme/kr_theme.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,8 +39,8 @@ define(function(require, exports, module) { exports.isDark = true; exports.cssClass = "ace-kr-theme"; -exports.cssText = require("../requirejs/text!./kr_theme.css"); +exports.cssText = require('ace/requirejs/text!./kr_theme.css'); -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); + var dom = require("../lib/dom"); + dom.importCssString(exports.cssText, exports.cssClass); }); diff --git a/lib/ace/theme/kuroir.css b/lib/ace/theme/kuroir.css deleted file mode 100644 index 5e987abc..00000000 --- a/lib/ace/theme/kuroir.css +++ /dev/null @@ -1,71 +0,0 @@ -/* THIS THEME WAS AUTOGENERATED BY Theme.tmpl.css (UUID: 467560D0-6ACE-4409-82FD-4791420837AC) */ - -.ace-kuroir .ace_gutter { - background: #e8e8e8; - color: #333; -} - -.ace-kuroir .ace_print-margin { - width: 1px; - background: #e8e8e8; -} - -.ace-kuroir { - background-color: #E8E9E8; - color: #363636; -} - -.ace-kuroir .ace_cursor { - color: #202020; -} - -.ace-kuroir .ace_marker-layer .ace_selection { - background: rgba(245, 170, 0, 0.57); -} - -.ace-kuroir.ace_multiselect .ace_selection.ace_start { - box-shadow: 0 0 3px 0px #E8E9E8; - border-radius: 2px; -} - -.ace-kuroir .ace_marker-layer .ace_step { - background: rgb(198, 219, 174); -} - -.ace-kuroir .ace_marker-layer .ace_bracket { - margin: -1px 0 0 -1px; - border: 1px solid rgba(0, 0, 0, 0.29); -} - -.ace-kuroir .ace_marker-layer .ace_active-line { - background: rgba(203, 220, 47, 0.22); -} - -.ace-kuroir .ace_gutter-active-line { - background-color: rgba(203, 220, 47, 0.22); -} - -.ace-kuroir .ace_marker-layer .ace_selected-word { - border: 1px solid rgba(245, 170, 0, 0.57); -} - -.ace-kuroir .ace_invisible { - color: #BFBFBF -} - -.ace-kuroir .ace_fold { - border-color: #363636; -} - - - - - -.ace-kuroir .ace_constant{color:#CD6839;}.ace-kuroir .ace_constant.ace_numeric{color:#9A5925;}.ace-kuroir .ace_support{color:#104E8B;}.ace-kuroir .ace_support.ace_function{color:#005273;}.ace-kuroir .ace_support.ace_constant{color:#CF6A4C;}.ace-kuroir .ace_storage{color:#A52A2A;}.ace-kuroir .ace_invalid.ace_illegal{color:#FD1224; -background-color:rgba(255, 6, 0, 0.15);}.ace-kuroir .ace_invalid.ace_deprecated{text-decoration:underline; -font-style:italic; -color:#FD1732; -background-color:#E8E9E8;}.ace-kuroir .ace_string{color:#639300;}.ace-kuroir .ace_string.ace_regexp{color:#417E00; -background-color:#C9D4BE;}.ace-kuroir .ace_comment{color:rgba(148, 148, 148, 0.91); -background-color:rgba(220, 220, 220, 0.56);}.ace-kuroir .ace_variable{color:#009ACD;}.ace-kuroir .ace_meta.ace_tag{color:#005273;}.ace-kuroir .ace_markup.ace_heading{color:#B8012D; -background-color:rgba(191, 97, 51, 0.051);}.ace-kuroir .ace_markup.ace_list{color:#8F5B26;} diff --git a/lib/ace/theme/kuroir.js b/lib/ace/theme/kuroir.js deleted file mode 100644 index cef6a50b..00000000 --- a/lib/ace/theme/kuroir.js +++ /dev/null @@ -1,39 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.isDark = false; -exports.cssClass = "ace-kuroir"; -exports.cssText = require("../requirejs/text!./kuroir.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/ace/theme/merbivore.css b/lib/ace/theme/merbivore.css index 9be25c66..9b110778 100644 --- a/lib/ace/theme/merbivore.css +++ b/lib/ace/theme/merbivore.css @@ -1,109 +1,144 @@ + +.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 + color: #E6E1DC; } -.ace-merbivore .ace_print-margin { +.ace-merbivore .ace_print_margin { width: 1px; - background: #555651 + background: #555651; } -.ace-merbivore { +.ace-merbivore .ace_scroller { background-color: #161616; - color: #E6E1DC +} + +.ace-merbivore .ace_text-layer { + color: #E6E1DC; } .ace-merbivore .ace_cursor { - color: #FFFFFF + 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 + background: #454545; } -.ace-merbivore.ace_multiselect .ace_selection.ace_start { +.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) + background: rgb(102, 82, 0); } .ace-merbivore .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; - border: 1px solid #404040 + border: 1px solid #404040; } -.ace-merbivore .ace_marker-layer .ace_active-line { - background: #333435 +.ace-merbivore .ace_marker-layer .ace_active_line { + background: #333435; } -.ace-merbivore .ace_gutter-active-line { - background-color: #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_marker-layer .ace_selected_word { + border: 1px solid #454545; } .ace-merbivore .ace_invisible { - color: #404040 + 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_keyword, .ace-merbivore .ace_meta { + 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-merbivore .ace_constant.ace_other { + color:#1EDAFB; } -.ace-merbivore .ace_constant.ace_character.ace_escape { - color: #519F50 +.ace-merbivore .ace_constant.ace_character, { + color:#1EDAFB; +} + +.ace-merbivore .ace_constant.ace_character.ace_escape, { + color:#1EDAFB; } .ace-merbivore .ace_constant.ace_language { - color: #FDC251 + 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_library { + color:#8DFF0A; } .ace-merbivore .ace_constant.ace_numeric { - color: #58C554 + color:#58C554; } .ace-merbivore .ace_invalid { - color: #FFFFFF; - background-color: #990000 + color:#FFFFFF; +background-color:#990000; +} + +.ace-merbivore .ace_support.ace_constant { + color:#8DFF0A; } .ace-merbivore .ace_fold { - background-color: #FC6F09; - border-color: #E6E1DC + background-color: #FC6F09; + border-color: #E6E1DC; +} + +.ace-merbivore .ace_support.ace_function { + color:#FC6F09; +} + +.ace-merbivore .ace_storage { + color:#FC6F09; +} + +.ace-merbivore .ace_string { + color:#8DFF0A; } .ace-merbivore .ace_comment { - font-style: italic; - color: #AD2EA4 + font-style:italic; +color:#AD2EA4; +} + +.ace-merbivore .ace_meta.ace_tag { + color:#FC6F09; } .ace-merbivore .ace_entity.ace_other.ace_attribute-name { - color: #FFFF89 + color:#FFFF89; +} + +.ace-merbivore .ace_markup.ace_underline { + text-decoration:underline; } .ace-merbivore .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMQFxf3ZXB1df0PAAdsAmERTkEHAAAAAElFTkSuQmCC) right repeat-y + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMQExP7zzBz5sz/AA50BAyDznYhAAAAAElFTkSuQmCC) right repeat-y; } \ No newline at end of file diff --git a/lib/ace/theme/merbivore.js b/lib/ace/theme/merbivore.js index 9b29db1c..6757f2c3 100644 --- a/lib/ace/theme/merbivore.js +++ b/lib/ace/theme/merbivore.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,8 +39,8 @@ define(function(require, exports, module) { exports.isDark = true; exports.cssClass = "ace-merbivore"; -exports.cssText = require("../requirejs/text!./merbivore.css"); +exports.cssText = require('ace/requirejs/text!./merbivore.css'); -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); + var dom = require("../lib/dom"); + dom.importCssString(exports.cssText, exports.cssClass); }); diff --git a/lib/ace/theme/merbivore_soft.css b/lib/ace/theme/merbivore_soft.css index 0d615376..55e401b1 100644 --- a/lib/ace/theme/merbivore_soft.css +++ b/lib/ace/theme/merbivore_soft.css @@ -1,110 +1,150 @@ + +.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 + color: #E6E1DC; } -.ace-merbivore-soft .ace_print-margin { +.ace-merbivore-soft .ace_print_margin { width: 1px; - background: #262424 + background: #262424; } -.ace-merbivore-soft { +.ace-merbivore-soft .ace_scroller { background-color: #1C1C1C; - color: #E6E1DC +} + +.ace-merbivore-soft .ace_text-layer { + color: #E6E1DC; } .ace-merbivore-soft .ace_cursor { - color: #FFFFFF + 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 + background: #494949; } -.ace-merbivore-soft.ace_multiselect .ace_selection.ace_start { +.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) + background: rgb(102, 82, 0); } .ace-merbivore-soft .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; - border: 1px solid #404040 + border: 1px solid #404040; } -.ace-merbivore-soft .ace_marker-layer .ace_active-line { - background: #333435 +.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_gutter_active_line { + background-color: #333435; } -.ace-merbivore-soft .ace_marker-layer .ace_selected-word { - border: 1px solid #494949 +.ace-merbivore-soft .ace_marker-layer .ace_selected_word { + border: 1px solid #494949; } .ace-merbivore-soft .ace_invisible { - color: #404040 + 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_keyword, .ace-merbivore-soft .ace_meta { + 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-merbivore-soft .ace_constant.ace_other { + color:#68C1D8; } -.ace-merbivore-soft .ace_constant.ace_character.ace_escape { - color: #B3E5B4 +.ace-merbivore-soft .ace_constant.ace_character, { + color:#68C1D8; +} + +.ace-merbivore-soft .ace_constant.ace_character.ace_escape, { + color:#68C1D8; } .ace-merbivore-soft .ace_constant.ace_language { - color: #E1C582 + 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_library { + color:#8EC65F; } .ace-merbivore-soft .ace_constant.ace_numeric { - color: #7FC578 + color:#7FC578; +} + +.ace-merbivore-soft .ace_invalid { + color:#FFFFFF; +background-color:#FE3838; } -.ace-merbivore-soft .ace_invalid, .ace-merbivore-soft .ace_invalid.ace_deprecated { - color: #FFFFFF; - background-color: #FE3838 + color:#FFFFFF; +background-color:#FE3838; +} + +.ace-merbivore-soft .ace_support.ace_constant { + color:#8EC65F; } .ace-merbivore-soft .ace_fold { - background-color: #FC803A; - border-color: #E6E1DC + background-color: #FC803A; + border-color: #E6E1DC; +} + +.ace-merbivore-soft .ace_storage { + color:#FC803A; +} + +.ace-merbivore-soft .ace_string { + color:#8EC65F; +} + +.ace-merbivore-soft .ace_comment { + font-style:italic; +color:#AC4BB8; } -.ace-merbivore-soft .ace_comment, .ace-merbivore-soft .ace_meta { - font-style: italic; - color: #AC4BB8 + font-style:italic; +color:#AC4BB8; +} + +.ace-merbivore-soft .ace_meta.ace_tag { + color:#FC803A; } .ace-merbivore-soft .ace_entity.ace_other.ace_attribute-name { - color: #EAF1A3 + color:#EAF1A3; +} + +.ace-merbivore-soft .ace_markup.ace_underline { + text-decoration:underline; } .ace-merbivore-soft .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWOQkpLyZfD09PwPAAfYAnaStpHRAAAAAElFTkSuQmCC) right repeat-y + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWOQkZH5zzBz5sz/AA8EBB6crd1rAAAAAElFTkSuQmCC) right repeat-y; } \ No newline at end of file diff --git a/lib/ace/theme/merbivore_soft.js b/lib/ace/theme/merbivore_soft.js index c0ffd910..2e7f6029 100644 --- a/lib/ace/theme/merbivore_soft.js +++ b/lib/ace/theme/merbivore_soft.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,8 +39,8 @@ define(function(require, exports, module) { exports.isDark = true; exports.cssClass = "ace-merbivore-soft"; -exports.cssText = require("../requirejs/text!./merbivore_soft.css"); +exports.cssText = require('ace/requirejs/text!./merbivore_soft.css'); -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); + var dom = require("../lib/dom"); + dom.importCssString(exports.cssText, exports.cssClass); }); diff --git a/lib/ace/theme/mono_industrial.css b/lib/ace/theme/mono_industrial.css index 6630e4a2..5d282e83 100644 --- a/lib/ace/theme/mono_industrial.css +++ b/lib/ace/theme/mono_industrial.css @@ -1,125 +1,152 @@ + +.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 + color: #C5C9C9; } -.ace-mono-industrial .ace_print-margin { +.ace-mono-industrial .ace_print_margin { width: 1px; - background: #555651 + background: #555651; } -.ace-mono-industrial { +.ace-mono-industrial .ace_scroller { background-color: #222C28; - color: #FFFFFF +} + +.ace-mono-industrial .ace_text-layer { + color: #FFFFFF; } .ace-mono-industrial .ace_cursor { - color: #FFFFFF + 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) + background: rgba(145, 153, 148, 0.40); } -.ace-mono-industrial.ace_multiselect .ace_selection.ace_start { +.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) + 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) + 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_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_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_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) + color: rgba(102, 108, 104, 0.50); } -.ace-mono-industrial .ace_string { - background-color: #151C19; - color: #FFFFFF +.ace-mono-industrial .ace_keyword, .ace-mono-industrial .ace_meta { + color:#A39E64; } -.ace-mono-industrial .ace_keyword, -.ace-mono-industrial .ace_meta { - color: #A39E64 +.ace-mono-industrial .ace_keyword.ace_operator { + color:#A8B3AB; } -.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_constant, .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_constant.ace_character, { + color:#E98800; +} + +.ace-mono-industrial .ace_constant.ace_character.ace_escape, { + color:#E98800; +} + +.ace-mono-industrial .ace_constant.ace_numeric { + color:#E98800; } .ace-mono-industrial .ace_invalid { - color: #FFFFFF; - background-color: rgba(153, 0, 0, 0.68) + color:#FFFFFF; +background-color:rgba(153, 0, 0, 0.68); } .ace-mono-industrial .ace_support.ace_constant { - color: #C87500 + color:#C87500; } .ace-mono-industrial .ace_fold { - background-color: #A8B3AB; - border-color: #FFFFFF + 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 + color:#588E60; } .ace-mono-industrial .ace_storage { - color: #C23B00 + color:#C23B00; +} + +.ace-mono-industrial .ace_variable { + color:#A8B3AB; } -.ace-mono-industrial .ace_variable.ace_language, .ace-mono-industrial .ace_variable.ace_parameter { - color: #648BD2 + color:#648BD2; } .ace-mono-industrial .ace_comment { - color: #666C68; - background-color: #151C19 + color:#666C68; +background-color:#151C19; +} + +.ace-mono-industrial .ace_variable.ace_language { + color:#648BD2; } .ace-mono-industrial .ace_entity.ace_other.ace_attribute-name { - color: #909993 + color:#909993; } -.ace-mono-industrial .ace_entity.ace_name.ace_tag { - color: #A65EFF +.ace-mono-industrial .ace_entity.ace_name { + color:#5778B6; +} + +.ace-mono-industrial .ace_entity.ace_name.ace_function { + color:#A8B3AB; +} + +.ace-mono-industrial .ace_markup.ace_underline { + text-decoration:underline; } .ace-mono-industrial .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNQ1NbwZfALD/4PAAlTArlEC4r/AAAAAElFTkSuQmCC) right repeat-y + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNQ0tH4zzBz5sz/ABAOBECKH+evAAAAAElFTkSuQmCC) right repeat-y; } \ No newline at end of file diff --git a/lib/ace/theme/mono_industrial.js b/lib/ace/theme/mono_industrial.js index cf0d0e48..d967b2e4 100644 --- a/lib/ace/theme/mono_industrial.js +++ b/lib/ace/theme/mono_industrial.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,8 +39,8 @@ define(function(require, exports, module) { exports.isDark = true; exports.cssClass = "ace-mono-industrial"; -exports.cssText = require("../requirejs/text!./mono_industrial.css"); +exports.cssText = require('ace/requirejs/text!./mono_industrial.css'); -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); + var dom = require("../lib/dom"); + dom.importCssString(exports.cssText, exports.cssClass); }); diff --git a/lib/ace/theme/monokai.css b/lib/ace/theme/monokai.css index bcc26ef4..02d4fa9d 100644 --- a/lib/ace/theme/monokai.css +++ b/lib/ace/theme/monokai.css @@ -1,121 +1,149 @@ + +.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: #8F908A + background: #2f3129; + color: #f1f1f1; } -.ace-monokai .ace_print-margin { +.ace-monokai .ace_print_margin { width: 1px; - background: #555651 + background: #555651; } -.ace-monokai { +.ace-monokai .ace_scroller { background-color: #272822; - color: #F8F8F2 +} + +.ace-monokai .ace_text-layer { + color: #F8F8F2; } .ace-monokai .ace_cursor { - color: #F8F8F0 + 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 + background: #49483E; } -.ace-monokai.ace_multiselect .ace_selection.ace_start { +.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) + background: rgb(102, 82, 0); } .ace-monokai .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; - border: 1px solid #49483E + border: 1px solid #49483E; } -.ace-monokai .ace_marker-layer .ace_active-line { - background: #202020 +.ace-monokai .ace_marker-layer .ace_active_line { + background: #49483E; +} +.ace-monokai .ace_gutter_active_line { + background-color: #191916; } -.ace-monokai .ace_gutter-active-line { - background-color: #272727 -} - -.ace-monokai .ace_marker-layer .ace_selected-word { - border: 1px solid #49483E +.ace-monokai .ace_marker-layer .ace_selected_word { + border: 1px solid #49483E; } .ace-monokai .ace_invisible { - color: #52524d + color: #49483E; } -.ace-monokai .ace_entity.ace_name.ace_tag, -.ace-monokai .ace_keyword, -.ace-monokai .ace_meta.ace_tag, -.ace-monokai .ace_storage { - color: #F92672 +.ace-monokai .ace_keyword, .ace-monokai .ace_meta { + color:#F92672; } -.ace-monokai .ace_punctuation, -.ace-monokai .ace_punctuation.ace_tag { - color: #fff +.ace-monokai .ace_constant.ace_language { + color:#AE81FF; +} + +.ace-monokai .ace_constant.ace_numeric { + color:#AE81FF; } -.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 + color:#AE81FF; } .ace-monokai .ace_invalid { - color: #F8F8F0; - background-color: #F92672 + color:#F8F8F0; +background-color:#F92672; } .ace-monokai .ace_invalid.ace_deprecated { - color: #F8F8F0; - background-color: #AE81FF + color:#F8F8F0; +background-color:#AE81FF; } -.ace-monokai .ace_support.ace_constant, -.ace-monokai .ace_support.ace_function { - color: #66D9EF +.ace-monokai .ace_support.ace_constant { + color:#66D9EF; } .ace-monokai .ace_fold { - background-color: #A6E22E; - border-color: #F8F8F2 + 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_support.ace_function { + color:#66D9EF; +} + +.ace-monokai .ace_storage { + color:#F92672; +} + +.ace-monokai .ace_storage.ace_type, .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-monokai .ace_entity.ace_other.ace_attribute-name, .ace-monokai .ace_variable { - color: #A6E22E + color:#A6E22E; } .ace-monokai .ace_variable.ace_parameter { - font-style: italic; - color: #FD971F + font-style:italic; +color:#FD971F; } .ace-monokai .ace_string { - color: #E6DB74 + color:#E6DB74; } .ace-monokai .ace_comment { - color: #75715E + color:#75715E; +} + +.ace-monokai .ace_entity.ace_other.ace_attribute-name { + color:#A6E22E; +} + +.ace-monokai .ace_entity.ace_name.ace_function { + color:#A6E22E; +} + +.ace-monokai .ace_markup.ace_underline { + text-decoration:underline; } .ace-monokai .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0FD0ZXBzd/wPAAjVAoxeSgNeAAAAAElFTkSuQmCC) right repeat-y + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNQ11D6z7Bq1ar/ABCKBG6g04U2AAAAAElFTkSuQmCC) right repeat-y; } \ No newline at end of file diff --git a/lib/ace/theme/monokai.js b/lib/ace/theme/monokai.js index 87d07786..4b906248 100644 --- a/lib/ace/theme/monokai.js +++ b/lib/ace/theme/monokai.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,8 +39,8 @@ define(function(require, exports, module) { exports.isDark = true; exports.cssClass = "ace-monokai"; -exports.cssText = require("../requirejs/text!./monokai.css"); +exports.cssText = require('ace/requirejs/text!./monokai.css'); -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); + var dom = require("../lib/dom"); + dom.importCssString(exports.cssText, exports.cssClass); }); diff --git a/lib/ace/theme/pastel_on_dark.css b/lib/ace/theme/pastel_on_dark.css index 0b637174..104d5168 100644 --- a/lib/ace/theme/pastel_on_dark.css +++ b/lib/ace/theme/pastel_on_dark.css @@ -1,128 +1,154 @@ + +.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 + color: #8F938F; } -.ace-pastel-on-dark .ace_print-margin { +.ace-pastel-on-dark .ace_print_margin { width: 1px; - background: #353030 + background: #353030; } -.ace-pastel-on-dark { +.ace-pastel-on-dark .ace_scroller { background-color: #2C2828; - color: #8F938F +} + +.ace-pastel-on-dark .ace_text-layer { + color: #8F938F; } .ace-pastel-on-dark .ace_cursor { - color: #A7A7A7 + 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) + background: rgba(221, 240, 255, 0.20); } -.ace-pastel-on-dark.ace_multiselect .ace_selection.ace_start { +.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) + 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) + 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_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_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_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) + 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-pastel-on-dark .ace_meta { + color:#757aD8; } .ace-pastel-on-dark .ace_keyword.ace_operator { - color: #797878 + color:#797878; } -.ace-pastel-on-dark .ace_constant.ace_character { - color: #AFA472 +.ace-pastel-on-dark .ace_constant, .ace-pastel-on-dark .ace_constant.ace_other { + color:#4FB7C5; +} + +.ace-pastel-on-dark .ace_constant.ace_character, { + color:#4FB7C5; +} + +.ace-pastel-on-dark .ace_constant.ace_character.ace_escape, { + color:#4FB7C5; } .ace-pastel-on-dark .ace_constant.ace_language { - color: #DE8E30 + color:#DE8E30; } .ace-pastel-on-dark .ace_constant.ace_numeric { - color: #CCCCCC + color:#CCCCCC; +} + +.ace-pastel-on-dark .ace_invalid { + color:#F8F8F8; +background-color:rgba(86, 45, 86, 0.75); } -.ace-pastel-on-dark .ace_invalid, .ace-pastel-on-dark .ace_invalid.ace_illegal { - color: #F8F8F8; - background-color: rgba(86, 45, 86, 0.75) + 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 + text-decoration:underline; +font-style:italic; +color:#D2A8A1; } .ace-pastel-on-dark .ace_fold { - background-color: #757aD8; - border-color: #8F938F + background-color: #757aD8; + border-color: #8F938F; } .ace-pastel-on-dark .ace_support.ace_function { - color: #AEB2F8 + color:#AEB2F8; } .ace-pastel-on-dark .ace_string { - color: #66A968 + color:#66A968; } .ace-pastel-on-dark .ace_string.ace_regexp { - color: #E9C062 + color:#E9C062; } .ace-pastel-on-dark .ace_comment { - color: #A6C6FF + color:#A6C6FF; } .ace-pastel-on-dark .ace_variable { - color: #BEBF55 + color:#BEBF55; } .ace-pastel-on-dark .ace_variable.ace_language { - color: #C1C144 + color:#C1C144; } -.ace-pastel-on-dark .ace_xml-pe { - color: #494949 +.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,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYIiPj/8PAARgAh2NTMh8AAAAAElFTkSuQmCC) right repeat-y + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0dD4z9DR0fEfAA+vBBPqhbn1AAAAAElFTkSuQmCC) right repeat-y; } \ No newline at end of file diff --git a/lib/ace/theme/pastel_on_dark.js b/lib/ace/theme/pastel_on_dark.js index 6eea03a4..073ec6a5 100644 --- a/lib/ace/theme/pastel_on_dark.js +++ b/lib/ace/theme/pastel_on_dark.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,8 +39,8 @@ define(function(require, exports, module) { exports.isDark = true; exports.cssClass = "ace-pastel-on-dark"; -exports.cssText = require("../requirejs/text!./pastel_on_dark.css"); +exports.cssText = require('ace/requirejs/text!./pastel_on_dark.css'); -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); + var dom = require("../lib/dom"); + dom.importCssString(exports.cssText, exports.cssClass); }); diff --git a/lib/ace/theme/solarized_dark.css b/lib/ace/theme/solarized_dark.css index 09740e69..11eaba93 100644 --- a/lib/ace/theme/solarized_dark.css +++ b/lib/ace/theme/solarized_dark.css @@ -1,100 +1,135 @@ + +.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 + color: #d0edf7; } -.ace-solarized-dark .ace_print-margin { +.ace-solarized-dark .ace_print_margin { width: 1px; - background: #33555E + background: #33555E; } -.ace-solarized-dark { +.ace-solarized-dark .ace_scroller { background-color: #002B36; - color: #93A1A1 } -.ace-solarized-dark .ace_entity.ace_other.ace_attribute-name, -.ace-solarized-dark .ace_storage { - color: #93A1A1 +.ace-solarized-dark .ace_text-layer { + color: #93A1A1; } -.ace-solarized-dark .ace_cursor, -.ace-solarized-dark .ace_string.ace_regexp { - color: #D30102 +.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) + background: #073642; } -.ace-solarized-dark.ace_multiselect .ace_selection.ace_start { +.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) + 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) + 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_active_line { + background: #073642; } -.ace-solarized-dark .ace_marker-layer .ace_selected-word { - border: 1px solid #073642 +.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) + 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_keyword, .ace-solarized-dark .ace_meta { + color:#859900; } .ace-solarized-dark .ace_constant.ace_language { - color: #B58900 + color:#B58900; } .ace-solarized-dark .ace_constant.ace_numeric { - color: #D33682 + color:#D33682; +} + +.ace-solarized-dark .ace_constant.ace_other { + color:#CB4B16; } .ace-solarized-dark .ace_fold { - background-color: #268BD2; - border-color: #93A1A1 + 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_support.ace_function { + color:#268BD2; +} + +.ace-solarized-dark .ace_storage { + color:#93A1A1; +} + +.ace-solarized-dark .ace_variable { + color:#268BD2; } .ace-solarized-dark .ace_string { - color: #2AA198 + color:#2AA198; +} + +.ace-solarized-dark .ace_string.ace_regexp { + color:#D30102; } .ace-solarized-dark .ace_comment { - font-style: italic; - color: #657B83 + font-style:italic; +color:#657B83; +} + +.ace-solarized-dark .ace_variable.ace_language { + color:#268BD2; +} + +.ace-solarized-dark .ace_entity.ace_other.ace_attribute-name { + color:#93A1A1; +} + +.ace-solarized-dark .ace_entity.ace_name.ace_function { + color:#268BD2; +} + +.ace-solarized-dark .ace_markup.ace_underline { + text-decoration:underline; } .ace-solarized-dark .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNg0Db1ZVCxc/sPAAd4AlUHlLenAAAAAElFTkSuQmCC) right repeat-y + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNg0Db7zzBz5sz/AA82BCv7wOIDAAAAAElFTkSuQmCC) right repeat-y; } \ No newline at end of file diff --git a/lib/ace/theme/solarized_dark.js b/lib/ace/theme/solarized_dark.js index 71812c28..4b7dd9dc 100644 --- a/lib/ace/theme/solarized_dark.js +++ b/lib/ace/theme/solarized_dark.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,8 +39,8 @@ define(function(require, exports, module) { exports.isDark = true; exports.cssClass = "ace-solarized-dark"; -exports.cssText = require("../requirejs/text!./solarized_dark.css"); +exports.cssText = require('ace/requirejs/text!./solarized_dark.css'); -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); + var dom = require("../lib/dom"); + dom.importCssString(exports.cssText, exports.cssClass); }); diff --git a/lib/ace/theme/solarized_light.css b/lib/ace/theme/solarized_light.css index 65399fda..d269ecc8 100644 --- a/lib/ace/theme/solarized_light.css +++ b/lib/ace/theme/solarized_light.css @@ -1,105 +1,134 @@ + +.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 + color: #333; } -.ace-solarized-light .ace_print-margin { +.ace-solarized-light .ace_print_margin { width: 1px; - background: #e8e8e8 + background: #e8e8e8; } -.ace-solarized-light { +.ace-solarized-light .ace_scroller { background-color: #FDF6E3; - color: #586E75 +} + +.ace-solarized-light .ace_text-layer { + color: #586E75; } .ace-solarized-light .ace_cursor { - color: #000000 + 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: rgba(7, 54, 67, 0.09) + background: #073642; } -.ace-solarized-light.ace_multiselect .ace_selection.ace_start { +.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) + 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) + border: 1px solid rgba(147, 161, 161, 0.50); } -.ace-solarized-light .ace_marker-layer .ace_active-line { - background: #EEE8D5 +.ace-solarized-light .ace_marker-layer .ace_active_line { + background: #EEE8D5; } -.ace-solarized-light .ace_gutter-active-line { - background-color : #EDE5C1 +.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_marker-layer .ace_selected_word { + border: 1px solid #073642; } .ace-solarized-light .ace_invisible { - color: rgba(147, 161, 161, 0.50) + 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_keyword, .ace-solarized-light .ace_meta { + color:#859900; } .ace-solarized-light .ace_constant.ace_language { - color: #B58900 + color:#B58900; } .ace-solarized-light .ace_constant.ace_numeric { - color: #D33682 + color:#D33682; +} + +.ace-solarized-light .ace_constant.ace_other { + color:#CB4B16; } .ace-solarized-light .ace_fold { - background-color: #268BD2; - border-color: #586E75 + 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_support.ace_function { + color:#268BD2; } .ace-solarized-light .ace_storage { - color: #073642 + color:#073642; +} + +.ace-solarized-light .ace_variable { + color:#268BD2; } .ace-solarized-light .ace_string { - color: #2AA198 + color:#2AA198; } .ace-solarized-light .ace_string.ace_regexp { - color: #D30102 + color:#D30102; +} + +.ace-solarized-light .ace_comment { + color:#93A1A1; +} + +.ace-solarized-light .ace_variable.ace_language { + color:#268BD2; } -.ace-solarized-light .ace_comment, .ace-solarized-light .ace_entity.ace_other.ace_attribute-name { - color: #93A1A1 + color:#93A1A1; +} + +.ace-solarized-light .ace_entity.ace_name.ace_function { + color:#268BD2; +} + +.ace-solarized-light .ace_markup.ace_underline { + text-decoration:underline; } .ace-solarized-light .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHjy8NJ/AAjgA5fzQUmBAAAAAElFTkSuQmCC) right repeat-y + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4++3xf4ZVq1b9BwAjxwbT1g3hiwAAAABJRU5ErkJggg==) right repeat-y; } \ No newline at end of file diff --git a/lib/ace/theme/solarized_light.js b/lib/ace/theme/solarized_light.js index 35ec219e..894c0edb 100644 --- a/lib/ace/theme/solarized_light.js +++ b/lib/ace/theme/solarized_light.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,8 +39,8 @@ define(function(require, exports, module) { exports.isDark = false; exports.cssClass = "ace-solarized-light"; -exports.cssText = require("../requirejs/text!./solarized_light.css"); +exports.cssText = require('ace/requirejs/text!./solarized_light.css'); -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); + var dom = require("../lib/dom"); + dom.importCssString(exports.cssText, exports.cssClass); }); diff --git a/lib/ace/theme/sqlserver.css b/lib/ace/theme/sqlserver.css deleted file mode 100644 index ff6d1e1c..00000000 --- a/lib/ace/theme/sqlserver.css +++ /dev/null @@ -1,171 +0,0 @@ -.ace_line { - font-family: Consolas; -} - -.ace-sqlserver .ace_gutter { - background: #ebebeb; - color: #333; - overflow: hidden; -} - -.ace-sqlserver .ace_print-margin { - width: 1px; - background: #e8e8e8; -} - -.ace-sqlserver { - background-color: #FFFFFF; - color: black; -} - -.ace-sqlserver .ace_identifier { - color: black; -} - -.ace-sqlserver .ace_keyword { - color: #0000FF; -} - -.ace-sqlserver .ace_numeric { - color: black; -} - -.ace-sqlserver .ace_storage { - color: #11B7BE; -} - -.ace-sqlserver .ace_keyword.ace_operator, -.ace-sqlserver .ace_lparen, -.ace-sqlserver .ace_rparen, -.ace-sqlserver .ace_punctuation { - color: #808080; -} - -.ace-sqlserver .ace_set.ace_statement { - color: #0000FF; - text-decoration: underline; -} - -.ace-sqlserver .ace_cursor { - color: black; -} - -.ace-sqlserver .ace_invisible { - color: rgb(191, 191, 191); -} - -.ace-sqlserver .ace_constant.ace_buildin { - color: rgb(88, 72, 246); -} - -.ace-sqlserver .ace_constant.ace_language { - color: #979797; -} - -.ace-sqlserver .ace_constant.ace_library { - color: rgb(6, 150, 14); -} - -.ace-sqlserver .ace_invalid { - background-color: rgb(153, 0, 0); - color: white; -} - -.ace-sqlserver .ace_support.ace_function { - color: #FF00FF; -} - -.ace-sqlserver .ace_support.ace_constant { - color: rgb(6, 150, 14); -} - -.ace-sqlserver .ace_class { - color: #008080; -} - -.ace-sqlserver .ace_support.ace_other { - color: #6D79DE; -} - -.ace-sqlserver .ace_variable.ace_parameter { - font-style: italic; - color: #FD971F; -} - -.ace-sqlserver .ace_comment { - color: #008000; -} - -.ace-sqlserver .ace_constant.ace_numeric { - color: black; -} - -.ace-sqlserver .ace_variable { - color: rgb(49, 132, 149); -} - -.ace-sqlserver .ace_xml-pe { - color: rgb(104, 104, 91); -} - -.ace-sqlserver .ace_support.ace_storedprocedure { - color: #800000; -} - -.ace-sqlserver .ace_heading { - color: rgb(12, 7, 255); -} - -.ace-sqlserver .ace_list { - color: rgb(185, 6, 144); -} - -.ace-sqlserver .ace_marker-layer .ace_selection { - background: rgb(181, 213, 255); -} - -.ace-sqlserver .ace_marker-layer .ace_step { - background: rgb(252, 255, 0); -} - -.ace-sqlserver .ace_marker-layer .ace_stack { - background: rgb(164, 229, 101); -} - -.ace-sqlserver .ace_marker-layer .ace_bracket { - margin: -1px 0 0 -1px; - border: 1px solid rgb(192, 192, 192); -} - -.ace-sqlserver .ace_marker-layer .ace_active-line { - background: rgba(0, 0, 0, 0.07); -} - -.ace-sqlserver .ace_gutter-active-line { - background-color: #dcdcdc; -} - -.ace-sqlserver .ace_marker-layer .ace_selected-word { - background: rgb(250, 250, 255); - border: 1px solid rgb(200, 200, 250); -} - -.ace-sqlserver .ace_meta.ace_tag { - color: #0000FF; -} - -.ace-sqlserver .ace_string.ace_regex { - color: #FF0000; -} - -.ace-sqlserver .ace_string { - color: #FF0000; -} - -.ace-sqlserver .ace_entity.ace_other.ace_attribute-name { - color: #994409; -} - -.ace-sqlserver .ace_indent-guide { - background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y; -} diff --git a/lib/ace/theme/sqlserver.js b/lib/ace/theme/sqlserver.js deleted file mode 100644 index ab657483..00000000 --- a/lib/ace/theme/sqlserver.js +++ /dev/null @@ -1,39 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.isDark = false; -exports.cssClass = "ace-sqlserver"; -exports.cssText = require("../requirejs/text!./sqlserver.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/ace/theme/terminal.css b/lib/ace/theme/terminal.css deleted file mode 100644 index f23a9ad6..00000000 --- a/lib/ace/theme/terminal.css +++ /dev/null @@ -1,131 +0,0 @@ -.ace-terminal-theme .ace_gutter { - background: #1a0005; - color: steelblue -} - -.ace-terminal-theme .ace_print-margin { - width: 1px; - background: #1a1a1a -} - -.ace-terminal-theme { - background-color: black; - color: #DEDEDE -} - -.ace-terminal-theme .ace_cursor { - color: #9F9F9F -} - -.ace-terminal-theme .ace_marker-layer .ace_selection { - background: #424242 -} - -.ace-terminal-theme.ace_multiselect .ace_selection.ace_start { - box-shadow: 0 0 3px 0px black; -} - -.ace-terminal-theme .ace_marker-layer .ace_step { - background: rgb(0, 0, 0) -} - -.ace-terminal-theme .ace_marker-layer .ace_bracket { - background: #090; -} - -.ace-terminal-theme .ace_marker-layer .ace_bracket-start { - background: #090; -} - -.ace-terminal-theme .ace_marker-layer .ace_bracket-unmatched { - margin: -1px 0 0 -1px; - border: 1px solid #900 -} - -.ace-terminal-theme .ace_marker-layer .ace_active-line { - background: #2A2A2A -} - -.ace-terminal-theme .ace_gutter-active-line { - background-color: #2A112A -} - -.ace-terminal-theme .ace_marker-layer .ace_selected-word { - border: 1px solid #424242 -} - -.ace-terminal-theme .ace_invisible { - color: #343434 -} - -.ace-terminal-theme .ace_keyword, -.ace-terminal-theme .ace_meta, -.ace-terminal-theme .ace_storage, -.ace-terminal-theme .ace_storage.ace_type, -.ace-terminal-theme .ace_support.ace_type { - color: tomato -} - -.ace-terminal-theme .ace_keyword.ace_operator { - color: deeppink -} - -.ace-terminal-theme .ace_constant.ace_character, -.ace-terminal-theme .ace_constant.ace_language, -.ace-terminal-theme .ace_constant.ace_numeric, -.ace-terminal-theme .ace_keyword.ace_other.ace_unit, -.ace-terminal-theme .ace_support.ace_constant, -.ace-terminal-theme .ace_variable.ace_parameter { - color: #E78C45 -} - -.ace-terminal-theme .ace_constant.ace_other { - color: gold -} - -.ace-terminal-theme .ace_invalid { - color: yellow; - background-color: red -} - -.ace-terminal-theme .ace_invalid.ace_deprecated { - color: #CED2CF; - background-color: #B798BF -} - -.ace-terminal-theme .ace_fold { - background-color: #7AA6DA; - border-color: #DEDEDE -} - -.ace-terminal-theme .ace_entity.ace_name.ace_function, -.ace-terminal-theme .ace_support.ace_function, -.ace-terminal-theme .ace_variable { - color: #7AA6DA -} - -.ace-terminal-theme .ace_support.ace_class, -.ace-terminal-theme .ace_support.ace_type { - color: #E7C547 -} - -.ace-terminal-theme .ace_heading, -.ace-terminal-theme .ace_string { - color: #B9CA4A -} - -.ace-terminal-theme .ace_entity.ace_name.ace_tag, -.ace-terminal-theme .ace_entity.ace_other.ace_attribute-name, -.ace-terminal-theme .ace_meta.ace_tag, -.ace-terminal-theme .ace_string.ace_regexp, -.ace-terminal-theme .ace_variable { - color: #D54E53 -} - -.ace-terminal-theme .ace_comment { - color: orangered -} - -.ace-terminal-theme .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYLBWV/8PAAK4AYnhiq+xAAAAAElFTkSuQmCC) right repeat-y; -} diff --git a/lib/ace/theme/terminal.js b/lib/ace/theme/terminal.js deleted file mode 100644 index d7ff36ae..00000000 --- a/lib/ace/theme/terminal.js +++ /dev/null @@ -1,39 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-terminal-theme"; -exports.cssText = require("../requirejs/text!./terminal.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/ace/theme/textmate.css b/lib/ace/theme/textmate.css index 18e2b4ee..7f9f5538 100644 --- a/lib/ace/theme/textmate.css +++ b/lib/ace/theme/textmate.css @@ -1,9 +1,17 @@ +.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 { +.ace-tm .ace_print_margin { width: 1px; background: #e8e8e8; } @@ -12,87 +20,90 @@ background-color: #6B72E6; } -.ace-tm { - background-color: #FFFFFF; - color: black; +.ace-tm .ace_text-layer { } .ace-tm .ace_cursor { - color: black; + border-left: 2px solid black; +} + +.ace-tm .ace_cursor.ace_overwrite { + border-left: 0px; + border-bottom: 1px solid black; } -.ace-tm .ace_invisible { +.ace-tm .ace_line .ace_invisible { color: rgb(191, 191, 191); } -.ace-tm .ace_storage, -.ace-tm .ace_keyword { +.ace-tm .ace_line .ace_storage, +.ace-tm .ace_line .ace_keyword { color: blue; } -.ace-tm .ace_constant { +.ace-tm .ace_line .ace_constant { color: rgb(197, 6, 11); } -.ace-tm .ace_constant.ace_buildin { +.ace-tm .ace_line .ace_constant.ace_buildin { color: rgb(88, 72, 246); } -.ace-tm .ace_constant.ace_language { +.ace-tm .ace_line .ace_constant.ace_language { color: rgb(88, 92, 246); } -.ace-tm .ace_constant.ace_library { +.ace-tm .ace_line .ace_constant.ace_library { color: rgb(6, 150, 14); } -.ace-tm .ace_invalid { +.ace-tm .ace_line .ace_invalid { background-color: rgba(255, 0, 0, 0.1); color: red; } -.ace-tm .ace_support.ace_function { +.ace-tm .ace_line .ace_support.ace_function { color: rgb(60, 76, 114); } -.ace-tm .ace_support.ace_constant { +.ace-tm .ace_line .ace_support.ace_constant { color: rgb(6, 150, 14); } -.ace-tm .ace_support.ace_type, -.ace-tm .ace_support.ace_class { +.ace-tm .ace_line .ace_support.ace_type, +.ace-tm .ace_line .ace_support.ace_class { color: rgb(109, 121, 222); } -.ace-tm .ace_keyword.ace_operator { +.ace-tm .ace_line .ace_keyword.ace_operator { color: rgb(104, 118, 135); } -.ace-tm .ace_string { +.ace-tm .ace_line .ace_string { color: rgb(3, 106, 7); } -.ace-tm .ace_comment { +.ace-tm .ace_line .ace_comment { color: rgb(76, 136, 107); } -.ace-tm .ace_comment.ace_doc { +.ace-tm .ace_line .ace_comment.ace_doc { color: rgb(0, 102, 255); } -.ace-tm .ace_comment.ace_doc.ace_tag { +.ace-tm .ace_line .ace_comment.ace_doc.ace_tag { color: rgb(128, 159, 191); } -.ace-tm .ace_constant.ace_numeric { +.ace-tm .ace_line .ace_constant.ace_numeric { color: rgb(0, 0, 205); } -.ace-tm .ace_variable { +.ace-tm .ace_line .ace_variable { color: rgb(49, 132, 149); } -.ace-tm .ace_xml-pe { +.ace-tm .ace_line .ace_xml_pe { color: rgb(104, 104, 91); } @@ -100,28 +111,24 @@ color: #0000A2; } +.ace-tm .ace_markup.ace_markupine { + text-decoration:underline; +} -.ace-tm .ace_heading { +.ace-tm .ace_markup.ace_heading { color: rgb(12, 7, 255); } -.ace-tm .ace_list { +.ace-tm .ace_markup.ace_list { color:rgb(185, 6, 144); } -.ace-tm .ace_meta.ace_tag { - color:rgb(0, 22, 142); -} - -.ace-tm .ace_string.ace_regex { - color: rgb(255, 0, 0) -} - .ace-tm .ace_marker-layer .ace_selection { background: rgb(181, 213, 255); } -.ace-tm.ace_multiselect .ace_selection.ace_start { +.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); @@ -136,19 +143,27 @@ border: 1px solid rgb(192, 192, 192); } -.ace-tm .ace_marker-layer .ace_active-line { +.ace-tm .ace_marker-layer .ace_active_line { background: rgba(0, 0, 0, 0.07); } -.ace-tm .ace_gutter-active-line { +.ace-tm .ace_gutter_active_line { background-color : #dcdcdc; } -.ace-tm .ace_marker-layer .ace_selected-word { +.ace-tm .ace_marker-layer .ace_selected_word { background: rgb(250, 250, 255); border: 1px solid rgb(200, 200, 250); } +.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_indent-guide { background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y; } diff --git a/lib/ace/theme/textmate.js b/lib/ace/theme/textmate.js index 75e19745..cd83f116 100644 --- a/lib/ace/theme/textmate.js +++ b/lib/ace/theme/textmate.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -33,7 +40,7 @@ define(function(require, exports, module) { exports.isDark = false; exports.cssClass = "ace-tm"; -exports.cssText = require("../requirejs/text!./textmate.css"); +exports.cssText = require('ace/requirejs/text!./textmate.css'); var dom = require("../lib/dom"); dom.importCssString(exports.cssText, exports.cssClass); diff --git a/lib/ace/theme/the_night_after_tomorrow.css b/lib/ace/theme/the_night_after_tomorrow.css deleted file mode 100644 index 48d2602c..00000000 --- a/lib/ace/theme/the_night_after_tomorrow.css +++ /dev/null @@ -1,139 +0,0 @@ -.ace-tomorrow-night .ace_gutter { - background: #25282c; - color: #C5C8C6 -} - -.ace-tomorrow-night .ace_print-margin { - width: 1px; - background: #25282c -} - -.ace-tomorrow-night { - background-color: #1D1F21; - color: #C5C8C6 -} - -.ace-tomorrow-night .ace_cursor { - color: #FFFFFF -} - -.ace-tomorrow-night .ace_marker-layer .ace_selection { - background: #373B41 -} - -.ace-tomorrow-night.ace_multiselect .ace_selection.ace_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_support.ace_type { - color: #C4A400 -} - -.ace-tomorrow-night .ace_storage, -.ace-tomorrow-night .ace_storage.ace_type { - color: #327FD7 -} - -.ace-tomorrow-night .ace_keyword.ace_operator { - color: #8ABEB7 -} - -.ace-tomorrow-night .ace_constant.ace_language{ - color: #934B9F -} - -.ace-tomorrow-night .ace_constant.ace_character, -.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: #37BC9B -} - -.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: #62A5D6; - 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: #62A5D6 -} - -.ace-tomorrow-night .ace_support.ace_class, -.ace-tomorrow-night .ace_support.ace_type { - color: #F0C674 -} - -.ace-tomorrow-night .ace_heading, -.ace-tomorrow-night .ace_markup.ace_heading, -.ace-tomorrow-night .ace_string { - color: #CD0000 -} - -.ace-tomorrow-night .ace_proc_name { - color: #04939A -} - -.ace-tomorrow-night .ace_backtick { - color: #1DAA49 -} - -.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: #FFFFFF -} - -.ace-tomorrow-night .ace_comment { - color: #3465A4 -} - -.ace-tomorrow-night .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHB3d/8PAAOIAdULw8qMAAAAAElFTkSuQmCC) right repeat-y -} diff --git a/lib/ace/theme/the_night_after_tomorrow.js b/lib/ace/theme/the_night_after_tomorrow.js deleted file mode 100644 index 3108e2a9..00000000 --- a/lib/ace/theme/the_night_after_tomorrow.js +++ /dev/null @@ -1,39 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.isDark = true; -exports.cssClass = "ace-tomorrow-night"; -exports.cssText = require("../requirejs/text!./the_night_after_tomorrow.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/ace/theme/tomorrow.css b/lib/ace/theme/tomorrow.css index 77407e66..a9c04182 100644 --- a/lib/ace/theme/tomorrow.css +++ b/lib/ace/theme/tomorrow.css @@ -1,124 +1,168 @@ + +.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 + color: #4D4D4C; } -.ace-tomorrow .ace_print-margin { +.ace-tomorrow .ace_print_margin { width: 1px; - background: #f6f6f6 + background: #f6f6f6; } -.ace-tomorrow { +.ace-tomorrow .ace_scroller { background-color: #FFFFFF; - color: #4D4D4C +} + +.ace-tomorrow .ace_text-layer { + color: #4D4D4C; } .ace-tomorrow .ace_cursor { - color: #AEAFAD + 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 + background: #D6D6D6; } -.ace-tomorrow.ace_multiselect .ace_selection.ace_start { +.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) + background: rgb(255, 255, 0); } .ace-tomorrow .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; - border: 1px solid #D1D1D1 + border: 1px solid #D1D1D1; } -.ace-tomorrow .ace_marker-layer .ace_active-line { - background: #EFEFEF +.ace-tomorrow .ace_marker-layer .ace_active_line { + background: #EFEFEF; } -.ace-tomorrow .ace_gutter-active-line { - background-color : #dcdcdc +.ace-tomorrow .ace_gutter_active_line { + background-color : #dcdcdc; } -.ace-tomorrow .ace_marker-layer .ace_selected-word { - border: 1px solid #D6D6D6 +.ace-tomorrow .ace_marker-layer .ace_selected_word { + border: 1px solid #D6D6D6; } .ace-tomorrow .ace_invisible { - color: #D1D1D1 + 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-tomorrow .ace_meta { + color:#8959A8; } .ace-tomorrow .ace_keyword.ace_operator { - color: #3E999F + 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_language { + color:#F5871F; +} + +.ace-tomorrow .ace_constant.ace_numeric { + color:#F5871F; } .ace-tomorrow .ace_constant.ace_other { - color: #666969 + color:#666969; } .ace-tomorrow .ace_invalid { - color: #FFFFFF; - background-color: #C82829 + color:#FFFFFF; +background-color:#C82829; } .ace-tomorrow .ace_invalid.ace_deprecated { - color: #FFFFFF; - background-color: #8959A8 + color:#FFFFFF; +background-color:#8959A8; +} + +.ace-tomorrow .ace_support.ace_constant { + color:#F5871F; } .ace-tomorrow .ace_fold { - background-color: #4271AE; - border-color: #4D4D4C + background-color: #4271AE; + border-color: #4D4D4C; +} + +.ace-tomorrow .ace_support.ace_function { + color:#4271AE; +} + +.ace-tomorrow .ace_storage { + color:#8959A8; +} + +.ace-tomorrow .ace_storage.ace_type, .ace-tomorrow .ace_support.ace_type{ + color:#8959A8; } -.ace-tomorrow .ace_entity.ace_name.ace_function, -.ace-tomorrow .ace_support.ace_function, .ace-tomorrow .ace_variable { - color: #4271AE + color:#4271AE; } -.ace-tomorrow .ace_support.ace_class, -.ace-tomorrow .ace_support.ace_type { - color: #C99E00 +.ace-tomorrow .ace_variable.ace_parameter { + color:#F5871F; } -.ace-tomorrow .ace_heading, -.ace-tomorrow .ace_markup.ace_heading, .ace-tomorrow .ace_string { - color: #718C00 + 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_string.ace_regexp { + color:#C82829; } .ace-tomorrow .ace_comment { - color: #8E908C + color:#8E908C; +} + +.ace-tomorrow .ace_variable { + color:#C82829; +} + +.ace-tomorrow .ace_meta.ace_tag { + color:#C82829; +} + +.ace-tomorrow .ace_entity.ace_other.ace_attribute-name { + color:#C82829; +} + +.ace-tomorrow .ace_entity.ace_name.ace_function { + color:#4271AE; +} + +.ace-tomorrow .ace_markup.ace_underline { + text-decoration:underline; +} + +.ace-tomorrow .ace_markup.ace_heading { + color:#718C00; } .ace-tomorrow .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bdu3f/BwAlfgctduB85QAAAABJRU5ErkJggg==) right repeat-y + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bdu3f/BwAlfgctduB85QAAAABJRU5ErkJggg==) right repeat-y; } \ No newline at end of file diff --git a/lib/ace/theme/tomorrow.js b/lib/ace/theme/tomorrow.js index 1f02d7d9..45daba61 100644 --- a/lib/ace/theme/tomorrow.js +++ b/lib/ace/theme/tomorrow.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,8 +39,8 @@ define(function(require, exports, module) { exports.isDark = false; exports.cssClass = "ace-tomorrow"; -exports.cssText = require("../requirejs/text!./tomorrow.css"); +exports.cssText = require('ace/requirejs/text!./tomorrow.css'); -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); + var dom = require("../lib/dom"); + dom.importCssString(exports.cssText, exports.cssClass); }); diff --git a/lib/ace/theme/tomorrow_night.css b/lib/ace/theme/tomorrow_night.css index e98a6580..137e35d8 100644 --- a/lib/ace/theme/tomorrow_night.css +++ b/lib/ace/theme/tomorrow_night.css @@ -1,124 +1,168 @@ + +.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 + color: #C5C8C6; } -.ace-tomorrow-night .ace_print-margin { +.ace-tomorrow-night .ace_print_margin { width: 1px; - background: #25282c + background: #25282c; } -.ace-tomorrow-night { +.ace-tomorrow-night .ace_scroller { background-color: #1D1F21; - color: #C5C8C6 +} + +.ace-tomorrow-night .ace_text-layer { + color: #C5C8C6; } .ace-tomorrow-night .ace_cursor { - color: #AEAFAD + 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 + background: #373B41; } -.ace-tomorrow-night.ace_multiselect .ace_selection.ace_start { +.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) + background: rgb(102, 82, 0); } .ace-tomorrow-night .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; - border: 1px solid #4B4E55 + border: 1px solid #4B4E55; } -.ace-tomorrow-night .ace_marker-layer .ace_active-line { - background: #282A2E +.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_gutter_active_line { + background-color: #282A2E; } -.ace-tomorrow-night .ace_marker-layer .ace_selected-word { - border: 1px solid #373B41 +.ace-tomorrow-night .ace_marker-layer .ace_selected_word { + border: 1px solid #373B41; } .ace-tomorrow-night .ace_invisible { - color: #4B4E55 + 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-tomorrow-night .ace_meta { + color:#B294BB; } .ace-tomorrow-night .ace_keyword.ace_operator { - color: #8ABEB7 + 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_language { + color:#DE935F; +} + +.ace-tomorrow-night .ace_constant.ace_numeric { + color:#DE935F; } .ace-tomorrow-night .ace_constant.ace_other { - color: #CED1CF + color:#CED1CF; } .ace-tomorrow-night .ace_invalid { - color: #CED2CF; - background-color: #DF5F5F + color:#CED2CF; +background-color:#DF5F5F; } .ace-tomorrow-night .ace_invalid.ace_deprecated { - color: #CED2CF; - background-color: #B798BF + color:#CED2CF; +background-color:#B798BF; +} + +.ace-tomorrow-night .ace_support.ace_constant { + color:#DE935F; } .ace-tomorrow-night .ace_fold { - background-color: #81A2BE; - border-color: #C5C8C6 + background-color: #81A2BE; + border-color: #C5C8C6; +} + +.ace-tomorrow-night .ace_support.ace_function { + color:#81A2BE; +} + +.ace-tomorrow-night .ace_storage { + color:#B294BB; +} + +.ace-tomorrow-night .ace_storage.ace_type, .ace-tomorrow-night .ace_support.ace_type{ + color:#B294BB; } -.ace-tomorrow-night .ace_entity.ace_name.ace_function, -.ace-tomorrow-night .ace_support.ace_function, .ace-tomorrow-night .ace_variable { - color: #81A2BE + color:#81A2BE; } -.ace-tomorrow-night .ace_support.ace_class, -.ace-tomorrow-night .ace_support.ace_type { - color: #F0C674 +.ace-tomorrow-night .ace_variable.ace_parameter { + color:#DE935F; } -.ace-tomorrow-night .ace_heading, -.ace-tomorrow-night .ace_markup.ace_heading, .ace-tomorrow-night .ace_string { - color: #B5BD68 + 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_string.ace_regexp { + color:#CC6666; } .ace-tomorrow-night .ace_comment { - color: #969896 + color:#969896; +} + +.ace-tomorrow-night .ace_variable { + color:#CC6666; +} + +.ace-tomorrow-night .ace_meta.ace_tag { + color:#CC6666; +} + +.ace-tomorrow-night .ace_entity.ace_other.ace_attribute-name { + color:#CC6666; +} + +.ace-tomorrow-night .ace_entity.ace_name.ace_function { + color:#81A2BE; +} + +.ace-tomorrow-night .ace_markup.ace_underline { + text-decoration:underline; +} + +.ace-tomorrow-night .ace_markup.ace_heading { + color:#B5BD68; } .ace-tomorrow-night .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYHB3d/8PAAOIAdULw8qMAAAAAElFTkSuQmCC) right repeat-y + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWOQlVf8z7Bq1ar/AA/hBFp7egmpAAAAAElFTkSuQmCC) right repeat-y; } \ No newline at end of file diff --git a/lib/ace/theme/tomorrow_night.js b/lib/ace/theme/tomorrow_night.js index e7137ffc..645aaa9c 100644 --- a/lib/ace/theme/tomorrow_night.js +++ b/lib/ace/theme/tomorrow_night.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,8 +39,8 @@ define(function(require, exports, module) { exports.isDark = true; exports.cssClass = "ace-tomorrow-night"; -exports.cssText = require("../requirejs/text!./tomorrow_night.css"); +exports.cssText = require('ace/requirejs/text!./tomorrow_night.css'); -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); + var dom = require("../lib/dom"); + dom.importCssString(exports.cssText, exports.cssClass); }); diff --git a/lib/ace/theme/tomorrow_night_blue.css b/lib/ace/theme/tomorrow_night_blue.css index 907eef35..7a8354bb 100644 --- a/lib/ace/theme/tomorrow_night_blue.css +++ b/lib/ace/theme/tomorrow_night_blue.css @@ -1,121 +1,168 @@ + +.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 + color: #7388b5; } -.ace-tomorrow-night-blue .ace_print-margin { +.ace-tomorrow-night-blue .ace_print_margin { width: 1px; - background: #00204b + background: #00204b; } -.ace-tomorrow-night-blue { +.ace-tomorrow-night-blue .ace_scroller { background-color: #002451; - color: #FFFFFF } -.ace-tomorrow-night-blue .ace_constant.ace_other, +.ace-tomorrow-night-blue .ace_text-layer { + color: #FFFFFF; +} + .ace-tomorrow-night-blue .ace_cursor { - color: #FFFFFF + 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 + background: #003F8E; } -.ace-tomorrow-night-blue.ace_multiselect .ace_selection.ace_start { +.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) + background: rgb(127, 111, 19); } .ace-tomorrow-night-blue .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; - border: 1px solid #404F7D + border: 1px solid #404F7D; } -.ace-tomorrow-night-blue .ace_marker-layer .ace_active-line { - background: #00346E +.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_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_marker-layer .ace_selected_word { + border: 1px solid #003F8E; } .ace-tomorrow-night-blue .ace_invisible { - color: #404F7D + 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-tomorrow-night-blue .ace_meta { + color:#EBBBFF; } .ace-tomorrow-night-blue .ace_keyword.ace_operator { - color: #99FFFF + 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_constant.ace_language { + color:#FFC58F; +} + +.ace-tomorrow-night-blue .ace_constant.ace_numeric { + color:#FFC58F; +} + +.ace-tomorrow-night-blue .ace_constant.ace_other { + color:#FFFFFF; } .ace-tomorrow-night-blue .ace_invalid { - color: #FFFFFF; - background-color: #F99DA5 + color:#FFFFFF; +background-color:#F99DA5; } .ace-tomorrow-night-blue .ace_invalid.ace_deprecated { - color: #FFFFFF; - background-color: #EBBBFF + color:#FFFFFF; +background-color:#EBBBFF; +} + +.ace-tomorrow-night-blue .ace_support.ace_constant { + color:#FFC58F; } .ace-tomorrow-night-blue .ace_fold { - background-color: #BBDAFF; - border-color: #FFFFFF + background-color: #BBDAFF; + border-color: #FFFFFF; +} + +.ace-tomorrow-night-blue .ace_support.ace_function { + color:#BBDAFF; +} + +.ace-tomorrow-night-blue .ace_storage { + color:#EBBBFF; +} + +.ace-tomorrow-night-blue .ace_storage.ace_type, .ace-tomorrow-night-blue .ace_support.ace_type{ + color:#EBBBFF; } -.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 + 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_variable.ace_parameter { + color:#FFC58F; } -.ace-tomorrow-night-blue .ace_heading, -.ace-tomorrow-night-blue .ace_markup.ace_heading, .ace-tomorrow-night-blue .ace_string { - color: #D1F1A9 + 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_string.ace_regexp { + color:#FF9DA4; } .ace-tomorrow-night-blue .ace_comment { - color: #7285B7 + color:#7285B7; +} + +.ace-tomorrow-night-blue .ace_variable { + color:#FF9DA4; +} + +.ace-tomorrow-night-blue .ace_meta.ace_tag { + color:#FF9DA4; +} + +.ace-tomorrow-night-blue .ace_entity.ace_other.ace_attribute-name { + color:#FF9DA4; +} + +.ace-tomorrow-night-blue .ace_entity.ace_name.ace_function { + color:#BBDAFF; +} + +.ace-tomorrow-night-blue .ace_markup.ace_underline { + text-decoration:underline; +} + +.ace-tomorrow-night-blue .ace_markup.ace_heading { + color:#D1F1A9; } .ace-tomorrow-night-blue .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYJDzqfwPAANXAeNsiA+ZAAAAAElFTkSuQmCC) right repeat-y + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgUAn8z7Bq1ar/ABBUBHJ4/r3JAAAAAElFTkSuQmCC) right repeat-y; } \ No newline at end of file diff --git a/lib/ace/theme/tomorrow_night_blue.js b/lib/ace/theme/tomorrow_night_blue.js index dcdf4adc..ab321ebd 100644 --- a/lib/ace/theme/tomorrow_night_blue.js +++ b/lib/ace/theme/tomorrow_night_blue.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,8 +39,8 @@ define(function(require, exports, module) { exports.isDark = true; exports.cssClass = "ace-tomorrow-night-blue"; -exports.cssText = require("../requirejs/text!./tomorrow_night_blue.css"); +exports.cssText = require('ace/requirejs/text!./tomorrow_night_blue.css'); -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); + var dom = require("../lib/dom"); + dom.importCssString(exports.cssText, exports.cssClass); }); diff --git a/lib/ace/theme/tomorrow_night_bright.css b/lib/ace/theme/tomorrow_night_bright.css index c0c33739..44d944a5 100644 --- a/lib/ace/theme/tomorrow_night_bright.css +++ b/lib/ace/theme/tomorrow_night_bright.css @@ -1,140 +1,168 @@ + +.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 + color: #DEDEDE; } -.ace-tomorrow-night-bright .ace_print-margin { +.ace-tomorrow-night-bright .ace_print_margin { width: 1px; - background: #1a1a1a + background: #1a1a1a; } -.ace-tomorrow-night-bright { +.ace-tomorrow-night-bright .ace_scroller { background-color: #000000; - color: #DEDEDE +} + +.ace-tomorrow-night-bright .ace_text-layer { + color: #DEDEDE; } .ace-tomorrow-night-bright .ace_cursor { - color: #9F9F9F + 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 + background: #424242; } -.ace-tomorrow-night-bright.ace_multiselect .ace_selection.ace_start { +.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) + background: rgb(102, 82, 0); } .ace-tomorrow-night-bright .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; - border: 1px solid #888888 + border: 1px solid #343434; } -.ace-tomorrow-night-bright .ace_marker-layer .ace_highlight { - border: 1px solid rgb(110, 119, 0); - border-bottom: 0; - box-shadow: inset 0 -1px rgb(110, 119, 0); - margin: -1px 0 0 -1px; - background: rgba(255, 235, 0, 0.1) +.ace-tomorrow-night-bright .ace_marker-layer .ace_active_line { + background: #2A2A2A; } -.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_gutter-active-line { - background-color: #2A2A2A -} - -.ace-tomorrow-night-bright .ace_stack { - background-color: rgb(66, 90, 44) -} - -.ace-tomorrow-night-bright .ace_marker-layer .ace_selected-word { - border: 1px solid #888888 +.ace-tomorrow-night-bright .ace_marker-layer .ace_selected_word { + border: 1px solid #424242; } .ace-tomorrow-night-bright .ace_invisible { - color: #343434 + 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-tomorrow-night-bright .ace_meta { + color:#C397D8; } .ace-tomorrow-night-bright .ace_keyword.ace_operator { - color: #70C0B1 + 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_language { + color:#E78C45; +} + +.ace-tomorrow-night-bright .ace_constant.ace_numeric { + color:#E78C45; } .ace-tomorrow-night-bright .ace_constant.ace_other { - color: #EEEEEE + color:#EEEEEE; } .ace-tomorrow-night-bright .ace_invalid { - color: #CED2CF; - background-color: #DF5F5F + color:#CED2CF; +background-color:#DF5F5F; } .ace-tomorrow-night-bright .ace_invalid.ace_deprecated { - color: #CED2CF; - background-color: #B798BF + color:#CED2CF; +background-color:#B798BF; +} + +.ace-tomorrow-night-bright .ace_support.ace_constant { + color:#E78C45; } .ace-tomorrow-night-bright .ace_fold { - background-color: #7AA6DA; - border-color: #DEDEDE + background-color: #7AA6DA; + border-color: #DEDEDE; +} + +.ace-tomorrow-night-bright .ace_support.ace_function { + color:#7AA6DA; +} + +.ace-tomorrow-night-bright .ace_storage { + color:#C397D8; +} + +.ace-tomorrow-night-bright .ace_storage.ace_type, .ace-tomorrow-night-bright .ace_support.ace_type{ + color:#C397D8; } -.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 + 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_variable.ace_parameter { + color:#E78C45; } -.ace-tomorrow-night-bright .ace_heading, -.ace-tomorrow-night-bright .ace_markup.ace_heading, .ace-tomorrow-night-bright .ace_string { - color: #B9CA4A + 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_string.ace_regexp { + color:#D54E53; } .ace-tomorrow-night-bright .ace_comment { - color: #969896 + color:#969896; } -.ace-tomorrow-night-bright .ace_c9searchresults.ace_keyword { - color: #C2C280 +.ace-tomorrow-night-bright .ace_variable { + color:#D54E53; +} + +.ace-tomorrow-night-bright .ace_meta.ace_tag { + color:#D54E53; +} + +.ace-tomorrow-night-bright .ace_entity.ace_other.ace_attribute-name { + color:#D54E53; +} + +.ace-tomorrow-night-bright .ace_entity.ace_name.ace_function { + color:#7AA6DA; +} + +.ace-tomorrow-night-bright .ace_markup.ace_underline { + text-decoration:underline; +} + +.ace-tomorrow-night-bright .ace_markup.ace_heading { + color:#B9CA4A; } .ace-tomorrow-night-bright .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYFBXV/8PAAJoAXX4kT2EAAAAAElFTkSuQmCC) right repeat-y + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGD4z7Bq1ar/AAz9A/2naJQKAAAAAElFTkSuQmCC) right repeat-y; } \ No newline at end of file diff --git a/lib/ace/theme/tomorrow_night_bright.js b/lib/ace/theme/tomorrow_night_bright.js index 4b285668..396fa860 100644 --- a/lib/ace/theme/tomorrow_night_bright.js +++ b/lib/ace/theme/tomorrow_night_bright.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,8 +39,8 @@ define(function(require, exports, module) { exports.isDark = true; exports.cssClass = "ace-tomorrow-night-bright"; -exports.cssText = require("../requirejs/text!./tomorrow_night_bright.css"); +exports.cssText = require('ace/requirejs/text!./tomorrow_night_bright.css'); -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); + var dom = require("../lib/dom"); + dom.importCssString(exports.cssText, exports.cssClass); }); diff --git a/lib/ace/theme/tomorrow_night_eighties.css b/lib/ace/theme/tomorrow_night_eighties.css index 69277fb1..1dfd9ead 100644 --- a/lib/ace/theme/tomorrow_night_eighties.css +++ b/lib/ace/theme/tomorrow_night_eighties.css @@ -1,124 +1,164 @@ + +.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 + color: #CCC; } -.ace-tomorrow-night-eighties .ace_print-margin { +.ace-tomorrow-night-eighties .ace_print_margin { width: 1px; - background: #272727 + background: #272727; } -.ace-tomorrow-night-eighties { +.ace-tomorrow-night-eighties .ace_scroller { background-color: #2D2D2D; - color: #CCCCCC } -.ace-tomorrow-night-eighties .ace_constant.ace_other, +.ace-tomorrow-night-eighties .ace_text-layer { + color: #CCCCCC; +} + .ace-tomorrow-night-eighties .ace_cursor { - color: #CCCCCC + 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 + background: #515151; } -.ace-tomorrow-night-eighties.ace_multiselect .ace_selection.ace_start { +.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) + background: rgb(102, 82, 0); } .ace-tomorrow-night-eighties .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; - border: 1px solid #6A6A6A + border: 1px solid #6A6A6A; } -.ace-tomorrow-night-bright .ace_stack { - background: rgb(66, 90, 44) +.ace-tomorrow-night-eighties .ace_marker-layer .ace_active_line { + background: #393939; } -.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_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_marker-layer .ace_selected_word { + border: 1px solid #515151; } .ace-tomorrow-night-eighties .ace_invisible { - color: #6A6A6A + 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-tomorrow-night-eighties .ace_meta { + color:#CC99CC; } .ace-tomorrow-night-eighties .ace_keyword.ace_operator { - color: #66CCCC + 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_constant.ace_language { + color:#F99157; +} + +.ace-tomorrow-night-eighties .ace_constant.ace_numeric { + color:#F99157; +} + +.ace-tomorrow-night-eighties .ace_constant.ace_other { + color:#CCCCCC; } .ace-tomorrow-night-eighties .ace_invalid { - color: #CDCDCD; - background-color: #F2777A + color:#CDCDCD; +background-color:#F2777A; } .ace-tomorrow-night-eighties .ace_invalid.ace_deprecated { - color: #CDCDCD; - background-color: #CC99CC + color:#CDCDCD; +background-color:#CC99CC; +} + +.ace-tomorrow-night-eighties .ace_support.ace_constant { + color:#F99157; } .ace-tomorrow-night-eighties .ace_fold { - background-color: #6699CC; - border-color: #CCCCCC + background-color: #6699CC; + border-color: #CCCCCC; +} + +.ace-tomorrow-night-eighties .ace_support.ace_function { + color:#6699CC; +} + +.ace-tomorrow-night-eighties .ace_storage { + color:#CC99CC; +} + +.ace-tomorrow-night-eighties .ace_storage.ace_type, .ace-tomorrow-night-eighties .ace_support.ace_type{ + color:#CC99CC; } -.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 + 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_variable.ace_parameter { + color:#F99157; } -.ace-tomorrow-night-eighties .ace_heading, -.ace-tomorrow-night-eighties .ace_markup.ace_heading, .ace-tomorrow-night-eighties .ace_string { - color: #99CC99 + color:#99CC99; } .ace-tomorrow-night-eighties .ace_comment { - color: #999999 + 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 + color:#F2777A; +} + +.ace-tomorrow-night-eighties .ace_meta.ace_tag { + color:#F2777A; +} + +.ace-tomorrow-night-eighties .ace_entity.ace_other.ace_attribute-name { + color:#F2777A; +} + +.ace-tomorrow-night-eighties .ace_entity.ace_name.ace_function { + color:#6699CC; +} + +.ace-tomorrow-night-eighties .ace_markup.ace_underline { + text-decoration:underline; +} + +.ace-tomorrow-night-eighties .ace_markup.ace_heading { + color:#99CC99; } .ace-tomorrow-night-eighties .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ09NrYAgMjP4PAAtGAwchHMyAAAAAAElFTkSuQmCC) right repeat-y + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ1dX9z7Bq1ar/ABE1BITwhhuFAAAAAElFTkSuQmCC) right repeat-y; } \ No newline at end of file diff --git a/lib/ace/theme/tomorrow_night_eighties.js b/lib/ace/theme/tomorrow_night_eighties.js index 9ac7be67..c6a2a553 100644 --- a/lib/ace/theme/tomorrow_night_eighties.js +++ b/lib/ace/theme/tomorrow_night_eighties.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,8 +39,8 @@ define(function(require, exports, module) { exports.isDark = true; exports.cssClass = "ace-tomorrow-night-eighties"; -exports.cssText = require("../requirejs/text!./tomorrow_night_eighties.css"); +exports.cssText = require('ace/requirejs/text!./tomorrow_night_eighties.css'); -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); + var dom = require("../lib/dom"); + dom.importCssString(exports.cssText, exports.cssClass); }); diff --git a/lib/ace/theme/twilight.css b/lib/ace/theme/twilight.css index ae353dae..70794da6 100644 --- a/lib/ace/theme/twilight.css +++ b/lib/ace/theme/twilight.css @@ -1,127 +1,166 @@ + +.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 + color: #E2E2E2; } -.ace-twilight .ace_print-margin { +.ace-twilight .ace_print_margin { width: 1px; - background: #232323 + background: #232323; } -.ace-twilight { +.ace-twilight .ace_scroller { background-color: #141414; - color: #F8F8F8 +} + +.ace-twilight .ace_text-layer { + color: #F8F8F8; } .ace-twilight .ace_cursor { - color: #A7A7A7 + 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) + background: rgba(221, 240, 255, 0.20); } -.ace-twilight.ace_multiselect .ace_selection.ace_start { +.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) + 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) + 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_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_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_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) + color: rgba(255, 255, 255, 0.25); } -.ace-twilight .ace_keyword, -.ace-twilight .ace_meta { - color: #CDA869 +.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_heading, -.ace-twilight .ace_markup.ace_heading, -.ace-twilight .ace_support.ace_constant { - color: #CF6A4C +.ace-twilight .ace_constant, .ace-twilight .ace_constant.ace_other { + color:#CF6A4C; +} + +.ace-twilight .ace_constant.ace_character, { + color:#CF6A4C; +} + +.ace-twilight .ace_constant.ace_character.ace_escape, { + color:#CF6A4C; } .ace-twilight .ace_invalid.ace_illegal { - color: #F8F8F8; - background-color: rgba(86, 45, 86, 0.75) + color:#F8F8F8; +background-color:rgba(86, 45, 86, 0.75); } .ace-twilight .ace_invalid.ace_deprecated { - text-decoration: underline; - font-style: italic; - color: #D2A8A1 + text-decoration:underline; +font-style:italic; +color:#D2A8A1; } .ace-twilight .ace_support { - color: #9B859D + color:#9B859D; +} + +.ace-twilight .ace_support.ace_constant { + color:#CF6A4C; } .ace-twilight .ace_fold { - background-color: #AC885B; - border-color: #F8F8F8 + background-color: #AC885B; + border-color: #F8F8F8; } .ace-twilight .ace_support.ace_function { - color: #DAD085 + color:#DAD085; } -.ace-twilight .ace_list, -.ace-twilight .ace_markup.ace_list, .ace-twilight .ace_storage { - color: #F9EE98 + color:#F9EE98; } -.ace-twilight .ace_entity.ace_name.ace_function, -.ace-twilight .ace_meta.ace_tag, .ace-twilight .ace_variable { - color: #AC885B + color:#AC885B; } .ace-twilight .ace_string { - color: #8F9D6A + color:#8F9D6A; } .ace-twilight .ace_string.ace_regexp { - color: #E9C062 + color:#E9C062; } .ace-twilight .ace_comment { - font-style: italic; - color: #5F5A60 + font-style:italic; +color:#5F5A60; } .ace-twilight .ace_variable { - color: #7587A6 + color:#7587A6; } -.ace-twilight .ace_xml-pe { - color: #494949 +.ace-twilight .ace_xml_pe { + color:#494949; +} + +.ace-twilight .ace_meta.ace_tag { + color:#AC885B; +} + +.ace-twilight .ace_entity.ace_name.ace_function { + color:#AC885B; +} + +.ace-twilight .ace_markup.ace_underline { + text-decoration:underline; +} + +.ace-twilight .ace_markup.ace_heading { + color:#CF6A4C; +} + +.ace-twilight .ace_markup.ace_list { + color:#F9EE98; } .ace-twilight .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMQERFpYLC1tf0PAAgOAnPnhxyiAAAAAElFTkSuQmCC) right repeat-y + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWMQERH5zzBz5sz/AA5EBAYqeZXWAAAAAElFTkSuQmCC) right repeat-y; } \ No newline at end of file diff --git a/lib/ace/theme/twilight.js b/lib/ace/theme/twilight.js index 904f7ef6..b497826f 100644 --- a/lib/ace/theme/twilight.js +++ b/lib/ace/theme/twilight.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,8 +39,8 @@ define(function(require, exports, module) { exports.isDark = true; exports.cssClass = "ace-twilight"; -exports.cssText = require("../requirejs/text!./twilight.css"); +exports.cssText = require('ace/requirejs/text!./twilight.css'); -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); + var dom = require("../lib/dom"); + dom.importCssString(exports.cssText, exports.cssClass); }); diff --git a/lib/ace/theme/vibrant_ink.css b/lib/ace/theme/vibrant_ink.css index a3a89402..08993a63 100644 --- a/lib/ace/theme/vibrant_ink.css +++ b/lib/ace/theme/vibrant_ink.css @@ -1,109 +1,145 @@ + +.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 + color: #BEBEBE; } -.ace-vibrant-ink .ace_print-margin { +.ace-vibrant-ink .ace_print_margin { width: 1px; - background: #1a1a1a + background: #1a1a1a; } -.ace-vibrant-ink { +.ace-vibrant-ink .ace_scroller { background-color: #0F0F0F; - color: #FFFFFF +} + +.ace-vibrant-ink .ace_text-layer { + color: #FFFFFF; } .ace-vibrant-ink .ace_cursor { - color: #FFFFFF + 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 + background: #6699CC; } -.ace-vibrant-ink.ace_multiselect .ace_selection.ace_start { +.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) + background: rgb(102, 82, 0); } .ace-vibrant-ink .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; - border: 1px solid #404040 + border: 1px solid #404040; } -.ace-vibrant-ink .ace_marker-layer .ace_active-line { - background: #333333 +.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_gutter_active_line { + background-color: #333333; } -.ace-vibrant-ink .ace_marker-layer .ace_selected-word { - border: 1px solid #6699CC +.ace-vibrant-ink .ace_marker-layer .ace_selected_word { + border: 1px solid #6699CC; } .ace-vibrant-ink .ace_invisible { - color: #404040 + color: #404040; } -.ace-vibrant-ink .ace_keyword, -.ace-vibrant-ink .ace_meta { - color: #FF6600 +.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-vibrant-ink .ace_constant.ace_other { + color:#339999; +} + +.ace-vibrant-ink .ace_constant.ace_character, { + color:#339999; +} + +.ace-vibrant-ink .ace_constant.ace_character.ace_escape, { + color:#339999; } .ace-vibrant-ink .ace_constant.ace_numeric { - color: #99CC99 + color:#99CC99; +} + +.ace-vibrant-ink .ace_invalid { + color:#CCFF33; +background-color:#000000; } -.ace-vibrant-ink .ace_invalid, .ace-vibrant-ink .ace_invalid.ace_deprecated { - color: #CCFF33; - background-color: #000000 + color:#CCFF33; +background-color:#000000; } .ace-vibrant-ink .ace_fold { - background-color: #FFCC00; - border-color: #FFFFFF + background-color: #FFCC00; + border-color: #FFFFFF; +} + +.ace-vibrant-ink .ace_support.ace_function { + color:#FFCC00; } -.ace-vibrant-ink .ace_entity.ace_name.ace_function, -.ace-vibrant-ink .ace_support.ace_function, .ace-vibrant-ink .ace_variable { - color: #FFCC00 + color:#FFCC00; } .ace-vibrant-ink .ace_variable.ace_parameter { - font-style: italic + font-style:italic; } .ace-vibrant-ink .ace_string { - color: #66FF00 + color:#66FF00; } .ace-vibrant-ink .ace_string.ace_regexp { - color: #44B4CC + color:#44B4CC; } .ace-vibrant-ink .ace_comment { - color: #9933CC + color:#9933CC; } .ace-vibrant-ink .ace_entity.ace_other.ace_attribute-name { - font-style: italic; - color: #99CC99 + font-style:italic; +color:#99CC99; +} + +.ace-vibrant-ink .ace_entity.ace_name.ace_function { + color:#FFCC00; +} + +.ace-vibrant-ink .ace_markup.ace_underline { + text-decoration:underline; } .ace-vibrant-ink .ace_indent-guide { - background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYNDTc/oPAALPAZ7hxlbYAAAAAElFTkSuQmCC) right repeat-y + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPg5+f/z7Bq1ar/AA5lBCqoLxsgAAAAAElFTkSuQmCC) right repeat-y; } \ No newline at end of file diff --git a/lib/ace/theme/vibrant_ink.js b/lib/ace/theme/vibrant_ink.js index 7156e5de..d0f94415 100644 --- a/lib/ace/theme/vibrant_ink.js +++ b/lib/ace/theme/vibrant_ink.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,8 +39,8 @@ define(function(require, exports, module) { exports.isDark = true; exports.cssClass = "ace-vibrant-ink"; -exports.cssText = require("../requirejs/text!./vibrant_ink.css"); +exports.cssText = require('ace/requirejs/text!./vibrant_ink.css'); -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); + var dom = require("../lib/dom"); + dom.importCssString(exports.cssText, exports.cssClass); }); diff --git a/lib/ace/theme/xcode.css b/lib/ace/theme/xcode.css deleted file mode 100644 index a22bd169..00000000 --- a/lib/ace/theme/xcode.css +++ /dev/null @@ -1,102 +0,0 @@ -/* THIS THEME WAS AUTOGENERATED BY Theme.tmpl.css (UUID: EE3AD170-2B7F-4DE1-B724-C75F13FE0085) */ - -.ace-xcode .ace_gutter { - background: #e8e8e8; - color: #333 -} - -.ace-xcode .ace_print-margin { - width: 1px; - background: #e8e8e8 -} - -.ace-xcode { - background-color: #FFFFFF; - color: #000000 -} - -.ace-xcode .ace_cursor { - color: #000000 -} - -.ace-xcode .ace_marker-layer .ace_selection { - background: #B5D5FF -} - -.ace-xcode.ace_multiselect .ace_selection.ace_start { - box-shadow: 0 0 3px 0px #FFFFFF; -} - -.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 -} \ No newline at end of file diff --git a/lib/ace/theme/xcode.js b/lib/ace/theme/xcode.js deleted file mode 100644 index e17d708d..00000000 --- a/lib/ace/theme/xcode.js +++ /dev/null @@ -1,39 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { - -exports.isDark = false; -exports.cssClass = "ace-xcode"; -exports.cssText = require("../requirejs/text!./xcode.css"); - -var dom = require("../lib/dom"); -dom.importCssString(exports.cssText, exports.cssClass); -}); diff --git a/lib/ace/token_iterator.js b/lib/ace/token_iterator.js index 74376fb3..252eee51 100644 --- a/lib/ace/token_iterator.js +++ b/lib/ace/token_iterator.js @@ -1,30 +1,38 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: +/* vim:ts=4:sts=4:sw=4: + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,19 +40,20 @@ define(function(require, exports, module) { "use strict"; /** - * + * 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. - * @class TokenIterator + * **/ /** - * Creates a new token iterator object. The inital token index is set to the provided row and column coordinates. - * @param {EditSession} session The session to associate with - * @param {Number} initialRow The row to start the tokenizing at - * @param {Number} initialColumn The column to start the tokenizing at + * 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. * - * @constructor **/ var TokenIterator = function(session, initialRow, initialColumn) { this.$session = session; @@ -58,9 +67,10 @@ var TokenIterator = function(session, initialRow, initialColumn) { (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. - * @returns {[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. **/ this.stepBackward = function() { this.$tokenIndex -= 1; @@ -80,17 +90,16 @@ var TokenIterator = function(session, initialRow, initialColumn) { }; /** + * TokenIterator.stepForward() -> String * * Tokenizes all the items from the current point until the next row in the document. If the current point is at the end of the file, this function returns `null`. Otherwise, it returns the tokenized string. - * @returns {String} **/ this.stepForward = function() { + var rowCount = this.$session.getLength(); this.$tokenIndex += 1; - var rowCount; + while (this.$tokenIndex >= this.$rowTokens.length) { this.$row += 1; - if (!rowCount) - rowCount = this.$session.getLength(); if (this.$row >= rowCount) { this.$row = rowCount - 1; return null; @@ -104,27 +113,30 @@ var TokenIterator = function(session, initialRow, initialColumn) { }; /** + * TokenIterator.getCurrentToken() -> String * * Returns the current tokenized string. - * @returns {String} + * **/ this.getCurrentToken = function () { return this.$rowTokens[this.$tokenIndex]; }; /** + * TokenIterator.getCurrentTokenRow() -> Number * * Returns the current row. - * @returns {Number} + * **/ this.getCurrentTokenRow = function () { return this.$row; }; /** + * TokenIterator.getCurrentTokenColumn() -> Number * * Returns the current column. - * @returns {Number} + * **/ this.getCurrentTokenColumn = function() { var rowTokens = this.$rowTokens; diff --git a/lib/ace/token_iterator_test.js b/lib/ace/token_iterator_test.js index c7202e84..9a2d236d 100644 --- a/lib/ace/token_iterator_test.js +++ b/lib/ace/token_iterator_test.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -202,7 +209,7 @@ module.exports = { assert.equal(iterator.getCurrentToken().value, "for"); assert.equal(iterator.getCurrentTokenRow(), 1); assert.equal(iterator.getCurrentTokenColumn(), 4); - } + }, }; }); diff --git a/lib/ace/tokenizer.js b/lib/ace/tokenizer.js index 72490fbb..2ac64b89 100644 --- a/lib/ace/tokenizer.js +++ b/lib/ace/tokenizer.js @@ -1,361 +1,194 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. * - * 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. + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ define(function(require, exports, module) { "use strict"; -var config = require("./config"); -// tokenizing lines longer than this makes editor very slow -var MAX_TOKEN_COUNT = 2000; /** + * 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). - * @class Tokenizer + * **/ /** - * Constructs a new tokenizer based on the given rules and flags. - * @param {Object} rules The highlighting rules + * 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. * - * @constructor **/ -var Tokenizer = function(rules) { - this.states = rules; +var Tokenizer = function(rules, flag) { + flag = flag ? "g" + flag : "g"; + this.rules = rules; this.regExps = {}; this.matchMappings = {}; - for (var key in this.states) { - var state = this.states[key]; + for ( var key in this.rules) { + var rule = this.rules[key]; + var state = rule; var ruleRegExps = []; var matchTotal = 0; - var mapping = this.matchMappings[key] = {defaultToken: "text"}; - var flag = "g"; + var mapping = this.matchMappings[key] = {}; - var splitterRurles = []; - for (var i = 0; i < state.length; i++) { - var rule = state[i]; - if (rule.defaultToken) - mapping.defaultToken = rule.defaultToken; - if (rule.caseInsensitive) - flag = "gi"; - if (rule.regex == null) - continue; + for ( var i = 0; i < state.length; i++) { - if (rule.regex instanceof RegExp) - rule.regex = rule.regex.toString().slice(1, -1); + 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 adjustedregex = rule.regex; - var matchcount = new RegExp("(?:(" + adjustedregex + ")|(.))").exec("a").length - 2; - if (Array.isArray(rule.token)) { - if (rule.token.length == 1 || matchcount == 1) { - rule.token = rule.token[0]; - } else if (matchcount - 1 != rule.token.length) { - this.reportError("number of classes and regexp groups doesn't match", { - rule: rule, - groupCount: matchcount - 1 - }); - rule.token = rule.token[0]; - } else { - rule.tokenArray = rule.token; - rule.token = null; - rule.onMatch = this.$arrayTokens; - } - } else if (typeof rule.token == "function" && !rule.onMatch) { - if (matchcount > 1) - rule.onMatch = this.$applyToken; - else - rule.onMatch = rule.token; - } + var matchcount = new RegExp("(?:(" + state[i].regex + ")|(.))").exec("a").length - 2; - if (matchcount > 1) { - if (/\\\d/.test(rule.regex)) { - // Replace any backreferences and offset appropriately. - adjustedregex = rule.regex.replace(/\\([0-9]+)/g, function(match, digit) { - return "\\" + (parseInt(digit, 10) + matchTotal + 1); - }); - } else { - matchcount = 1; - adjustedregex = this.removeCapturingGroups(rule.regex); - } - if (!rule.splitRegex && typeof rule.token != "string") - splitterRurles.push(rule); // flag will be known only at the very end - } + // Replace any backreferences and offset appropriately. + var adjustedregex = state[i].regex.replace(/\\([0-9]+)/g, function (match, digit) { + return "\\" + (parseInt(digit, 10) + matchTotal + 1); + }); - mapping[matchTotal] = i; + if (matchcount > 1 && state[i].token.length !== matchcount-1) + throw new Error("Matching groups and length of the token array don't match in rule #" + i + " of state " + key); + + mapping[matchTotal] = { + rule: i, + len: matchcount + }; matchTotal += matchcount; ruleRegExps.push(adjustedregex); - - // makes property access faster - if (!rule.onMatch) - rule.onMatch = null; } - - if (!ruleRegExps.length) { - mapping[0] = 0; - ruleRegExps.push("$"); - } - - splitterRurles.forEach(function(rule) { - rule.splitRegex = this.createSplitterRegexp(rule.regex, flag); - }, this); - this.regExps[key] = new RegExp("(" + ruleRegExps.join(")|(") + ")|($)", flag); + this.regExps[key] = new RegExp("(?:(" + ruleRegExps.join(")|(") + ")|(.))", flag); } }; (function() { - this.$setMaxTokenCount = function(m) { - MAX_TOKEN_COUNT = m | 0; - }; - - this.$applyToken = function(str) { - var values = this.splitRegex.exec(str).slice(1); - var types = this.token.apply(this, values); - - // required for compatibility with old modes - if (typeof types === "string") - return [{type: types, value: str}]; - - var tokens = []; - for (var i = 0, l = types.length; i < l; i++) { - if (values[i]) - tokens[tokens.length] = { - type: types[i], - value: values[i] - }; - } - return tokens; - }, - - this.$arrayTokens = function(str) { - if (!str) - return []; - var values = this.splitRegex.exec(str); - if (!values) - return "text"; - var tokens = []; - var types = this.tokenArray; - for (var i = 0, l = types.length; i < l; i++) { - if (values[i + 1]) - tokens[tokens.length] = { - type: types[i], - value: values[i + 1] - }; - } - return tokens; - }; - - this.removeCapturingGroups = function(src) { - var r = src.replace( - /\[(?:\\.|[^\]])*?\]|\\.|\(\?[:=!]|(\()/g, - function(x, y) {return y ? "(?:" : x;} - ); - return r; - }; - - this.createSplitterRegexp = function(src, flag) { - if (src.indexOf("(?=") != -1) { - var stack = 0; - var inChClass = false; - var lastCapture = {}; - src.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g, function( - m, esc, parenOpen, parenClose, square, index - ) { - if (inChClass) { - inChClass = square != "]"; - } else if (square) { - inChClass = true; - } else if (parenClose) { - if (stack == lastCapture.stack) { - lastCapture.end = index+1; - lastCapture.stack = -1; - } - stack--; - } else if (parenOpen) { - stack++; - if (parenOpen.length != 1) { - lastCapture.stack = stack - lastCapture.start = index; - } - } - return m; - }); - - if (lastCapture.end != null && /^\)*$/.test(src.substr(lastCapture.end))) - src = src.substring(0, lastCapture.start) + src.substr(lastCapture.end); - } - return new RegExp(src, (flag||"").replace("g", "")); - }; /** + * Tokenizer.getLineTokens() -> Object + * * Returns an object containing two properties: `tokens`, which contains all the tokens; and `state`, the current state. - * @returns {Object} **/ this.getLineTokens = function(line, startState) { - if (startState && typeof startState != "string") { - var stack = startState.slice(0); - startState = stack[0]; - if (startState === "#tmp") { - stack.shift() - startState = stack.shift() - } - } else - var stack = []; - var currentState = startState || "start"; - var state = this.states[currentState]; - if (!state) { - currentState = "start"; - state = this.states[currentState]; - } + 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 matchAttempts = 0; - var token = {type: null, value: ""}; + var lastIndex = 0; + + var token = { + type: null, + value: "" + }; while (match = re.exec(line)) { - var type = mapping.defaultToken; + var type = "text"; var rule = null; - var value = match[0]; - var index = re.lastIndex; - - if (index - value.length > lastIndex) { - var skipped = line.substring(lastIndex, index - value.length); - if (token.type == type) { - token.value += skipped; - } else { - if (token.type) - tokens.push(token); - token = {type: type, value: skipped}; - } - } + var value = [match[0]]; for (var i = 0; i < match.length-2; i++) { if (match[i + 1] === undefined) continue; - rule = state[mapping[i]]; + rule = state[mapping[i].rule]; - if (rule.onMatch) - type = rule.onMatch(value, currentState, stack); + 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) { - if (typeof rule.next == "string") { - currentState = rule.next; - } else { - currentState = rule.next(currentState, stack); - } - - state = this.states[currentState]; - if (!state) { - this.reportError("state doesn't exist", currentState); - currentState = "start"; - state = this.states[currentState]; - } + currentState = rule.next; + state = this.rules[currentState]; mapping = this.matchMappings[currentState]; - lastIndex = index; + lastIndex = re.lastIndex; + re = this.regExps[currentState]; - re.lastIndex = index; + re.lastIndex = lastIndex; } break; } - if (value) { - if (typeof type === "string") { - if ((!rule || rule.merge !== false) && token.type === type) { - token.value += value; + 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, value: value}; + + token = { + type: type[i], + value: value[i] + }; } - } else if (type) { - if (token.type) - tokens.push(token); - token = {type: null, value: ""}; - for (var i = 0; i < type.length; i++) - tokens.push(type[i]); } } if (lastIndex == line.length) break; - lastIndex = index; - - if (matchAttempts++ > MAX_TOKEN_COUNT) { - if (matchAttempts > 2 * line.length) { - this.reportError("infinite loop with in ace tokenizer", { - startState: startState, - line: line - }); - } - // chrome doens't show contents of text nodes with very long text - while (lastIndex < line.length) { - if (token.type) - tokens.push(token); - token = { - value: line.substring(lastIndex, lastIndex += 2000), - type: "overflow" - }; - } - currentState = "start"; - stack = []; - break; - } + lastIndex = re.lastIndex; } if (token.type) tokens.push(token); - - if (stack.length > 1) { - if (stack[0] !== currentState) - stack.unshift("#tmp", currentState); - } + return { tokens : tokens, - state : stack.length ? stack : currentState + state : currentState }; }; - - this.reportError = config.reportError; - + }).call(Tokenizer.prototype); exports.Tokenizer = Tokenizer; diff --git a/lib/ace/tokenizer_dev.js b/lib/ace/tokenizer_dev.js deleted file mode 100644 index 61821f60..00000000 --- a/lib/ace/tokenizer_dev.js +++ /dev/null @@ -1,183 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -var BaseTokenizer = require("./tokenizer").Tokenizer; - -// tokenizing lines longer than this makes editor very slow -var MAX_TOKEN_COUNT = 100000; -/* - * version of Tokenizer with additional logging - * and infinite loop checks - * can be used for developing/testing new modes - **/ - -var Tokenizer = function(rules) { - BaseTokenizer.call(this, rules); - - /** - * Returns an object containing two properties: `tokens`, which contains all the tokens; and `state`, the current state. - * @returns {Object} - **/ - this.getLineTokens = function(line, startState) { - if (startState && typeof startState != "string") { - var stack = startState.slice(0); - startState = stack[0]; - } else - var stack = []; - - var currentState = startState || "start"; - var state = this.states[currentState]; - var mapping = this.matchMappings[currentState]; - var re = this.regExps[currentState]; - re.lastIndex = 0; - - var match, tokens = []; - - var lastIndex = 0; - - var stateTransitions = []; - function onStateChange() { - stateTransitions.push(startState+"@"+lastIndex); - } - function initState() { - onStateChange(); - stateTransitions = []; - onStateChange(); - } - - var token = { - type: null, - value: "", - state: currentState - }; - initState(); - - var maxRecur = 100000; - - while (match = re.exec(line)) { - var type = mapping.defaultToken; - var rule = null; - var value = match[0]; - var index = re.lastIndex; - - if (index - value.length > lastIndex) { - var skipped = line.substring(lastIndex, index - value.length); - if (token.type == type) { - token.value += skipped; - } else { - if (token.type) - tokens.push(token); - token = {type: type, value: skipped}; - } - } - - for (var i = 0; i < match.length-2; i++) { - if (match[i + 1] === undefined) - continue; - - if (!maxRecur--) { - throw "infinite" + state[mapping[i]] + currentState - } - - rule = state[mapping[i]]; - - if (rule.onMatch) - type = rule.onMatch(value, currentState, stack); - else - type = rule.token; - - if (rule.next) { - if (typeof rule.next == "string") - currentState = rule.next; - else - currentState = rule.next(currentState, stack); - - state = this.states[currentState]; - if (!state) { - window.console && console.error && console.error(currentState, "doesn't exist"); - currentState = "start"; - state = this.states[currentState]; - } - mapping = this.matchMappings[currentState]; - lastIndex = index; - re = this.regExps[currentState]; - re.lastIndex = index; - - onStateChange(); - } - break; - } - - if (value) { - if (typeof type == "string") { - if ((!rule || rule.merge !== false) && token.type === type) { - token.value += value; - } else { - if (token.type) - tokens.push(token); - token = {type: type, value: value}; - } - } else { - if (token.type) - tokens.push(token); - token = {type: null, value: ""}; - for (var i = 0; i < type.length; i++) - tokens.push(type[i]); - } - } - - if (lastIndex == line.length) - break; - - lastIndex = index; - - if (tokens.length > MAX_TOKEN_COUNT) { - token.value += line.substr(lastIndex); - currentState = "start" - break; - } - } - - if (token.type) - tokens.push(token); - - return { - tokens : tokens, - state : stack.length ? stack : currentState - }; - }; - -}; - -Tokenizer.prototype = BaseTokenizer.prototype; - -exports.Tokenizer = Tokenizer; -}); diff --git a/lib/ace/tokenizer_test.js b/lib/ace/tokenizer_test.js deleted file mode 100644 index 41bf01c8..00000000 --- a/lib/ace/tokenizer_test.js +++ /dev/null @@ -1,97 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - - if (typeof process !== "undefined") { - require("amd-loader"); - } - -define(function(require, exports, module) { -"use strict"; - -var Tokenizer = require("./tokenizer").Tokenizer; -var assert = require("./test/assertions"); - -module.exports = { - "test: createSplitterRegexp" : function() { - var t = new Tokenizer({}); - var re = t.createSplitterRegexp("(a)(b)(?=[x)(])"); - assert.equal(re.source, "(a)(b)"); - var re = t.createSplitterRegexp("xc(?=([x)(]))"); - assert.equal(re.source, "xc"); - var re = t.createSplitterRegexp("(xc(?=([x)(])))"); - assert.equal(re.source, "(xc)"); - var re = t.createSplitterRegexp("(?=r)[(?=)](?=([x)(]))"); - assert.equal(re.source, "(?=r)[(?=)]"); - var re = t.createSplitterRegexp("(?=r)[(?=)](\\?=t)"); - assert.equal(re.source, "(?=r)[(?=)](\\?=t)"); - var re = t.createSplitterRegexp("[(?=)](\\?=t)"); - assert.equal(re.source, "[(?=)](\\?=t)"); - }, - - "test: removeCapturingGroups" : function() { - var t = new Tokenizer({}); - var re = t.removeCapturingGroups("(ax(by))[()]"); - assert.equal(re, "(?:ax(?:by))[()]"); - }, - - "test: broken highlight rules": function() { - var t = new Tokenizer({ - start: [{ - token: 's', - regex: '&&&|^^^' - }, { - defaultToken: "def" - }], - state1: [{ - token: 'x', - regex: /\b([\w]*)(\s*)((?::)?)/ - }] - }); - var errorReports = 0; - t.reportError = function() { errorReports++; }; - var tokens = t.getLineTokens("x|", "start"); - assert.deepEqual(tokens, { - tokens: [{value: 'x|', type: 'overflow'}], - state: 'start' - }); - var tokens = t.getLineTokens("x|", "state1"); - assert.deepEqual(tokens, { - tokens: [{value: 'x', type: 'x'}, {value: '|', type: 'overflow'}], - state: 'start' - }); - assert.equal(errorReports, 2); - }, -}; - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec() -} diff --git a/lib/ace/tooltip.js b/lib/ace/tooltip.js deleted file mode 100644 index 1f5502d6..00000000 --- a/lib/ace/tooltip.js +++ /dev/null @@ -1,138 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -define(function(require, exports, module) { -"use strict"; - -var oop = require("./lib/oop"); -var dom = require("./lib/dom"); - -/** - * @class Tooltip - **/ - -/** - * @param {Element} parentNode - * - * @constructor - **/ -function Tooltip (parentNode) { - this.isOpen = false; - this.$element = null; - this.$parentNode = parentNode; -} - -(function() { - this.$init = function() { - this.$element = dom.createElement("div"); - this.$element.className = "ace_tooltip"; - this.$element.style.display = "none"; - this.$parentNode.appendChild(this.$element); - return this.$element; - }; - - /** - * @returns {Element} - **/ - this.getElement = function() { - return this.$element || this.$init(); - }; - - /** - * @param {String} text - **/ - this.setText = function(text) { - dom.setInnerText(this.getElement(), text); - }; - - /** - * @param {String} html - **/ - this.setHtml = function(html) { - this.getElement().innerHTML = html; - }; - - /** - * @param {Number} x - * @param {Number} y - **/ - this.setPosition = function(x, y) { - this.getElement().style.left = x + "px"; - this.getElement().style.top = y + "px"; - }; - - /** - * @param {String} className - **/ - this.setClassName = function(className) { - dom.addCssClass(this.getElement(), className); - }; - - /** - * @param {String} text - * @param {Number} x - * @param {Number} y - **/ - this.show = function(text, x, y) { - if (text != null) - this.setText(text); - if (x != null && y != null) - this.setPosition(x, y); - if (!this.isOpen) { - this.getElement().style.display = "block"; - this.isOpen = true; - } - }; - - this.hide = function() { - if (this.isOpen) { - this.getElement().style.display = "none"; - this.isOpen = false; - } - }; - - /** - * @returns {Number} - **/ - this.getHeight = function() { - return this.getElement().offsetHeight; - }; - - /** - * @returns {Number} - **/ - this.getWidth = function() { - return this.getElement().offsetWidth; - }; - -}).call(Tooltip.prototype); - -exports.Tooltip = Tooltip; -}); diff --git a/lib/ace/undomanager.js b/lib/ace/undomanager.js index 6da50a8b..67c30f38 100644 --- a/lib/ace/undomanager.js +++ b/lib/ace/undomanager.js @@ -1,30 +1,39 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: +/* vim:ts=4:sts=4:sw=4: + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * Mihai Sucan + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,18 +41,16 @@ define(function(require, exports, module) { "use strict"; /** - * + * class UndoManager * * This object maintains the undo stack for an [[EditSession `EditSession`]]. - * @class UndoManager + * **/ /** - * + * new UndoManager() * * Resets the current undo state and creates a new `UndoManager`. - * - * @constructor **/ var UndoManager = function() { this.reset(); @@ -52,163 +59,84 @@ var UndoManager = function() { (function() { /** - * 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 - * - * @param {Object} options Contains additional properties - * - **/ + * 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) { - // Normalize deltas for storage. - // var deltaSets = this.$serializeDeltas(options.args[0]); - var deltaSets = options.args[0]; - // Add deltas to undo stack. + var deltas = options.args[0]; this.$doc = options.args[1]; - if (options.merge && this.hasUndo()){ - this.dirtyCounter--; - deltaSets = this.$undoStack.pop().concat(deltaSets); - } - this.$undoStack.push(deltaSets); - - // Reset redo stack. + this.$undoStack.push(deltas); this.$redoStack = []; - if (this.dirtyCounter < 0) { - // The user has made a change after undoing past the last clean state. - // We can never get back to a clean state now until markClean() is called. - this.dirtyCounter = NaN; - } - this.dirtyCounter++; }; /** - * [Perform an undo operation on the document, reverting the last change.]{: #UndoManager.undo} - * @param {Boolean} dontSelect {:dontSelect} - * - * - * @returns {Range} The range of the undo. - **/ + * UndoManager.undo(dontSelect) -> Range + * - dontSelect (Boolean): {:dontSelect} + * + * [Perform an undo operation on the document, reverting the last change. Returns the range of the undo.]{: #UndoManager.undo} + **/ this.undo = function(dontSelect) { - var deltaSets = this.$undoStack.pop(); + var deltas = this.$undoStack.pop(); var undoSelectionRange = null; - if (deltaSets) { - undoSelectionRange = this.$doc.undoChanges(this.$deserializeDeltas(deltaSets), dontSelect); - this.$redoStack.push(deltaSets); - this.dirtyCounter--; + if (deltas) { + undoSelectionRange = + this.$doc.undoChanges(deltas, dontSelect); + this.$redoStack.push(deltas); } - return undoSelectionRange; }; /** - * [Perform a redo operation on the document, reimplementing the last change.]{: #UndoManager.redo} - * @param {Boolean} dontSelect {:dontSelect} - * - * - **/ + * UndoManager.redo(dontSelect) -> Void + * - dontSelect (Boolean): {:dontSelect} + * + * [Perform a redo operation on the document, reimplementing the last change.]{: #UndoManager.redo} + **/ this.redo = function(dontSelect) { - var deltaSets = this.$redoStack.pop(); + var deltas = this.$redoStack.pop(); var redoSelectionRange = null; - if (deltaSets) { + if (deltas) { redoSelectionRange = - this.$doc.redoChanges(this.$deserializeDeltas(deltaSets), dontSelect); - this.$undoStack.push(deltaSets); - this.dirtyCounter++; + this.$doc.redoChanges(deltas, dontSelect); + this.$undoStack.push(deltas); } return redoSelectionRange; }; /** - * - * Destroys the stack of undo and redo redo operations. - **/ + * UndoManager.reset() -> Void + * + * Destroys the stack of undo and redo redo operations. + **/ this.reset = function() { this.$undoStack = []; this.$redoStack = []; - this.dirtyCounter = 0; }; /** - * - * Returns `true` if there are undo operations left to perform. - * @returns {Boolean} - **/ + * UndoManager.hasUndo() -> Boolean + * + * Returns `true` if there are undo operations left to perform. + **/ this.hasUndo = function() { return this.$undoStack.length > 0; }; /** - * - * Returns `true` if there are redo operations left to perform. - * @returns {Boolean} - **/ + * UndoManager.hasRedo() -> Boolean + * + * Returns `true` if there are redo operations left to perform. + **/ this.hasRedo = function() { return this.$redoStack.length > 0; }; - /** - * - * Marks the current status clean - **/ - this.markClean = function() { - this.dirtyCounter = 0; - }; - - /** - * - * Returns if the current status is clean - * @returns {Boolean} - **/ - this.isClean = function() { - return this.dirtyCounter === 0; - }; - - // Serializes deltaSets to reduce memory usage. - this.$serializeDeltas = function(deltaSets) { - return cloneDeltaSetsObj(deltaSets, $serializeDelta); - }; - - // Deserializes deltaSets to allow application to the document. - this.$deserializeDeltas = function(deltaSets) { - return cloneDeltaSetsObj(deltaSets, $deserializeDelta); - }; - - function $serializeDelta(delta){ - return { - action: delta.action, - start: delta.start, - end: delta.end, - lines: delta.lines.length == 1 ? null : delta.lines, - text: delta.lines.length == 1 ? delta.lines[0] : null, - }; - } - - function $deserializeDelta(delta) { - return { - action: delta.action, - start: delta.start, - end: delta.end, - lines: delta.lines || [delta.text] - }; - } - - function cloneDeltaSetsObj(deltaSets_old, fnGetModifiedDelta) { - var deltaSets_new = new Array(deltaSets_old.length); - for (var i = 0; i < deltaSets_old.length; i++) { - var deltaSet_old = deltaSets_old[i]; - var deltaSet_new = { group: deltaSet_old.group, deltas: new Array(deltaSet_old.length)}; - - for (var j = 0; j < deltaSet_old.deltas.length; j++) { - var delta_old = deltaSet_old.deltas[j]; - deltaSet_new.deltas[j] = fnGetModifiedDelta(delta_old); - } - - deltaSets_new[i] = deltaSet_new; - } - return deltaSets_new; - } - }).call(UndoManager.prototype); exports.UndoManager = UndoManager; diff --git a/lib/ace/virtual_renderer.js b/lib/ace/virtual_renderer.js index 45226a1d..69a04240 100644 --- a/lib/ace/virtual_renderer.js +++ b/lib/ace/virtual_renderer.js @@ -1,30 +1,40 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: +/* vim:ts=4:sts=4:sw=4: + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. * - * 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. + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * Irakli Gozalishvili (http://jeditoolkit.com) + * Julian Viereck + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -33,48 +43,50 @@ define(function(require, exports, module) { var oop = require("./lib/oop"); var dom = require("./lib/dom"); -var config = require("./config"); +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 HScrollBar = require("./scrollbar").HScrollBar; -var VScrollBar = require("./scrollbar").VScrollBar; +var ScrollBar = require("./scrollbar").ScrollBar; var RenderLoop = require("./renderloop").RenderLoop; -var FontMetrics = require("./layer/font_metrics").FontMetrics; var EventEmitter = require("./lib/event_emitter").EventEmitter; -var editorCss = require("./requirejs/text!./css/editor.css"); +var editorCss = require("ace/requirejs/text!./css/editor.css"); -dom.importCssString(editorCss, "ace_editor.css"); +dom.importCssString(editorCss, "ace_editor"); /** + * class VirtualRenderer + * * The class that is responsible for drawing everything you see on the screen! - * @related editor.renderer - * @class VirtualRenderer + * **/ /** - * Constructs a new `VirtualRenderer` within the `container` specified, applying the given `theme`. - * @param {DOMElement} container The root element of the editor - * @param {String} theme The starting theme + * 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`. * - * @constructor **/ var VirtualRenderer = function(container, theme) { var _self = this; - this.container = container || dom.createElement("div"); + 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); +// // 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.isOldIE; + this.$keepTextAreaAtCursor = !useragent.isIE; - dom.addCssClass(this.container, "ace_editor"); + dom.addCssClass(container, "ace_editor"); this.setTheme(theme); @@ -90,8 +102,9 @@ var VirtualRenderer = function(container, theme) { this.content.className = "ace_content"; this.scroller.appendChild(this.content); + this.setHighlightGutterLine(true); this.$gutterLayer = new GutterLayer(this.$gutter); - this.$gutterLayer.on("changeGutterWidth", this.onGutterResize.bind(this)); + this.$gutterLayer.on("changeGutterWidth", this.onResize.bind(this, true)); this.$markerBack = new MarkerLayer(this.content); @@ -100,46 +113,52 @@ var VirtualRenderer = function(container, theme) { 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.$vScroll = false; + this.$horizScrollAlwaysVisible = false; - this.scrollBar = - this.scrollBarV = new VScrollBar(this.container, this); - this.scrollBarH = new HScrollBar(this.container, this); - this.scrollBarV.addEventListener("scroll", function(e) { - if (!_self.$scrollAnimation) - _self.session.setScrollTop(e.data - _self.scrollMargin.top); - }); - this.scrollBarH.addEventListener("scroll", function(e) { - if (!_self.$scrollAnimation) - _self.session.setScrollLeft(e.data - _self.scrollMargin.left); + 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.$fontMetrics = new FontMetrics(this.container, 500); - this.$textLayer.$setFontMetrics(this.$fontMetrics); - this.$textLayer.addEventListener("changeCharacterSize", function(e) { - _self.updateCharacterSize(); - _self.onResize(true, _self.gutterWidth, _self.$size.width, _self.$size.height); - _self._signal("changeCharacterSize", e); + 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, - $dirty: true + scrollerWidth: 0 }; this.layerConfig = { @@ -148,22 +167,12 @@ var VirtualRenderer = function(container, theme) { firstRow : 0, firstRowScreen: 0, lastRow : 0, - lineHeight : 0, - characterWidth : 0, + lineHeight : 1, + characterWidth : 1, minHeight : 1, maxHeight : 1, offset : 0, - height : 1, - gutterOffset: 1 - }; - - this.scrollMargin = { - left: 0, - right: 0, - top: 0, - bottom: 0, - v: 0, - h: 0 + height : 1 }; this.$loop = new RenderLoop( @@ -172,13 +181,12 @@ var VirtualRenderer = function(container, theme) { ); this.$loop.schedule(this.CHANGE_FULL); - this.updateCharacterSize(); this.setPadding(4); - config.resetOptions(this); - config._emit("renderer", this); + this.$updatePrintMargin(); }; (function() { + this.showGutter = true; this.CHANGE_CURSOR = 1; this.CHANGE_MARKER = 2; @@ -192,73 +200,35 @@ var VirtualRenderer = function(container, theme) { this.CHANGE_FULL = 512; this.CHANGE_H_SCROLL = 1024; - // this.$logChanges = function(changes) { - // var a = "" - // if (changes & this.CHANGE_CURSOR) a += " cursor"; - // if (changes & this.CHANGE_MARKER) a += " marker"; - // if (changes & this.CHANGE_GUTTER) a += " gutter"; - // if (changes & this.CHANGE_SCROLL) a += " scroll"; - // if (changes & this.CHANGE_LINES) a += " lines"; - // if (changes & this.CHANGE_TEXT) a += " text"; - // if (changes & this.CHANGE_SIZE) a += " size"; - // if (changes & this.CHANGE_MARKER_BACK) a += " marker_back"; - // if (changes & this.CHANGE_MARKER_FRONT) a += " marker_front"; - // if (changes & this.CHANGE_FULL) a += " full"; - // if (changes & this.CHANGE_H_SCROLL) a += " h_scroll"; - // console.log(a.trim()) - // }; - oop.implement(this, EventEmitter); - this.updateCharacterSize = function() { - if (this.$textLayer.allowBoldFonts != this.$allowBoldFonts) { - this.$allowBoldFonts = this.$textLayer.allowBoldFonts; - this.setStyle("ace_nobold", !this.$allowBoldFonts); - } - - this.layerConfig.characterWidth = - this.characterWidth = this.$textLayer.getCharacterWidth(); - this.layerConfig.lineHeight = - this.lineHeight = this.$textLayer.getLineHeight(); - this.$updatePrintMargin(); - }; - /** - * - * Associates the renderer with an [[EditSession `EditSession`]]. + * VirtualRenderer.setSession(session) -> Void + * + * Associates an [[EditSession `EditSession`]]. **/ this.setSession = function(session) { - if (this.session) - this.session.doc.off("changeNewLineMode", this.onChangeNewLineMode); - this.session = session; - if (session && this.scrollMargin.top && session.getScrollTop() <= 0) - session.setScrollTop(-this.scrollMargin.top); - + + 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); - if (!session) - return; - this.$loop.schedule(this.CHANGE_FULL); - this.session.$setFontMetrics(this.$fontMetrics); - this.onChangeNewLineMode = this.onChangeNewLineMode.bind(this); - this.onChangeNewLineMode() - this.session.doc.on("changeNewLineMode", this.onChangeNewLineMode); }; /** + * VirtualRenderer.updateLines(firstRow, lastRow) -> Void + * - firstRow (Number): The first row to update + * - lastRow (Number): The last row to update + * * Triggers a partial update of the text, from the range given by the two parameters. - * @param {Number} firstRow The first row to update - * @param {Number} lastRow The last row to update - * - * **/ - this.updateLines = function(firstRow, lastRow, force) { + this.updateLines = function(firstRow, lastRow) { if (lastRow === undefined) lastRow = Infinity; @@ -276,32 +246,17 @@ var VirtualRenderer = function(container, theme) { this.$changedLines.lastRow = lastRow; } - // If the change happened offscreen above us then it's possible - // that a new line wrap will affect the position of the lines on our - // screen so they need redrawn. - // TODO: better solution is to not change scroll position when text is changed outside of visible area - if (this.$changedLines.lastRow < this.layerConfig.firstRow) { - if (force) - this.$changedLines.lastRow = this.layerConfig.lastRow; - else - return; - } - if (this.$changedLines.firstRow > this.layerConfig.lastRow) - return; this.$loop.schedule(this.CHANGE_LINES); }; - this.onChangeNewLineMode = function() { - this.$loop.schedule(this.CHANGE_TEXT); - this.$textLayer.$updateEolChar(); - }; - this.onChangeTabSize = function() { this.$loop.schedule(this.CHANGE_TEXT | this.CHANGE_MARKER); this.$textLayer.onChangeTabSize(); }; /** + * VirtualRenderer.updateText() -> Void + * * Triggers a full update of the text, for all the rows. **/ this.updateText = function() { @@ -309,19 +264,21 @@ var VirtualRenderer = function(container, theme) { }; /** + * VirtualRenderer.updateFull() -> Void + * * Triggers a full update of all the layers, for all the rows. - * @param {Boolean} force If `true`, forces the changes through - * - * **/ this.updateFull = function(force) { - if (force) + if (force){ this.$renderChanges(this.CHANGE_FULL, true); - else + } + else { this.$loop.schedule(this.CHANGE_FULL); + } }; /** + * VirtualRenderer.updateFontSize() -> Void * * Updates the font size. **/ @@ -329,299 +286,272 @@ var VirtualRenderer = function(container, theme) { this.$textLayer.checkForSizeChanges(); }; - this.$changes = 0; - this.$updateSizeAsync = function() { - if (this.$loop.pending) - this.$size.$dirty = true; - else - this.onResize(); - }; /** + * VirtualRenderer.onResize(force) -> Void + * - force (Boolean): If `true`, recomputes the size, even if the height and width haven't changed + * * [Triggers a resize of the editor.]{: #VirtualRenderer.onResize} - * @param {Boolean} force If `true`, recomputes the size, even if the height and width haven't changed - * @param {Number} gutterWidth The width of the gutter in pixels - * @param {Number} width The width of the editor in pixels - * @param {Number} height The hiehgt of the editor, in pixels - * - * **/ 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 > 0) + else if (this.resizing > 1) this.resizing++; else this.resizing = force ? 1 : 0; - // `|| el.scrollHeight` is required for outosizing editors on ie - // where elements with clientHeight = 0 alsoe have clientWidth = 0 - var el = this.container; + if (!height) - height = el.clientHeight || el.scrollHeight; - if (!width) - width = el.clientWidth || el.scrollWidth; - var changes = this.$updateCachedSize(force, gutterWidth, width, height); - - - if (!this.$size.scrollerHeight || (!width && !height)) - return this.resizing = 0; - - if (force) - this.$gutterLayer.$padding = null; - - if (force) - this.$renderChanges(changes | this.$changes, true); - else - this.$loop.schedule(changes | this.$changes); - - if (this.resizing) - this.resizing = 0; - // reset cached values on scrollbars, needs to be removed when switching to non-native scrollbars - // see https://github.com/ajaxorg/ace/issues/2195 - this.scrollBarV.scrollLeft = this.scrollBarV.scrollTop = null; - }; - - this.$updateCachedSize = function(force, gutterWidth, width, height) { - height -= (this.$extraHeight || 0); - var changes = 0; - var size = this.$size; - var oldSize = { - width: size.width, - height: size.height, - scrollerHeight: size.scrollerHeight, - scrollerWidth: size.scrollerWidth - }; - if (height && (force || size.height != height)) { + height = dom.getInnerHeight(this.container); + if (force || size.height != height) { size.height = height; - changes |= this.CHANGE_SIZE; - size.scrollerHeight = size.height; - if (this.$horizScroll) - size.scrollerHeight -= this.scrollBarH.getHeight(); - - // this.scrollBarV.setHeight(size.scrollerHeight); - this.scrollBarV.element.style.bottom = this.scrollBarH.getHeight() + "px"; + this.scroller.style.height = height + "px"; + size.scrollerHeight = this.scroller.clientHeight; + this.scrollBar.setHeight(size.scrollerHeight); - changes = changes | this.CHANGE_SCROLL; + if (this.session) { + this.session.setScrollTop(this.getScrollTop()); + changes = changes | this.CHANGE_FULL; + } } - if (width && (force || size.width != width)) { - changes |= this.CHANGE_SIZE; + if (!width) + width = dom.getInnerWidth(this.container); + if (force || this.resizing > 1 || size.width != width) { size.width = width; - - if (gutterWidth == null) - gutterWidth = this.$showGutter ? this.$gutter.offsetWidth : 0; - - this.gutterWidth = gutterWidth; - - this.scrollBarH.element.style.left = + + var gutterWidth = this.showGutter ? this.$gutter.offsetWidth : 0; this.scroller.style.left = gutterWidth + "px"; - size.scrollerWidth = Math.max(0, width - gutterWidth - this.scrollBarV.getWidth()); - - this.scrollBarH.element.style.right = - this.scroller.style.right = this.scrollBarV.getWidth() + "px"; - this.scroller.style.bottom = this.scrollBarH.getHeight() + "px"; - - // this.scrollBarH.element.style.setWidth(size.scrollerWidth); + size.scrollerWidth = Math.max(0, width - gutterWidth - this.scrollBar.getWidth()); + this.scroller.style.right = this.scrollBar.getWidth() + "px"; - if (this.session && this.session.getUseWrapMode() && this.adjustWrapLimit() || force) - changes |= this.CHANGE_FULL; + if (this.session.getUseWrapMode() && this.adjustWrapLimit() || force) + changes = changes | this.CHANGE_FULL; } + + if (force) + this.$renderChanges(changes, true); + else + this.$loop.schedule(changes); - size.$dirty = !width || !height; - - if (changes) - this._signal("resize", oldSize); - - return changes; - }; - - this.onGutterResize = function() { - var gutterWidth = this.$showGutter ? this.$gutter.offsetWidth : 0; - if (gutterWidth != this.gutterWidth) - this.$changes |= this.$updateCachedSize(true, gutterWidth, this.$size.width, this.$size.height); - - if (this.session.getUseWrapMode() && this.adjustWrapLimit()) { - this.$loop.schedule(this.CHANGE_FULL); - } else if (this.$size.$dirty) { - this.$loop.schedule(this.CHANGE_FULL); - } else { - this.$computeLayerConfig(); - this.$loop.schedule(this.CHANGE_MARKER); - } + if (force) + delete this.resizing; }; /** + * VirtualRenderer.adjustWrapLimit() -> Void + * * Adjusts the wrap limit, which is the number of characters that can fit within the width of the edit area on screen. **/ this.adjustWrapLimit = function() { var availableWidth = this.$size.scrollerWidth - this.$padding * 2; var limit = Math.floor(availableWidth / this.characterWidth); - return this.session.adjustWrapLimit(limit, this.$showPrintMargin && this.$printMarginColumn); + return this.session.adjustWrapLimit(limit); }; /** + * VirtualRenderer.setAnimatedScroll(shouldAnimate) -> Void + * - shouldAnimate (Boolean): Set to `true` to show animated scrolls + * * Identifies whether you want to have an animated scroll or not. - * @param {Boolean} shouldAnimate Set to `true` to show animated scrolls * **/ this.setAnimatedScroll = function(shouldAnimate){ - this.setOption("animatedScroll", shouldAnimate); + this.$animatedScroll = shouldAnimate; }; /** + * VirtualRenderer.getAnimatedScroll() -> Boolean + * * Returns whether an animated scroll happens or not. - * @returns {Boolean} **/ this.getAnimatedScroll = function() { return this.$animatedScroll; }; /** + * VirtualRenderer.setShowInvisibles(showInvisibles) -> Void + * - showInvisibles (Boolean): Set to `true` to show invisibles + * * Identifies whether you want to show invisible characters or not. - * @param {Boolean} showInvisibles Set to `true` to show invisibles * **/ this.setShowInvisibles = function(showInvisibles) { - this.setOption("showInvisibles", showInvisibles); + if (this.$textLayer.setShowInvisibles(showInvisibles)) + this.$loop.schedule(this.CHANGE_TEXT); }; /** + * VirtualRenderer.getShowInvisibles() -> Boolean + * * Returns whether invisible characters are being shown or not. - * @returns {Boolean} **/ this.getShowInvisibles = function() { - return this.getOption("showInvisibles"); - }; - this.getDisplayIndentGuides = function() { - return this.getOption("displayIndentGuides"); + return this.$textLayer.showInvisibles; }; - this.setDisplayIndentGuides = function(display) { - this.setOption("displayIndentGuides", display); + 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; /** + * VirtualRenderer.setShowPrintMargin(showPrintMargin) + * - showPrintMargin (Boolean): Set to `true` to show the print margin + * * Identifies whether you want to show the print margin or not. - * @param {Boolean} showPrintMargin Set to `true` to show the print margin * **/ this.setShowPrintMargin = function(showPrintMargin) { - this.setOption("showPrintMargin", showPrintMargin); + this.$showPrintMargin = showPrintMargin; + this.$updatePrintMargin(); }; /** - * Returns whether the print margin is being shown or not. - * @returns {Boolean} + * VirtualRenderer.getShowPrintMargin() -> Boolean + * + * Returns whetherthe print margin is being shown or not. **/ this.getShowPrintMargin = function() { - return this.getOption("showPrintMargin"); + return this.$showPrintMargin; }; + + this.$printMarginColumn = 80; + /** + * VirtualRenderer.setPrintMarginColumn(showPrintMargin) + * - showPrintMargin (Boolean): Set to `true` to show the print margin column + * * Identifies whether you want to show the print margin column or not. - * @param {Boolean} showPrintMargin Set to `true` to show the print margin column * **/ this.setPrintMarginColumn = function(showPrintMargin) { - this.setOption("printMarginColumn", showPrintMargin); + this.$printMarginColumn = showPrintMargin; + this.$updatePrintMargin(); }; /** + * VirtualRenderer.getPrintMarginColumn() -> Boolean + * * Returns whether the print margin column is being shown or not. - * @returns {Boolean} **/ this.getPrintMarginColumn = function() { - return this.getOption("printMarginColumn"); + return this.$printMarginColumn; }; /** + * VirtualRenderer.getShowGutter() -> Boolean + * * Returns `true` if the gutter is being shown. - * @returns {Boolean} **/ this.getShowGutter = function(){ - return this.getOption("showGutter"); + return this.showGutter; }; /** - * Identifies whether you want to show the gutter or not. - * @param {Boolean} show Set to `true` to show the gutter + * VirtualRenderer.setShowGutter(show) -> Void + * - show (Boolean): Set to `true` to show the gutter * + * Identifies whether you want to show the gutter or not. **/ this.setShowGutter = function(show){ - return this.setOption("showGutter", show); + if(this.showGutter === show) + return; + this.$gutter.style.display = show ? "block" : "none"; + this.showGutter = show; + this.onResize(true); }; this.getFadeFoldWidgets = function(){ - return this.getOption("fadeFoldWidgets") + return dom.hasCssClass(this.$gutter, "ace_fade-fold-widgets"); }; this.setFadeFoldWidgets = function(show) { - this.setOption("fadeFoldWidgets", 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) { - this.setOption("highlightGutterLine", 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.getOption("highlightGutterLine"); + return this.$highlightGutterLine; }; this.$updateGutterLineHighlight = function() { - var pos = this.$cursorLayer.$pixelPos; - var height = this.layerConfig.lineHeight; - if (this.session.getUseWrapMode()) { - var cursor = this.session.selection.getCursor(); - cursor.column = 0; - pos = this.$cursorLayer.getPixelPosition(cursor, true); - height *= this.session.getRowLength(cursor.row); - } - this.$gutterLineHighlight.style.top = pos.top - this.layerConfig.offset + "px"; - this.$gutterLineHighlight.style.height = height + "px"; + 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) { - var containerEl = dom.createElement("div"); - containerEl.className = "ace_layer ace_print-margin-layer"; + containerEl = dom.createElement("div"); + containerEl.className = "ace_print_margin_layer"; this.$printMarginEl = dom.createElement("div"); - this.$printMarginEl.className = "ace_print-margin"; + this.$printMarginEl.className = "ace_print_margin"; containerEl.appendChild(this.$printMarginEl); - this.content.insertBefore(containerEl, this.content.firstChild); + 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"; - - if (this.session && this.session.$wrap == -1) - this.adjustWrapLimit(); }; /** + * VirtualRenderer.getContainerElement() -> DOMElement * * Returns the root element containing this renderer. - * @returns {DOMElement} **/ this.getContainerElement = function() { return this.container; }; /** + * VirtualRenderer.getMouseEventTarget() -> DOMElement * * Returns the element that the mouse events are attached to - * @returns {DOMElement} **/ this.getMouseEventTarget = function() { - return this.scroller; + return this.content; }; /** + * VirtualRenderer.getTextAreaContainer() -> DOMElement * * Returns the element to which the hidden text area is added. - * @returns {DOMElement} **/ this.getTextAreaContainer = function() { return this.container; @@ -632,57 +562,52 @@ var VirtualRenderer = function(container, theme) { this.$moveTextAreaToCursor = function() { if (!this.$keepTextAreaAtCursor) return; - var config = this.layerConfig; + var posTop = this.$cursorLayer.$pixelPos.top; var posLeft = this.$cursorLayer.$pixelPos.left; - posTop -= config.offset; + posTop -= this.layerConfig.offset; - var style = this.textarea.style; - var h = this.lineHeight; - if (posTop < 0 || posTop > config.height - h) { - style.top = style.left = "0"; + if (posTop < 0 || posTop > this.layerConfig.height - this.lineHeight) return; - } var w = this.characterWidth; - if (this.$composition) { - var val = this.textarea.value.replace(/^\x01+/, ""); - w *= (this.session.$getStringScreenWidth(val)[0]+2); - h += 2; - } + if (this.$composition) + w += this.textarea.scrollWidth; posLeft -= this.scrollLeft; if (posLeft > this.$size.scrollerWidth - w) posLeft = this.$size.scrollerWidth - w; - posLeft += this.gutterWidth; - style.height = h + "px"; - style.width = w + "px"; - style.left = Math.min(posLeft, this.$size.scrollerWidth - w) + "px"; - style.top = Math.min(posTop, this.$size.height - h) + "px"; + 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"; }; /** + * VirtualRenderer.getFirstVisibleRow() -> Number * * [Returns the index of the first visible row.]{: #VirtualRenderer.getFirstVisibleRow} - * @returns {Number} **/ this.getFirstVisibleRow = function() { return this.layerConfig.firstRow; }; /** + * VirtualRenderer.getFirstFullyVisibleRow() -> Number * * Returns the index of the first fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen. - * @returns {Number} **/ this.getFirstFullyVisibleRow = function() { return this.layerConfig.firstRow + (this.layerConfig.offset === 0 ? 0 : 1); }; /** + * VirtualRenderer.getLastFullyVisibleRow() -> Number * * Returns the index of the last fully visible row. "Fully" here means that the characters in the row are not truncated; that the top and the bottom of the row are on the screen. - * @returns {Number} **/ this.getLastFullyVisibleRow = function() { var flint = Math.floor((this.layerConfig.height + this.layerConfig.offset) / this.layerConfig.lineHeight); @@ -690,9 +615,9 @@ var VirtualRenderer = function(container, theme) { }; /** + * VirtualRenderer.getLastVisibleRow() -> Number * * [Returns the index of the last visible row.]{: #VirtualRenderer.getLastVisibleRow} - * @returns {Number} **/ this.getLastVisibleRow = function() { return this.layerConfig.lastRow; @@ -701,10 +626,10 @@ var VirtualRenderer = function(container, theme) { this.$padding = null; /** + * VirtualRenderer.setPadding(padding) -> Void + * - padding (Number): A new padding value (in pixels) + * * Sets the padding for all the layers. - * @param {Number} padding A new padding value (in pixels) - * - * * **/ this.setPadding = function(padding) { @@ -716,274 +641,146 @@ var VirtualRenderer = function(container, theme) { this.$loop.schedule(this.CHANGE_FULL); this.$updatePrintMargin(); }; - - this.setScrollMargin = function(top, bottom, left, right) { - var sm = this.scrollMargin; - sm.top = top|0; - sm.bottom = bottom|0; - sm.right = right|0; - sm.left = left|0; - sm.v = sm.top + sm.bottom; - sm.h = sm.left + sm.right; - if (sm.top && this.scrollTop <= 0 && this.session) - this.session.setScrollTop(-sm.top); - this.updateFull(); - }; /** - * Returns whether the horizontal scrollbar is set to be always visible. - * @returns {Boolean} - **/ + * VirtualRenderer.getHScrollBarAlwaysVisible() -> Boolean + * + * Returns whether the horizontal scrollbar is set to be always visible. + **/ this.getHScrollBarAlwaysVisible = function() { - return this.$hScrollBarAlwaysVisible; + return this.$horizScrollAlwaysVisible; }; /** - * Identifies whether you want to show the horizontal scrollbar or not. - * @param {Boolean} alwaysVisible Set to `true` to make the horizontal scroll bar visible - **/ + * VirtualRenderer.setHScrollBarAlwaysVisible(alwaysVisible) -> Void + * - alwaysVisible (Boolean): Set to `true` to make the horizontal scroll bar visible + * + * Identifies whether you want to show the horizontal scrollbar or not. + **/ this.setHScrollBarAlwaysVisible = function(alwaysVisible) { - this.setOption("hScrollBarAlwaysVisible", alwaysVisible); - }; - /** - * Returns whether the horizontal scrollbar is set to be always visible. - * @returns {Boolean} - **/ - this.getVScrollBarAlwaysVisible = function() { - return this.$vScrollBarAlwaysVisible; - }; - - /** - * Identifies whether you want to show the horizontal scrollbar or not. - * @param {Boolean} alwaysVisible Set to `true` to make the horizontal scroll bar visible - **/ - this.setVScrollBarAlwaysVisible = function(alwaysVisible) { - this.setOption("vScrollBarAlwaysVisible", alwaysVisible); - }; - - this.$updateScrollBarV = function() { - var scrollHeight = this.layerConfig.maxHeight; - var scrollerHeight = this.$size.scrollerHeight; - if (!this.$maxLines && this.$scrollPastEnd) { - scrollHeight -= (scrollerHeight - this.lineHeight) * this.$scrollPastEnd; - if (this.scrollTop > scrollHeight - scrollerHeight) { - scrollHeight = this.scrollTop + scrollerHeight; - this.scrollBarV.scrollTop = null; - } + if (this.$horizScrollAlwaysVisible != alwaysVisible) { + this.$horizScrollAlwaysVisible = alwaysVisible; + if (!this.$horizScrollAlwaysVisible || !this.$horizScroll) + this.$loop.schedule(this.CHANGE_SCROLL); } - this.scrollBarV.setScrollHeight(scrollHeight + this.scrollMargin.v); - this.scrollBarV.setScrollTop(this.scrollTop + this.scrollMargin.top); }; - this.$updateScrollBarH = function() { - this.scrollBarH.setScrollWidth(this.layerConfig.width + 2 * this.$padding + this.scrollMargin.h); - this.scrollBarH.setScrollLeft(this.scrollLeft + this.scrollMargin.left); - }; - - this.$frozen = false; - this.freeze = function() { - this.$frozen = true; - }; - - this.unfreeze = function() { - this.$frozen = false; + + this.$updateScrollBar = function() { + this.scrollBar.setInnerHeight(this.layerConfig.maxHeight); + this.scrollBar.setScrollTop(this.scrollTop); }; this.$renderChanges = function(changes, force) { - if (this.$changes) { - changes |= this.$changes; - this.$changes = 0; - } - if ((!this.session || !this.container.offsetWidth || this.$frozen) || (!changes && !force)) { - this.$changes |= changes; - return; - } - if (this.$size.$dirty) { - this.$changes |= changes; - return this.onResize(true); - } - if (!this.lineHeight) { - this.$textLayer.checkForSizeChanges(); - } - // this.$logChanges(changes); - - this._signal("beforeRender"); - var config = this.layerConfig; + 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 || - changes & this.CHANGE_H_SCROLL - ) { - changes |= this.$computeLayerConfig(); - // If a change is made offscreen and wrapMode is on, then the onscreen - // lines may have been pushed down. If so, the first screen row will not - // have changed, but the first actual row will. In that case, adjust - // scrollTop so that the cursor and onscreen content stays in the same place. - // TODO: find a better way to handle this, that works non wrapped case and doesn't compute layerConfig twice - if (config.firstRow != this.layerConfig.firstRow && config.firstRowScreen == this.layerConfig.firstRowScreen) { - var st = this.scrollTop + (config.firstRow - this.layerConfig.firstRow) * this.lineHeight; - if (st > 0) { - // this check is needed as a workaround for the documentToScreenRow returning -1 if document.length == 0 - this.scrollTop = st; - changes = changes | this.CHANGE_SCROLL; - changes |= this.$computeLayerConfig(); - } - } - config = this.layerConfig; - // update scrollbar first to not lose scroll position when gutter calls resize - this.$updateScrollBarV(); - if (changes & this.CHANGE_H_SCROLL) - this.$updateScrollBarH(); - this.$gutterLayer.element.style.marginTop = (-config.offset) + "px"; - this.content.style.marginTop = (-config.offset) + "px"; - this.content.style.width = config.width + 2 * this.$padding + "px"; - this.content.style.height = config.minHeight + "px"; - } - + changes & this.CHANGE_SCROLL + ) + this.$computeLayerConfig(); + // horizontal scrolling if (changes & this.CHANGE_H_SCROLL) { - this.content.style.marginLeft = -this.scrollLeft + "px"; - this.scroller.className = this.scrollLeft <= 0 ? "ace_scroller" : "ace_scroller ace_scroll-left"; + 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.update(config); - if (this.$showGutter) - this.$gutterLayer.update(config); - this.$markerBack.update(config); - this.$markerFront.update(config); - this.$cursorLayer.update(config); + 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(); - this._signal("afterRender"); return; } // scrolling if (changes & this.CHANGE_SCROLL) { + this.$updateScrollBar(); if (changes & this.CHANGE_TEXT || changes & this.CHANGE_LINES) - this.$textLayer.update(config); + this.$textLayer.update(this.layerConfig); else - this.$textLayer.scrollLines(config); + this.$textLayer.scrollLines(this.layerConfig); - if (this.$showGutter) - this.$gutterLayer.update(config); - this.$markerBack.update(config); - this.$markerFront.update(config); - this.$cursorLayer.update(config); - this.$highlightGutterLine && this.$updateGutterLineHighlight(); + 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._signal("afterRender"); + this.$highlightGutterLine && this.$updateGutterLineHighlight(); return; } if (changes & this.CHANGE_TEXT) { - this.$textLayer.update(config); - if (this.$showGutter) - this.$gutterLayer.update(config); + 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(config); + 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(config); + if (this.showGutter) + this.$gutterLayer.update(this.layerConfig); } if (changes & this.CHANGE_CURSOR) { - this.$cursorLayer.update(config); + this.$cursorLayer.update(this.layerConfig); this.$moveTextAreaToCursor(); this.$highlightGutterLine && this.$updateGutterLineHighlight(); } if (changes & (this.CHANGE_MARKER | this.CHANGE_MARKER_FRONT)) { - this.$markerFront.update(config); + this.$markerFront.update(this.layerConfig); } if (changes & (this.CHANGE_MARKER | this.CHANGE_MARKER_BACK)) { - this.$markerBack.update(config); + this.$markerBack.update(this.layerConfig); } - this._signal("afterRender"); + if (changes & this.CHANGE_SIZE) + this.$updateScrollBar(); }; - - this.$autosize = function() { - var height = this.session.getScreenLength() * this.lineHeight; - var maxHeight = this.$maxLines * this.lineHeight; - var desiredHeight = Math.max( - (this.$minLines||1) * this.lineHeight, - Math.min(maxHeight, height) - ) + this.scrollMargin.v + (this.$extraHeight || 0); - if (this.$horizScroll) - desiredHeight += this.scrollBarH.getHeight(); - var vScroll = height > maxHeight; - - if (desiredHeight != this.desiredHeight || - this.$size.height != this.desiredHeight || vScroll != this.$vScroll) { - if (vScroll != this.$vScroll) { - this.$vScroll = vScroll; - this.scrollBarV.setVisible(vScroll); - } - - var w = this.container.clientWidth; - this.container.style.height = desiredHeight + "px"; - this.$updateCachedSize(true, this.$gutterWidth, w, desiredHeight); - // this.$loop.changes = 0; - this.desiredHeight = desiredHeight; - - this._signal("autosize"); - } - }; - this.$computeLayerConfig = function() { var session = this.session; - var size = this.$size; - - var hideScrollbars = size.height <= 2 * this.lineHeight; - var screenLines = this.session.getScreenLength(); - var maxHeight = screenLines * this.lineHeight; - - var longestLine = this.$getLongestLine(); - - var horizScroll = !hideScrollbars && (this.$hScrollBarAlwaysVisible || - size.scrollerWidth - longestLine - 2 * this.$padding < 0); - - var hScrollChanged = this.$horizScroll !== horizScroll; - if (hScrollChanged) { - this.$horizScroll = horizScroll; - this.scrollBarH.setVisible(horizScroll); - } - // autoresize only after updating hscroll to include scrollbar height in desired height - if (this.$maxLines && this.lineHeight > 1) - this.$autosize(); var offset = this.scrollTop % this.lineHeight; - var minHeight = size.scrollerHeight + this.lineHeight; - - var scrollPastEnd = !this.$maxLines && this.$scrollPastEnd - ? (size.scrollerHeight - this.lineHeight) * this.$scrollPastEnd - : 0; - maxHeight += scrollPastEnd; - - var sm = this.scrollMargin; - this.session.setScrollTop(Math.max(-sm.top, - Math.min(this.scrollTop, maxHeight - size.scrollerHeight + sm.bottom))); + var minHeight = this.$size.scrollerHeight + this.lineHeight; - this.session.setScrollLeft(Math.max(-sm.left, Math.min(this.scrollLeft, - longestLine + 2 * this.$padding - size.scrollerWidth + sm.right))); - - var vScroll = !hideScrollbars && (this.$vScrollBarAlwaysVisible || - size.scrollerHeight - maxHeight + scrollPastEnd < 0 || this.scrollTop > sm.top); - var vScrollChanged = this.$vScroll !== vScroll; - if (vScrollChanged) { - this.$vScroll = vScroll; - this.scrollBarV.setVisible(vScroll); + 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)); @@ -1005,23 +802,11 @@ var VirtualRenderer = function(container, theme) { firstRowHeight = session.getRowLength(firstRow) * lineHeight; lastRow = Math.min(session.screenToDocumentRow(lastRow, 0), session.getLength() - 1); - minHeight = size.scrollerHeight + session.getRowLength(lastRow) * lineHeight + + minHeight = this.$size.scrollerHeight + session.getRowLength(lastRow) * lineHeight + firstRowHeight; offset = this.scrollTop - firstRowScreen * lineHeight; - var changes = 0; - if (this.layerConfig.width != longestLine) - changes = this.CHANGE_H_SCROLL; - // Horizontal scrollbar visibility may have changed, which changes - // the client height of the scroller - if (hScrollChanged || vScrollChanged) { - changes = this.$updateCachedSize(true, this.gutterWidth, size.width, size.height); - this._signal("scrollbarVisibilityChanged"); - if (vScrollChanged) - longestLine = this.$getLongestLine(); - } - this.layerConfig = { width : longestLine, padding : this.$padding, @@ -1033,14 +818,21 @@ var VirtualRenderer = function(container, theme) { minHeight : minHeight, maxHeight : maxHeight, offset : offset, - gutterOffset : Math.max(0, Math.ceil((offset + size.height - size.scrollerHeight) / lineHeight)), height : this.$size.scrollerHeight }; // For debugging. // console.log(JSON.stringify(this.layerConfig)); - return changes; + 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() { @@ -1055,7 +847,7 @@ var VirtualRenderer = function(container, theme) { // if the last row is unknown -> redraw everything if (lastRow === Infinity) { - if (this.$showGutter) + if (this.showGutter) this.$gutterLayer.update(layerConfig); this.$textLayer.update(layerConfig); return; @@ -1068,13 +860,14 @@ var VirtualRenderer = function(container, theme) { this.$getLongestLine = function() { var charCount = this.session.getScreenWidth(); - if (this.showInvisibles && !this.session.$useWrapMode) + if (this.$textLayer.showInvisibles) charCount += 1; return Math.max(this.$size.scrollerWidth - 2 * this.$padding, Math.round(charCount * this.characterWidth)); }; /** + * VirtualRenderer.updateFrontMarkers() -> Void * * Schedules an update to all the front markers in the document. **/ @@ -1084,6 +877,7 @@ var VirtualRenderer = function(container, theme) { }; /** + * VirtualRenderer.updateBackMarkers() -> Void * * Schedules an update to all the back markers in the document. **/ @@ -1093,23 +887,25 @@ var VirtualRenderer = function(container, theme) { }; /** + * VirtualRenderer.addGutterDecoration(row, className) -> Void * - * Deprecated; (moved to [[EditSession]]) - * @deprecated + * Deprecated (moved to EditSession) **/ this.addGutterDecoration = function(row, className){ this.$gutterLayer.addGutterDecoration(row, className); }; /** - * Deprecated; (moved to [[EditSession]]) - * @deprecated + * VirtualRenderer.removeGutterDecoration(row, className)-> Void + * + * Deprecated (moved to EditSession) **/ this.removeGutterDecoration = function(row, className){ this.$gutterLayer.removeGutterDecoration(row, className); }; /** + * VirtualRenderer.updateBreakpoints() -> Void * * Redraw breakpoints. **/ @@ -1118,11 +914,10 @@ var VirtualRenderer = function(container, theme) { }; /** + * VirtualRenderer.setAnnotations(annotations) -> Void + * - annotations (Array): An array containing annotations * * Sets annotations for the gutter. - * @param {Array} annotations An array containing annotations - * - * **/ this.setAnnotations = function(annotations) { this.$gutterLayer.setAnnotations(annotations); @@ -1130,6 +925,7 @@ var VirtualRenderer = function(container, theme) { }; /** + * VirtualRenderer.updateCursor() -> Void * * Updates the cursor icon. **/ @@ -1138,6 +934,7 @@ var VirtualRenderer = function(container, theme) { }; /** + * VirtualRenderer.hideCursor() -> Void * * Hides the cursor icon. **/ @@ -1146,6 +943,7 @@ var VirtualRenderer = function(container, theme) { }; /** + * VirtualRenderer.showCursor() -> Void * * Shows the cursor icon. **/ @@ -1160,10 +958,11 @@ var VirtualRenderer = function(container, theme) { }; /** + * VirtualRenderer.scrollCursorIntoView(cursor, offset) -> Void * * Scrolls the cursor into the first visibile area of the editor **/ - this.scrollCursorIntoView = function(cursor, offset, $viewMargin) { + this.scrollCursorIntoView = function(cursor, offset) { // the editor is not visible if (this.$size.scrollerHeight === 0) return; @@ -1172,19 +971,12 @@ var VirtualRenderer = function(container, theme) { var left = pos.left; var top = pos.top; - - var topMargin = $viewMargin && $viewMargin.top || 0; - var bottomMargin = $viewMargin && $viewMargin.bottom || 0; - - var scrollTop = this.$scrollAnimation ? this.session.getScrollTop() : this.scrollTop; - - if (scrollTop + topMargin > top) { + + if (this.scrollTop > top) { if (offset) top -= offset * this.$size.scrollerHeight; - if (top === 0) - top = -this.scrollMargin.top; this.session.setScrollTop(top); - } else if (scrollTop + this.$size.scrollerHeight - bottomMargin < top + this.lineHeight) { + } 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); @@ -1194,57 +986,54 @@ var VirtualRenderer = function(container, theme) { if (scrollLeft > left) { if (left < this.$padding + 2 * this.layerConfig.characterWidth) - left = -this.scrollMargin.left; + 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)); - } else if (scrollLeft <= this.$padding && left - scrollLeft < this.characterWidth) { - this.session.setScrollLeft(0); } }; - /** + /** related to: EditSession.getScrollTop + * VirtualRenderer.getScrollTop() -> Number + * * {:EditSession.getScrollTop} - * @related EditSession.getScrollTop - * @returns {Number} **/ this.getScrollTop = function() { return this.session.getScrollTop(); }; - /** + /** related to: EditSession.getScrollLeft + * VirtualRenderer.getScrollLeft() -> Number + * * {:EditSession.getScrollLeft} - * @related EditSession.getScrollLeft - * @returns {Number} **/ this.getScrollLeft = function() { return this.session.getScrollLeft(); }; /** + * VirtualRenderer.getScrollTopRow() -> Number * * Returns the first visible row, regardless of whether it's fully visible or not. - * @returns {Number} **/ this.getScrollTopRow = function() { return this.scrollTop / this.lineHeight; }; /** + * VirtualRenderer.getScrollBottomRow() -> Number * * Returns the last visible row, regardless of whether it's fully visible or not. - * @returns {Number} **/ this.getScrollBottomRow = function() { return Math.max(0, Math.floor((this.scrollTop + this.$size.scrollerHeight) / this.lineHeight) - 1); }; - /** - * Gracefully scrolls from the top of the editor to the row indicated. - * @param {Number} row A row id + /** related to: EditSession.setScrollTop + * VirtualRenderer.scrollToRow(row) -> Void + * - row (Number): A row id * - * - * @related EditSession.setScrollTop + * Gracefully scrolls the top of the editor to the row indicated. **/ this.scrollToRow = function(row) { this.session.setScrollTop(row * this.lineHeight); @@ -1255,11 +1044,9 @@ var VirtualRenderer = function(container, theme) { 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); + var offset = pos.top - this.$size.scrollerHeight * (alignment || 0); this.session.setScrollTop(offset); - return offset; }; this.STEPS = 8; @@ -1279,13 +1066,13 @@ var VirtualRenderer = function(container, theme) { }; /** + * VirtualRenderer.scrollToLine(line, center, animate, callback) -> Void + * - line (Number): A line number + * - center (Boolean): If `true`, centers the editor the to indicated line + * - animate (Boolean): If `true` animates scrolling + * - callback (Function): Function to be called after the animation has finished + * * Gracefully scrolls the editor to the row indicated. - * @param {Number} line A line number - * @param {Boolean} center If `true`, centers the editor the to indicated line - * @param {Boolean} animate If `true` animates scrolling - * @param {Function} callback Function to be called after the animation has finished - * - * **/ this.scrollToLine = function(line, center, animate, callback) { var pos = this.$cursorLayer.getPixelPosition({row: line, column: 0}); @@ -1301,53 +1088,39 @@ var VirtualRenderer = function(container, theme) { this.animateScrolling = function(fromValue, callback) { var toValue = this.scrollTop; - if (!this.$animatedScroll) - return; - var _self = this; - - if (fromValue == toValue) - return; - - if (this.$scrollAnimation) { - var oldSteps = this.$scrollAnimation.steps; - if (oldSteps.length) { - fromValue = oldSteps[0]; - if (fromValue == toValue) - return; - } + 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); } - - var steps = _self.$calcSteps(fromValue, toValue); - this.$scrollAnimation = {from: fromValue, to: toValue, steps: steps}; - - clearInterval(this.$timer); - - _self.session.setScrollTop(steps.shift()); - // trick session to think it's already scrolled to not loose toValue - _self.session.$scrollTop = toValue; - this.$timer = setInterval(function() { - if (steps.length) { - _self.session.setScrollTop(steps.shift()); - _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.$scrollAnimation = null; - callback && callback(); - } - }, 10); }; /** + * VirtualRenderer.scrollToY(scrollTop) -> Number + * - scrollTop (Number): The position to scroll to + * * Scrolls the editor to the y pixel indicated. - * @param {Number} scrollTop The position to scroll to * - * - * @returns {Number} **/ this.scrollToY = function(scrollTop) { // after calling scrollBar.setScrollTop @@ -1359,32 +1132,27 @@ var VirtualRenderer = function(container, theme) { }; /** - * Scrolls the editor across the x-axis to the pixel indicated. - * @param {Number} scrollLeft The position to scroll to + * VirtualRenderer.scrollToX(scrollLeft) -> Number + * - scrollLeft (Number): The position to scroll to * + * Scrolls the editor to the x pixel indicated. * - * @returns {Number} **/ this.scrollToX = function(scrollLeft) { + if (scrollLeft < 0) + scrollLeft = 0; + if (this.scrollLeft !== scrollLeft) this.scrollLeft = scrollLeft; this.$loop.schedule(this.CHANGE_H_SCROLL); }; /** + * VirtualRenderer.scrollBy(deltaX, deltaY) -> Void + * - deltaX (Number): The x value to scroll by + * - deltaY (Number): The y value to scroll by + * * Scrolls the editor across both x- and y-axes. - * @param {Number} x The x value to scroll to - * @param {Number} y The y value to scroll to - **/ - this.scrollTo = function(x, y) { - this.session.setScrollTop(y); - this.session.setScrollLeft(y); - }; - - /** - * Scrolls the editor across both x- and y-axes. - * @param {Number} deltaX The x value to scroll by - * @param {Number} deltaY The y value to scroll by **/ this.scrollBy = function(deltaX, deltaY) { deltaY && this.session.setScrollTop(this.session.getScrollTop() + deltaY); @@ -1392,24 +1160,18 @@ var VirtualRenderer = function(container, theme) { }; /** + * VirtualRenderer.isScrollableBy(deltaX, deltaY) -> Boolean + * - deltaX (Number): The x value to scroll by + * - deltaY (Number): The y value to scroll by + * * Returns `true` if you can still scroll by either parameter; in other words, you haven't reached the end of the file or line. - * @param {Number} deltaX The x value to scroll by - * @param {Number} deltaY The y value to scroll by - * - * - * @returns {Boolean} **/ this.isScrollableBy = function(deltaX, deltaY) { - if (deltaY < 0 && this.session.getScrollTop() >= 1 - this.scrollMargin.top) + if (deltaY < 0 && this.session.getScrollTop() > 0) return true; - if (deltaY > 0 && this.session.getScrollTop() + this.$size.scrollerHeight - - this.layerConfig.maxHeight < -1 + this.scrollMargin.bottom) - return true; - if (deltaX < 0 && this.session.getScrollLeft() >= 1 - this.scrollMargin.left) - return true; - if (deltaX > 0 && this.session.getScrollLeft() + this.$size.scrollerWidth - - this.layerConfig.width < -1 + this.scrollMargin.right) + if (deltaY > 0 && this.session.getScrollTop() + this.$size.scrollerHeight < this.layerConfig.maxHeight) return true; + // todo: handle horizontal scrolling }; this.pixelToScreenCoordinates = function(x, y) { @@ -1428,20 +1190,21 @@ var VirtualRenderer = function(container, theme) { var col = Math.round( (x + this.scrollLeft - canvasPos.left - this.$padding) / this.characterWidth ); - - var row = (y + this.scrollTop - canvasPos.top) / this.lineHeight; + var row = Math.floor( + (y + this.scrollTop - canvasPos.top) / this.lineHeight + ); return this.session.screenToDocumentPosition(row, Math.max(col, 0)); }; /** + * VirtualRenderer.textToScreenCoordinates(row, column) -> Object + * - row (Number): The document row position + * - column (Number): The document column position + * * Returns an object containing the `pageX` and `pageY` coordinates of the document position. - * @param {Number} row The document row position - * @param {Number} column The document column position * * - * - * @returns {Object} **/ this.textToScreenCoordinates = function(row, column) { var canvasPos = this.scroller.getBoundingClientRect(); @@ -1457,26 +1220,28 @@ var VirtualRenderer = function(container, theme) { }; /** - * - * Focuses the current container. - **/ + * VirtualRenderer.visualizeFocus() -> Void + * + * Focuses the current container. + **/ this.visualizeFocus = function() { dom.addCssClass(this.container, "ace_focus"); }; /** - * - * Blurs the current container. - **/ + * VirtualRenderer.visualizeBlur() -> Void + * + * Blurs the current container. + **/ this.visualizeBlur = function() { dom.removeCssClass(this.container, "ace_focus"); }; - /** - * @param {Number} position - * - * @private - **/ + /** internal, hide + * VirtualRenderer.showComposition(position) -> Void + * - position (Number): + * + **/ this.showComposition = function(position) { if (!this.$composition) this.$composition = { @@ -1491,18 +1256,20 @@ var VirtualRenderer = function(container, theme) { }; /** - * @param {String} text A string of text to use - * - * Sets the inner text of the current composition to `text`. - **/ + * VirtualRenderer.setCompositionText(text) -> Void + * - text (String): A string of text to use + * + * Sets the inner text of the current composition to `text`. + **/ this.setCompositionText = function(text) { this.$moveTextAreaToCursor(); }; /** - * - * Hides the current composition. - **/ + * VirtualRenderer.hideComposition() -> Void + * + * Hides the current composition. + **/ this.hideComposition = function() { if (!this.$composition) return; @@ -1513,67 +1280,80 @@ var VirtualRenderer = function(container, theme) { this.$composition = null; }; - /** - * [Sets a new theme for the editor. `theme` should exist, and be a directory path, like `ace/theme/textmate`.]{: #VirtualRenderer.setTheme} - * @param {String} theme The path to a theme - * @param {Function} cb optional callback - * - **/ - this.setTheme = function(theme, cb) { - var _self = this; - this.$themeId = theme; - _self._dispatchEvent('themeChange',{theme:theme}); + this._loadTheme = function(name, callback) { + if (!config.get("packaged")) + return callback(); + net.loadScript(config.moduleUrl(name, "theme"), callback); + }; + + /** + * VirtualRenderer.setTheme(theme) -> Void + * - theme (String): The path to a theme + * + * [Sets a new theme for the editor. `theme` should exist, and be a directory path, like `ace/theme/textmate`.]{: #VirtualRenderer.setTheme} + **/ + this.setTheme = function(theme) { + var _self = this; + + this.$themeValue = theme; if (!theme || typeof theme == "string") { - var moduleName = theme || this.$options.theme.initialValue; - config.loadModule(["theme", moduleName], afterLoad); + 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(module) { - if (_self.$themeId != theme) - return cb && cb(); - if (!module.cssClass) - return; + function afterLoad(theme) { dom.importCssString( - module.cssText, - module.cssClass, + theme.cssText, + theme.cssClass, _self.container.ownerDocument ); - if (_self.theme) - dom.removeCssClass(_self.container, _self.theme.cssClass); + if (_self.$theme) + dom.removeCssClass(_self.container, _self.$theme); - var padding = "padding" in module ? module.padding - : "padding" in (_self.theme || {}) ? 4 : _self.$padding; - if (_self.$padding && padding != _self.$padding) - _self.setPadding(padding); - - // this is kept only for backwards compatibility - _self.$theme = module.cssClass; + _self.$theme = theme ? theme.cssClass : null; - _self.theme = module; - dom.addCssClass(_self.container, module.cssClass); - dom.setCssClass(_self.container, "ace_dark", module.isDark); + 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.$updateSizeAsync(); + _self.onResize(); } - - _self._dispatchEvent('themeLoaded', {theme:module}); - cb && cb(); } }; /** - * [Returns the path of the current theme.]{: #VirtualRenderer.getTheme} - * @returns {String} - **/ + * VirtualRenderer.getTheme() -> String + * + * [Returns the path of the current theme.]{: #VirtualRenderer.getTheme} + **/ this.getTheme = function() { - return this.$themeId; + return this.$themeValue; }; // Methods allows to add / remove CSS classnames to the editor element. @@ -1581,39 +1361,30 @@ var VirtualRenderer = function(container, theme) { // a certain mode that editor is in. /** - * [Adds a new class, `style`, to the editor.]{: #VirtualRenderer.setStyle} - * @param {String} style A class name - * - **/ - this.setStyle = function(style, include) { - dom.setCssClass(this.container, style, include !== false); + * VirtualRenderer.setStyle(style) -> Void + * - 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); }; /** - * [Removes the class `style` from the editor.]{: #VirtualRenderer.unsetStyle} - * @param {String} style A class name - * - **/ - this.unsetStyle = function(style) { - dom.removeCssClass(this.container, style); - }; - - this.setCursorStyle = function(style) { - if (this.scroller.style.cursor != style) - this.scroller.style.cursor = style; + * VirtualRenderer.unsetStyle(style) -> Void + * - style (String): A class name + * + * [Removes the class `style` from the editor.]{: #VirtualRenderer.unsetStyle} + **/ + this.unsetStyle = function unsetStyle(style) { + dom.removeCssClass(this.container, style); }; /** - * @param {String} cursorStyle A css cursor style - * - **/ - this.setMouseCursor = function(cursorStyle) { - this.scroller.style.cursor = cursorStyle; - }; - - /** - * Destroys the text and cursor layers for this renderer. - **/ + * VirtualRenderer.destroy() + * + * Destroys the text and cursor layers for this renderer. + **/ this.destroy = function() { this.$textLayer.destroy(); this.$cursorLayer.destroy(); @@ -1621,147 +1392,5 @@ var VirtualRenderer = function(container, theme) { }).call(VirtualRenderer.prototype); - -config.defineOptions(VirtualRenderer.prototype, "renderer", { - animatedScroll: {initialValue: false}, - showInvisibles: { - set: function(value) { - if (this.$textLayer.setShowInvisibles(value)) - this.$loop.schedule(this.CHANGE_TEXT); - }, - initialValue: false - }, - showPrintMargin: { - set: function() { this.$updatePrintMargin(); }, - initialValue: true - }, - printMarginColumn: { - set: function() { this.$updatePrintMargin(); }, - initialValue: 80 - }, - printMargin: { - set: function(val) { - if (typeof val == "number") - this.$printMarginColumn = val; - this.$showPrintMargin = !!val; - this.$updatePrintMargin(); - }, - get: function() { - return this.$showPrintMargin && this.$printMarginColumn; - } - }, - showGutter: { - set: function(show){ - this.$gutter.style.display = show ? "block" : "none"; - this.$loop.schedule(this.CHANGE_FULL); - this.onGutterResize(); - }, - initialValue: true - }, - fadeFoldWidgets: { - set: function(show) { - dom.setCssClass(this.$gutter, "ace_fade-fold-widgets", show); - }, - initialValue: false - }, - showFoldWidgets: { - set: function(show) {this.$gutterLayer.setShowFoldWidgets(show)}, - initialValue: true - }, - showLineNumbers: { - set: function(show) { - this.$gutterLayer.setShowLineNumbers(show); - this.$loop.schedule(this.CHANGE_GUTTER); - }, - initialValue: true - }, - displayIndentGuides: { - set: function(show) { - if (this.$textLayer.setDisplayIndentGuides(show)) - this.$loop.schedule(this.CHANGE_TEXT); - }, - initialValue: true - }, - highlightGutterLine: { - set: function(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(); - }, - initialValue: false, - value: true - }, - hScrollBarAlwaysVisible: { - set: function(val) { - if (!this.$hScrollBarAlwaysVisible || !this.$horizScroll) - this.$loop.schedule(this.CHANGE_SCROLL); - }, - initialValue: false - }, - vScrollBarAlwaysVisible: { - set: function(val) { - if (!this.$vScrollBarAlwaysVisible || !this.$vScroll) - this.$loop.schedule(this.CHANGE_SCROLL); - }, - initialValue: false - }, - fontSize: { - set: function(size) { - if (typeof size == "number") - size = size + "px"; - this.container.style.fontSize = size; - this.updateFontSize(); - }, - initialValue: 12 - }, - fontFamily: { - set: function(name) { - this.container.style.fontFamily = name; - this.updateFontSize(); - } - }, - maxLines: { - set: function(val) { - this.updateFull(); - } - }, - minLines: { - set: function(val) { - this.updateFull(); - } - }, - scrollPastEnd: { - set: function(val) { - val = +val || 0; - if (this.$scrollPastEnd == val) - return; - this.$scrollPastEnd = val; - this.$loop.schedule(this.CHANGE_SCROLL); - }, - initialValue: 0, - handlesSet: true - }, - fixedWidthGutter: { - set: function(val) { - this.$gutterLayer.$fixedWidth = !!val; - this.$loop.schedule(this.CHANGE_GUTTER); - } - }, - theme: { - set: function(val) { this.setTheme(val) }, - get: function() { return this.$themeId || this.theme; }, - initialValue: "./theme/textmate", - handlesSet: true - } -}); - exports.VirtualRenderer = VirtualRenderer; }); diff --git a/lib/ace/virtual_renderer_test.js b/lib/ace/virtual_renderer_test.js index 9b1ed866..191666c3 100644 --- a/lib/ace/virtual_renderer_test.js +++ b/lib/ace/virtual_renderer_test.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * 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. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -36,40 +43,26 @@ if (typeof process !== "undefined") { define(function(require, exports, module) { "use strict"; -var Editor = require("./edit_session").Editor; var EditSession = require("./edit_session").EditSession; var VirtualRenderer = require("./virtual_renderer").VirtualRenderer; var assert = require("./test/assertions"); -var editor = null; module.exports = { - setUp: function() { - if (editor) - editor.destroy() + "test: screen2text the column should be rounded to the next character edge" : function() { var el = document.createElement("div"); + if (!el.getBoundingClientRect) { console.log("Skipping test: This test only runs in the browser"); return; } + el.style.left = "20px"; el.style.top = "30px"; el.style.width = "300px"; el.style.height = "100px"; document.body.appendChild(el); - var renderer = new VirtualRenderer(el); - var editor = new Editor(renderer); - editor.on("destroy", function() { - document.body.removeChild(el); - }); - }, - tearDown: function() { - editor && editor.destroy(); - editor = null; - }, - "test: screen2text the column should be rounded to the next character edge" : function(done) { - if (!editor) return done(); - var renderer = editor.renderer; + var renderer = new VirtualRenderer(el); renderer.setPadding(0); renderer.setSession(new EditSession("1234")); @@ -87,23 +80,7 @@ module.exports = { testPixelToText(10, 0, 0, 1); testPixelToText(14, 0, 0, 1); testPixelToText(15, 0, 0, 2); - done(); - }, - - "test scrollmargin + autosize": function(done) { - if (!editor) return done(); - editor.setOptions({ - maxLines: 100, - useWrapMode: true - }); - editor.renderer.setScrollMargin(10, 10); - editor.setValue("\n\n"); - editor.setValue("\n\n\n\n"); - editor.renderer.once("afterRender", function() { - setTimeout(function() { - done(); - }, 0); - }); + document.body.removeChild(el); } // change tab size after setDocument (for text layer) diff --git a/lib/ace/worker/jshint.js b/lib/ace/worker/jshint.js new file mode 100644 index 00000000..ad54b555 --- /dev/null +++ b/lib/ace/worker/jshint.js @@ -0,0 +1,4469 @@ +define(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 . + + 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 () { + "use strict"; + + 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 "use strict"; 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 "use strict"; 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*!|</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, '&') + .replace(//g, '>'); + }; + } + + 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(''); + 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('
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ' + h + ' '); + 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('
                                                                                                                                                                                                                                                                                                                                                                                                                                                              '); + } + } + + + if (data.errors || data.implieds || data.unused) { + err = true; + o.push('
                                                                                                                                                                                                                                                                                                                                                                                                                                                              Error:'); + if (data.errors) { + for (i = 0; i < data.errors.length; i += 1) { + c = data.errors[i]; + if (c) { + e = c.evidence || ''; + o.push('

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Problem' + (isFinite(c.line) ? ' at line ' + + c.line + ' character ' + c.character : '') + + ': ' + c.reason.entityify() + + '

                                                                                                                                                                                                                                                                                                                                                                                                                                                              ' + + (e && (e.length > 80 ? e.slice(0, 77) + '...' : + e).entityify()) + '

                                                                                                                                                                                                                                                                                                                                                                                                                                                              '); + } + } + } + + if (data.implieds) { + s = []; + for (i = 0; i < data.implieds.length; i += 1) { + s[i] = '' + data.implieds[i].name + ' ' + + data.implieds[i].line + ''; + } + o.push('

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Implied global: ' + s.join(', ') + '

                                                                                                                                                                                                                                                                                                                                                                                                                                                              '); + } + + if (data.unused) { + s = []; + for (i = 0; i < data.unused.length; i += 1) { + s[i] = '' + data.unused[i].name + ' ' + + data.unused[i].line + ' ' + + data.unused[i]['function'] + ''; + } + o.push('

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Unused variable: ' + s.join(', ') + '

                                                                                                                                                                                                                                                                                                                                                                                                                                                              '); + } + if (data.json) { + o.push('

                                                                                                                                                                                                                                                                                                                                                                                                                                                              JSON: bad.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              '); + } + o.push('
                                                                                                                                                                                                                                                                                                                                                                                                                                                              '); + } + + if (!option) { + + o.push('
                                                                                                                                                                                                                                                                                                                                                                                                                                                              '); + + if (data.urls) { + detail("URLs
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ", data.urls, '
                                                                                                                                                                                                                                                                                                                                                                                                                                                              '); + } + + if (data.json && !err) { + o.push('

                                                                                                                                                                                                                                                                                                                                                                                                                                                              JSON: good.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              '); + } else if (data.globals) { + o.push('
                                                                                                                                                                                                                                                                                                                                                                                                                                                              Global ' + + data.globals.sort().join(', ') + '
                                                                                                                                                                                                                                                                                                                                                                                                                                                              '); + } else { + o.push('
                                                                                                                                                                                                                                                                                                                                                                                                                                                              No new global variables introduced.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              '); + } + + for (i = 0; i < data.functions.length; i += 1) { + f = data.functions[i]; + + o.push('
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ' + f.line + '-' + + f.last + ' ' + (f.name || '') + '(' + + (f.param ? f.param.join(', ') : '') + ')
                                                                                                                                                                                                                                                                                                                                                                                                                                                              '); + detail('Unused', 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 = '
                                                                                                                                                                                                                                                                                                                                                                                                                                                              /*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 + '
                                                                                                                                                                                                                                                                                                                                                                                                                                                              '); + m = ' '; + l = 1; + } + l += n.length + 2; + if (data.member[k] === 1) { + n = '' + n + ''; + } + if (i < a.length - 1) { + n += ', '; + } + m += n; + } + o.push(m + '
                                                                                                                                                                                                                                                                                                                                                                                                                                                              */
                                                                                                                                                                                                                                                                                                                                                                                                                                                              '); + } + o.push('
                                                                                                                                                                                                                                                                                                                                                                                                                                                              '); + } + } + return o.join(''); + }; + + itself.jshint = itself; + + return itself; +}()); + +// Make JSHINT a Node module, if possible. +if (typeof exports === 'object' && exports) + exports.JSHINT = JSHINT; + +}); diff --git a/lib/ace/worker/jslint.js b/lib/ace/worker/jslint.js new file mode 100644 index 00000000..9e7eb443 --- /dev/null +++ b/lib/ace/worker/jslint.js @@ -0,0 +1,6396 @@ +define(function(require, exports, module) { +// jslint.js +// 2012-03-15 + +// 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. + +// WARNING: JSLint will hurt your feelings. + +// JSLINT is a global function. It takes two parameters. + +// var myResult = JSLINT(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 HTML text, or a JSON text, or a CSS text. + +// The second parameter is an optional object of options that control the +// operation of JSLINT. 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, JSLINT returns true. Otherwise, it returns false. + +// If false, you can inspect JSLINT.errors to find out the problems. +// JSLINT.errors is an array of objects containing these properties: + +// { +// 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 stopping error was found, a null will be the last element of the +// JSLINT.errors array. A stopping error means that JSLint was not confident +// enough to continue. It does not necessarily mean that the error was +// especially heinous. + +// 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 . + +// var myReport = JSLINT.report(errors_only); + +// If errors_only is true, then the report will be limited to only errors. + +// You can request a data structure that contains JSLint's results. + +// var myData = JSLINT.data(); + +// It returns a structure with this form: + +// { +// errors: [ +// { +// line: NUMBER, +// character: NUMBER, +// reason: STRING, +// evidence: STRING +// } +// ], +// functions: [ +// { +// name: STRING, +// line: NUMBER, +// last: NUMBER, +// params: [ +// { +// string: STRING +// } +// ], +// closure: [ +// STRING +// ], +// var: [ +// STRING +// ], +// exception: [ +// STRING +// ], +// outer: [ +// STRING +// ], +// unused: [ +// STRING +// ], +// undef: [ +// STRING +// ], +// global: [ +// STRING +// ], +// label: [ +// STRING +// ] +// } +// ], +// globals: [ +// STRING +// ], +// member: { +// STRING: NUMBER +// }, +// urls: [ +// STRING +// ], +// json: BOOLEAN +// } + +// Empty arrays will not be included. + +// You can obtain the parse tree that JSLint constructed while parsing. The +// latest tree is kept in JSLINT.tree. A nice stringication can be produced +// with + +// JSON.stringify(JSLINT.tree, [ +// 'string', 'arity', 'name', 'first', +// 'second', 'third', 'block', 'else' +// ], 4)); + +// JSLint provides three directives. They look like slashstar comments, and +// allow for setting options, declaring global variables, and establishing a +// set of allowed property names. + +// These directives respect function scope. + +// The jslint directive is a special comment that can set one or more options. +// The current option set is + +// anon true, if the space may be omitted in anonymous function declarations +// bitwise true, if bitwise operators should be allowed +// browser true, if the standard browser globals should be predefined +// cap true, if upper case HTML should be allowed +// 'continue' true, if the continuation statement should be tolerated +// css true, if CSS workarounds should be tolerated +// debug true, if debugger statements should be allowed +// devel true, if logging should be allowed (console, alert, etc.) +// eqeq true, if == should be allowed +// es5 true, if ES5 syntax should be allowed +// evil true, if eval should be allowed +// forin true, if for in statements need not filter +// fragment true, if HTML fragments should be allowed +// indent the indentation factor +// maxerr the maximum number of errors to allow +// maxlen the maximum length of a source line +// newcap true, if constructor names capitalization is ignored +// node true, if Node.js globals should be predefined +// nomen true, if names may have dangling _ +// on true, if HTML event handlers should be allowed +// passfail true, if the scan should stop on first error +// plusplus true, if increment/decrement should be allowed +// properties true, if all property names must be declared with /*properties*/ +// regexp true, if the . should be allowed in regexp literals +// rhino true, if the Rhino environment globals should be predefined +// undef true, if variables can be declared out of order +// unparam true, if unused parameters should be tolerated +// sloppy true, if the 'use strict'; pragma is optional +// sub true, if all forms of subscript notation are tolerated +// vars true, if multiple var statements per function should be allowed +// white true, if sloppy whitespace is tolerated +// widget true if the Yahoo Widgets globals should be predefined +// windows true, if MS Windows-specific globals should be predefined + +// For example: + +/*jslint + evil: true, nomen: true, regexp: true +*/ + +// The properties directive declares an exclusive list of property names. +// Any properties named in the program that are not in the list will +// produce a warning. + +// For example: + +/*properties + '\b', '\t', '\n', '\f', '\r', '!=', '!==', '"', '%', '\'', '(arguments)', + '(begin)', '(breakage)', '(context)', '(error)', '(identifier)', '(line)', + '(loopage)', '(name)', '(params)', '(scope)', '(token)', '(vars)', '(verb)', + '*', '+', '-', '/', '<', '<=', '==', '===', '>', '>=', ADSAFE, + Array, Date, Function, Object, '\\', a, a_label, a_not_allowed, + a_not_defined, a_scope, abbr, acronym, address, adsafe, adsafe_a, + adsafe_autocomplete, adsafe_bad_id, adsafe_div, adsafe_fragment, adsafe_go, + adsafe_html, adsafe_id, adsafe_id_go, adsafe_lib, adsafe_lib_second, + adsafe_missing_id, adsafe_name_a, adsafe_placement, adsafe_prefix_a, + adsafe_script, adsafe_source, adsafe_subscript_a, adsafe_tag, all, + already_defined, and, anon, applet, apply, approved, area, arity, article, + aside, assign, assign_exception, assignment_function_expression, at, + attribute_case_a, audio, autocomplete, avoid_a, b, background, + 'background-attachment', 'background-color', 'background-image', + 'background-position', 'background-repeat', bad_assignment, bad_color_a, + bad_constructor, bad_entity, bad_html, bad_id_a, bad_in_a, bad_invocation, + bad_name_a, bad_new, bad_number, bad_operand, bad_style, bad_type, bad_url_a, + bad_wrap, base, bdo, big, bitwise, block, blockquote, body, border, + 'border-bottom', 'border-bottom-color', 'border-bottom-left-radius', + 'border-bottom-right-radius', 'border-bottom-style', 'border-bottom-width', + 'border-collapse', 'border-color', 'border-left', 'border-left-color', + 'border-left-style', 'border-left-width', 'border-radius', 'border-right', + 'border-right-color', 'border-right-style', 'border-right-width', + 'border-spacing', 'border-style', 'border-top', 'border-top-color', + 'border-top-left-radius', 'border-top-right-radius', 'border-top-style', + 'border-top-width', 'border-width', bottom, br, braille, browser, button, c, + call, canvas, cap, caption, 'caption-side', center, charAt, charCodeAt, + character, cite, clear, clip, closure, cm, code, col, colgroup, color, + combine_var, command, conditional_assignment, confusing_a, confusing_regexp, + constructor_name_a, content, continue, control_a, 'counter-increment', + 'counter-reset', create, css, cursor, d, dangerous_comment, dangling_a, data, + datalist, dd, debug, del, deleted, details, devel, dfn, dialog, dir, + direction, display, disrupt, div, dl, dt, duplicate_a, edge, edition, else, + em, embed, embossed, empty, 'empty-cells', empty_block, empty_case, + empty_class, entityify, eqeq, errors, es5, eval, evidence, evil, ex, + exception, exec, expected_a, expected_a_at_b_c, expected_a_b, + expected_a_b_from_c_d, expected_at_a, expected_attribute_a, + expected_attribute_value_a, expected_class_a, expected_fraction_a, + expected_id_a, expected_identifier_a, expected_identifier_a_reserved, + expected_lang_a, expected_linear_a, expected_media_a, expected_name_a, + expected_nonstandard_style_attribute, expected_number_a, expected_operator_a, + expected_percent_a, expected_positive_a, expected_pseudo_a, + expected_selector_a, expected_small_a, expected_space_a_b, expected_string_a, + expected_style_attribute, expected_style_pattern, expected_tagname_a, + expected_type_a, f, fieldset, figure, filter, first, flag, float, floor, + font, 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', + 'font-style', 'font-variant', 'font-weight', footer, forEach, for_if, forin, + form, fragment, frame, frameset, from, fromCharCode, fud, funct, function, + function_block, function_eval, function_loop, function_statement, + function_strict, functions, global, globals, h1, h2, h3, h4, h5, h6, + handheld, hasOwnProperty, head, header, height, hgroup, hr, + 'hta:application', html, html_confusion_a, html_handlers, i, id, identifier, + identifier_function, iframe, img, immed, implied_evil, in, indent, indexOf, + infix_in, init, input, ins, insecure_a, isAlpha, isArray, isDigit, isNaN, + join, jslint, json, kbd, keygen, keys, label, labeled, lang, lbp, + leading_decimal_a, led, left, legend, length, 'letter-spacing', li, lib, + line, 'line-height', link, 'list-style', 'list-style-image', + 'list-style-position', 'list-style-type', map, margin, 'margin-bottom', + 'margin-left', 'margin-right', 'margin-top', mark, 'marker-offset', match, + 'max-height', 'max-width', maxerr, maxlen, member, menu, message, meta, + meter, 'min-height', 'min-width', missing_a, missing_a_after_b, + missing_option, missing_property, missing_space_a_b, missing_url, + missing_use_strict, mixed, mm, mode, move_invocation, move_var, n, name, + name_function, nav, nested_comment, newcap, node, noframes, nomen, noscript, + not, not_a_constructor, not_a_defined, not_a_function, not_a_label, + not_a_scope, not_greater, nud, number, object, octal_a, ol, on, opacity, + open, optgroup, option, outer, outline, 'outline-color', 'outline-style', + 'outline-width', output, overflow, 'overflow-x', 'overflow-y', p, padding, + 'padding-bottom', 'padding-left', 'padding-right', 'padding-top', + 'page-break-after', 'page-break-before', param, parameter_a_get_b, + parameter_arguments_a, parameter_set_a, params, paren, parent, passfail, pc, + plusplus, pop, position, postscript, pre, predef, print, progress, + projection, properties, prototype, pt, push, px, q, quote, quotes, r, radix, + range, raw, read_only, reason, redefinition_a, regexp, replace, report, + reserved, reserved_a, rhino, right, rp, rt, ruby, safe, samp, scanned_a_b, + screen, script, search, second, section, select, shift, slash_equal, slice, + sloppy, small, sort, source, span, speech, split, src, statement_block, + stopping, strange_loop, strict, string, strong, style, styleproperty, sub, + subscript, substr, sup, supplant, t, table, 'table-layout', tag_a_in_b, + tbody, td, test, 'text-align', 'text-decoration', 'text-indent', + 'text-shadow', 'text-transform', textarea, tfoot, th, thead, third, thru, + time, title, toLowerCase, toString, toUpperCase, token, too_long, too_many, + top, tr, trailing_decimal_a, tree, tt, tty, tv, type, u, ul, unclosed, + unclosed_comment, unclosed_regexp, undef, undefined, unescaped_a, + unexpected_a, unexpected_char_a_b, unexpected_comment, unexpected_else, + unexpected_label_a, unexpected_property_a, unexpected_space_a_b, + 'unicode-bidi', unnecessary_initialize, unnecessary_use, unparam, + unreachable_a_b, unrecognized_style_attribute_a, unrecognized_tag_a, unsafe, + unused, url, urls, use_array, use_braces, use_charAt, use_object, use_or, + use_param, used_before_a, var, var_a_not, vars, 'vertical-align', video, + visibility, was, weird_assignment, weird_condition, weird_new, + weird_program, weird_relation, weird_ternary, white, 'white-space', widget, + width, windows, 'word-spacing', 'word-wrap', wrap, wrap_immediate, + wrap_regexp, write_is_wrong, writeable, 'z-index' +*/ + +// The global directive is used to declare global variables that can +// be accessed by the program. If a declaration is true, then the variable +// is writeable. Otherwise, it is read-only. + +// 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 JSLINT function itself. That function is also an object that +// can contain data and other functions. + +var JSLINT = (function () { + 'use strict'; + + function array_to_object(array, value) { + +// Make an object from an array of keys and a common value. + + var i, length = array.length, object = {}; + for (i = 0; i < length; i += 1) { + object[array[i]] = value; + } + return object; + } + + + var adsafe_id, // The widget's ADsafe id. + adsafe_may, // The widget may load approved scripts. + adsafe_top, // At the top of the widget script. + adsafe_went, // ADSAFE.go has been called. + allowed_option = { + anon : true, + bitwise : true, + browser : true, + cap : true, + 'continue': true, + css : true, + debug : true, + devel : true, + eqeq : true, + es5 : true, + evil : true, + forin : true, + fragment : true, + indent : 10, + maxerr : 1000, + maxlen : 256, + newcap : true, + node : true, + nomen : true, + on : true, + passfail : true, + plusplus : true, + properties: true, + regexp : true, + rhino : true, + undef : true, + unparam : true, + sloppy : true, + sub : true, + vars : true, + white : true, + widget : true, + windows : true + }, + anonname, // The guessed name for anonymous functions. + approved, // ADsafe approved urls. + +// 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 property names that should not be permitted in the safe subset. + + banned = array_to_object([ + 'arguments', 'callee', 'caller', 'constructor', 'eval', 'prototype', + 'stack', 'unwatch', 'valueOf', 'watch' + ], true), + begin, // The root token + +// browser contains a set of global names that are commonly provided by a +// web browser environment. + + browser = array_to_object([ + 'clearInterval', 'clearTimeout', 'document', 'event', 'FormData', + 'frames', 'history', 'Image', 'localStorage', 'location', 'name', + 'navigator', 'Option', 'parent', 'screen', 'sessionStorage', + 'setInterval', 'setTimeout', 'Storage', 'window', 'XMLHttpRequest' + ], false), + +// bundle contains the text messages. + + bundle = { + a_label: "'{a}' is a statement label.", + a_not_allowed: "'{a}' is not allowed.", + a_not_defined: "'{a}' is not defined.", + a_scope: "'{a}' used out of scope.", + adsafe_a: "ADsafe violation: '{a}'.", + adsafe_autocomplete: "ADsafe autocomplete violation.", + adsafe_bad_id: "ADSAFE violation: bad id.", + adsafe_div: "ADsafe violation: Wrap the widget in a div.", + adsafe_fragment: "ADSAFE: Use the fragment option.", + adsafe_go: "ADsafe violation: Misformed ADSAFE.go.", + adsafe_html: "Currently, ADsafe does not operate on whole HTML " + + "documents. It operates on
                                                                                                                                                                                                                                                                                                                                                                                                                                                              fragments and .js files.", + adsafe_id: "ADsafe violation: id does not match.", + adsafe_id_go: "ADsafe violation: Missing ADSAFE.id or ADSAFE.go.", + adsafe_lib: "ADsafe lib violation.", + adsafe_lib_second: "ADsafe: The second argument to lib must be a function.", + adsafe_missing_id: "ADSAFE violation: missing ID_.", + adsafe_name_a: "ADsafe name violation: '{a}'.", + adsafe_placement: "ADsafe script placement violation.", + adsafe_prefix_a: "ADsafe violation: An id must have a '{a}' prefix", + adsafe_script: "ADsafe script violation.", + adsafe_source: "ADsafe unapproved script source.", + adsafe_subscript_a: "ADsafe subscript '{a}'.", + adsafe_tag: "ADsafe violation: Disallowed tag '{a}'.", + already_defined: "'{a}' is already defined.", + and: "The '&&' subexpression should be wrapped in parens.", + assign_exception: "Do not assign to the exception parameter.", + assignment_function_expression: "Expected an assignment or " + + "function call and instead saw an expression.", + attribute_case_a: "Attribute '{a}' not all lower case.", + avoid_a: "Avoid '{a}'.", + bad_assignment: "Bad assignment.", + bad_color_a: "Bad hex color '{a}'.", + bad_constructor: "Bad constructor.", + bad_entity: "Bad entity.", + bad_html: "Bad HTML string", + bad_id_a: "Bad id: '{a}'.", + bad_in_a: "Bad for in variable '{a}'.", + bad_invocation: "Bad invocation.", + bad_name_a: "Bad name: '{a}'.", + bad_new: "Do not use 'new' for side effects.", + bad_number: "Bad number '{a}'.", + bad_operand: "Bad operand.", + bad_style: "Bad style.", + bad_type: "Bad type.", + bad_url_a: "Bad url '{a}'.", + bad_wrap: "Do not wrap function literals in parens unless they " + + "are to be immediately invoked.", + combine_var: "Combine this with the previous 'var' statement.", + conditional_assignment: "Expected a conditional expression and " + + "instead saw an assignment.", + confusing_a: "Confusing use of '{a}'.", + confusing_regexp: "Confusing regular expression.", + constructor_name_a: "A constructor name '{a}' should start with " + + "an uppercase letter.", + control_a: "Unexpected control character '{a}'.", + css: "A css file should begin with @charset 'UTF-8';", + dangling_a: "Unexpected dangling '_' in '{a}'.", + dangerous_comment: "Dangerous comment.", + deleted: "Only properties should be deleted.", + duplicate_a: "Duplicate '{a}'.", + empty_block: "Empty block.", + empty_case: "Empty case.", + empty_class: "Empty class.", + es5: "This is an ES5 feature.", + evil: "eval is evil.", + expected_a: "Expected '{a}'.", + expected_a_b: "Expected '{a}' and instead saw '{b}'.", + expected_a_b_from_c_d: "Expected '{a}' to match '{b}' from line " + + "{c} and instead saw '{d}'.", + expected_at_a: "Expected an at-rule, and instead saw @{a}.", + expected_a_at_b_c: "Expected '{a}' at column {b}, not column {c}.", + expected_attribute_a: "Expected an attribute, and instead saw [{a}].", + expected_attribute_value_a: "Expected an attribute value and " + + "instead saw '{a}'.", + expected_class_a: "Expected a class, and instead saw .{a}.", + expected_fraction_a: "Expected a number between 0 and 1 and " + + "instead saw '{a}'", + expected_id_a: "Expected an id, and instead saw #{a}.", + expected_identifier_a: "Expected an identifier and instead saw '{a}'.", + expected_identifier_a_reserved: "Expected an identifier and " + + "instead saw '{a}' (a reserved word).", + expected_linear_a: "Expected a linear unit and instead saw '{a}'.", + expected_lang_a: "Expected a lang code, and instead saw :{a}.", + expected_media_a: "Expected a CSS media type, and instead saw '{a}'.", + expected_name_a: "Expected a name and instead saw '{a}'.", + expected_nonstandard_style_attribute: "Expected a non-standard " + + "style attribute and instead saw '{a}'.", + expected_number_a: "Expected a number and instead saw '{a}'.", + expected_operator_a: "Expected an operator and instead saw '{a}'.", + expected_percent_a: "Expected a percentage and instead saw '{a}'", + expected_positive_a: "Expected a positive number and instead saw '{a}'", + expected_pseudo_a: "Expected a pseudo, and instead saw :{a}.", + expected_selector_a: "Expected a CSS selector, and instead saw {a}.", + expected_small_a: "Expected a small positive integer and instead saw '{a}'", + expected_space_a_b: "Expected exactly one space between '{a}' and '{b}'.", + expected_string_a: "Expected a string and instead saw {a}.", + expected_style_attribute: "Excepted a style attribute, and instead saw '{a}'.", + expected_style_pattern: "Expected a style pattern, and instead saw '{a}'.", + expected_tagname_a: "Expected a tagName, and instead saw {a}.", + expected_type_a: "Expected a type, and instead saw {a}.", + for_if: "The body of a for in should be wrapped in an if " + + "statement to filter unwanted properties from the prototype.", + function_block: "Function statements should not be placed in blocks. " + + "Use a function expression or move the statement to the top of " + + "the outer function.", + function_eval: "The Function constructor is eval.", + function_loop: "Don't make functions within a loop.", + function_statement: "Function statements are not invocable. " + + "Wrap the whole function invocation in parens.", + function_strict: "Use the function form of 'use strict'.", + html_confusion_a: "HTML confusion in regular expression '<{a}'.", + html_handlers: "Avoid HTML event handlers.", + identifier_function: "Expected an identifier in an assignment " + + "and instead saw a function invocation.", + implied_evil: "Implied eval is evil. Pass a function instead of a string.", + infix_in: "Unexpected 'in'. Compare with undefined, or use the " + + "hasOwnProperty method instead.", + insecure_a: "Insecure '{a}'.", + isNaN: "Use the isNaN function to compare with NaN.", + lang: "lang is deprecated.", + leading_decimal_a: "A leading decimal point can be confused with a dot: '.{a}'.", + missing_a: "Missing '{a}'.", + missing_a_after_b: "Missing '{a}' after '{b}'.", + missing_option: "Missing option value.", + missing_property: "Missing property name.", + missing_space_a_b: "Missing space between '{a}' and '{b}'.", + missing_url: "Missing url.", + missing_use_strict: "Missing 'use strict' statement.", + mixed: "Mixed spaces and tabs.", + move_invocation: "Move the invocation into the parens that " + + "contain the function.", + move_var: "Move 'var' declarations to the top of the function.", + name_function: "Missing name in function statement.", + nested_comment: "Nested comment.", + not: "Nested not.", + not_a_constructor: "Do not use {a} as a constructor.", + not_a_defined: "'{a}' has not been fully defined yet.", + not_a_function: "'{a}' is not a function.", + not_a_label: "'{a}' is not a label.", + not_a_scope: "'{a}' is out of scope.", + not_greater: "'{a}' should not be greater than '{b}'.", + octal_a: "Don't use octal: '{a}'. Use '\\u....' instead.", + parameter_arguments_a: "Do not mutate parameter '{a}' when using 'arguments'.", + parameter_a_get_b: "Unexpected parameter '{a}' in get {b} function.", + parameter_set_a: "Expected parameter (value) in set {a} function.", + radix: "Missing radix parameter.", + read_only: "Read only.", + redefinition_a: "Redefinition of '{a}'.", + reserved_a: "Reserved name '{a}'.", + scanned_a_b: "{a} ({b}% scanned).", + slash_equal: "A regular expression literal can be confused with '/='.", + statement_block: "Expected to see a statement and instead saw a block.", + stopping: "Stopping. ", + strange_loop: "Strange loop.", + strict: "Strict violation.", + subscript: "['{a}'] is better written in dot notation.", + tag_a_in_b: "A '<{a}>' must be within '<{b}>'.", + too_long: "Line too long.", + too_many: "Too many errors.", + trailing_decimal_a: "A trailing decimal point can be confused " + + "with a dot: '.{a}'.", + type: "type is unnecessary.", + unclosed: "Unclosed string.", + unclosed_comment: "Unclosed comment.", + unclosed_regexp: "Unclosed regular expression.", + unescaped_a: "Unescaped '{a}'.", + unexpected_a: "Unexpected '{a}'.", + unexpected_char_a_b: "Unexpected character '{a}' in {b}.", + unexpected_comment: "Unexpected comment.", + unexpected_else: "Unexpected 'else' after 'return'.", + unexpected_label_a: "Unexpected label '{a}'.", + unexpected_property_a: "Unexpected /*property*/ '{a}'.", + unexpected_space_a_b: "Unexpected space between '{a}' and '{b}'.", + unnecessary_initialize: "It is not necessary to initialize '{a}' " + + "to 'undefined'.", + unnecessary_use: "Unnecessary 'use strict'.", + unreachable_a_b: "Unreachable '{a}' after '{b}'.", + unrecognized_style_attribute_a: "Unrecognized style attribute '{a}'.", + unrecognized_tag_a: "Unrecognized tag '<{a}>'.", + unsafe: "Unsafe character.", + url: "JavaScript URL.", + use_array: "Use the array literal notation [].", + use_braces: "Spaces are hard to count. Use {{a}}.", + use_charAt: "Use the charAt method.", + use_object: "Use the object literal notation {}.", + use_or: "Use the || operator.", + use_param: "Use a named parameter.", + used_before_a: "'{a}' was used before it was defined.", + var_a_not: "Variable {a} was not declared correctly.", + weird_assignment: "Weird assignment.", + weird_condition: "Weird condition.", + weird_new: "Weird construction. Delete 'new'.", + weird_program: "Weird program.", + weird_relation: "Weird relation.", + weird_ternary: "Weird ternary.", + wrap_immediate: "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.", + wrap_regexp: "Wrap the /regexp/ literal in parens to " + + "disambiguate the slash operator.", + write_is_wrong: "document.write can be a form of eval." + }, + comments_off, + css_attribute_data, + css_any, + + css_colorData = array_to_object([ + "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige", + "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", + "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", + "cornflowerblue", "cornsilk", "crimson", "cyan", "darkblue", + "darkcyan", "darkgoldenrod", "darkgray", "darkgreen", "darkkhaki", + "darkmagenta", "darkolivegreen", "darkorange", "darkorchid", + "darkred", "darksalmon", "darkseagreen", "darkslateblue", + "darkslategray", "darkturquoise", "darkviolet", "deeppink", + "deepskyblue", "dimgray", "dodgerblue", "firebrick", "floralwhite", + "forestgreen", "fuchsia", "gainsboro", "ghostwhite", "gold", + "goldenrod", "gray", "green", "greenyellow", "honeydew", "hotpink", + "indianred", "indigo", "ivory", "khaki", "lavender", + "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", + "lightcoral", "lightcyan", "lightgoldenrodyellow", "lightgreen", + "lightpink", "lightsalmon", "lightseagreen", "lightskyblue", + "lightslategray", "lightsteelblue", "lightyellow", "lime", + "limegreen", "linen", "magenta", "maroon", "mediumaquamarine", + "mediumblue", "mediumorchid", "mediumpurple", "mediumseagreen", + "mediumslateblue", "mediumspringgreen", "mediumturquoise", + "mediumvioletred", "midnightblue", "mintcream", "mistyrose", + "moccasin", "navajowhite", "navy", "oldlace", "olive", "olivedrab", + "orange", "orangered", "orchid", "palegoldenrod", "palegreen", + "paleturquoise", "palevioletred", "papayawhip", "peachpuff", + "peru", "pink", "plum", "powderblue", "purple", "red", "rosybrown", + "royalblue", "saddlebrown", "salmon", "sandybrown", "seagreen", + "seashell", "sienna", "silver", "skyblue", "slateblue", "slategray", + "snow", "springgreen", "steelblue", "tan", "teal", "thistle", + "tomato", "turquoise", "violet", "wheat", "white", "whitesmoke", + "yellow", "yellowgreen", + + "activeborder", "activecaption", "appworkspace", "background", + "buttonface", "buttonhighlight", "buttonshadow", "buttontext", + "captiontext", "graytext", "highlight", "highlighttext", + "inactiveborder", "inactivecaption", "inactivecaptiontext", + "infobackground", "infotext", "menu", "menutext", "scrollbar", + "threeddarkshadow", "threedface", "threedhighlight", + "threedlightshadow", "threedshadow", "window", "windowframe", + "windowtext" + ], true), + + css_border_style, + css_break, + + css_lengthData = { + '%': true, + 'cm': true, + 'em': true, + 'ex': true, + 'in': true, + 'mm': true, + 'pc': true, + 'pt': true, + 'px': true + }, + + css_media, + css_overflow, + + descapes = { + 'b': '\b', + 't': '\t', + 'n': '\n', + 'f': '\f', + 'r': '\r', + '"': '"', + '/': '/', + '\\': '\\' + }, + + devel = array_to_object([ + 'alert', 'confirm', 'console', 'Debug', 'opera', 'prompt', 'WSH' + ], false), + directive, + escapes = { + '\b': '\\b', + '\t': '\\t', + '\n': '\\n', + '\f': '\\f', + '\r': '\\r', + '\'': '\\\'', + '"' : '\\"', + '/' : '\\/', + '\\': '\\\\' + }, + + funct, // The current function, including the labels used in + // the function, as well as (breakage), + // (context), (loopage), (name), (params), (token), + // (vars), (verb) + + functionicity = [ + 'closure', 'exception', 'global', 'label', 'outer', 'undef', + 'unused', 'var' + ], + + functions, // All of the functions + global_funct, // The global body + global_scope, // The global scope + html_tag = { + a: {}, + abbr: {}, + acronym: {}, + address: {}, + applet: {}, + area: {empty: true, parent: ' map '}, + article: {}, + aside: {}, + audio: {}, + b: {}, + base: {empty: true, parent: ' head '}, + bdo: {}, + big: {}, + blockquote: {}, + body: {parent: ' html noframes '}, + br: {empty: true}, + button: {}, + canvas: {parent: ' body p div th td '}, + caption: {parent: ' table '}, + center: {}, + cite: {}, + code: {}, + col: {empty: true, parent: ' table colgroup '}, + colgroup: {parent: ' table '}, + command: {parent: ' menu '}, + datalist: {}, + dd: {parent: ' dl '}, + del: {}, + details: {}, + dialog: {}, + dfn: {}, + dir: {}, + div: {}, + dl: {}, + dt: {parent: ' dl '}, + em: {}, + embed: {}, + fieldset: {}, + figure: {}, + font: {}, + footer: {}, + form: {}, + frame: {empty: true, parent: ' frameset '}, + frameset: {parent: ' html frameset '}, + h1: {}, + h2: {}, + h3: {}, + h4: {}, + h5: {}, + h6: {}, + head: {parent: ' html '}, + header: {}, + hgroup: {}, + hr: {empty: true}, + 'hta:application': + {empty: true, parent: ' head '}, + html: {parent: '*'}, + i: {}, + iframe: {}, + img: {empty: true}, + input: {empty: true}, + ins: {}, + kbd: {}, + keygen: {}, + label: {}, + legend: {parent: ' details fieldset figure '}, + li: {parent: ' dir menu ol ul '}, + link: {empty: true, parent: ' head '}, + map: {}, + mark: {}, + menu: {}, + meta: {empty: true, parent: ' head noframes noscript '}, + meter: {}, + nav: {}, + noframes: {parent: ' html body '}, + noscript: {parent: ' body head noframes '}, + object: {}, + ol: {}, + optgroup: {parent: ' select '}, + option: {parent: ' optgroup select '}, + output: {}, + p: {}, + param: {empty: true, parent: ' applet object '}, + pre: {}, + progress: {}, + q: {}, + rp: {}, + rt: {}, + ruby: {}, + samp: {}, + script: {empty: true, parent: ' body div frame head iframe p pre span '}, + section: {}, + select: {}, + small: {}, + span: {}, + source: {}, + strong: {}, + style: {parent: ' head ', empty: true}, + sub: {}, + sup: {}, + table: {}, + tbody: {parent: ' table '}, + td: {parent: ' tr '}, + textarea: {}, + tfoot: {parent: ' table '}, + th: {parent: ' tr '}, + thead: {parent: ' table '}, + time: {}, + title: {parent: ' head '}, + tr: {parent: ' table tbody thead tfoot '}, + tt: {}, + u: {}, + ul: {}, + 'var': {}, + video: {} + }, + + ids, // HTML ids + in_block, + indent, + itself, // JSLint itself + json_mode, + lex, // the tokenizer + lines, + lookahead, + node = array_to_object([ + 'Buffer', 'clearInterval', 'clearTimeout', 'console', 'exports', + 'global', 'module', 'process', 'querystring', 'require', + 'setInterval', 'setTimeout', '__dirname', '__filename' + ], false), + node_js, + numbery = array_to_object(['indexOf', 'lastIndexOf', 'search'], true), + next_token, + option, + predefined, // Global variables defined by option + prereg, + prev_token, + property, + regexp_flag = array_to_object(['g', 'i', 'm'], true), + return_this = function return_this() { + return this; + }, + rhino = array_to_object([ + 'defineClass', 'deserialize', 'gc', 'help', 'load', 'loadClass', + 'print', 'quit', 'readFile', 'readUrl', 'runCommand', 'seal', + 'serialize', 'spawn', 'sync', 'toint32', 'version' + ], false), + + scope, // An object containing an object for each variable in scope + semicolon_coda = array_to_object([';', '"', '\'', ')'], true), + src, + stack, + +// standard contains the global names that are provided by the +// ECMAScript standard. + + standard = array_to_object([ + 'Array', 'Boolean', 'Date', 'decodeURI', 'decodeURIComponent', + 'encodeURI', 'encodeURIComponent', 'Error', 'eval', 'EvalError', + 'Function', 'isFinite', 'isNaN', 'JSON', 'Math', 'Number', + 'Object', 'parseInt', 'parseFloat', 'RangeError', 'ReferenceError', + 'RegExp', 'String', 'SyntaxError', 'TypeError', 'URIError' + ], false), + + strict_mode, + syntax = {}, + tab, + token, + urls, + var_mode, + warnings, + +// widget contains the global names which are provided to a Yahoo +// (fna Konfabulator) widget. + + widget = array_to_object([ + 'alert', 'animator', 'appleScript', 'beep', 'bytesToUIString', + 'Canvas', 'chooseColor', 'chooseFile', 'chooseFolder', + 'closeWidget', 'COM', 'convertPathToHFS', 'convertPathToPlatform', + 'CustomAnimation', 'escape', 'FadeAnimation', 'filesystem', 'Flash', + 'focusWidget', 'form', 'FormField', 'Frame', 'HotKey', 'Image', + 'include', 'isApplicationRunning', 'iTunes', 'konfabulatorVersion', + 'log', 'md5', 'MenuItem', 'MoveAnimation', 'openURL', 'play', + 'Point', 'popupMenu', 'preferenceGroups', 'preferences', 'print', + 'prompt', 'random', 'Rectangle', 'reloadWidget', 'ResizeAnimation', + 'resolvePath', 'resumeUpdates', 'RotateAnimation', 'runCommand', + 'runCommandInBg', 'saveAs', 'savePreferences', 'screen', + 'ScrollBar', 'showWidgetPreferences', 'sleep', 'speak', 'Style', + 'suppressUpdates', 'system', 'tellWidget', 'Text', 'TextArea', + 'Timer', 'unescape', 'updateNow', 'URL', 'Web', 'widget', 'Window', + 'XMLDOM', 'XMLHttpRequest', 'yahooCheckLogin', 'yahooLogin', + 'yahooLogout' + ], true), + + windows = array_to_object([ + 'ActiveXObject', 'CScript', 'Debug', 'Enumerator', 'System', + 'VBArray', 'WScript', 'WSH' + ], false), + +// xmode is used to adapt to the exceptions in html parsing. +// It can have these states: +// '' .js script file +// 'html' +// 'outer' +// 'script' +// 'style' +// 'scriptstring' +// 'styleproperty' + + xmode, + xquote, + +// Regular expressions. Some of these are stupidly long. + +// unsafe comment or string + ax = /@cc|<\/?|script|\]\s*\]|<\s*!|</i, +// carriage return, carriage return linefeed, or linefeed + crlfx = /\r\n?|\n/, +// 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]/, +// query characters for ids + dx = /[\[\]\/\\"'*<>.&:(){}+=#]/, +// html token + hx = /^\s*(['"=>\/&#]|<(?:\/|\!(?:--)?)?|[a-zA-Z][a-zA-Z0-9_\-:]*|[0-9]+|--)/, +// identifier + ix = /^([a-zA-Z_$][a-zA-Z0-9_$]*)$/, +// javascript url + jx = /^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\s*:/i, +// star slash + lx = /\*\/|\/\*/, +// 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]/g, +// outer html token + ox = /[>&]|<[\/!]?|--/, +// attributes characters + qx = /[^a-zA-Z0-9+\-_\/. ]/, +// style + sx = /^\s*([{}:#%.=,>+\[\]@()"';]|[*$\^~]=|[a-zA-Z_][a-zA-Z0-9_\-]*|[0-9]+|<\/|\/\*)/, + ssx = /^\s*([@#!"'};:\-%.=,+\[\]()*_]|[a-zA-Z][a-zA-Z0-9._\-]*|\/\*?|\d+(?:\.\d+)?|<\/)/, +// token + tx = /^\s*([(){}\[\]\?.,:;'"~#@`]|={1,3}|\/(\*(jslint|properties|property|members?|globals?)?|=|\/)?|\*[\/=]?|\+(?:=|\++)?|-(?:=|-+)?|[\^%]=?|&[&=]?|\|[|=]?|>{1,3}=?|<(?:[\/=!]|\!(\[|--)?|<=?)?|\!={0,2}|[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+(?:[xX][0-9a-fA-F]+|\.[0-9]*)?(?:[eE][+\-]?[0-9]+)?)/, +// url badness + ux = /&|\+|\u00AD|\.\.|\/\*|%[^;]|base64|url|expression|data|mailto|script/i, + + rx = { + outer: hx, + html: hx, + style: sx, + styleproperty: ssx + }; + + + function F() {} // Used by Object.create + +// Provide critical ES5 functions to ES3. + + if (typeof Array.prototype.filter !== 'function') { + Array.prototype.filter = function (f) { + var i, length = this.length, result = [], value; + for (i = 0; i < length; i += 1) { + try { + value = this[i]; + if (f(value)) { + result.push(value); + } + } catch (ignore) { + } + } + return result; + }; + } + + if (typeof Array.prototype.forEach !== 'function') { + Array.prototype.forEach = function (f) { + var i, length = this.length; + for (i = 0; i < length; i += 1) { + try { + f(this[i]); + } catch (ignore) { + } + } + }; + } + + if (typeof Array.isArray !== 'function') { + Array.isArray = function (o) { + return Object.prototype.toString.apply(o) === '[object Array]'; + }; + } + + if (!Object.prototype.hasOwnProperty.call(Object, 'create')) { + Object.create = function (o) { + F.prototype = o; + return new F(); + }; + } + + if (typeof Object.keys !== 'function') { + Object.keys = function (o) { + var array = [], key; + for (key in o) { + if (Object.prototype.hasOwnProperty.call(o, key)) { + array.push(key); + } + } + return array; + }; + } + + if (typeof String.prototype.entityify !== 'function') { + String.prototype.entityify = function () { + return this + .replace(/&/g, '&') + .replace(//g, '>'); + }; + } + + 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 replacement = o[b]; + return typeof replacement === 'string' || + typeof replacement === 'number' ? replacement : a; + }); + }; + } + + + function sanitize(a) { + +// Escapify a troublesome character. + + return escapes[a] || + '\\u' + ('0000' + a.charCodeAt().toString(16)).slice(-4); + } + + + function add_to_predefined(group) { + Object.keys(group).forEach(function (name) { + predefined[name] = group[name]; + }); + } + + + function assume() { + if (!option.safe) { + if (option.rhino) { + add_to_predefined(rhino); + option.rhino = false; + } + if (option.devel) { + add_to_predefined(devel); + option.devel = false; + } + if (option.browser) { + add_to_predefined(browser); + option.browser = false; + } + if (option.windows) { + add_to_predefined(windows); + option.windows = false; + } + if (option.node) { + add_to_predefined(node); + option.node = false; + node_js = true; + } + if (option.widget) { + add_to_predefined(widget); + option.widget = false; + } + } + } + + +// Produce an error warning. + + function artifact(tok) { + if (!tok) { + tok = next_token; + } + return tok.number || tok.string; + } + + function quit(message, line, character) { + throw { + name: 'JSLintError', + line: line, + character: character, + message: bundle.scanned_a_b.supplant({ + a: message, + b: Math.floor((line / lines.length) * 100) + }) + }; + } + + function warn(message, offender, a, b, c, d) { + var character, line, warning; + offender = offender || next_token; // ~~ + line = offender.line || 0; + character = offender.from || 0; + warning = { + id: '(error)', + raw: bundle[message] || message, + evidence: lines[line - 1] || '', + line: line, + character: character, + a: a || (offender.id === '(number)' + ? String(offender.number) + : offender.string), + b: b, + c: c, + d: d + }; + warning.reason = warning.raw.supplant(warning); + JSLINT.errors.push(warning); + if (option.passfail) { + quit(bundle.stopping, line, character); + } + warnings += 1; + if (warnings >= option.maxerr) { + quit(bundle.too_many, line, character); + } + return warning; + } + + function warn_at(message, line, character, a, b, c, d) { + return warn(message, { + line: line, + from: character + }, a, b, c, d); + } + + function stop(message, offender, a, b, c, d) { + var warning = warn(message, offender, a, b, c, d); + quit(bundle.stopping, warning.line, warning.character); + } + + function stop_at(message, line, character, a, b, c, d) { + return stop(message, { + line: line, + from: character + }, a, b, c, d); + } + + function expected_at(at) { + if (!option.white && next_token.from !== at) { + warn('expected_a_at_b_c', next_token, '', at, + next_token.from); + } + } + + function aint(it, name, expected) { + if (it[name] !== expected) { + warn('expected_a_b', it, expected, it[name]); + return true; + } + return false; + } + + +// lexical analysis and token construction + + lex = (function lex() { + var character, c, from, length, line, pos, source_row; + +// Private lex methods + + function next_line() { + var at; + if (line >= lines.length) { + return false; + } + character = 1; + source_row = lines[line]; + line += 1; + at = source_row.search(/ \t/); + if (at >= 0) { + warn_at('mixed', line, at + 1); + } + source_row = source_row.replace(/\t/g, tab); + at = source_row.search(cx); + if (at >= 0) { + warn_at('unsafe', line, at); + } + if (option.maxlen && option.maxlen < source_row.length) { + warn_at('too_long', line, source_row.length); + } + return true; + } + +// Produce a token object. The token inherits from a syntax symbol. + + function it(type, value) { + var id, the_token; + if (type === '(string)' || type === '(range)') { + if (jx.test(value)) { + warn_at('url', line, from); + } + } + the_token = Object.create(syntax[( + type === '(punctuator)' || (type === '(identifier)' && + Object.prototype.hasOwnProperty.call(syntax, value)) + ? value + : type + )] || syntax['(error)']); + if (type === '(identifier)') { + the_token.identifier = true; + if (value === '__iterator__' || value === '__proto__') { + stop_at('reserved_a', line, from, value); + } else if (!option.nomen && + (value.charAt(0) === '_' || + value.charAt(value.length - 1) === '_')) { + warn_at('dangling_a', line, from, value); + } + } + if (type === '(number)') { + the_token.number = +value; + } else if (value !== undefined) { + the_token.string = String(value); + } + the_token.line = line; + the_token.from = from; + the_token.thru = character; + id = the_token.id; + prereg = id && ( + ('(,=:[!&|?{};'.indexOf(id.charAt(id.length - 1)) >= 0) || + id === 'return' || id === 'case' + ); + return the_token; + } + + function match(x) { + var exec = x.exec(source_row), first; + if (exec) { + length = exec[0].length; + first = exec[1]; + c = first.charAt(0); + source_row = source_row.slice(length); + from = character + length - first.length; + character += length; + return first; + } + } + + function string(x) { + var c, pos = 0, r = '', result; + + function hex(n) { + var i = parseInt(source_row.substr(pos + 1, n), 16); + pos += n; + if (i >= 32 && i <= 126 && + i !== 34 && i !== 92 && i !== 39) { + warn_at('unexpected_a', line, character, '\\'); + } + character += n; + c = String.fromCharCode(i); + } + + if (json_mode && x !== '"') { + warn_at('expected_a', line, character, '"'); + } + + if (xquote === x || (xmode === 'scriptstring' && !xquote)) { + return it('(punctuator)', x); + } + + for (;;) { + while (pos >= source_row.length) { + pos = 0; + if (xmode !== 'html' || !next_line()) { + stop_at('unclosed', line, from); + } + } + c = source_row.charAt(pos); + if (c === x) { + character += 1; + source_row = source_row.slice(pos + 1); + result = it('(string)', r); + result.quote = x; + return result; + } + if (c < ' ') { + if (c === '\n' || c === '\r') { + break; + } + warn_at('control_a', line, character + pos, + source_row.slice(0, pos)); + } else if (c === xquote) { + warn_at('bad_html', line, character + pos); + } else if (c === '<') { + if (option.safe && xmode === 'html') { + warn_at('adsafe_a', line, character + pos, c); + } else if (source_row.charAt(pos + 1) === '/' && (xmode || option.safe)) { + warn_at('expected_a_b', line, character, + '<\\/', '= '0' && c <= '7' ? 'octal_a' : 'unexpected_a', + line, character, '\\' + c); + } else { + c = descapes[c]; + } + } + } + } + r += c; + character += 1; + pos += 1; + } + } + + function number(snippet) { + var digit; + if (xmode !== 'style' && xmode !== 'styleproperty' && + source_row.charAt(0).isAlpha()) { + warn_at('expected_space_a_b', + line, character, c, source_row.charAt(0)); + } + if (c === '0') { + digit = snippet.charAt(1); + if (digit.isDigit()) { + if (token.id !== '.' && xmode !== 'styleproperty') { + warn_at('unexpected_a', line, character, snippet); + } + } else if (json_mode && (digit === 'x' || digit === 'X')) { + warn_at('unexpected_a', line, character, '0x'); + } + } + if (snippet.slice(snippet.length - 1) === '.') { + warn_at('trailing_decimal_a', line, character, snippet); + } + if (xmode !== 'style') { + digit = +snippet; + if (!isFinite(digit)) { + warn_at('bad_number', line, character, snippet); + } + snippet = digit; + } + return it('(number)', snippet); + } + + function comment(snippet) { + if (comments_off || src || (xmode && xmode !== 'script' && + xmode !== 'style' && xmode !== 'styleproperty')) { + warn_at('unexpected_comment', line, character); + } else if (xmode === 'script' && /<\//i.test(source_row)) { + warn_at('unexpected_a', line, character, '<\/'); + } else if (option.safe && ax.test(snippet)) { + warn_at('dangerous_comment', line, character); + } + } + + function regexp() { + var b, + bit, + captures = 0, + depth = 0, + flag = '', + high, + letter, + length = 0, + low, + potential, + quote, + result; + for (;;) { + b = true; + c = source_row.charAt(length); + length += 1; + switch (c) { + case '': + stop_at('unclosed_regexp', line, from); + return; + case '/': + if (depth > 0) { + warn_at('unescaped_a', line, from + length, '/'); + } + c = source_row.slice(0, length - 1); + potential = Object.create(regexp_flag); + for (;;) { + letter = source_row.charAt(length); + if (potential[letter] !== true) { + break; + } + potential[letter] = false; + length += 1; + flag += letter; + } + if (source_row.charAt(length).isAlpha()) { + stop_at('unexpected_a', line, from, source_row.charAt(length)); + } + character += length; + source_row = source_row.slice(length); + quote = source_row.charAt(0); + if (quote === '/' || quote === '*') { + stop_at('confusing_regexp', line, from); + } + result = it('(regexp)', c); + result.flag = flag; + return result; + case '\\': + c = source_row.charAt(length); + if (c < ' ') { + warn_at('control_a', line, from + length, String(c)); + } else if (c === '<') { + warn_at(bundle.unexpected_a, line, from + length, '\\'); + } + length += 1; + break; + case '(': + depth += 1; + b = false; + if (source_row.charAt(length) === '?') { + length += 1; + switch (source_row.charAt(length)) { + case ':': + case '=': + case '!': + length += 1; + break; + default: + warn_at(bundle.expected_a_b, line, from + length, + ':', source_row.charAt(length)); + } + } else { + captures += 1; + } + break; + case '|': + b = false; + break; + case ')': + if (depth === 0) { + warn_at('unescaped_a', line, from + length, ')'); + } else { + depth -= 1; + } + break; + case ' ': + pos = 1; + while (source_row.charAt(length) === ' ') { + length += 1; + pos += 1; + } + if (pos > 1) { + warn_at('use_braces', line, from + length, pos); + } + break; + case '[': + c = source_row.charAt(length); + if (c === '^') { + length += 1; + if (!option.regexp) { + warn_at('insecure_a', line, from + length, c); + } else if (source_row.charAt(length) === ']') { + stop_at('unescaped_a', line, from + length, '^'); + } + } + bit = false; + if (c === ']') { + warn_at('empty_class', line, from + length - 1); + bit = true; + } +klass: do { + c = source_row.charAt(length); + length += 1; + switch (c) { + case '[': + case '^': + warn_at('unescaped_a', line, from + length, c); + bit = true; + break; + case '-': + if (bit) { + bit = false; + } else { + warn_at('unescaped_a', line, from + length, '-'); + bit = true; + } + break; + case ']': + if (!bit) { + warn_at('unescaped_a', line, from + length - 1, '-'); + } + break klass; + case '\\': + c = source_row.charAt(length); + if (c < ' ') { + warn_at(bundle.control_a, line, from + length, String(c)); + } else if (c === '<') { + warn_at(bundle.unexpected_a, line, from + length, '\\'); + } + length += 1; + bit = true; + break; + case '/': + warn_at('unescaped_a', line, from + length - 1, '/'); + bit = true; + break; + case '<': + if (xmode === 'script') { + c = source_row.charAt(length); + if (c === '!' || c === '/') { + warn_at(bundle.html_confusion_a, line, + from + length, c); + } + } + bit = true; + break; + default: + bit = true; + } + } while (c); + break; + case '.': + if (!option.regexp) { + warn_at('insecure_a', line, from + length, c); + } + break; + case ']': + case '?': + case '{': + case '}': + case '+': + case '*': + warn_at('unescaped_a', line, from + length, c); + break; + case '<': + if (xmode === 'script') { + c = source_row.charAt(length); + if (c === '!' || c === '/') { + warn_at(bundle.html_confusion_a, line, from + length, c); + } + } + break; + } + if (b) { + switch (source_row.charAt(length)) { + case '?': + case '+': + case '*': + length += 1; + if (source_row.charAt(length) === '?') { + length += 1; + } + break; + case '{': + length += 1; + c = source_row.charAt(length); + if (c < '0' || c > '9') { + warn_at(bundle.expected_number_a, line, + from + length, c); + } + length += 1; + low = +c; + for (;;) { + c = source_row.charAt(length); + if (c < '0' || c > '9') { + break; + } + length += 1; + low = +c + (low * 10); + } + high = low; + if (c === ',') { + length += 1; + high = Infinity; + c = source_row.charAt(length); + if (c >= '0' && c <= '9') { + length += 1; + high = +c; + for (;;) { + c = source_row.charAt(length); + if (c < '0' || c > '9') { + break; + } + length += 1; + high = +c + (high * 10); + } + } + } + if (source_row.charAt(length) !== '}') { + warn_at(bundle.expected_a_b, line, from + length, + '}', c); + } else { + length += 1; + } + if (source_row.charAt(length) === '?') { + length += 1; + } + if (low > high) { + warn_at(bundle.not_greater, line, from + length, + low, high); + } + break; + } + } + } + c = source_row.slice(0, length - 1); + character += length; + source_row = source_row.slice(length); + return it('(regexp)', c); + } + +// Public lex methods + + return { + init: function (source) { + if (typeof source === 'string') { + lines = source.split(crlfx); + } else { + lines = source; + } + line = 0; + next_line(); + from = 1; + }, + + range: function (begin, end) { + var c, value = ''; + from = character; + if (source_row.charAt(0) !== begin) { + stop_at('expected_a_b', line, character, begin, + source_row.charAt(0)); + } + for (;;) { + source_row = source_row.slice(1); + character += 1; + c = source_row.charAt(0); + switch (c) { + case '': + stop_at('missing_a', line, character, c); + break; + case end: + source_row = source_row.slice(1); + character += 1; + return it('(range)', value); + case xquote: + case '\\': + warn_at('unexpected_a', line, character, c); + break; + } + value += c; + } + }, + +// token -- this is called by advance to get the next token. + + token: function () { + var c, i, snippet; + + for (;;) { + while (!source_row) { + if (!next_line()) { + return it('(end)'); + } + } + while (xmode === 'outer') { + i = source_row.search(ox); + if (i === 0) { + break; + } else if (i > 0) { + character += 1; + source_row = source_row.slice(i); + break; + } else { + if (!next_line()) { + return it('(end)', ''); + } + } + } + snippet = match(rx[xmode] || tx); + if (!snippet) { + if (source_row) { + if (source_row.charAt(0) === ' ') { + if (!option.white) { + warn_at('unexpected_a', line, character, + '(space)'); + } + character += 1; + source_row = ''; + } else { + stop_at('unexpected_a', line, character, + source_row.charAt(0)); + } + } + } else { + +// identifier + + c = snippet.charAt(0); + if (c.isAlpha() || c === '_' || c === '$') { + return it('(identifier)', snippet); + } + +// number + + if (c.isDigit()) { + return number(snippet); + } + switch (snippet) { + +// string + + case '"': + case "'": + return string(snippet); + +// // comment + + case '//': + comment(source_row); + source_row = ''; + break; + +// /* comment + + case '/*': + for (;;) { + i = source_row.search(lx); + if (i >= 0) { + break; + } + comment(source_row); + if (!next_line()) { + stop_at('unclosed_comment', line, character); + } + } + comment(source_row.slice(0, i)); + character += i + 2; + if (source_row.charAt(i) === '/') { + stop_at('nested_comment', line, character); + } + source_row = source_row.slice(i + 2); + break; + + case '': + break; +// / + case '/': + if (token.id === '/=') { + stop_at( + bundle.slash_equal, + line, + from + ); + } + return prereg + ? regexp() + : it('(punctuator)', snippet); + +// punctuator + + case ''); + } + character += 3; + source_row = source_row.slice(i + 3); + break; + case '#': + if (xmode === 'html' || xmode === 'styleproperty') { + for (;;) { + c = source_row.charAt(0); + if ((c < '0' || c > '9') && + (c < 'a' || c > 'f') && + (c < 'A' || c > 'F')) { + break; + } + character += 1; + source_row = source_row.slice(1); + snippet += c; + } + if (snippet.length !== 4 && snippet.length !== 7) { + warn_at('bad_color_a', line, + from + length, snippet); + } + return it('(color)', snippet); + } + return it('(punctuator)', snippet); + + default: + if (xmode === 'outer' && c === '&') { + character += 1; + source_row = source_row.slice(1); + for (;;) { + c = source_row.charAt(0); + character += 1; + source_row = source_row.slice(1); + if (c === ';') { + break; + } + if (!((c >= '0' && c <= '9') || + (c >= 'a' && c <= 'z') || + c === '#')) { + stop_at('bad_entity', line, from + length, + character); + } + } + break; + } + return it('(punctuator)', snippet); + } + } + } + } + }; + }()); + + + function add_label(token, kind, name) { + +// Define the symbol in the current function in the current scope. + + name = name || token.string; + +// Global variables cannot be created in the safe subset. If a global variable +// already exists, do nothing. If it is predefined, define it. + + if (funct === global_funct) { + if (option.safe) { + warn('adsafe_a', token, name); + } + if (typeof global_funct[name] !== 'string') { + token.writeable = typeof predefined[name] === 'boolean' + ? predefined[name] + : true; + token.funct = funct; + global_scope[name] = token; + } + if (kind === 'becoming') { + kind = 'var'; + } + +// Ordinary variables. + + } else { + +// Warn if the variable already exists. + + if (typeof funct[name] === 'string') { + if (funct[name] === 'undef') { + if (!option.undef) { + warn('used_before_a', token, name); + } + kind = 'var'; + } else { + warn('already_defined', token, name); + } + } else { + +// Add the symbol to the current function. + + token.funct = funct; + token.writeable = true; + scope[name] = token; + } + } + funct[name] = kind; + } + + + function peek(distance) { + +// Peek ahead to a future token. The distance is how far ahead to look. The +// default is the next token. + + var found, slot = 0; + + distance = distance || 0; + while (slot <= distance) { + found = lookahead[slot]; + if (!found) { + found = lookahead[slot] = lex.token(); + } + slot += 1; + } + return found; + } + + + function advance(id, match) { + +// Produce the next token, also looking for programming errors. + + if (indent) { + +// If indentation checking was requested, then inspect all of the line breakings. +// The var statement is tricky because the names might be aligned or not. We +// look at the first line break after the var to determine the programmer's +// intention. + + if (var_mode && next_token.line !== token.line) { + if ((var_mode !== indent || !next_token.edge) && + next_token.from === indent.at - + (next_token.edge ? option.indent : 0)) { + var dent = indent; + for (;;) { + dent.at -= option.indent; + if (dent === var_mode) { + break; + } + dent = dent.was; + } + dent.open = false; + } + var_mode = null; + } + if (next_token.id === '?' && indent.mode === ':' && + token.line !== next_token.line) { + indent.at -= option.indent; + } + if (indent.open) { + +// If the token is an edge. + + if (next_token.edge) { + if (next_token.edge === 'label') { + expected_at(1); + } else if (next_token.edge === 'case' || indent.mode === 'statement') { + expected_at(indent.at - option.indent); + } else if (indent.mode !== 'array' || next_token.line !== token.line) { + expected_at(indent.at); + } + +// If the token is not an edge, but is the first token on the line. + + } else if (next_token.line !== token.line) { + if (next_token.from < indent.at + (indent.mode === + 'expression' ? 0 : option.indent)) { + expected_at(indent.at + option.indent); + } + indent.wrap = true; + } + } else if (next_token.line !== token.line) { + if (next_token.edge) { + expected_at(indent.at); + } else { + indent.wrap = true; + if (indent.mode === 'statement' || indent.mode === 'var') { + expected_at(indent.at + option.indent); + } else if (next_token.from < indent.at + (indent.mode === + 'expression' ? 0 : option.indent)) { + expected_at(indent.at + option.indent); + } + } + } + } + + switch (token.id) { + case '(number)': + if (next_token.id === '.') { + warn('trailing_decimal_a'); + } + break; + case '-': + if (next_token.id === '-' || next_token.id === '--') { + warn('confusing_a'); + } + break; + case '+': + if (next_token.id === '+' || next_token.id === '++') { + warn('confusing_a'); + } + break; + } + if (token.id === '(string)' || token.identifier) { + anonname = token.string; + } + + if (id && next_token.id !== id) { + if (match) { + warn('expected_a_b_from_c_d', next_token, id, + match.id, match.line, artifact()); + } else if (!next_token.identifier || next_token.string !== id) { + warn('expected_a_b', next_token, id, artifact()); + } + } + prev_token = token; + token = next_token; + next_token = lookahead.shift() || lex.token(); + } + + + function advance_identifier(string) { + if (next_token.identifier && next_token.string === string) { + advance(); + } else { + warn('expected_a_b', next_token, string, artifact()); + } + } + + + function do_safe() { + if (option.adsafe) { + option.safe = true; + } + if (option.safe) { + option.browser = + option['continue'] = + option.css = + option.debug = + option.devel = + option.evil = + option.forin = + option.newcap = + option.nomen = + option.on = + option.rhino = + option.sloppy = + option.sub = + option.undef = + option.widget = + option.windows = false; + + + delete predefined.Array; + delete predefined.Date; + delete predefined.Function; + delete predefined.Object; + delete predefined['eval']; + + add_to_predefined({ + ADSAFE: false, + lib: false + }); + } + } + + + function do_globals() { + var name, writeable; + for (;;) { + if (next_token.id !== '(string)' && !next_token.identifier) { + return; + } + name = next_token.string; + advance(); + writeable = false; + if (next_token.id === ':') { + advance(':'); + switch (next_token.id) { + case 'true': + writeable = predefined[name] !== false; + advance('true'); + break; + case 'false': + advance('false'); + break; + default: + stop('unexpected_a'); + } + } + predefined[name] = writeable; + if (next_token.id !== ',') { + return; + } + advance(','); + } + } + + + function do_jslint() { + var name, value; + while (next_token.id === '(string)' || next_token.identifier) { + name = next_token.string; + if (!allowed_option[name]) { + stop('unexpected_a'); + } + advance(); + if (next_token.id !== ':') { + stop('expected_a_b', next_token, ':', artifact()); + } + advance(':'); + if (typeof allowed_option[name] === 'number') { + value = next_token.number; + if (value > allowed_option[name] || value <= 0 || + Math.floor(value) !== value) { + stop('expected_small_a'); + } + option[name] = value; + } else { + if (next_token.id === 'true') { + option[name] = true; + } else if (next_token.id === 'false') { + option[name] = false; + } else { + stop('unexpected_a'); + } + } + advance(); + if (next_token.id === ',') { + advance(','); + } + } + assume(); + } + + + function do_properties() { + var name; + option.properties = true; + for (;;) { + if (next_token.id !== '(string)' && !next_token.identifier) { + return; + } + name = next_token.string; + advance(); + if (next_token.id === ':') { + for (;;) { + advance(); + if (next_token.id !== '(string)' && !next_token.identifier) { + break; + } + } + } + property[name] = 0; + if (next_token.id !== ',') { + return; + } + advance(','); + } + } + + + directive = function directive() { + var command = this.id, + old_comments_off = comments_off, + old_indent = indent; + comments_off = true; + indent = null; + if (next_token.line === token.line && next_token.from === token.thru) { + warn('missing_space_a_b', next_token, artifact(token), artifact()); + } + if (lookahead.length > 0) { + warn('unexpected_a', this); + } + switch (command) { + case '/*properties': + case '/*property': + case '/*members': + case '/*member': + do_properties(); + break; + case '/*jslint': + if (option.safe) { + warn('adsafe_a', this); + } + do_jslint(); + break; + case '/*globals': + case '/*global': + if (option.safe) { + warn('adsafe_a', this); + } + do_globals(); + break; + default: + stop('unexpected_a', this); + } + comments_off = old_comments_off; + advance('*/'); + indent = old_indent; + }; + + +// Indentation intention + + function edge(mode) { + next_token.edge = indent ? indent.open && (mode || 'edge') : ''; + } + + + function step_in(mode) { + var open; + if (typeof mode === 'number') { + indent = { + at: +mode, + open: true, + was: indent + }; + } else if (!indent) { + indent = { + at: 1, + mode: 'statement', + open: true + }; + } else if (mode === 'statement') { + indent = { + at: indent.at, + open: true, + was: indent + }; + } else { + open = mode === 'var' || next_token.line !== token.line; + indent = { + at: (open || mode === 'control' + ? indent.at + option.indent + : indent.at) + (indent.wrap ? option.indent : 0), + mode: mode, + open: open, + was: indent + }; + if (mode === 'var' && open) { + var_mode = indent; + } + } + } + + function step_out(id, symbol) { + if (id) { + if (indent && indent.open) { + indent.at -= option.indent; + edge(); + } + advance(id, symbol); + } + if (indent) { + indent = indent.was; + } + } + +// Functions for conformance of whitespace. + + function one_space(left, right) { + left = left || token; + right = right || next_token; + if (right.id !== '(end)' && !option.white && + (token.line !== right.line || + token.thru + 1 !== right.from)) { + warn('expected_space_a_b', right, artifact(token), artifact(right)); + } + } + + function one_space_only(left, right) { + left = left || token; + right = right || next_token; + if (right.id !== '(end)' && (left.line !== right.line || + (!option.white && left.thru + 1 !== right.from))) { + warn('expected_space_a_b', right, artifact(left), artifact(right)); + } + } + + function no_space(left, right) { + left = left || token; + right = right || next_token; + if ((!option.white || xmode === 'styleproperty' || xmode === 'style') && + left.thru !== right.from && left.line === right.line) { + warn('unexpected_space_a_b', right, artifact(left), artifact(right)); + } + } + + function no_space_only(left, right) { + left = left || token; + right = right || next_token; + if (right.id !== '(end)' && (left.line !== right.line || + (!option.white && left.thru !== right.from))) { + warn('unexpected_space_a_b', right, artifact(left), artifact(right)); + } + } + + function spaces(left, right) { + if (!option.white) { + left = left || token; + right = right || next_token; + if (left.thru === right.from && left.line === right.line) { + warn('missing_space_a_b', right, artifact(left), artifact(right)); + } + } + } + + function comma() { + if (next_token.id !== ',') { + warn_at('expected_a_b', token.line, token.thru, ',', artifact()); + } else { + if (!option.white) { + no_space_only(); + } + advance(','); + spaces(); + } + } + + + function semicolon() { + if (next_token.id !== ';') { + warn_at('expected_a_b', token.line, token.thru, ';', artifact()); + } else { + if (!option.white) { + no_space_only(); + } + advance(';'); + if (semicolon_coda[next_token.id] !== true) { + spaces(); + } + } + } + + function use_strict() { + if (next_token.string === 'use strict') { + if (strict_mode) { + warn('unnecessary_use'); + } + edge(); + advance(); + semicolon(); + strict_mode = true; + option.newcap = false; + option.undef = false; + return true; + } + return false; + } + + + function are_similar(a, b) { + if (a === b) { + return true; + } + if (Array.isArray(a)) { + if (Array.isArray(b) && a.length === b.length) { + var i; + for (i = 0; i < a.length; i += 1) { + if (!are_similar(a[i], b[i])) { + return false; + } + } + return true; + } + return false; + } + if (Array.isArray(b)) { + return false; + } + if (a.id === '(number)' && b.id === '(number)') { + return a.number === b.number; + } + if (a.arity === b.arity && a.string === b.string) { + switch (a.arity) { + case 'prefix': + case 'suffix': + case undefined: + return a.id === b.id && are_similar(a.first, b.first); + case 'infix': + return are_similar(a.first, b.first) && + are_similar(a.second, b.second); + case 'ternary': + return are_similar(a.first, b.first) && + are_similar(a.second, b.second) && + are_similar(a.third, b.third); + case 'function': + case 'regexp': + return false; + default: + return true; + } + } else { + if (a.id === '.' && b.id === '[' && b.arity === 'infix') { + return a.second.string === b.second.string && b.second.id === '(string)'; + } + if (a.id === '[' && a.arity === 'infix' && b.id === '.') { + return a.second.string === b.second.string && a.second.id === '(string)'; + } + } + return false; + } + + +// This is the heart of JSLINT, 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) { + +// rbp is the right binding power. +// initial indicates that this is the first expression of a statement. + + var left; + if (next_token.id === '(end)') { + stop('unexpected_a', token, next_token.id); + } + advance(); + if (option.safe && scope[token.string] && + scope[token.string] === global_scope[token.string] && + (next_token.id !== '(' && next_token.id !== '.')) { + warn('adsafe_a', token); + } + if (initial) { + anonname = 'anonymous'; + funct['(verb)'] = token.string; + } + if (initial === true && token.fud) { + left = token.fud(); + } else { + if (token.nud) { + left = token.nud(); + } else { + if (next_token.id === '(number)' && token.id === '.') { + warn('leading_decimal_a', token, artifact()); + advance(); + return token; + } + stop('expected_identifier_a', token, token.id); + } + while (rbp < next_token.lbp) { + advance(); + if (token.led) { + left = token.led(left); + } else { + stop('expected_operator_a', token, token.id); + } + } + } + return left; + } + + +// 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 || 0, + string: s + }; + } + return x; + } + + function postscript(x) { + x.postscript = true; + return x; + } + + function ultimate(s) { + var x = symbol(s, 0); + x.from = 1; + x.thru = 1; + x.line = 0; + x.edge = 'edge'; + s.string = s; + return postscript(x); + } + + + function stmt(s, f) { + var x = symbol(s); + x.identifier = x.reserved = true; + x.fud = f; + return x; + } + + function labeled_stmt(s, f) { + var x = stmt(s, f); + x.labeled = true; + } + + function disrupt_stmt(s, f) { + var x = stmt(s, f); + x.disrupt = true; + } + + + function reserve_name(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); + reserve_name(x); + x.nud = typeof f === 'function' + ? f + : function () { + if (s === 'typeof') { + one_space(); + } else { + no_space_only(); + } + this.first = expression(150); + this.arity = 'prefix'; + if (this.id === '++' || this.id === '--') { + if (!option.plusplus) { + warn('unexpected_a', this); + } else if ((!this.first.identifier || this.first.reserved) && + this.first.id !== '.' && this.first.id !== '[') { + warn('bad_operand', this); + } + } + return this; + }; + return x; + } + + + function type(s, t, nud) { + var x = symbol(s); + x.arity = t; + if (nud) { + x.nud = nud; + } + return x; + } + + + function reserve(s, f) { + var x = symbol(s); + x.identifier = x.reserved = true; + if (typeof f === 'function') { + x.nud = f; + } + return x; + } + + + function constant(name) { + var x = reserve(name); + x.string = name; + x.nud = return_this; + return x; + } + + + function reservevar(s, v) { + return reserve(s, function () { + if (typeof v === 'function') { + v(this); + } + return this; + }); + } + + + function infix(s, p, f, w) { + var x = symbol(s, p); + reserve_name(x); + x.led = function (left) { + this.arity = 'infix'; + if (!w) { + spaces(prev_token, token); + spaces(); + } + if (!option.bitwise && this.bitwise) { + warn('unexpected_a', this); + } + if (typeof f === 'function') { + return f(left, this); + } + this.first = left; + this.second = expression(p); + return this; + }; + return x; + } + + function expected_relation(node, message) { + if (node.assign) { + warn(message || bundle.conditional_assignment, node); + } + return node; + } + + function expected_condition(node, message) { + switch (node.id) { + case '[': + case '-': + if (node.arity !== 'infix') { + warn(message || bundle.weird_condition, node); + } + break; + case 'false': + case 'function': + case 'Infinity': + case 'NaN': + case 'null': + case 'true': + case 'undefined': + case 'void': + case '(number)': + case '(regexp)': + case '(string)': + case '{': + warn(message || bundle.weird_condition, node); + break; + case '(': + if (node.first.id === '.' && numbery[node.first.second.string] === true) { + warn(message || bundle.weird_condition, node); + } + break; + } + return node; + } + + function check_relation(node) { + switch (node.arity) { + case 'prefix': + switch (node.id) { + case '{': + case '[': + warn('unexpected_a', node); + break; + case '!': + warn('confusing_a', node); + break; + } + break; + case 'function': + case 'regexp': + warn('unexpected_a', node); + break; + default: + if (node.id === 'NaN') { + warn('isNaN', node); + } + } + return node; + } + + + function relation(s, eqeq) { + return infix(s, 100, function (left, that) { + check_relation(left); + if (eqeq && !option.eqeq) { + warn('expected_a_b', that, eqeq, that.id); + } + var right = expression(100); + if (are_similar(left, right) || + ((left.id === '(string)' || left.id === '(number)') && + (right.id === '(string)' || right.id === '(number)'))) { + warn('weird_relation', that); + } + that.first = left; + that.second = check_relation(right); + return that; + }); + } + + + function assignop(s, op) { + var x = infix(s, 20, function (left, that) { + var l; + that.first = left; + if (left.identifier) { + if (scope[left.string]) { + if (scope[left.string].writeable === false) { + warn('read_only', left); + } + } else { + stop('read_only'); + } + if (funct['(params)']) { + funct['(params)'].forEach(function (value) { + if (value.string === left.string) { + value.assign = true; + } + }); + } + } else if (option.safe) { + l = left; + do { + if (typeof predefined[l.string] === 'boolean') { + warn('adsafe_a', l); + } + l = l.first; + } while (l); + } + if (left === syntax['function']) { + warn('identifier_function', token); + } + if (left.id === '.' || left.id === '[') { + if (!left.first || left.first.string === 'arguments') { + warn('bad_assignment', that); + } + } else if (left.identifier) { + if (!left.reserved && funct[left.string] === 'exception') { + warn('assign_exception', left); + } + } else { + warn('bad_assignment', that); + } + that.second = expression(19); + if (that.id === '=' && are_similar(that.first, that.second)) { + warn('weird_assignment', that); + } + return that; + }); + x.assign = true; + if (op) { + if (syntax[op].bitwise) { + x.bitwise = true; + } + } + return x; + } + + + function bitwise(s, p) { + var x = infix(s, p, 'number'); + x.bitwise = true; + return x; + } + + + function suffix(s) { + var x = symbol(s, 150); + x.led = function (left) { + no_space_only(prev_token, token); + if (!option.plusplus) { + warn('unexpected_a', this); + } else if ((!left.identifier || left.reserved) && + left.id !== '.' && left.id !== '[') { + warn('bad_operand', this); + } + this.first = left; + this.arity = 'suffix'; + return this; + }; + return x; + } + + + function optional_identifier() { + if (next_token.identifier) { + advance(); + if (option.safe && banned[token.string]) { + warn('adsafe_a', token); + } else if (token.reserved && !option.es5) { + warn('expected_identifier_a_reserved', token); + } + return token.string; + } + } + + + function identifier() { + var i = optional_identifier(); + if (!i) { + stop(token.id === 'function' && next_token.id === '(' + ? 'name_function' + : 'expected_identifier_a'); + } + return i; + } + + + function statement() { + + var label, old_scope = scope, the_statement; + +// We don't like the empty statement. + + if (next_token.id === ';') { + warn('unexpected_a'); + semicolon(); + return; + } + +// Is this a labeled statement? + + if (next_token.identifier && !next_token.reserved && peek().id === ':') { + edge('label'); + label = next_token; + advance(); + advance(':'); + scope = Object.create(old_scope); + add_label(label, 'label'); + if (next_token.labeled !== true || funct === global_funct) { + stop('unexpected_label_a', label); + } else if (jx.test(label.string + ':')) { + warn('url', label); + } + next_token.label = label; + } + +// Parse the statement. + + if (token.id !== 'else') { + edge(); + } + step_in('statement'); + the_statement = expression(0, true); + if (the_statement) { + +// Look for the final semicolon. + + if (the_statement.arity === 'statement') { + if (the_statement.id === 'switch' || + (the_statement.block && the_statement.id !== 'do')) { + spaces(); + } else { + semicolon(); + } + } else { + +// If this is an expression statement, determine if it is acceptable. +// We do not like +// new Blah(); +// statments. If it is to be used at all, new should only be used to make +// objects, not side effects. The expression statements we do like do +// assignment or invocation or delete. + + if (the_statement.id === '(') { + if (the_statement.first.id === 'new') { + warn('bad_new'); + } + } else if (!the_statement.assign && + the_statement.id !== 'delete' && + the_statement.id !== '++' && + the_statement.id !== '--') { + warn('assignment_function_expression', token); + } + semicolon(); + } + } + step_out(); + scope = old_scope; + return the_statement; + } + + + function statements() { + var array = [], disruptor, the_statement; + +// A disrupt statement may not be followed by any other statement. +// If the last statement is disrupt, then the sequence is disrupt. + + while (next_token.postscript !== true) { + if (next_token.id === ';') { + warn('unexpected_a', next_token); + semicolon(); + } else { + if (next_token.string === 'use strict') { + if ((!node_js && xmode !== 'script') || funct !== global_funct || array.length > 0) { + warn('function_strict'); + } + use_strict(); + } + if (disruptor) { + warn('unreachable_a_b', next_token, next_token.string, + disruptor.string); + disruptor = null; + } + the_statement = statement(); + if (the_statement) { + array.push(the_statement); + if (the_statement.disrupt) { + disruptor = the_statement; + array.disrupt = true; + } + } + } + } + return array; + } + + + function block(ordinary) { + +// array block is array sequence of statements wrapped in braces. +// ordinary is false for function bodies and try blocks. +// ordinary is true for if statements, while, etc. + + var array, + curly = next_token, + old_in_block = in_block, + old_scope = scope, + old_strict_mode = strict_mode; + + in_block = ordinary; + scope = Object.create(scope); + spaces(); + if (next_token.id === '{') { + advance('{'); + step_in(); + if (!ordinary && !use_strict() && !old_strict_mode && + !option.sloppy && funct['(context)'] === global_funct) { + warn('missing_use_strict'); + } + array = statements(); + strict_mode = old_strict_mode; + step_out('}', curly); + } else if (!ordinary) { + stop('expected_a_b', next_token, '{', artifact()); + } else { + warn('expected_a_b', next_token, '{', artifact()); + array = [statement()]; + array.disrupt = array[0].disrupt; + } + funct['(verb)'] = null; + scope = old_scope; + in_block = old_in_block; + if (ordinary && array.length === 0) { + warn('empty_block'); + } + return array; + } + + + function tally_property(name) { + if (option.properties && typeof property[name] !== 'number') { + warn('unexpected_property_a', token, name); + } + if (typeof property[name] === 'number') { + property[name] += 1; + } else { + property[name] = 1; + } + } + + +// ECMAScript parser + + syntax['(identifier)'] = { + id: '(identifier)', + lbp: 0, + identifier: true, + nud: function () { + var name = this.string, + variable = scope[name], + site, + writeable; + +// If the variable is not in scope, then we may have an undeclared variable. +// Check the predefined list. If it was predefined, create the global +// variable. + + if (typeof variable !== 'object') { + writeable = predefined[name]; + if (typeof writeable === 'boolean') { + global_scope[name] = variable = { + string: name, + writeable: writeable, + funct: global_funct + }; + global_funct[name] = 'var'; + +// But if the variable is not in scope, and is not predefined, and if we are not +// in the global scope, then we have an undefined variable error. + + } else { + if (!option.undef) { + warn('used_before_a', token); + } + scope[name] = variable = { + string: name, + writeable: true, + funct: funct + }; + funct[name] = 'undef'; + } + + } + site = variable.funct; + +// The name is in scope and defined in the current function. + + if (funct === site) { + +// Change 'unused' to 'var', and reject labels. + + switch (funct[name]) { + case 'becoming': + warn('unexpected_a', token); + funct[name] = 'var'; + break; + case 'unused': + funct[name] = 'var'; + break; + case 'unparam': + funct[name] = 'parameter'; + break; + case 'unction': + funct[name] = 'function'; + break; + case 'label': + warn('a_label', token, name); + break; + } + +// If the name is already defined in the current +// function, but not as outer, then there is a scope error. + + } else { + switch (funct[name]) { + case 'closure': + case 'function': + case 'var': + case 'unused': + warn('a_scope', token, name); + break; + case 'label': + warn('a_label', token, name); + 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. + + switch (site[name]) { + case 'becoming': + case 'closure': + case 'function': + case 'parameter': + case 'unction': + case 'unused': + case 'var': + site[name] = 'closure'; + funct[name] = site === global_funct + ? 'global' + : 'outer'; + break; + case 'unparam': + site[name] = 'parameter'; + funct[name] = 'outer'; + break; + case 'undef': + funct[name] = 'undef'; + break; + case 'label': + warn('a_label', token, name); + break; + } + } + } + return this; + }, + led: function () { + stop('expected_operator_a'); + } + }; + +// Build the syntax table by declaring the syntactic elements. + + type('(array)', 'array'); + type('(color)', 'color'); + type('(function)', 'function'); + type('(number)', 'number', return_this); + type('(object)', 'object'); + type('(string)', 'string', return_this); + type('(boolean)', 'boolean', return_this); + type('(range)', 'range'); + type('(regexp)', 'regexp', return_this); + + ultimate('(begin)'); + ultimate('(end)'); + ultimate('(error)'); + postscript(symbol(''); + postscript(symbol('}')); + symbol(')'); + symbol(']'); + postscript(symbol('"')); + postscript(symbol('\'')); + symbol(';'); + symbol(':'); + symbol(','); + symbol('#'); + symbol('@'); + symbol('*/'); + postscript(reserve('case')); + reserve('catch'); + postscript(reserve('default')); + reserve('else'); + reserve('finally'); + + reservevar('arguments', function (x) { + if (strict_mode && funct === global_funct) { + warn('strict', x); + } else if (option.safe) { + warn('adsafe_a', x); + } + funct['(arguments)'] = true; + }); + reservevar('eval', function (x) { + if (option.safe) { + warn('adsafe_a', x); + } + }); + constant('false', 'boolean'); + constant('Infinity', 'number'); + constant('NaN', 'number'); + constant('null', ''); + reservevar('this', function (x) { + if (option.safe) { + warn('adsafe_a', x); + } else if (strict_mode && funct['(token)'].arity === 'statement' && + funct['(name)'].charAt(0) > 'Z') { + warn('strict', x); + } + }); + constant('true', 'boolean'); + constant('undefined', ''); + + infix('?', 30, function (left, that) { + step_in('?'); + that.first = expected_condition(expected_relation(left)); + that.second = expression(0); + spaces(); + step_out(); + var colon = next_token; + advance(':'); + step_in(':'); + spaces(); + that.third = expression(10); + that.arity = 'ternary'; + if (are_similar(that.second, that.third)) { + warn('weird_ternary', colon); + } else if (are_similar(that.first, that.second)) { + warn('use_or', that); + } + step_out(); + return that; + }); + + infix('||', 40, function (left, that) { + function paren_check(that) { + if (that.id === '&&' && !that.paren) { + warn('and', that); + } + return that; + } + + that.first = paren_check(expected_condition(expected_relation(left))); + that.second = paren_check(expected_relation(expression(40))); + if (are_similar(that.first, that.second)) { + warn('weird_condition', that); + } + return that; + }); + + infix('&&', 50, function (left, that) { + that.first = expected_condition(expected_relation(left)); + that.second = expected_relation(expression(50)); + if (are_similar(that.first, that.second)) { + warn('weird_condition', that); + } + return that; + }); + + prefix('void', function () { + this.first = expression(0); + this.arity = 'prefix'; + if (option.es5) { + warn('expected_a_b', this, 'undefined', 'void'); + } else if (this.first.number !== 0) { + warn('expected_a_b', this.first, '0', artifact(this.first)); + } + return this; + }); + + bitwise('|', 70); + bitwise('^', 80); + bitwise('&', 90); + + relation('==', '==='); + relation('==='); + relation('!=', '!=='); + relation('!=='); + relation('<'); + relation('>'); + relation('<='); + relation('>='); + + bitwise('<<', 120); + bitwise('>>', 120); + bitwise('>>>', 120); + + infix('in', 120, function (left, that) { + warn('infix_in', that); + that.left = left; + that.right = expression(130); + return that; + }); + infix('instanceof', 120); + infix('+', 130, function (left, that) { + if (left.id === '(number)') { + if (left.number === 0) { + warn('unexpected_a', left, '0'); + } + } else if (left.id === '(string)') { + if (left.string === '') { + warn('expected_a_b', left, 'String', '\'\''); + } + } + var right = expression(130); + if (right.id === '(number)') { + if (right.number === 0) { + warn('unexpected_a', right, '0'); + } + } else if (right.id === '(string)') { + if (right.string === '') { + warn('expected_a_b', right, 'String', '\'\''); + } + } + if (left.id === right.id) { + if (left.id === '(string)' || left.id === '(number)') { + if (left.id === '(string)') { + left.string += right.string; + if (jx.test(left.string)) { + warn('url', left); + } + } else { + left.number += right.number; + } + left.thru = right.thru; + return left; + } + } + that.first = left; + that.second = right; + return that; + }); + prefix('+', 'num'); + prefix('+++', function () { + warn('confusing_a', token); + this.first = expression(150); + this.arity = 'prefix'; + return this; + }); + infix('+++', 130, function (left) { + warn('confusing_a', token); + this.first = left; + this.second = expression(130); + return this; + }); + infix('-', 130, function (left, that) { + if ((left.id === '(number)' && left.number === 0) || left.id === '(string)') { + warn('unexpected_a', left); + } + var right = expression(130); + if ((right.id === '(number)' && right.number === 0) || right.id === '(string)') { + warn('unexpected_a', right); + } + if (left.id === right.id && left.id === '(number)') { + left.number -= right.number; + left.thru = right.thru; + return left; + } + that.first = left; + that.second = right; + return that; + }); + prefix('-'); + prefix('---', function () { + warn('confusing_a', token); + this.first = expression(150); + this.arity = 'prefix'; + return this; + }); + infix('---', 130, function (left) { + warn('confusing_a', token); + this.first = left; + this.second = expression(130); + return this; + }); + infix('*', 140, function (left, that) { + if ((left.id === '(number)' && (left.number === 0 || left.number === 1)) || left.id === '(string)') { + warn('unexpected_a', left); + } + var right = expression(140); + if ((right.id === '(number)' && (right.number === 0 || right.number === 1)) || right.id === '(string)') { + warn('unexpected_a', right); + } + if (left.id === right.id && left.id === '(number)') { + left.number *= right.number; + left.thru = right.thru; + return left; + } + that.first = left; + that.second = right; + return that; + }); + infix('/', 140, function (left, that) { + if ((left.id === '(number)' && left.number === 0) || left.id === '(string)') { + warn('unexpected_a', left); + } + var right = expression(140); + if ((right.id === '(number)' && (right.number === 0 || right.number === 1)) || right.id === '(string)') { + warn('unexpected_a', right); + } + if (left.id === right.id && left.id === '(number)') { + left.number /= right.number; + left.thru = right.thru; + return left; + } + that.first = left; + that.second = right; + return that; + }); + infix('%', 140, function (left, that) { + if ((left.id === '(number)' && (left.number === 0 || left.number === 1)) || left.id === '(string)') { + warn('unexpected_a', left); + } + var right = expression(140); + if ((right.id === '(number)' && right.number === 0) || right.id === '(string)') { + warn('unexpected_a', right); + } + if (left.id === right.id && left.id === '(number)') { + left.number %= right.number; + left.thru = right.thru; + return left; + } + that.first = left; + that.second = right; + return that; + }); + + suffix('++'); + prefix('++'); + + suffix('--'); + prefix('--'); + prefix('delete', function () { + one_space(); + var p = expression(0); + if (!p || (p.id !== '.' && p.id !== '[')) { + warn('deleted'); + } + this.first = p; + return this; + }); + + + prefix('~', function () { + no_space_only(); + if (!option.bitwise) { + warn('unexpected_a', this); + } + expression(150); + return this; + }); + prefix('!', function () { + no_space_only(); + this.first = expected_condition(expression(150)); + this.arity = 'prefix'; + if (bang[this.first.id] === true || this.first.assign) { + warn('confusing_a', this); + } + return this; + }); + prefix('typeof', null); + prefix('new', function () { + one_space(); + var c = expression(160), n, p, v; + this.first = c; + if (c.id !== 'function') { + if (c.identifier) { + switch (c.string) { + case 'Object': + warn('use_object', token); + break; + case 'Array': + if (next_token.id === '(') { + p = next_token; + p.first = this; + advance('('); + if (next_token.id !== ')') { + n = expression(0); + p.second = [n]; + if (n.id !== '(number)' || next_token.id === ',') { + warn('use_array', p); + } + while (next_token.id === ',') { + advance(','); + p.second.push(expression(0)); + } + } else { + warn('use_array', token); + } + advance(')', p); + return p; + } + warn('use_array', token); + break; + case 'Number': + case 'String': + case 'Boolean': + case 'Math': + case 'JSON': + warn('not_a_constructor', c); + break; + case 'Function': + if (!option.evil) { + warn('function_eval'); + } + break; + case 'Date': + case 'RegExp': + case 'this': + break; + default: + if (c.id !== 'function') { + v = c.string.charAt(0); + if (!option.newcap && (v < 'A' || v > 'Z')) { + warn('constructor_name_a', token); + } + } + } + } else { + if (c.id !== '.' && c.id !== '[' && c.id !== '(') { + warn('bad_constructor', token); + } + } + } else { + warn('weird_new', this); + } + if (next_token.id !== '(') { + warn('missing_a', next_token, '()'); + } + return this; + }); + + infix('(', 160, function (left, that) { + var p; + if (indent && indent.mode === 'expression') { + no_space(prev_token, token); + } else { + no_space_only(prev_token, token); + } + if (!left.immed && left.id === 'function') { + warn('wrap_immediate'); + } + p = []; + if (left.identifier) { + if (left.string.match(/^[A-Z]([A-Z0-9_$]*[a-z][A-Za-z0-9_$]*)?$/)) { + if (left.string !== 'Number' && left.string !== 'String' && + left.string !== 'Boolean' && left.string !== 'Date') { + if (left.string === 'Math' || left.string === 'JSON') { + warn('not_a_function', left); + } else if (left.string === 'Object') { + warn('use_object', token); + } else if (left.string === 'Array' || !option.newcap) { + warn('missing_a', left, 'new'); + } + } + } + } else if (left.id === '.') { + if (option.safe && left.first.string === 'Math' && + left.second === 'random') { + warn('adsafe_a', left); + } else if (left.second.string === 'split' && + left.first.id === '(string)') { + warn('use_array', left.second); + } + } + step_in(); + if (next_token.id !== ')') { + no_space(); + for (;;) { + edge(); + p.push(expression(10)); + if (next_token.id !== ',') { + break; + } + comma(); + } + } + no_space(); + step_out(')', that); + if (typeof left === 'object') { + if (left.string === 'parseInt' && p.length === 1) { + warn('radix', left); + } + if (!option.evil) { + if (left.string === 'eval' || left.string === 'Function' || + left.string === 'execScript') { + warn('evil', left); + } else if (p[0] && p[0].id === '(string)' && + (left.string === 'setTimeout' || + left.string === 'setInterval')) { + warn('implied_evil', left); + } + } + if (!left.identifier && left.id !== '.' && left.id !== '[' && + left.id !== '(' && left.id !== '&&' && left.id !== '||' && + left.id !== '?') { + warn('bad_invocation', left); + } + } + that.first = left; + that.second = p; + return that; + }, true); + + prefix('(', function () { + step_in('expression'); + no_space(); + edge(); + if (next_token.id === 'function') { + next_token.immed = true; + } + var value = expression(0); + value.paren = true; + no_space(); + step_out(')', this); + if (value.id === 'function') { + switch (next_token.id) { + case '(': + warn('move_invocation'); + break; + case '.': + case '[': + warn('unexpected_a'); + break; + default: + warn('bad_wrap', this); + } + } + return value; + }); + + infix('.', 170, function (left, that) { + no_space(prev_token, token); + no_space(); + var name = identifier(); + if (typeof name === 'string') { + tally_property(name); + } + that.first = left; + that.second = token; + if (left && left.string === 'arguments' && + (name === 'callee' || name === 'caller')) { + warn('avoid_a', left, 'arguments.' + name); + } else if (!option.evil && left && left.string === 'document' && + (name === 'write' || name === 'writeln')) { + warn('write_is_wrong', left); + } else if (option.adsafe) { + if (!adsafe_top && left.string === 'ADSAFE') { + if (name === 'id' || name === 'lib') { + warn('adsafe_a', that); + } else if (name === 'go') { + if (xmode !== 'script') { + warn('adsafe_a', that); + } else if (adsafe_went || next_token.id !== '(' || + peek(0).id !== '(string)' || + peek(0).string !== adsafe_id || + peek(1).id !== ',') { + stop('adsafe_a', that, 'go'); + } + adsafe_went = true; + adsafe_may = false; + } + } + adsafe_top = false; + } + if (!option.evil && (name === 'eval' || name === 'execScript')) { + warn('evil'); + } else if (option.safe) { + for (;;) { + if (banned[name] === true) { + warn('adsafe_a', token, name); + } + if (typeof predefined[left.string] !== 'boolean' || //// check for writeable + next_token.id === '(') { + break; + } + if (next_token.id !== '.') { + warn('adsafe_a', that); + break; + } + advance('.'); + token.first = that; + token.second = name; + that = token; + name = identifier(); + if (typeof name === 'string') { + tally_property(name); + } + } + } + return that; + }, true); + + infix('[', 170, function (left, that) { + var e, s; + no_space_only(prev_token, token); + no_space(); + step_in(); + edge(); + e = expression(0); + switch (e.id) { + case '(number)': + if (e.id === '(number)' && left.id === 'arguments') { + warn('use_param', left); + } + break; + case '(string)': + if (option.safe && (banned[e.string] || + e.string.charAt(0) === '_' || e.string.slice(-1) === '_')) { + warn('adsafe_subscript_a', e); + } else if (!option.evil && + (e.string === 'eval' || e.string === 'execScript')) { + warn('evil', e); + } else if (!option.sub && ix.test(e.string)) { + s = syntax[e.string]; + if (!s || !s.reserved) { + warn('subscript', e); + } + } + tally_property(e.string); + break; + default: + if (option.safe) { + warn('adsafe_subscript_a', e); + } + } + step_out(']', that); + no_space(prev_token, token); + that.first = left; + that.second = e; + return that; + }, true); + + prefix('[', function () { + this.arity = 'prefix'; + this.first = []; + step_in('array'); + while (next_token.id !== '(end)') { + while (next_token.id === ',') { + warn('unexpected_a', next_token); + advance(','); + } + if (next_token.id === ']') { + break; + } + indent.wrap = false; + edge(); + this.first.push(expression(10)); + if (next_token.id === ',') { + comma(); + if (next_token.id === ']' && !option.es5) { + warn('unexpected_a', token); + break; + } + } else { + break; + } + } + step_out(']', this); + return this; + }, 170); + + + function property_name() { + var id = optional_identifier(true); + if (!id) { + if (next_token.id === '(string)') { + id = next_token.string; + if (option.safe) { + if (banned[id]) { + warn('adsafe_a'); + } else if (id.charAt(0) === '_' || + id.charAt(id.length - 1) === '_') { + warn('dangling_a'); + } + } + advance(); + } else if (next_token.id === '(number)') { + id = next_token.number.toString(); + advance(); + } + } + return id; + } + + + function function_params() { + var id, paren = next_token, params = []; + advance('('); + step_in(); + no_space(); + if (next_token.id === ')') { + no_space(); + step_out(')', paren); + return params; + } + for (;;) { + edge(); + id = identifier(); + params.push(token); + add_label(token, option.unparam ? 'parameter' : 'unparam'); + if (next_token.id === ',') { + comma(); + } else { + no_space(); + step_out(')', paren); + return params; + } + } + } + + + + function do_function(func, name) { + var old_funct = funct, + old_option = option, + old_scope = scope; + funct = { + '(name)' : name || '\'' + (anonname || '').replace(nx, sanitize) + '\'', + '(line)' : next_token.line, + '(context)' : old_funct, + '(breakage)' : 0, + '(loopage)' : 0, + '(scope)' : scope, + '(token)' : func + }; + option = Object.create(old_option); + scope = Object.create(old_scope); + functions.push(funct); + func.name = name; + if (name) { + add_label(func, 'function', name); + } + func.writeable = false; + func.first = funct['(params)'] = function_params(); + one_space(); + func.block = block(false); + if (funct['(arguments)']) { + func.first.forEach(function (value) { + if (value.assign) { + warn('parameter_arguments_a', value, value.string); + } + }); + } + funct = old_funct; + option = old_option; + scope = old_scope; + } + + + assignop('='); + assignop('+=', '+'); + assignop('-=', '-'); + assignop('*=', '*'); + assignop('/=', '/').nud = function () { + stop('slash_equal'); + }; + assignop('%=', '%'); + assignop('&=', '&'); + assignop('|=', '|'); + assignop('^=', '^'); + assignop('<<=', '<<'); + assignop('>>=', '>>'); + assignop('>>>=', '>>>'); + + + prefix('{', function () { + var get, i, j, name, p, set, seen = {}; + this.arity = 'prefix'; + this.first = []; + step_in(); + while (next_token.id !== '}') { + indent.wrap = false; + +// JSLint recognizes the ES5 extension for get/set in object literals, +// but requires that they be used in pairs. + + edge(); + if (next_token.string === 'get' && peek().id !== ':') { + if (!option.es5) { + warn('es5'); + } + get = next_token; + advance('get'); + one_space_only(); + name = next_token; + i = property_name(); + if (!i) { + stop('missing_property'); + } + get.string = ''; + do_function(get); + if (funct['(loopage)']) { + warn('function_loop', get); + } + p = get.first; + if (p && p.length) { + warn('parameter_a_get_b', p[0], p[0].string, i); + } + comma(); + set = next_token; + spaces(); + edge(); + advance('set'); + set.string = ''; + one_space_only(); + j = property_name(); + if (i !== j) { + stop('expected_a_b', token, i, j || next_token.string); + } + do_function(set); + if (set.block.length === 0) { + warn('missing_a', token, 'throw'); + } + p = set.first; + if (!p || p.length !== 1) { + stop('parameter_set_a', set, 'value'); + } else if (p[0].string !== 'value') { + stop('expected_a_b', p[0], 'value', p[0].string); + } + name.first = [get, set]; + } else { + name = next_token; + i = property_name(); + if (typeof i !== 'string') { + stop('missing_property'); + } + advance(':'); + spaces(); + name.first = expression(10); + } + this.first.push(name); + if (seen[i] === true) { + warn('duplicate_a', next_token, i); + } + seen[i] = true; + tally_property(i); + if (next_token.id !== ',') { + break; + } + for (;;) { + comma(); + if (next_token.id !== ',') { + break; + } + warn('unexpected_a', next_token); + } + if (next_token.id === '}' && !option.es5) { + warn('unexpected_a', token); + } + } + step_out('}', this); + return this; + }); + + stmt('{', function () { + warn('statement_block'); + this.arity = 'statement'; + this.block = statements(); + this.disrupt = this.block.disrupt; + advance('}', this); + return this; + }); + + stmt('/*global', directive); + stmt('/*globals', directive); + stmt('/*jslint', directive); + stmt('/*member', directive); + stmt('/*members', directive); + stmt('/*property', directive); + stmt('/*properties', directive); + + stmt('var', function () { + +// JavaScript does not have block scope. It only has function scope. So, +// declaring a variable in a block can have unexpected consequences. + +// var.first will contain an array, the array containing name tokens +// and assignment tokens. + + var assign, id, name; + + if (funct['(vars)'] && !option.vars) { + warn('combine_var'); + } else if (funct !== global_funct) { + funct['(vars)'] = true; + } + this.arity = 'statement'; + this.first = []; + step_in('var'); + for (;;) { + name = next_token; + id = identifier(); + add_label(name, 'becoming'); + + if (next_token.id === '=') { + assign = next_token; + assign.first = name; + spaces(); + advance('='); + spaces(); + if (next_token.id === 'undefined') { + warn('unnecessary_initialize', token, id); + } + if (peek(0).id === '=' && next_token.identifier) { + stop('var_a_not'); + } + assign.second = expression(0); + assign.arity = 'infix'; + this.first.push(assign); + } else { + this.first.push(name); + } + if (funct[id] === 'becoming') { + funct[id] = 'unused'; + } + if (next_token.id !== ',') { + break; + } + comma(); + indent.wrap = false; + if (var_mode && next_token.line === token.line && + this.first.length === 1) { + var_mode = null; + indent.open = false; + indent.at -= option.indent; + } + spaces(); + edge(); + } + var_mode = null; + step_out(); + return this; + }); + + stmt('function', function () { + one_space(); + if (in_block) { + warn('function_block', token); + } + var name = next_token, id = identifier(); + add_label(name, 'unction'); + no_space(); + this.arity = 'statement'; + do_function(this, id); + if (next_token.id === '(' && next_token.line === token.line) { + stop('function_statement'); + } + return this; + }); + + prefix('function', function () { + if (!option.anon) { + one_space(); + } + var id = optional_identifier(); + if (id) { + no_space(); + } else { + id = ''; + } + do_function(this, id); + if (funct['(loopage)']) { + warn('function_loop'); + } + switch (next_token.id) { + case ';': + case '(': + case ')': + case ',': + case ']': + case '}': + case ':': + break; + case '.': + if (peek().string !== 'bind' || peek(1).id !== '(') { + warn('unexpected_a'); + } + break; + default: + stop('unexpected_a'); + } + this.arity = 'function'; + return this; + }); + + stmt('if', function () { + var paren = next_token; + one_space(); + advance('('); + step_in('control'); + no_space(); + edge(); + this.arity = 'statement'; + this.first = expected_condition(expected_relation(expression(0))); + no_space(); + step_out(')', paren); + one_space(); + this.block = block(true); + if (next_token.id === 'else') { + one_space(); + advance('else'); + one_space(); + this['else'] = next_token.id === 'if' || next_token.id === 'switch' + ? statement(true) + : block(true); + if (this['else'].disrupt && this.block.disrupt) { + this.disrupt = true; + } + } + return this; + }); + + stmt('try', function () { + +// try.first The catch variable +// try.second The catch clause +// try.third The finally clause +// try.block The try block + + var exception_variable, old_scope, paren; + if (option.adsafe) { + warn('adsafe_a', this); + } + one_space(); + this.arity = 'statement'; + this.block = block(false); + if (next_token.id === 'catch') { + one_space(); + advance('catch'); + one_space(); + paren = next_token; + advance('('); + step_in('control'); + no_space(); + edge(); + old_scope = scope; + scope = Object.create(old_scope); + exception_variable = next_token.string; + this.first = exception_variable; + if (!next_token.identifier) { + warn('expected_identifier_a', next_token); + } else { + add_label(next_token, 'exception'); + } + advance(); + no_space(); + step_out(')', paren); + one_space(); + this.second = block(false); + scope = old_scope; + } + if (next_token.id === 'finally') { + one_space(); + advance('finally'); + one_space(); + this.third = block(false); + } else if (!this.second) { + stop('expected_a_b', next_token, 'catch', artifact()); + } + return this; + }); + + labeled_stmt('while', function () { + one_space(); + var paren = next_token; + funct['(breakage)'] += 1; + funct['(loopage)'] += 1; + advance('('); + step_in('control'); + no_space(); + edge(); + this.arity = 'statement'; + this.first = expected_relation(expression(0)); + if (this.first.id !== 'true') { + expected_condition(this.first, bundle.unexpected_a); + } + no_space(); + step_out(')', paren); + one_space(); + this.block = block(true); + if (this.block.disrupt) { + warn('strange_loop', prev_token); + } + funct['(breakage)'] -= 1; + funct['(loopage)'] -= 1; + return this; + }); + + reserve('with'); + + labeled_stmt('switch', function () { + +// switch.first the switch expression +// switch.second the array of cases. A case is 'case' or 'default' token: +// case.first the array of case expressions +// case.second the array of statements +// If all of the arrays of statements are disrupt, then the switch is disrupt. + + var cases = [], + old_in_block = in_block, + particular, + the_case = next_token, + unbroken = true; + + function find_duplicate_case(value) { + if (are_similar(particular, value)) { + warn('duplicate_a', value); + } + } + + funct['(breakage)'] += 1; + one_space(); + advance('('); + no_space(); + step_in(); + this.arity = 'statement'; + this.first = expected_condition(expected_relation(expression(0))); + no_space(); + step_out(')', the_case); + one_space(); + advance('{'); + step_in(); + in_block = true; + this.second = []; + while (next_token.id === 'case') { + the_case = next_token; + cases.forEach(find_duplicate_case); + the_case.first = []; + the_case.arity = 'case'; + spaces(); + edge('case'); + advance('case'); + for (;;) { + one_space(); + particular = expression(0); + cases.forEach(find_duplicate_case); + cases.push(particular); + the_case.first.push(particular); + if (particular.id === 'NaN') { + warn('unexpected_a', particular); + } + no_space_only(); + advance(':'); + if (next_token.id !== 'case') { + break; + } + spaces(); + edge('case'); + advance('case'); + } + spaces(); + the_case.second = statements(); + if (the_case.second && the_case.second.length > 0) { + particular = the_case.second[the_case.second.length - 1]; + if (particular.disrupt) { + if (particular.id === 'break') { + unbroken = false; + } + } else { + warn('missing_a_after_b', next_token, 'break', 'case'); + } + } else { + warn('empty_case'); + } + this.second.push(the_case); + } + if (this.second.length === 0) { + warn('missing_a', next_token, 'case'); + } + if (next_token.id === 'default') { + spaces(); + the_case = next_token; + the_case.arity = 'case'; + edge('case'); + advance('default'); + no_space_only(); + advance(':'); + spaces(); + the_case.second = statements(); + if (the_case.second && the_case.second.length > 0) { + particular = the_case.second[the_case.second.length - 1]; + if (unbroken && particular.disrupt && particular.id !== 'break') { + this.disrupt = true; + } + } + this.second.push(the_case); + } + funct['(breakage)'] -= 1; + spaces(); + step_out('}', this); + in_block = old_in_block; + return this; + }); + + stmt('debugger', function () { + if (!option.debug) { + warn('unexpected_a', this); + } + this.arity = 'statement'; + return this; + }); + + labeled_stmt('do', function () { + funct['(breakage)'] += 1; + funct['(loopage)'] += 1; + one_space(); + this.arity = 'statement'; + this.block = block(true); + if (this.block.disrupt) { + warn('strange_loop', prev_token); + } + one_space(); + advance('while'); + var paren = next_token; + one_space(); + advance('('); + step_in(); + no_space(); + edge(); + this.first = expected_condition(expected_relation(expression(0)), bundle.unexpected_a); + no_space(); + step_out(')', paren); + funct['(breakage)'] -= 1; + funct['(loopage)'] -= 1; + return this; + }); + + labeled_stmt('for', function () { + + var blok, filter, ok = false, paren = next_token, value; + this.arity = 'statement'; + funct['(breakage)'] += 1; + funct['(loopage)'] += 1; + advance('('); + if (next_token.id === ';') { + no_space(); + advance(';'); + no_space(); + advance(';'); + no_space(); + advance(')'); + blok = block(true); + } else { + step_in('control'); + spaces(this, paren); + no_space(); + if (next_token.id === 'var') { + stop('move_var'); + } + edge(); + if (peek(0).id === 'in') { + this.forin = true; + value = next_token; + switch (funct[value.string]) { + case 'unused': + funct[value.string] = 'var'; + break; + case 'closure': + case 'var': + break; + default: + warn('bad_in_a', value); + } + advance(); + advance('in'); + this.first = value; + this.second = expression(20); + step_out(')', paren); + blok = block(true); + if (!option.forin) { + if (blok.length === 1 && typeof blok[0] === 'object' && + blok[0].string === 'if' && !blok[0]['else']) { + filter = blok[0].first; + while (filter.id === '&&') { + filter = filter.first; + } + switch (filter.id) { + case '===': + case '!==': + ok = filter.first.id === '[' + ? filter.first.first.string === this.second.string && + filter.first.second.string === this.first.string + : filter.first.id === 'typeof' && + filter.first.first.id === '[' && + filter.first.first.first.string === this.second.string && + filter.first.first.second.string === this.first.string; + break; + case '(': + ok = filter.first.id === '.' && (( + filter.first.first.string === this.second.string && + filter.first.second.string === 'hasOwnProperty' && + filter.second[0].string === this.first.string + ) || ( + filter.first.first.string === 'ADSAFE' && + filter.first.second.string === 'has' && + filter.second[0].string === this.second.string && + filter.second[1].string === this.first.string + ) || ( + filter.first.first.id === '.' && + filter.first.first.first.id === '.' && + filter.first.first.first.first.string === 'Object' && + filter.first.first.first.second.string === 'prototype' && + filter.first.first.second.string === 'hasOwnProperty' && + filter.first.second.string === 'call' && + filter.second[0].string === this.second.string && + filter.second[1].string === this.first.string + )); + break; + } + } + if (!ok) { + warn('for_if', this); + } + } + } else { + edge(); + this.first = []; + for (;;) { + this.first.push(expression(0, 'for')); + if (next_token.id !== ',') { + break; + } + comma(); + } + semicolon(); + edge(); + this.second = expected_relation(expression(0)); + if (this.second.id !== 'true') { + expected_condition(this.second, bundle.unexpected_a); + } + semicolon(token); + if (next_token.id === ';') { + stop('expected_a_b', next_token, ')', ';'); + } + this.third = []; + edge(); + for (;;) { + this.third.push(expression(0, 'for')); + if (next_token.id !== ',') { + break; + } + comma(); + } + no_space(); + step_out(')', paren); + one_space(); + blok = block(true); + } + } + if (blok.disrupt) { + warn('strange_loop', prev_token); + } + this.block = blok; + funct['(breakage)'] -= 1; + funct['(loopage)'] -= 1; + return this; + }); + + disrupt_stmt('break', function () { + var label = next_token.string; + this.arity = 'statement'; + if (funct['(breakage)'] === 0) { + warn('unexpected_a', this); + } + if (next_token.identifier && token.line === next_token.line) { + one_space_only(); + if (funct[label] !== 'label') { + warn('not_a_label', next_token); + } else if (scope[label].funct !== funct) { + warn('not_a_scope', next_token); + } + this.first = next_token; + advance(); + } + return this; + }); + + disrupt_stmt('continue', function () { + if (!option['continue']) { + warn('unexpected_a', this); + } + var label = next_token.string; + this.arity = 'statement'; + if (funct['(breakage)'] === 0) { + warn('unexpected_a', this); + } + if (next_token.identifier && token.line === next_token.line) { + one_space_only(); + if (funct[label] !== 'label') { + warn('not_a_label', next_token); + } else if (scope[label].funct !== funct) { + warn('not_a_scope', next_token); + } + this.first = next_token; + advance(); + } + return this; + }); + + disrupt_stmt('return', function () { + if (funct === global_funct && xmode !== 'scriptstring') { + warn('unexpected_a', this); + } + this.arity = 'statement'; + if (next_token.id !== ';' && next_token.line === token.line) { + one_space_only(); + if (next_token.id === '/' || next_token.id === '(regexp)') { + warn('wrap_regexp'); + } + this.first = expression(20); + } + if (peek(0).id === '}' && peek(1).id === 'else') { + warn('unexpected_else', this); + } + return this; + }); + + disrupt_stmt('throw', function () { + this.arity = 'statement'; + one_space_only(); + this.first = expression(20); + return this; + }); + + +// Superfluous reserved words + + reserve('class'); + reserve('const'); + reserve('enum'); + reserve('export'); + reserve('extends'); + reserve('import'); + reserve('super'); + +// Harmony reserved words + + reserve('implements'); + reserve('interface'); + reserve('let'); + reserve('package'); + reserve('private'); + reserve('protected'); + reserve('public'); + reserve('static'); + reserve('yield'); + + +// Parse JSON + + function json_value() { + + function json_object() { + var brace = next_token, object = {}; + advance('{'); + if (next_token.id !== '}') { + while (next_token.id !== '(end)') { + while (next_token.id === ',') { + warn('unexpected_a', next_token); + advance(','); + } + if (next_token.id !== '(string)') { + warn('expected_string_a'); + } + if (object[next_token.string] === true) { + warn('duplicate_a'); + } else if (next_token.string === '__proto__') { + warn('dangling_a'); + } else { + object[next_token.string] = true; + } + advance(); + advance(':'); + json_value(); + if (next_token.id !== ',') { + break; + } + advance(','); + if (next_token.id === '}') { + warn('unexpected_a', token); + break; + } + } + } + advance('}', brace); + } + + function json_array() { + var bracket = next_token; + advance('['); + if (next_token.id !== ']') { + while (next_token.id !== '(end)') { + while (next_token.id === ',') { + warn('unexpected_a', next_token); + advance(','); + } + json_value(); + if (next_token.id !== ',') { + break; + } + advance(','); + if (next_token.id === ']') { + warn('unexpected_a', token); + break; + } + } + } + advance(']', bracket); + } + + switch (next_token.id) { + case '{': + json_object(); + break; + case '[': + json_array(); + break; + case 'true': + case 'false': + case 'null': + case '(number)': + case '(string)': + advance(); + break; + case '-': + advance('-'); + no_space_only(); + advance('(number)'); + break; + default: + stop('unexpected_a'); + } + } + + +// CSS parsing. + + function css_name() { + if (next_token.identifier) { + advance(); + return true; + } + } + + + function css_number() { + if (next_token.id === '-') { + advance('-'); + no_space_only(); + } + if (next_token.id === '(number)') { + advance('(number)'); + return true; + } + } + + + function css_string() { + if (next_token.id === '(string)') { + advance(); + return true; + } + } + + function css_color() { + var i, number, paren, value; + if (next_token.identifier) { + value = next_token.string; + if (value === 'rgb' || value === 'rgba') { + advance(); + paren = next_token; + advance('('); + for (i = 0; i < 3; i += 1) { + if (i) { + comma(); + } + number = next_token.number; + if (next_token.id !== '(number)' || number < 0) { + warn('expected_positive_a', next_token); + advance(); + } else { + advance(); + if (next_token.id === '%') { + advance('%'); + if (number > 100) { + warn('expected_percent_a', token, number); + } + } else { + if (number > 255) { + warn('expected_small_a', token, number); + } + } + } + } + if (value === 'rgba') { + comma(); + number = next_token.number; + if (next_token.id !== '(number)' || number < 0 || number > 1) { + warn('expected_fraction_a', next_token); + } + advance(); + if (next_token.id === '%') { + warn('unexpected_a'); + advance('%'); + } + } + advance(')', paren); + return true; + } + if (css_colorData[next_token.string] === true) { + advance(); + return true; + } + } else if (next_token.id === '(color)') { + advance(); + return true; + } + return false; + } + + + function css_length() { + if (next_token.id === '-') { + advance('-'); + no_space_only(); + } + if (next_token.id === '(number)') { + advance(); + if (next_token.id !== '(string)' && + css_lengthData[next_token.string] === true) { + no_space_only(); + advance(); + } else if (+token.number !== 0) { + warn('expected_linear_a'); + } + return true; + } + return false; + } + + + function css_line_height() { + if (next_token.id === '-') { + advance('-'); + no_space_only(); + } + if (next_token.id === '(number)') { + advance(); + if (next_token.id !== '(string)' && + css_lengthData[next_token.string] === true) { + no_space_only(); + advance(); + } + return true; + } + return false; + } + + + function css_width() { + if (next_token.identifier) { + switch (next_token.string) { + case 'thin': + case 'medium': + case 'thick': + advance(); + return true; + } + } else { + return css_length(); + } + } + + + function css_margin() { + if (next_token.identifier) { + if (next_token.string === 'auto') { + advance(); + return true; + } + } else { + return css_length(); + } + } + + function css_attr() { + if (next_token.identifier && next_token.string === 'attr') { + advance(); + advance('('); + if (!next_token.identifier) { + warn('expected_name_a'); + } + advance(); + advance(')'); + return true; + } + return false; + } + + + function css_comma_list() { + while (next_token.id !== ';') { + if (!css_name() && !css_string()) { + warn('expected_name_a'); + } + if (next_token.id !== ',') { + return true; + } + comma(); + } + } + + + function css_counter() { + if (next_token.identifier && next_token.string === 'counter') { + advance(); + advance('('); + advance(); + if (next_token.id === ',') { + comma(); + if (next_token.id !== '(string)') { + warn('expected_string_a'); + } + advance(); + } + advance(')'); + return true; + } + if (next_token.identifier && next_token.string === 'counters') { + advance(); + advance('('); + if (!next_token.identifier) { + warn('expected_name_a'); + } + advance(); + if (next_token.id === ',') { + comma(); + if (next_token.id !== '(string)') { + warn('expected_string_a'); + } + advance(); + } + if (next_token.id === ',') { + comma(); + if (next_token.id !== '(string)') { + warn('expected_string_a'); + } + advance(); + } + advance(')'); + return true; + } + return false; + } + + + function css_radius() { + return css_length() && (next_token.id !== '(number)' || css_length()); + } + + + function css_shape() { + var i; + if (next_token.identifier && next_token.string === 'rect') { + advance(); + advance('('); + for (i = 0; i < 4; i += 1) { + if (!css_length()) { + warn('expected_number_a'); + break; + } + } + advance(')'); + return true; + } + return false; + } + + + function css_url() { + var c, url; + if (next_token.identifier && next_token.string === 'url') { + next_token = lex.range('(', ')'); + url = next_token.string; + c = url.charAt(0); + if (c === '"' || c === '\'') { + if (url.slice(-1) !== c) { + warn('bad_url_a'); + } else { + url = url.slice(1, -1); + if (url.indexOf(c) >= 0) { + warn('bad_url_a'); + } + } + } + if (!url) { + warn('missing_url'); + } + if (ux.test(url)) { + stop('bad_url_a'); + } + urls.push(url); + advance(); + return true; + } + return false; + } + + + css_any = [css_url, function () { + for (;;) { + if (next_token.identifier) { + switch (next_token.string.toLowerCase()) { + case 'url': + css_url(); + break; + case 'expression': + warn('unexpected_a'); + advance(); + break; + default: + advance(); + } + } else { + if (next_token.id === ';' || next_token.id === '!' || + next_token.id === '(end)' || next_token.id === '}') { + return true; + } + advance(); + } + } + }]; + + + function font_face() { + advance_identifier('font-family'); + advance(':'); + if (!css_name() && !css_string()) { + stop('expected_name_a'); + } + semicolon(); + advance_identifier('src'); + advance(':'); + while (true) { + if (next_token.string === 'local') { + advance_identifier('local'); + advance('('); + if (ux.test(next_token.string)) { + stop('bad_url_a'); + } + + if (!css_name() && !css_string()) { + stop('expected_name_a'); + } + advance(')'); + } else if (!css_url()) { + stop('expected_a_b', next_token, 'url', artifact()); + } + if (next_token.id !== ',') { + break; + } + comma(); + } + semicolon(); + } + + + css_border_style = [ + 'none', 'dashed', 'dotted', 'double', 'groove', + 'hidden', 'inset', 'outset', 'ridge', 'solid' + ]; + + css_break = [ + 'auto', 'always', 'avoid', 'left', 'right' + ]; + + css_media = { + 'all': true, + 'braille': true, + 'embossed': true, + 'handheld': true, + 'print': true, + 'projection': true, + 'screen': true, + 'speech': true, + 'tty': true, + 'tv': true + }; + + css_overflow = [ + 'auto', 'hidden', 'scroll', 'visible' + ]; + + css_attribute_data = { + background: [ + true, 'background-attachment', 'background-color', + 'background-image', 'background-position', 'background-repeat' + ], + 'background-attachment': ['scroll', 'fixed'], + 'background-color': ['transparent', css_color], + 'background-image': ['none', css_url], + 'background-position': [ + 2, [css_length, 'top', 'bottom', 'left', 'right', 'center'] + ], + 'background-repeat': [ + 'repeat', 'repeat-x', 'repeat-y', 'no-repeat' + ], + 'border': [true, 'border-color', 'border-style', 'border-width'], + 'border-bottom': [ + true, 'border-bottom-color', 'border-bottom-style', + 'border-bottom-width' + ], + 'border-bottom-color': css_color, + 'border-bottom-left-radius': css_radius, + 'border-bottom-right-radius': css_radius, + 'border-bottom-style': css_border_style, + 'border-bottom-width': css_width, + 'border-collapse': ['collapse', 'separate'], + 'border-color': ['transparent', 4, css_color], + 'border-left': [ + true, 'border-left-color', 'border-left-style', 'border-left-width' + ], + 'border-left-color': css_color, + 'border-left-style': css_border_style, + 'border-left-width': css_width, + 'border-radius': function () { + function count(separator) { + var n = 1; + if (separator) { + advance(separator); + } + if (!css_length()) { + return false; + } + while (next_token.id === '(number)') { + if (!css_length()) { + return false; + } + n += 1; + } + if (n > 4) { + warn('bad_style'); + } + return true; + } + + return count() && (next_token.id !== '/' || count('/')); + }, + 'border-right': [ + true, 'border-right-color', 'border-right-style', + 'border-right-width' + ], + 'border-right-color': css_color, + 'border-right-style': css_border_style, + 'border-right-width': css_width, + 'border-spacing': [2, css_length], + 'border-style': [4, css_border_style], + 'border-top': [ + true, 'border-top-color', 'border-top-style', 'border-top-width' + ], + 'border-top-color': css_color, + 'border-top-left-radius': css_radius, + 'border-top-right-radius': css_radius, + 'border-top-style': css_border_style, + 'border-top-width': css_width, + 'border-width': [4, css_width], + bottom: [css_length, 'auto'], + 'caption-side' : ['bottom', 'left', 'right', 'top'], + clear: ['both', 'left', 'none', 'right'], + clip: [css_shape, 'auto'], + color: css_color, + content: [ + 'open-quote', 'close-quote', 'no-open-quote', 'no-close-quote', + css_string, css_url, css_counter, css_attr + ], + 'counter-increment': [ + css_name, 'none' + ], + 'counter-reset': [ + css_name, 'none' + ], + cursor: [ + css_url, 'auto', 'crosshair', 'default', 'e-resize', 'help', 'move', + 'n-resize', 'ne-resize', 'nw-resize', 'pointer', 's-resize', + 'se-resize', 'sw-resize', 'w-resize', 'text', 'wait' + ], + direction: ['ltr', 'rtl'], + display: [ + 'block', 'compact', 'inline', 'inline-block', 'inline-table', + 'list-item', 'marker', 'none', 'run-in', 'table', 'table-caption', + 'table-cell', 'table-column', 'table-column-group', + 'table-footer-group', 'table-header-group', 'table-row', + 'table-row-group' + ], + 'empty-cells': ['show', 'hide'], + 'float': ['left', 'none', 'right'], + font: [ + 'caption', 'icon', 'menu', 'message-box', 'small-caption', + 'status-bar', true, 'font-size', 'font-style', 'font-weight', + 'font-family' + ], + 'font-family': css_comma_list, + 'font-size': [ + 'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', + 'xx-large', 'larger', 'smaller', css_length + ], + 'font-size-adjust': ['none', css_number], + 'font-stretch': [ + 'normal', 'wider', 'narrower', 'ultra-condensed', + 'extra-condensed', 'condensed', 'semi-condensed', + 'semi-expanded', 'expanded', 'extra-expanded' + ], + 'font-style': [ + 'normal', 'italic', 'oblique' + ], + 'font-variant': [ + 'normal', 'small-caps' + ], + 'font-weight': [ + 'normal', 'bold', 'bolder', 'lighter', css_number + ], + height: [css_length, 'auto'], + left: [css_length, 'auto'], + 'letter-spacing': ['normal', css_length], + 'line-height': ['normal', css_line_height], + 'list-style': [ + true, 'list-style-image', 'list-style-position', 'list-style-type' + ], + 'list-style-image': ['none', css_url], + 'list-style-position': ['inside', 'outside'], + 'list-style-type': [ + 'circle', 'disc', 'square', 'decimal', 'decimal-leading-zero', + 'lower-roman', 'upper-roman', 'lower-greek', 'lower-alpha', + 'lower-latin', 'upper-alpha', 'upper-latin', 'hebrew', 'katakana', + 'hiragana-iroha', 'katakana-oroha', 'none' + ], + margin: [4, css_margin], + 'margin-bottom': css_margin, + 'margin-left': css_margin, + 'margin-right': css_margin, + 'margin-top': css_margin, + 'marker-offset': [css_length, 'auto'], + 'max-height': [css_length, 'none'], + 'max-width': [css_length, 'none'], + 'min-height': css_length, + 'min-width': css_length, + opacity: css_number, + outline: [true, 'outline-color', 'outline-style', 'outline-width'], + 'outline-color': ['invert', css_color], + 'outline-style': [ + 'dashed', 'dotted', 'double', 'groove', 'inset', 'none', + 'outset', 'ridge', 'solid' + ], + 'outline-width': css_width, + overflow: css_overflow, + 'overflow-x': css_overflow, + 'overflow-y': css_overflow, + padding: [4, css_length], + 'padding-bottom': css_length, + 'padding-left': css_length, + 'padding-right': css_length, + 'padding-top': css_length, + 'page-break-after': css_break, + 'page-break-before': css_break, + position: ['absolute', 'fixed', 'relative', 'static'], + quotes: [8, css_string], + right: [css_length, 'auto'], + 'table-layout': ['auto', 'fixed'], + 'text-align': ['center', 'justify', 'left', 'right'], + 'text-decoration': [ + 'none', 'underline', 'overline', 'line-through', 'blink' + ], + 'text-indent': css_length, + 'text-shadow': ['none', 4, [css_color, css_length]], + 'text-transform': ['capitalize', 'uppercase', 'lowercase', 'none'], + top: [css_length, 'auto'], + 'unicode-bidi': ['normal', 'embed', 'bidi-override'], + 'vertical-align': [ + 'baseline', 'bottom', 'sub', 'super', 'top', 'text-top', 'middle', + 'text-bottom', css_length + ], + visibility: ['visible', 'hidden', 'collapse'], + 'white-space': [ + 'normal', 'nowrap', 'pre', 'pre-line', 'pre-wrap', 'inherit' + ], + width: [css_length, 'auto'], + 'word-spacing': ['normal', css_length], + 'word-wrap': ['break-word', 'normal'], + 'z-index': ['auto', css_number] + }; + + function style_attribute() { + var v; + while (next_token.id === '*' || next_token.id === '#' || + next_token.string === '_') { + if (!option.css) { + warn('unexpected_a'); + } + advance(); + } + if (next_token.id === '-') { + if (!option.css) { + warn('unexpected_a'); + } + advance('-'); + if (!next_token.identifier) { + warn('expected_nonstandard_style_attribute'); + } + advance(); + return css_any; + } + if (!next_token.identifier) { + warn('expected_style_attribute'); + } else { + if (Object.prototype.hasOwnProperty.call(css_attribute_data, + next_token.string)) { + v = css_attribute_data[next_token.string]; + } else { + v = css_any; + if (!option.css) { + warn('unrecognized_style_attribute_a'); + } + } + } + advance(); + return v; + } + + + function style_value(v) { + var i = 0, + n, + once, + match, + round, + start = 0, + vi; + switch (typeof v) { + case 'function': + return v(); + case 'string': + if (next_token.identifier && next_token.string === v) { + advance(); + return true; + } + return false; + } + for (;;) { + if (i >= v.length) { + return false; + } + vi = v[i]; + i += 1; + if (typeof vi === 'boolean') { + break; + } else if (typeof vi === 'number') { + n = vi; + vi = v[i]; + i += 1; + } else { + n = 1; + } + match = false; + while (n > 0) { + if (style_value(vi)) { + match = true; + n -= 1; + } else { + break; + } + } + if (match) { + return true; + } + } + start = i; + once = []; + for (;;) { + round = false; + for (i = start; i < v.length; i += 1) { + if (!once[i]) { + if (style_value(css_attribute_data[v[i]])) { + match = true; + round = true; + once[i] = true; + break; + } + } + } + if (!round) { + return match; + } + } + } + + function style_child() { + if (next_token.id === '(number)') { + advance(); + if (next_token.string === 'n' && next_token.identifier) { + no_space_only(); + advance(); + if (next_token.id === '+') { + no_space_only(); + advance('+'); + no_space_only(); + advance('(number)'); + } + } + return; + } + if (next_token.identifier && + (next_token.string === 'odd' || next_token.string === 'even')) { + advance(); + return; + } + warn('unexpected_a'); + } + + function substyle() { + var v; + for (;;) { + if (next_token.id === '}' || next_token.id === '(end)' || + (xquote && next_token.id === xquote)) { + return; + } + v = style_attribute(); + advance(':'); + if (next_token.identifier && next_token.string === 'inherit') { + advance(); + } else { + if (!style_value(v)) { + warn('unexpected_a'); + advance(); + } + } + if (next_token.id === '!') { + advance('!'); + no_space_only(); + if (next_token.identifier && next_token.string === 'important') { + advance(); + } else { + warn('expected_a_b', + next_token, 'important', artifact()); + } + } + if (next_token.id === '}' || next_token.id === xquote) { + warn('expected_a_b', next_token, ';', artifact()); + } else { + semicolon(); + } + } + } + + function style_selector() { + if (next_token.identifier) { + if (!Object.prototype.hasOwnProperty.call(html_tag, option.cap + ? next_token.string.toLowerCase() + : next_token.string)) { + warn('expected_tagname_a'); + } + advance(); + } else { + switch (next_token.id) { + case '>': + case '+': + advance(); + style_selector(); + break; + case ':': + advance(':'); + switch (next_token.string) { + case 'active': + case 'after': + case 'before': + case 'checked': + case 'disabled': + case 'empty': + case 'enabled': + case 'first-child': + case 'first-letter': + case 'first-line': + case 'first-of-type': + case 'focus': + case 'hover': + case 'last-child': + case 'last-of-type': + case 'link': + case 'only-of-type': + case 'root': + case 'target': + case 'visited': + advance_identifier(next_token.string); + break; + case 'lang': + advance_identifier('lang'); + advance('('); + if (!next_token.identifier) { + warn('expected_lang_a'); + } + advance(')'); + break; + case 'nth-child': + case 'nth-last-child': + case 'nth-last-of-type': + case 'nth-of-type': + advance_identifier(next_token.string); + advance('('); + style_child(); + advance(')'); + break; + case 'not': + advance_identifier('not'); + advance('('); + if (next_token.id === ':' && peek(0).string === 'not') { + warn('not'); + } + style_selector(); + advance(')'); + break; + default: + warn('expected_pseudo_a'); + } + break; + case '#': + advance('#'); + if (!next_token.identifier) { + warn('expected_id_a'); + } + advance(); + break; + case '*': + advance('*'); + break; + case '.': + advance('.'); + if (!next_token.identifier) { + warn('expected_class_a'); + } + advance(); + break; + case '[': + advance('['); + if (!next_token.identifier) { + warn('expected_attribute_a'); + } + advance(); + if (next_token.id === '=' || next_token.string === '~=' || + next_token.string === '$=' || + next_token.string === '|=' || + next_token.id === '*=' || + next_token.id === '^=') { + advance(); + if (next_token.id !== '(string)') { + warn('expected_string_a'); + } + advance(); + } + advance(']'); + break; + default: + stop('expected_selector_a'); + } + } + } + + function style_pattern() { + if (next_token.id === '{') { + warn('expected_style_pattern'); + } + for (;;) { + style_selector(); + if (next_token.id === '= 0) { + warn('unexpected_char_a_b', token, v.charAt(x), a); + } + ids[u] = true; + } else if (a === 'class' || a === 'type' || a === 'name') { + x = v.search(qx); + if (x >= 0) { + warn('unexpected_char_a_b', token, v.charAt(x), a); + } + ids[u] = true; + } else if (a === 'href' || a === 'background' || + a === 'content' || a === 'data' || + a.indexOf('src') >= 0 || a.indexOf('url') >= 0) { + if (option.safe && ux.test(v)) { + stop('bad_url_a', next_token, v); + } + urls.push(v); + } else if (a === 'for') { + if (option.adsafe) { + if (adsafe_id) { + if (v.slice(0, adsafe_id.length) !== adsafe_id) { + warn('adsafe_prefix_a', next_token, adsafe_id); + } else if (!/^[A-Z]+_[A-Z]+$/.test(v)) { + warn('adsafe_bad_id'); + } + } else { + warn('adsafe_bad_id'); + } + } + } else if (a === 'name') { + if (option.adsafe && v.indexOf('_') >= 0) { + warn('adsafe_name_a', next_token, v); + } + } + } + + function do_tag(name, attribute) { + var i, tag = html_tag[name], script, x; + src = false; + if (!tag) { + stop( + bundle.unrecognized_tag_a, + next_token, + name === name.toLowerCase() + ? name + : name + ' (capitalization error)' + ); + } + if (stack.length > 0) { + if (name === 'html') { + stop('unexpected_a', token, name); + } + x = tag.parent; + if (x) { + if (x.indexOf(' ' + stack[stack.length - 1].name + ' ') < 0) { + stop('tag_a_in_b', token, name, x); + } + } else if (!option.adsafe && !option.fragment) { + i = stack.length; + do { + if (i <= 0) { + stop('tag_a_in_b', token, name, 'body'); + } + i -= 1; + } while (stack[i].name !== 'body'); + } + } + switch (name) { + case 'div': + if (option.adsafe && stack.length === 1 && !adsafe_id) { + warn('adsafe_missing_id'); + } + break; + case 'script': + xmode = 'script'; + advance('>'); + if (attribute.lang) { + warn('lang', token); + } + if (option.adsafe && stack.length !== 1) { + warn('adsafe_placement', token); + } + if (attribute.src) { + if (option.adsafe && (!adsafe_may || !approved[attribute.src])) { + warn('adsafe_source', token); + } + } else { + step_in(next_token.from); + edge(); + use_strict(); + adsafe_top = true; + script = statements(); + +// JSLint is also the static analyzer for ADsafe. See www.ADsafe.org. + + if (option.adsafe) { + if (adsafe_went) { + stop('adsafe_script', token); + } + if (script.length !== 1 || + aint(script[0], 'id', '(') || + aint(script[0].first, 'id', '.') || + aint(script[0].first.first, 'string', 'ADSAFE') || + aint(script[0].second[0], 'string', adsafe_id)) { + stop('adsafe_id_go'); + } + switch (script[0].first.second.string) { + case 'id': + if (adsafe_may || adsafe_went || + script[0].second.length !== 1) { + stop('adsafe_id', next_token); + } + adsafe_may = true; + break; + case 'go': + if (adsafe_went) { + stop('adsafe_go'); + } + if (script[0].second.length !== 2 || + aint(script[0].second[1], 'id', 'function') || + !script[0].second[1].first || + aint(script[0].second[1].first[0], 'string', 'dom') || + script[0].second[1].first.length > 2 || + (script[0].second[1].first.length === 2 && + aint(script[0].second[1].first[1], 'string', 'lib'))) { + stop('adsafe_go', next_token); + } + adsafe_went = true; + break; + default: + stop('adsafe_id_go'); + } + } + indent = null; + } + xmode = 'html'; + advance(''); + styles(); + xmode = 'html'; + advance(''; + } + + function html() { + var attribute, attributes, is_empty, name, old_white = option.white, + quote, tag_name, tag, wmode; + xmode = 'html'; + xquote = ''; + stack = null; + for (;;) { + switch (next_token.string) { + case '<': + xmode = 'html'; + advance('<'); + attributes = {}; + tag_name = next_token; + name = tag_name.string; + advance_identifier(name); + if (option.cap) { + name = name.toLowerCase(); + } + tag_name.name = name; + if (!stack) { + stack = []; + do_begin(name); + } + tag = html_tag[name]; + if (typeof tag !== 'object') { + stop('unrecognized_tag_a', tag_name, name); + } + is_empty = tag.empty; + tag_name.type = name; + for (;;) { + if (next_token.id === '/') { + advance('/'); + if (next_token.id !== '>') { + warn('expected_a_b', next_token, '>', artifact()); + } + break; + } + if (next_token.id && next_token.id.charAt(0) === '>') { + break; + } + if (!next_token.identifier) { + if (next_token.id === '(end)' || next_token.id === '(error)') { + warn('expected_a_b', next_token, '>', artifact()); + } + warn('bad_name_a'); + } + option.white = false; + spaces(); + attribute = next_token.string; + option.white = old_white; + advance(); + if (!option.cap && attribute !== attribute.toLowerCase()) { + warn('attribute_case_a', token); + } + attribute = attribute.toLowerCase(); + xquote = ''; + if (Object.prototype.hasOwnProperty.call(attributes, attribute)) { + warn('duplicate_a', token, attribute); + } + if (attribute.slice(0, 2) === 'on') { + if (!option.on) { + warn('html_handlers'); + } + xmode = 'scriptstring'; + advance('='); + quote = next_token.id; + if (quote !== '"' && quote !== '\'') { + stop('expected_a_b', next_token, '"', artifact()); + } + xquote = quote; + wmode = option.white; + option.white = true; + advance(quote); + use_strict(); + statements(); + option.white = wmode; + if (next_token.id !== quote) { + stop('expected_a_b', next_token, quote, artifact()); + } + xmode = 'html'; + xquote = ''; + advance(quote); + tag = false; + } else if (attribute === 'style') { + xmode = 'scriptstring'; + advance('='); + quote = next_token.id; + if (quote !== '"' && quote !== '\'') { + stop('expected_a_b', next_token, '"', artifact()); + } + xmode = 'styleproperty'; + xquote = quote; + advance(quote); + substyle(); + xmode = 'html'; + xquote = ''; + advance(quote); + tag = false; + } else { + if (next_token.id === '=') { + advance('='); + tag = next_token.string; + if (!next_token.identifier && + next_token.id !== '"' && + next_token.id !== '\'' && + next_token.id !== '(string)' && + next_token.id !== '(string)' && + next_token.id !== '(color)') { + warn('expected_attribute_value_a', token, attribute); + } + advance(); + } else { + tag = true; + } + } + attributes[attribute] = tag; + do_attribute(attribute, tag); + } + do_tag(name, attributes); + if (!is_empty) { + stack.push(tag_name); + } + xmode = 'outer'; + advance('>'); + break; + case '') { + stop('expected_a_b', next_token, '>', artifact()); + } + xmode = 'outer'; + advance('>'); + break; + case '' || next_token.id === '(end)') { + break; + } + if (next_token.string.indexOf('--') >= 0) { + stop('unexpected_a', next_token, '--'); + } + if (next_token.string.indexOf('<') >= 0) { + stop('unexpected_a', next_token, '<'); + } + if (next_token.string.indexOf('>') >= 0) { + stop('unexpected_a', next_token, '>'); + } + } + xmode = 'outer'; + advance('>'); + break; + case '(end)': + if (stack.length !== 0) { + warn('missing_a', next_token, ''); + } + return; + default: + if (next_token.id === '(end)') { + stop('missing_a', next_token, + ''); + } else { + advance(); + } + } + if (stack && stack.length === 0 && (option.adsafe || + !option.fragment || next_token.id === '(end)')) { + break; + } + } + if (next_token.id !== '(end)') { + stop('unexpected_a'); + } + } + + +// The actual JSLINT function itself. + + itself = function JSLint(the_source, the_option) { + + var i, predef, tree; + JSLINT.errors = []; + JSLINT.tree = ''; + begin = prev_token = token = next_token = + Object.create(syntax['(begin)']); + predefined = {}; + add_to_predefined(standard); + property = {}; + if (the_option) { + option = Object.create(the_option); + predef = option.predef; + if (predef) { + if (Array.isArray(predef)) { + for (i = 0; i < predef.length; i += 1) { + predefined[predef[i]] = true; + } + } else if (typeof predef === 'object') { + add_to_predefined(predef); + } + } + do_safe(); + } else { + option = {}; + } + option.indent = +option.indent || 4; + option.maxerr = +option.maxerr || 50; + adsafe_id = ''; + adsafe_may = adsafe_top = adsafe_went = false; + approved = {}; + if (option.approved) { + for (i = 0; i < option.approved.length; i += 1) { + approved[option.approved[i]] = option.approved[i]; + } + } else { + approved.test = 'test'; + } + tab = ''; + for (i = 0; i < option.indent; i += 1) { + tab += ' '; + } + global_scope = scope = {}; + global_funct = funct = { + '(scope)': scope, + '(breakage)': 0, + '(loopage)': 0 + }; + functions = [funct]; + + comments_off = false; + ids = {}; + in_block = false; + indent = null; + json_mode = false; + lookahead = []; + node_js = false; + prereg = true; + src = false; + stack = null; + strict_mode = false; + urls = []; + var_mode = null; + warnings = 0; + xmode = ''; + lex.init(the_source); + + assume(); + + try { + advance(); + if (next_token.id === '(number)') { + stop('unexpected_a'); + } else if (next_token.string.charAt(0) === '<') { + html(); + if (option.adsafe && !adsafe_went) { + warn('adsafe_go', this); + } + } else { + switch (next_token.id) { + case '{': + case '[': + json_mode = true; + json_value(); + break; + case '@': + case '*': + case '#': + case '.': + case ':': + xmode = 'style'; + advance(); + if (token.id !== '@' || !next_token.identifier || + next_token.string !== 'charset' || token.line !== 1 || + token.from !== 1) { + stop('css'); + } + advance(); + if (next_token.id !== '(string)' && + next_token.string !== 'UTF-8') { + stop('css'); + } + advance(); + semicolon(); + styles(); + break; + + default: + if (option.adsafe && option.fragment) { + stop('expected_a_b', + next_token, '
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ', artifact()); + } + +// If the first token is a semicolon, ignore it. This is sometimes used when +// files are intended to be appended to files that may be sloppy. A sloppy +// file may be depending on semicolon insertion on its last line. + + step_in(1); + if (next_token.id === ';' && !node_js) { + semicolon(); + } + adsafe_top = true; + tree = statements(); + begin.first = tree; + JSLINT.tree = begin; + // infer_types(tree); + if (option.adsafe && (tree.length !== 1 || + aint(tree[0], 'id', '(') || + aint(tree[0].first, 'id', '.') || + aint(tree[0].first.first, 'string', 'ADSAFE') || + aint(tree[0].first.second, 'string', 'lib') || + tree[0].second.length !== 2 || + tree[0].second[0].id !== '(string)' || + aint(tree[0].second[1], 'id', 'function'))) { + stop('adsafe_lib'); + } + if (tree.disrupt) { + warn('weird_program', prev_token); + } + } + } + indent = null; + advance('(end)'); + } catch (e) { + if (e) { // ~~ + JSLINT.errors.push({ + reason : e.message, + line : e.line || next_token.line, + character : e.character || next_token.from + }, null); + } + } + return JSLINT.errors.length === 0; + }; + + +// Data summary. + + itself.data = function () { + var data = {functions: []}, + function_data, + globals, + i, + j, + kind, + members = [], + name, + the_function, + undef = [], + unused = []; + if (itself.errors.length) { + data.errors = itself.errors; + } + + if (json_mode) { + data.json = true; + } + + if (urls.length > 0) { + data.urls = urls; + } + + globals = Object.keys(global_scope).filter(function (value) { + return value.charAt(0) !== '(' && typeof standard[value] !== 'boolean'; + }); + if (globals.length > 0) { + data.globals = globals; + } + + for (i = 1; i < functions.length; i += 1) { + the_function = functions[i]; + function_data = {}; + for (j = 0; j < functionicity.length; j += 1) { + function_data[functionicity[j]] = []; + } + for (name in the_function) { + if (Object.prototype.hasOwnProperty.call(the_function, name)) { + if (name.charAt(0) !== '(') { + kind = the_function[name]; + if (kind === 'unction' || kind === 'unparam') { + kind = 'unused'; + } + if (Array.isArray(function_data[kind])) { + function_data[kind].push(name); + if (kind === 'unused') { + unused.push({ + name: name, + line: the_function['(line)'], + 'function': the_function['(name)'] + }); + } else if (kind === 'undef') { + undef.push({ + name: name, + line: the_function['(line)'], + 'function': the_function['(name)'] + }); + } + } + } + } + } + for (j = 0; j < functionicity.length; j += 1) { + if (function_data[functionicity[j]].length === 0) { + delete function_data[functionicity[j]]; + } + } + function_data.name = the_function['(name)']; + function_data.params = the_function['(params)']; + function_data.line = the_function['(line)']; + data.functions.push(function_data); + } + + if (unused.length > 0) { + data.unused = unused; + } + if (undef.length > 0) { + data['undefined'] = undef; + } + + members = []; + for (name in property) { + if (typeof property[name] === 'number') { + data.member = property; + break; + } + } + + return data; + }; + + + itself.report = function (errors_only) { + var data = itself.data(), err, evidence, i, italics, j, key, keys, + length, mem = '', name, names, not_first, output = [], snippets, + the_function, warning; + + function detail(h, value) { + var comma_needed, singularity; + if (Array.isArray(value)) { + output.push('
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ' + h + ' '); + value.sort().forEach(function (item) { + if (item !== singularity) { + singularity = item; + output.push((comma_needed ? ', ' : '') + singularity); + comma_needed = true; + } + }); + output.push('
                                                                                                                                                                                                                                                                                                                                                                                                                                                              '); + } else if (value) { + output.push('
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ' + h + ' ' + value + '
                                                                                                                                                                                                                                                                                                                                                                                                                                                              '); + } + } + + if (data.errors || data.unused || data['undefined']) { + err = true; + output.push('
                                                                                                                                                                                                                                                                                                                                                                                                                                                              Error:'); + if (data.errors) { + for (i = 0; i < data.errors.length; i += 1) { + warning = data.errors[i]; + if (warning) { + evidence = warning.evidence || ''; + output.push('

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Problem' + (isFinite(warning.line) + ? ' at line ' + String(warning.line) + + ' character ' + String(warning.character) + : '') + + ': ' + warning.reason.entityify() + + '

                                                                                                                                                                                                                                                                                                                                                                                                                                                              ' + + (evidence && (evidence.length > 80 + ? evidence.slice(0, 77) + '...' + : evidence).entityify()) + '

                                                                                                                                                                                                                                                                                                                                                                                                                                                              '); + } + } + } + + if (data['undefined']) { + snippets = []; + for (i = 0; i < data['undefined'].length; i += 1) { + snippets[i] = '' + data['undefined'][i].name + ' ' + + String(data['undefined'][i].line) + ' ' + + data['undefined'][i]['function'] + ''; + } + output.push('

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Undefined variable: ' + snippets.join(', ') + '

                                                                                                                                                                                                                                                                                                                                                                                                                                                              '); + } + if (data.unused) { + snippets = []; + for (i = 0; i < data.unused.length; i += 1) { + snippets[i] = '' + data.unused[i].name + ' ' + + String(data.unused[i].line) + ' ' + + data.unused[i]['function'] + ''; + } + output.push('

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Unused variable: ' + snippets.join(', ') + '

                                                                                                                                                                                                                                                                                                                                                                                                                                                              '); + } + if (data.json) { + output.push('

                                                                                                                                                                                                                                                                                                                                                                                                                                                              JSON: bad.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              '); + } + output.push('
                                                                                                                                                                                                                                                                                                                                                                                                                                                              '); + } + + if (!errors_only) { + + output.push('
                                                                                                                                                                                                                                                                                                                                                                                                                                                              '); + + if (data.urls) { + detail("URLs
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ", data.urls, '
                                                                                                                                                                                                                                                                                                                                                                                                                                                              '); + } + + if (xmode === 'style') { + output.push('

                                                                                                                                                                                                                                                                                                                                                                                                                                                              CSS.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              '); + } else if (data.json && !err) { + output.push('

                                                                                                                                                                                                                                                                                                                                                                                                                                                              JSON: good.

                                                                                                                                                                                                                                                                                                                                                                                                                                                              '); + } else if (data.globals) { + output.push('
                                                                                                                                                                                                                                                                                                                                                                                                                                                              Global ' + + data.globals.sort().join(', ') + '
                                                                                                                                                                                                                                                                                                                                                                                                                                                              '); + } else { + output.push('
                                                                                                                                                                                                                                                                                                                                                                                                                                                              No new global variables introduced.
                                                                                                                                                                                                                                                                                                                                                                                                                                                              '); + } + + for (i = 0; i < data.functions.length; i += 1) { + the_function = data.functions[i]; + names = []; + if (the_function.params) { + for (j = 0; j < the_function.params.length; j += 1) { + names[j] = the_function.params[j].string; + } + } + output.push('
                                                                                                                                                                                                                                                                                                                                                                                                                                                              ' + + String(the_function.line) + ' ' + + the_function.name.entityify() + + '(' + names.join(', ') + ')
                                                                                                                                                                                                                                                                                                                                                                                                                                                              '); + detail('Undefined', the_function['undefined']); + detail('Unused', the_function.unused); + detail('Closure', the_function.closure); + detail('Variable', the_function['var']); + detail('Exception', the_function.exception); + detail('Outer', the_function.outer); + detail('Global', the_function.global); + detail('Label', the_function.label); + } + + if (data.member) { + keys = Object.keys(data.member); + if (keys.length) { + keys = keys.sort(); + output.push('
                                                                                                                                                                                                                                                                                                                                                                                                                                                              /*properties
                                                                                                                                                                                                                                                                                                                                                                                                                                                              '); + mem = ' '; + italics = 0; + j = 0; + not_first = false; + for (i = 0; i < keys.length; i += 1) { + key = keys[i]; + if (data.member[key] > 0) { + if (not_first) { + mem += ', '; + } + name = ix.test(key) + ? key + : '\'' + key.entityify().replace(nx, sanitize) + '\''; + length += name.length + 2; + if (data.member[key] === 1) { + name = '' + name + ''; + italics += 1; + j = 1; + } + if (mem.length + name.length - (italics * 7) > 80) { + output.push(mem + '
                                                                                                                                                                                                                                                                                                                                                                                                                                                              '); + mem = ' '; + italics = j; + } + mem += name; + j = 0; + not_first = true; + } + } + output.push(mem + '
                                                                                                                                                                                                                                                                                                                                                                                                                                                              */
                                                                                                                                                                                                                                                                                                                                                                                                                                                              '); + } + output.push('
                                                                                                                                                                                                                                                                                                                                                                                                                                                              '); + } + } + return output.join(''); + }; + itself.jslint = itself; + + itself.edition = '2012-03-15'; + + return itself; +}()); + +}); diff --git a/lib/ace/worker/mirror.js b/lib/ace/worker/mirror.js index ef6e2aa3..9e6dda73 100644 --- a/lib/ace/worker/mirror.js +++ b/lib/ace/worker/mirror.js @@ -1,7 +1,6 @@ define(function(require, exports, module) { "use strict"; -var Range = require("../range").Range; var Document = require("../document").Document; var lang = require("../lib/lang"); @@ -9,26 +8,12 @@ var Mirror = exports.Mirror = function(sender) { this.sender = sender; var doc = this.doc = new Document(""); - var deferredUpdate = this.deferredUpdate = lang.delayedCall(this.onUpdate.bind(this)); + var deferredUpdate = this.deferredUpdate = lang.deferredCall(this.onUpdate.bind(this)); var _self = this; sender.on("change", function(e) { - var data = e.data; - if (data[0].start) { - doc.applyDeltas(data); - } else { - for (var i = 0; i < data.length; i += 2) { - if (Array.isArray(data[i+1])) { - var d = {action: "insert", start: data[i], lines: data[i+1]}; - } else { - var d = {action: "remove", start: data[i], end: data[i+1]}; - } - doc.applyDelta(d, true); - } - } - if (_self.$timeout) - return deferredUpdate.schedule(_self.$timeout); - _self.onUpdate(); + doc.applyDeltas([e.data]); + deferredUpdate.schedule(_self.$timeout); }); }; @@ -53,10 +38,6 @@ var Mirror = exports.Mirror = function(sender) { // abstract method }; - this.isPending = function() { - return this.deferredUpdate.isPending(); - }; - }).call(Mirror.prototype); }); diff --git a/lib/ace/worker/worker.js b/lib/ace/worker/worker.js index 28fc0fe2..2e1853df 100644 --- a/lib/ace/worker/worker.js +++ b/lib/ace/worker/worker.js @@ -1,64 +1,38 @@ "no use strict"; -;(function(window) { -if (typeof window.window != "undefined" && window.document) - return; -if (window.require && window.define) - return; -window.console = function() { - var msgs = Array.prototype.slice.call(arguments, 0); - postMessage({type: "log", data: msgs}); +var console = { + log: function(msg) { + postMessage({type: "log", data: msg}); + } }; -window.console.error = -window.console.warn = -window.console.log = -window.console.trace = window.console; - -window.window = window; -window.ace = window; - -window.onerror = function(message, file, line, col, err) { - postMessage({type: "error", data: { - message: message, - data: err.data, - file: file, - line: line, - col: col, - stack: err.stack - }}); +var window = { + console: console }; -window.normalizeModule = function(parentId, moduleName) { +var normalizeModule = function(parentId, moduleName) { // normalize plugin requires if (moduleName.indexOf("!") !== -1) { var chunks = moduleName.split("!"); - return window.normalizeModule(parentId, chunks[0]) + "!" + window.normalizeModule(parentId, chunks[1]); + 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 ? base + "/" : "") + moduleName; + var moduleName = base + "/" + moduleName; - while (moduleName.indexOf(".") !== -1 && previous != moduleName) { + while(moduleName.indexOf(".") !== -1 && previous != moduleName) { var previous = moduleName; - moduleName = moduleName.replace(/^\.\//, "").replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, ""); + var moduleName = moduleName.replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, ""); } } return moduleName; }; -window.require = function require(parentId, id) { - if (!id) { - id = parentId; - parentId = null; - } - if (!id.charAt) - throw new Error("worker.js require() accepts only (parentId, id) as arguments"); - - id = window.normalizeModule(parentId, id); - - var module = window.require.modules[id]; +var require = function(parentId, id) { + var id = normalizeModule(parentId, id); + + var module = require.modules[id]; if (module) { if (!module.initialized) { module.initialized = true; @@ -66,102 +40,59 @@ window.require = function require(parentId, id) { } return module.exports; } - - if (!window.require.tlns) - return console.log("unable to load " + id); - var path = resolveModuleId(id, window.require.tlns); - if (path.slice(-3) != ".js") path += ".js"; + var chunks = id.split("/"); + chunks[0] = require.tlns[chunks[0]] || chunks[0]; + var path = chunks.join("/") + ".js"; - window.require.id = id; - window.require.modules[id] = {}; // prevent infinite loop on broken modules + require.id = id; importScripts(path); - return window.require(parentId, id); + return require(parentId, id); }; -function resolveModuleId(id, paths) { - var testPath = id, tail = ""; - while (testPath) { - var alias = paths[testPath]; - if (typeof alias == "string") { - return alias + tail; - } else if (alias) { - return alias.location.replace(/\/*$/, "/") + (tail || alias.main || alias.name); - } else if (alias === false) { - return ""; - } - var i = testPath.lastIndexOf("/"); - if (i === -1) break; - tail = testPath.substr(i) + tail; - testPath = testPath.slice(0, i); - } - return id; -} -window.require.modules = {}; -window.require.tlns = {}; -window.define = function(id, deps, factory) { +require.modules = {}; +require.tlns = {}; + +var define = function(id, deps, factory) { if (arguments.length == 2) { factory = deps; if (typeof id != "string") { deps = id; - id = window.require.id; + id = require.id; } } else if (arguments.length == 1) { factory = id; - deps = []; - id = window.require.id; + id = require.id; } - - if (typeof factory != "function") { - window.require.modules[id] = { - exports: factory, - initialized: true - }; + + if (id.indexOf("text!") === 0) return; - } - - if (!deps.length) - // If there is no dependencies, we inject "require", "exports" and - // "module" as dependencies, to provide CommonJS compatibility. - deps = ["require", "exports", "module"]; - - var req = function(childId) { - return window.require(id, childId); + + var req = function(deps, factory) { + return require(id, deps, factory); }; - window.require.modules[id] = { - exports: {}, + require.modules[id] = { factory: function() { - var module = this; - var returnExports = factory.apply(this, deps.map(function(dep) { - switch (dep) { - // Because "require", "exports" and "module" aren't actual - // dependencies, we must handle them seperately. - case "require": return req; - case "exports": return module.exports; - case "module": return module; - // But for all other dependencies, we can just go ahead and - // require them. - default: return req(dep); - } - })); + var module = { + exports: {} + }; + var returnExports = factory(req, module.exports, module); if (returnExports) module.exports = returnExports; return module; } }; }; -window.define.amd = {}; -require.tlns = {}; -window.initBaseUrls = function initBaseUrls(topLevelNamespaces) { - for (var i in topLevelNamespaces) - require.tlns[i] = topLevelNamespaces[i]; -}; -window.initSender = function initSender() { +function initBaseUrls(topLevelNamespaces) { + require.tlns = topLevelNamespaces; +} - var EventEmitter = window.require("ace/lib/event_emitter").EventEmitter; - var oop = window.require("ace/lib/oop"); +function initSender() { + + var EventEmitter = require(null, "ace/lib/event_emitter").EventEmitter; + var oop = require(null, "ace/lib/oop"); var Sender = function() {}; @@ -188,30 +119,24 @@ window.initSender = function initSender() { }).call(Sender.prototype); return new Sender(); -}; +} -var main = window.main = null; -var sender = window.sender = null; +var main; +var sender; -window.onmessage = function(e) { +onmessage = function(e) { var msg = e.data; - if (msg.event && sender) { - sender._signal(msg.event, msg.data); + if (msg.command) { + main[msg.command].apply(main, msg.args); } - else if (msg.command) { - if (main[msg.command]) - main[msg.command].apply(main, msg.args); - else if (window[msg.command]) - window[msg.command].apply(window, msg.args); - else - throw new Error("Unknown command:" + msg.command); - } - else if (msg.init) { - window.initBaseUrls(msg.tlns); - require("ace/lib/es5-shim"); - sender = window.sender = window.initSender(); - var clazz = require(msg.module)[msg.classname]; - main = window.main = new clazz(sender); + 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); } }; -})(this); \ No newline at end of file diff --git a/lib/ace/worker/worker_client.js b/lib/ace/worker/worker_client.js index ba4f20a0..ed1ada78 100644 --- a/lib/ace/worker/worker_client.js +++ b/lib/ace/worker/worker_client.js @@ -1,30 +1,37 @@ /* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * 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. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. * - * 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. + * The Original Code is Ajax.org Code Editor (ACE). + * + * The Initial Developer of the Original Code is + * Ajax.org B.V. + * Portions created by the Initial Developer are Copyright (C) 2010 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Fabian Jakobs + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -32,100 +39,96 @@ define(function(require, exports, module) { "use strict"; var oop = require("../lib/oop"); -var net = require("../lib/net"); var EventEmitter = require("../lib/event_emitter").EventEmitter; var config = require("../config"); -var WorkerClient = function(topLevelNamespaces, mod, classname, workerUrl) { - this.$sendDeltaQueue = this.$sendDeltaQueue.bind(this); - this.changeListener = this.changeListener.bind(this); - this.onMessage = this.onMessage.bind(this); +var WorkerClient = function(topLevelNamespaces, mod, classname) { - // nameToUrl is renamed to toUrl in requirejs 2 - if (require.nameToUrl && !require.toUrl) - require.toUrl = require.nameToUrl; - - if (config.get("packaged") || !require.toUrl) { - workerUrl = workerUrl || config.moduleUrl(mod, "worker"); - } else { - var normalizePath = this.$normalizePath; - workerUrl = workerUrl || normalizePath(require.toUrl("ace/worker/worker.js", null, "_")); + 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 = {}; - topLevelNamespaces.forEach(function(ns) { - tlns[ns] = normalizePath(require.toUrl(ns, null, "_").replace(/(\.js)?(\?.*)?$/, "")); - }); - } + for (var i=0; i 50 && q.length > this.$doc.getLength() >> 1) { - this.call("setValue", [this.$doc.getValue()]); - } else - this.emit("change", {data: q}); - }; - - this.$workerBlob = function(workerUrl) { - // workerUrl can be protocol relative - // importScripts only takes fully qualified urls - var script = "importScripts('" + net.qualifyURL(workerUrl) + "');"; - try { - return new Blob([script], {"type": "application/javascript"}); - } catch (e) { // Backwards-compatibility - var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder; - var blobBuilder = new BlobBuilder(); - blobBuilder.append(script); - return blobBuilder.getBlob("application/javascript"); - } + this.changeListener = function(e) { + e.range = { + start: e.data.range.start, + end: e.data.range.end + }; + this.emit("change", e); }; }).call(WorkerClient.prototype); - -var UIWorkerClient = function(topLevelNamespaces, mod, classname) { - this.$sendDeltaQueue = this.$sendDeltaQueue.bind(this); - this.changeListener = this.changeListener.bind(this); - this.callbackId = 1; - this.callbacks = {}; - this.messageBuffer = []; - - var main = null; - var emitSync = false; - var sender = Object.create(EventEmitter); - var _self = this; - - this.$worker = {}; - this.$worker.terminate = function() {}; - this.$worker.postMessage = function(e) { - _self.messageBuffer.push(e); - if (main) { - if (emitSync) - setTimeout(processNext); - else - processNext(); - } - }; - this.setEmitSync = function(val) { emitSync = val }; - - var processNext = function() { - var msg = _self.messageBuffer.shift(); - if (msg.command) - main[msg.command].apply(main, msg.args); - else if (msg.event) - sender._signal(msg.event, msg.data); - }; - - sender.postMessage = function(msg) { - _self.onMessage({data: msg}); - }; - sender.callback = function(data, callbackId) { - this.postMessage({type: "call", id: callbackId, data: data}); - }; - sender.emit = function(name, data) { - this.postMessage({type: "event", name: name, data: data}); - }; - - config.loadModule(["worker", mod], function(Main) { - main = new Main[classname](sender); - while (_self.messageBuffer.length) - processNext(); - }); -}; - -UIWorkerClient.prototype = WorkerClient.prototype; - -exports.UIWorkerClient = UIWorkerClient; exports.WorkerClient = WorkerClient; }); diff --git a/lib/ace/worker/worker_sourcemint.js b/lib/ace/worker/worker_sourcemint.js new file mode 100644 index 00000000..bc305b79 --- /dev/null +++ b/lib/ace/worker/worker_sourcemint.js @@ -0,0 +1,73 @@ + +define(function(require, exports, module) { + + "no use strict"; + + exports.main = function() + { + var console = { + log: function(msg) { + postMessage({type: "log", data: msg}); + } + }; + + // NOTE: This sets the global `window` object used by workers. + // TODO: Pass into worker what it needs and don't set global here. + window = { + console: console + }; + + function initSender() { + + var EventEmitter = require("ace/lib/event_emitter").EventEmitter; + var oop = require("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) { + require("ace/lib/fixoldbrowsers"); + sender = initSender(); + require.async(msg.module, function(WORKER) { + var clazz = WORKER[msg.classname]; + main = new clazz(sender); + }); + } + else if (msg.event && sender) { + sender._emit(msg.event, msg.data); + } + }; + } +}); diff --git a/lib/ace/worker/worker_test.js b/lib/ace/worker/worker_test.js deleted file mode 100644 index c0a5b0a7..00000000 --- a/lib/ace/worker/worker_test.js +++ /dev/null @@ -1,125 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Distributed under the BSD license: - * - * Copyright (c) 2010, Ajax.org B.V. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Ajax.org B.V. nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * ***** END LICENSE BLOCK ***** */ - -// The loading of ace/worker/worker is complicated, because when we need to load -// it via RequireJS, it needs a shim to make it into a AMD-module. -// When using the AMD-loader it's just works, so we just it load the file now - -require("amd-loader"); - -define(function(require, exports, module) { -"use strict"; - -var assert = require("../test/assertions"); -var worker = require("./worker") - -module.exports = { - setUp : function() { - // And define a few mock dependency modules - worker.define("depA", [], function(require, exports, module) { - module.exports = 'dependency A'; - }) - worker.define("depB", [], function(require, exports, module) { - module.exports = 'dependency B'; - }) - }, - - "test: define() with no dependencies, and CommonJS-compatability require()-calls" : function() { - // We want to be able to call define without an id or deps, but - // since we aren't loading an external file, we must explicitly give - // it some kind of id, in this case 'test1'. - worker.require.id = 'test1'; - // Now define out module - worker.define(function(require, exports, module) { - var depA = require("depA"); - var depB = require("depB"); - assert.equal("dependency A", depA); - assert.equal("dependency B", depB); - module.exports = 'test 1'; - }) - // And then try and require it - var res = worker.require("test1") - assert.equal("test 1", res) - }, - "test: define() with dependencies" : function() { - // We want to be able to call define without an id, but since we aren't - // loading an external file, we must explicitly give it some kind of - // id, in this case 'test2'. - worker.require.id = 'test2'; - // Now define our module - worker.define(['depA', 'depB'], function(depA, depB) { - assert.equal("dependency A", depA); - assert.equal("dependency B", depB); - return 'test 2'; - }) - // And then try and require it - var res = worker.require("test2"); - assert.equal("test 2", res); - }, - "test: define() used require, exports and module as a dependency": function() { - // We want to be able to call define without an id, but since we aren't - // loading an external file, we must explicitly give it some kind of - // id, in this case 'test3'. - worker.require.id = 'test3'; - // Now define our module - worker.define(['require', 'exports', 'module', 'depA', 'depB'], function(require, exports, module) { - var depA = require("depA"); - var depB = require("depB"); - assert.equal("dependency A", depA); - assert.equal("dependency B", depB); - module.exports = 'test 3'; - }) - // And then try and require it - var res = worker.require("test3"); - assert.equal("test 3", res); - }, - "test: define() with a mix of require and actual dependecies": function() { - // We want to be able to call define without an id, but since we aren't - // loading an external file, we must explicitly give it some kind of - // id, in this case 'test4'. - worker.require.id = 'test4'; - // Now define our module - worker.define(['depA', 'require'], function(depA, require) { - var depB = require("depB"); - assert.equal("dependency A", depA); - assert.equal("dependency B", depB); - return 'test 4'; - }) - // And then try and require it - var res = worker.require("test4"); - assert.equal("test 4", res); - } -} - -}); - -if (typeof module !== "undefined" && module === require.main) { - require("asyncjs").test.testcase(module.exports).exec() -} \ No newline at end of file diff --git a/package.json b/package.json index 41c40fce..28943867 100644 --- a/package.json +++ b/package.json @@ -1,37 +1,64 @@ { "name": "ace", "description": "Ajax.org Code Editor is a full featured source code highlighting editor that powers the Cloud9 IDE", - "version": "1.1.9", - "homepage": "http://github.com/ajaxorg/ace", + "version": "0.2.0", + "homepage" : "http://github.com/ajaxorg/ace", "engines": {"node": ">= 0.6.0"}, - "author": "Fabian Jakobs ", + "author": "Fabian Jakobs ", "main": "lib/ace", - "repository": { - "type": "git", - "url": "http://github.com/ajaxorg/ace.git" + "repository" : { + "type" : "git", + "url" : "http://github.com/ajaxorg/ace.git" }, "dependencies": { - "mime": "1.2.x" - }, - "devDependencies": { + "mime": "1.2.x", "asyncjs": "0.0.x", "jsdom": "0.2.x", "amd-loader": "~0.0.4", - "dryice": "0.4.11", - "architect-build": "https://github.com/c9/architect-build/tarball/a3bad51808" + "plist": "", + "dryice": "" }, "mappings": { "ace": "." }, "licenses": [{ - "type": "BSD New", - "url": "http://opensource.org/licenses/BSD-3-Clause" + "type": "MPL", + "url": "http://www.mozilla.org/MPL/" + }, { + "type": "GPL", + "url": "http://www.gnu.org/licenses/gpl.html" + }, { + "type": "LGPL", + "url": "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html" }], "directories": { "lib": "lib/ace" }, "scripts": { - "start": "node static.js", - "test": "node lib/ace/test/all.js" + "test": "node lib/ace/test/all.js", + "postinstall": "node ./install.js" + }, + "config": { + "github.com/sourcemint/bundler-js/0/-meta/config/0": { + "adapter": "github.com/sourcemint/sdk-requirejs/0", + "modules": { + "/lib/ace/virtual_renderer.js": { + "dynamicLinks": [ + "/lib/ace/theme/*.js" + ] + }, + "/lib/ace/worker/worker_client.js": { + "dynamicLinks": [ + "/lib/ace/worker/worker_sourcemint.js" + ] + }, + "/lib/ace/worker/worker_sourcemint.js": { + "bundleLoader": true, + "dynamicLinks": [ + "/lib/ace/mode/*_worker.js" + ] + } + } + } } -} +} \ No newline at end of file diff --git a/sourcemint/.gitignore b/sourcemint/.gitignore new file mode 100644 index 00000000..81ce55f2 --- /dev/null +++ b/sourcemint/.gitignore @@ -0,0 +1,2 @@ +/dist/ +/node_modules/ \ No newline at end of file diff --git a/sourcemint/README.md b/sourcemint/README.md new file mode 100644 index 00000000..47e33462 --- /dev/null +++ b/sourcemint/README.md @@ -0,0 +1,63 @@ +Develop & Distribute ACE using the Sourcemint Loader +==================================================== + +The [Sourcemint JavaScript Loader](https://github.com/sourcemint/loader-js) is an optimized +module loader that boots sets of *statically linked* modules from *bundles*. An application may +load additional bundles by using *dynamic links*. + +*Bundles* are generated from the AMD formatted source files on the fly during development (using a server helper) +and in-batch for production builds. To generate bundles the Sourcemint [RequireJS SDK](https://github.com/sourcemint/sdk-requirejs) +and [Platform NodeJS](https://github.com/sourcemint/platform-nodejs) projects are used. + + +Development +=========== + +**Requirements:** + + * [NodeJS](http://nodejs.org/) + +**Install:** + + git clone git://github.com/ajaxorg/ace.git + cd ace + # TMP: Switch to sourcemint branch + git checkout sourcemint + cd sourcemint + npm install + +**Start development server:** + + node dev + +**NOTE:** Modified source files are automatically reloaded on browser refresh so there is no +need to restart the server during development. + + +Production +========== + +To generate production bundles, use the same setup as for *Development*, then run: + + // NOT YET IMPLEMENTED + node build ../demo/kitchen-sink ./dist + +Where `../demo/kitchen-sink` is the path to your ACE bootstrap package which embeds ACE in the page +or provides an interface for the rest of your application to interact with ACE. + +Everything needed for ACE (and your bootstrap package) to run will be written to the `./dist` directory which can be +used in a production application by serving these static files via a web server. To load the bootstrap file use: + + + + + + +See `../demo/kitchen-sink` for an example of how to write an ACE bootstrap package. + +See [Embedding Ace](https://github.com/ajaxorg/ace) and [Embedding API](https://github.com/ajaxorg/ace/wiki/Embedding---API) +for more information on how to embed and interact with ACE. diff --git a/sourcemint/dev.js b/sourcemint/dev.js new file mode 100644 index 00000000..5ce51b03 --- /dev/null +++ b/sourcemint/dev.js @@ -0,0 +1,47 @@ + +var PATH = require("path"), + FS = require("fs"), + CONNECT = require("connect"), + BUNDLER = require("sourcemint-platform-nodejs/lib/bundler"); + + +exports.main = function(options) { + + var server = CONNECT(); + + server.use(CONNECT.router(function(app) { + + app.get(/^\/loader.js/, CONNECT.static(PATH.dirname(require.resolve("sourcemint-loader-js/loader.js")))); + + app.get(/^(?:\/demo\/kitchen-sink)(?:\.js)?(\/.*)?$/, BUNDLER.hoist(PATH.dirname(__dirname) + "/demo/kitchen-sink", { + distributionBasePath: __dirname + "/dist", + packageIdHashSeed: "__ACE__", + bundleLoader: false, + logger: { + log: function() { + console.log.apply(null, arguments); + } + } + })); + + app.get(/^\//, function(req, res) + { + CONNECT.static(__dirname)(req, res, function() + { + res.writeHead(404); + res.end("Not found!"); + }); + }); + })); + + server.listen(options.port, "127.0.0.1"); + + console.log("ACE development server running at http://127.0.0.1:" + options.port + "/"); +} + +if (require.main === module) { + // TODO: Make configurable via command-line flag. + exports.main({ + port: 8888 + }); +} diff --git a/sourcemint/index.html b/sourcemint/index.html new file mode 100644 index 00000000..b149a1c5 --- /dev/null +++ b/sourcemint/index.html @@ -0,0 +1,16 @@ + + + + + + Ace Development Server + + + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Demos

                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                                                                                                                              Kitchen Sink

                                                                                                                                                                                                                                                                                                                                                                                                                                                              + + + diff --git a/sourcemint/kitchen-sink.html b/sourcemint/kitchen-sink.html new file mode 100644 index 00000000..035d17d2 --- /dev/null +++ b/sourcemint/kitchen-sink.html @@ -0,0 +1,209 @@ + + + + + + Ace Kitchen Sink + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + + + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + + + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + + + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + + + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + + + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + + + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + + + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + + + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + + + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + + + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + + + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + + + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + + + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + + + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + + + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + + + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + + + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              + + + + + + diff --git a/sourcemint/package.json b/sourcemint/package.json new file mode 100644 index 00000000..6e186a9f --- /dev/null +++ b/sourcemint/package.json @@ -0,0 +1,12 @@ +{ + "name": "ajaxorg-ace-sourcemint", + "version": "0.1.0", + "engines": { + "node": "0.x" + }, + "dependencies": { + "connect": "1.x", + "sourcemint-platform-nodejs": "0.x", + "sourcemint-loader-js": "0.x" + } +} \ No newline at end of file diff --git a/static.js b/static.js index 3b75c2b6..69108eb3 100755 --- a/static.js +++ b/static.js @@ -5,106 +5,41 @@ var http = require("http") , mime = require("mime") , url = require("url") , fs = require("fs") - , port = process.env.PORT || 8888 - , ip = process.env.IP || "0.0.0.0"; + , port = process.env.PORT || 8888; // compatibility with node 0.6 if (!fs.exists) - fs.exists = path.exists; + fs.exists = path.exists; -var allowSave = process.argv.indexOf("--allow-save") != -1; +http.createServer(function(request, response) { -http.createServer(function(req, res) { - var uri = url.parse(req.url).pathname - , filename = path.join(process.cwd(), uri); - - if (req.method == "PUT") { - if (!allowSave) - return error(res, 404, "Saving not allowed pass --allow-save to enable"); - return save(req, res, filename); + var uri = url.parse(request.url).pathname + , filename = path.join(process.cwd(), uri); + + fs.exists(filename, function(exists) { + if(!exists) { + response.writeHead(404, {"Content-Type": "text/plain"}); + response.write("404 Not Found\n"); + response.end(); + return; } - fs.exists(filename, function(exists) { - if (!exists) - return error(res, 404, "404 Not Found\n"); + if (fs.statSync(filename).isDirectory()) filename += '/index.html'; - if (fs.statSync(filename).isDirectory()) { - var files = fs.readdirSync(filename); - res.writeHead(200, {"Content-Type": "text/html"}); - - files.push(".", ".."); - var html = files.map(function(name) { - var href = uri + "/" + name; - href = href.replace(/[\/\\]+/g, "/").replace(/\/$/g, ""); - if (fs.statSync(filename + "/" + name + "/").isDirectory()) - href += "/"; - return "" + name + "
                                                                                                                                                                                                                                                                                                                                                                                                                                                              "; - }); + fs.readFile(filename, "binary", function(err, file) { + if(err) { + response.writeHead(500, {"Content-Type": "text/plain"}); + response.write(err + "\n"); + response.end(); + return; + } - res._hasBody && res.write(html.join("")); - res.end(); - return; - } - - fs.readFile(filename, "binary", function(err, file) { - if (err) { - res.writeHead(500, { "Content-Type": "text/plain" }); - res.write(err + "\n"); - res.end(); - return; - } - - var contentType = mime.lookup(filename) || "text/plain"; - res.writeHead(200, { "Content-Type": contentType }); - res.write(file, "binary"); - res.end(); - }); + var contentType = mime.lookup(filename) || "text/plain"; + response.writeHead(200, {"Content-Type": contentType}); + response.write(file, "binary"); + response.end(); }); -}).listen(port, ip); - -function error(res, status, message, error) { - console.error(error || message); - res.writeHead(status, { "Content-Type": "text/plain" }); - res.write(message); - res.end(); -} - -function save(req, res, filePath) { - var data = ""; - req.on("data", function(chunk) { - data += chunk; - }); - req.on("error", function() { - error(res, 404, "Could't save file"); - }); - req.on("end", function() { - try { - fs.writeFileSync(filePath, data); - } - catch (e) { - return error(res, 404, "Could't save file", e); - } - res.statusCode = 200; - res.end("OK"); - console.log("saved ", filePath); - }); -} - -function getLocalIps() { - var os = require("os"); - - var interfaces = os.networkInterfaces ? os.networkInterfaces() : {}; - var addresses = []; - for (var k in interfaces) { - for (var k2 in interfaces[k]) { - var address = interfaces[k][k2]; - if (address.family === "IPv4" && !address.internal) { - addresses.push(address.address); - } - } - } - return addresses; -} - -console.log("http://" + (ip == "0.0.0.0" ? getLocalIps()[0] : ip) + ":" + port); + }); +}).listen(port, "0.0.0.0"); +console.log("http://localhost:" + port); diff --git a/static.py b/static.py index 7a2faf91..eb864596 100755 --- a/static.py +++ b/static.py @@ -32,9 +32,7 @@ import time import string import sys from os import path, stat, getcwd -from fnmatch import fnmatch from wsgiref import util -from wsgiref.validate import validator from wsgiref.headers import Headers from wsgiref.simple_server import make_server from optparse import OptionParser @@ -86,8 +84,6 @@ class Cling(object): not_modified = StatusApp('304 Not Modified', "") moved_permanently = StatusApp('301 Moved Permanently') method_not_allowed = StatusApp('405 Method Not Allowed') - success_no_content = StatusApp('204 No Content', "") - server_error = StatusApp('500 Internal Server Error') def __init__(self, root, **kw): """Just set the root and any other attribs passes via **kw.""" @@ -97,6 +93,9 @@ class Cling(object): def __call__(self, environ, start_response): """Respond to a request when called in the usual WSGI way.""" + if environ['REQUEST_METHOD'] not in ('GET', 'HEAD'): + headers = [('Allow', 'GET, HEAD')] + return self.method_not_allowed(environ, start_response, headers) path_info = environ.get('PATH_INFO', '') full_path = self._full_path(path_info) if not self._is_under_root(full_path): @@ -110,23 +109,6 @@ class Cling(object): return self.moved_permanently(environ, start_response, headers) else: full_path = self._full_path(path_info + self.index_file) - try: - sz = int(environ['CONTENT_LENGTH']) - except: - sz = 0 - if environ['REQUEST_METHOD'] == 'PUT' and sz > 0: - for putglob in self.puttable: - if fnmatch(path_info, putglob): - data = environ['wsgi.input'].read(sz) - try: - with open(full_path, "wb") as f: f.write(data) - return self.success_no_content(environ, start_response) - except: - print sys.exc_info()[1] - return self.server_error(environ, start_response) - if environ['REQUEST_METHOD'] not in ('GET', 'HEAD'): - headers = [('Allow', 'GET, HEAD')] - return self.method_not_allowed(environ, start_response, headers) content_type = self._guess_type(full_path) try: etag, last_modified = self._conditions(full_path, environ) @@ -209,90 +191,52 @@ def cling_wrap(package_name, dir_name, **kw): def command(): - usage = "%prog [--help] [-d DIR] [-l [HOST][:PORT]] [-p GLOB[,GLOB...]]" - parser = OptionParser(usage=usage, version="static 0.3.6") - parser.add_option("-d", "--dir", dest="rootdir", default=".", - help="Root directory to serve. Defaults to '.' .", metavar="DIR") - parser.add_option("-l", "--listen", dest="listen", default="127.0.0.1:8888", - help="Listen on this interface (given by its hostname or IP) and port."+ - " HOST defaults to 127.0.0.1. PORT defaults to 8888. "+ - "Leave HOST empty to listen on all interfaces (INSECURE!).", - metavar="[HOST][:PORT]") - parser.add_option("-p", "--puttable", dest="puttable", default="", - help="Comma or space-separated list of request paths for which to"+ - " permit PUT requests. Each path is a glob pattern that may "+ - "contain wildcard characters '*' and/or '?'. "+ - "'*' matches any sequence of characters, including the empty"+ - " string. '?' matches exactly 1 arbitrary character. "+ - "NOTE: Both '*' and '?' match slashes and dots. "+ - "I.e. --puttable=* makes every file under DIR writable!", - metavar="GLOB[,GLOB...]") - parser.add_option("--validate", dest="validate", action="store_true", - default=False, - help="Enable HTTP validation. You don't need this unless "+ - "you're developing static.py itself.") - + parser = OptionParser(usage="%prog DIR [HOST][:][PORT]", + version="static 0.3.6") options, args = parser.parse_args() - if len(args) > 0: + if len(args) in (1, 2): + if len(args) == 2: + parts = args[1].split(":") + if len(parts) == 1: + host = parts[0] + port = None + elif len(parts) == 2: + host, port = parts + else: + sys.exit("Invalid host:port specification.") + elif len(args) == 1: + host, port = None, None + if not host: + host = '0.0.0.0' + if not port: + port = 8888 + try: + port = int(port) + except: + sys.exit("Invalid host:port specification.") + app = Cling(args[0]) + try: + make_server(host, port, app).serve_forever() + except KeyboardInterrupt, ki: + print "Cio, baby!" + except: + sys.exit("Problem initializing server.") + else: parser.print_help(sys.stderr) sys.exit(1) - parts = options.listen.split(":") - if len(parts) == 1: - try: # if the the listen argument consists only of a port number - port = int(parts[0]) - host = None - except: # could not parse as port number => must be a host IP or name - host = parts[0] - port = None - elif len(parts) == 2: - host, port = parts - else: - sys.exit("Invalid host:port specification.") - if not host: - host = '0.0.0.0' - if not port: - port = 8888 +def test(): + from wsgiref.validate import validator + app = Cling(getcwd()) try: - port = int(port) - if port <= 0 or port > 65535: raise ValueError - except: - sys.exit("Invalid host:port specification.") - - puttable = set(path.abspath(p) for p in - options.puttable.replace(","," ").split()) - if puttable and host not in ('127.0.0.1', 'localhost'): - print("Permitting PUT access for non-localhost connections may be unwise.") - - options.rootdir = path.abspath(options.rootdir) - - for p in puttable: - if not p.startswith(options.rootdir): - sys.exit("puttable path '%s' not under root '%s'" % (p, options.rootdir)) - - # cut off root prefix from puttable paths - puttable = set(p[len(options.rootdir):] for p in puttable) - - app = Cling(options.rootdir, puttable=puttable) - - if options.validate: - app = validator(app) - - try: - print "Serving %s to http://%s:%d" % (options.rootdir, host, port) - if puttable: - print("The following paths (relative to server root) may be "+ - "OVERWRITTEN via HTTP PUT.") - for p in puttable: - print p - make_server(host, port, app).serve_forever() + print "Serving " + getcwd() + " to http://localhost:8888" + make_server('0.0.0.0', 8888, validator(app)).serve_forever() except KeyboardInterrupt, ki: + print "" print "Ciao, baby!" - except: - sys.exit("Problem initializing server: %s" % sys.exc_info()[1]) if __name__ == '__main__': - command() + test() diff --git a/tool/Readme.md b/tool/Readme.md deleted file mode 100644 index 28dd5166..00000000 --- a/tool/Readme.md +++ /dev/null @@ -1,26 +0,0 @@ -Helper Scripts for Ace -====================== - -To use this you need to install node.js. and run `npm install` in this directory. - - -# add_mode.js - - Run -``` -node add_mode.js ModeName "extension1|extension2|^FullName" -``` - to create all the files needed for a new mode named `ModeName` - this adds stubs for: - `ace/mode/mode_name.js` - `ace/mode/mode_name_hightlight_rules.js` - `ace/snippets/mode_name.js` - `ace/demo/kitchen_sink/docs/mode_name.extension1` - and adds entry for the new mode to `ace/ext/modelist.js` - - -# tmlanguage.js - -``` -node tmlanguage.js ./templates/dummy.JSON-tmLanguage -``` \ No newline at end of file diff --git a/tool/Theme.tmpl.css b/tool/Theme.tmpl.css new file mode 100644 index 00000000..f1579b60 --- /dev/null +++ b/tool/Theme.tmpl.css @@ -0,0 +1,250 @@ + +.%cssClass% .ace_editor { + border: 2px solid rgb(159, 159, 159); +} + +.%cssClass% .ace_editor.ace_focus { + border: 2px solid #327fbd; +} + +.%cssClass% .ace_gutter { + background: #e8e8e8; + color: #333; +} + +.%cssClass% .ace_print_margin { + width: 1px; + background: %printMargin%; +} + +.%cssClass% .ace_scroller { + background-color: %background%; +} + +.%cssClass% .ace_text-layer { + color: %foreground%; +} + +.%cssClass% .ace_cursor { + border-left: 2px solid %cursor%; +} + +.%cssClass% .ace_cursor.ace_overwrite { + border-left: 0px; + border-bottom: 1px solid %overwrite%; +} + +.%cssClass% .ace_marker-layer .ace_selection { + background: %selection%; +} + +.%cssClass%.multiselect .ace_selection.start { + box-shadow: 0 0 3px 0px %background%; + border-radius: 2px; +} + +.%cssClass% .ace_marker-layer .ace_step { + background: %step%; +} + +.%cssClass% .ace_marker-layer .ace_bracket { + margin: -1px 0 0 -1px; + border: 1px solid %bracket%; +} + +.%cssClass% .ace_marker-layer .ace_active_line { + background: %active_line%; +} + +.%cssClass% .ace_gutter_active_line { + background-color: %active_line%; +} + +.%cssClass% .ace_marker-layer .ace_selected_word { + %selected_word_highlight% +} + +.%cssClass% .ace_invisible { + %invisible% +} + +.%cssClass% .ace_keyword, .%cssClass% .ace_meta { + %keyword% +} + +.%cssClass% .ace_keyword.ace_operator { + %keyword.operator% +} + +.%cssClass% .ace_constant, .%cssClass% .ace_constant.ace_other { + %constant% +} + +.%cssClass% .ace_constant.ace_character, { + %constant% +} + +.%cssClass% .ace_constant.ace_character.ace_escape, { + %constant% +} + +.%cssClass% .ace_constant.ace_language { + %constant.language% +} + +.%cssClass% .ace_constant.ace_library { + %constant.library% +} + +.%cssClass% .ace_constant.ace_numeric { + %constant.numeric% +} + +.%cssClass% .ace_constant.ace_other { + %constant.other% +} + +.%cssClass% .ace_invalid { + %invalid% +} + +.%cssClass% .ace_invalid.ace_illegal { + %invalid.illegal% +} + +.%cssClass% .ace_invalid.ace_deprecated { + %invalid.deprecated% +} + +.%cssClass% .ace_support { + %support% +} + +.%cssClass% .ace_support.ace_constant { + %support.constant% +} + +.%cssClass% .ace_fold { + background-color: %fold%; + border-color: %foreground%; +} + +.%cssClass% .ace_support.ace_function { + %support.function% +} + +.%cssClass% .ace_storage { + %storage% +} + +.%cssClass% .ace_storage.ace_type, .%cssClass% .ace_support.ace_type{ + %storage.type% +} + +.%cssClass% .ace_variable { + %entity.name.function% +} + +.%cssClass% .ace_variable.ace_parameter { + %variable.parameter% +} + +.%cssClass% .ace_function.ace_buildin { + %function.buildin% +} + +.%cssClass% .ace_string { + %string% +} + +.%cssClass% .ace_string.ace_regexp { + %string.regexp% +} + +.%cssClass% .ace_comment { + %comment% +} + +.%cssClass% .ace_comment.ace_doc { + %comment.doc% +} + +.%cssClass% .ace_comment.ace_doc.ace_tag { + %comment.doc.tag% +} + +.%cssClass% .ace_variable { + %variable% +} + +.%cssClass% .ace_variable.ace_language { + %variable.language% +} + +.%cssClass% .ace_xml_pe { + %xml_pe% +} + +.%cssClass% .ace_meta { + %meta% +} + +.%cssClass% .ace_meta.ace_tag { + %meta.tag% +} + +.%cssClass% .ace_meta.ace_tag.ace_input { + %ace.meta.tag.input% +} + +.%cssClass% .ace_entity.ace_other.ace_attribute-name { + %entity.other.attribute-name% +} + +.%cssClass% .ace_entity.ace_name { + %entity.name% +} + +.%cssClass% .ace_entity.ace_name.ace_function { + %entity.name.function% +} + +.%cssClass% .ace_markup.ace_underline { + text-decoration:underline; +} + +.%cssClass% .ace_markup.ace_heading { + %markup.heading% +} + +.%cssClass% .ace_markup.ace_heading.ace_1 { + %markup.heading.1% +} + +.%cssClass% .ace_markup.ace_heading.ace_2 { + %markup.heading.2% +} + +.%cssClass% .ace_markup.ace_heading.ace_3 { + %markup.heading.3% +} + +.%cssClass% .ace_markup.ace_heading.ace_4 { + %markup.heading.4% +} + +.%cssClass% .ace_markup.ace_heading.ace_5 { + %markup.heading.5% +} + +.%cssClass% .ace_markup.ace_heading.ace_6 { + %markup.heading.6% +} + +.%cssClass% .ace_markup.ace_list { + %markup.list% +} + +.%cssClass% .ace_collab.ace_user1 { + %collab.user1% +} \ No newline at end of file diff --git a/tool/add_mode.js b/tool/add_mode.js deleted file mode 100644 index 879b9204..00000000 --- a/tool/add_mode.js +++ /dev/null @@ -1,106 +0,0 @@ -var fs = require('fs'); -var lib = require('./lib'); -var path = require('path'); - -function main(displayName, extRe) { - var name = lib.snakeCase(displayName).replace(/[^\w]/g, ""); - - /** demo **/ - var demoFileExt = extRe.split("|")[0] || name; - var demoFileName = demoFileExt[0] == "^" ? demoFileExt.substr(1) : name + "." + demoFileExt; - var demoFilePath = lib.AceRoot + "demo/kitchen-sink/docs/" + demoFileName; - fs.writeFileSync(demoFilePath, "TODO add a nice demo!\nTry to keep it short!", "utf8"); - console.log("Created demo file at: " + path.normalize(demoFilePath)); - - /** mode **/ - var template = fs.readFileSync(__dirname + "/templates/mode.js", "utf8"); - var modePath = lib.AceLib + "ace/mode/" + name + ".js"; - var text = lib.fillTemplate(template, { - languageHighlightFilename: name, - languagename: name, - lineCommentStart: "TODO", - blockCommentStart: "TODO", - blockCommentEnd: "TODO" - }); - fs.writeFileSync(modePath, text); - console.log("Created mode file at: " + path.normalize(modePath)); - - /** highlight rules **/ - template = fs.readFileSync(__dirname + "/templates/highlight_rules.js", "utf8"); - var hlPath = lib.AceLib + "ace/mode/" + name + "_highlight_rules.js"; - template = template.replace(/\/\* THIS[\s\S]*?\*{3}\/\s*/, ""); - text = lib.fillTemplate(template, { - language: name, - languageTokens: '{\n\ - start: [{\n\ - token: "string.start",\n\ - regex: \'"\',\n\ - next: "qstring"\n\ - }],\n\ - qstring: [{\n\ - token: "escape",\n\ - regex: /\\\\./,\n\ - }, {\n\ - token: "string.end",\n\ - regex: \'"\',\n\ - next: "start"\n\ - }],\n\ - }' - }); - fs.writeFileSync(hlPath, text); - console.log("Created mode file at: " + path.normalize(hlPath)); - - /** snippets **/ - template = fs.readFileSync(__dirname + "/templates/snippets.js", "utf8"); - var snipetsPath = lib.AceLib + "ace/snippets/" + name + ".js"; - text = lib.fillTemplate(template, { - languagename: name, - snippets: "" - }); - fs.writeFileSync(snipetsPath, text); - console.log("Created snippets file at: " + path.normalize(snipetsPath)); - - /** modelist **/ - var modelistPath = lib.AceLib + "ace/ext/modelist.js"; - var modelist = fs.readFileSync(modelistPath, "utf8").replace(/\r\n?/g, "\n"); - modelist = modelist.replace(/(supportedModes = {\n)([\s\S]*?)(\n^};)/m, function(_, m1, m2, m3) { - var langs = m2.split(/,\n/); - var offset = langs[0].trim().indexOf("["); - var padding = Array(Math.max(offset - displayName.length - 1, 0) + 1).join(" "); - var newLang = " " + displayName + ":" + padding + "[\"" + extRe + "\"]"; - langs = langs.concat(newLang).map(function(x) { - return { - value: x, - id: x.match(/[^"':\s]+/)[0].toLowerCase() - }; - }); - langs[langs.length - 1].isNew = true; - - langs = langs.filter(function(x) { - console.log(x.id, displayName) - return x.id != displayName.toLowerCase() || x.isNew; - }); - langs = langs.sort(function(a, b) { - return a.id.localeCompare(b.id); - }).map(function(x) { - return x.value; - }); - - return m1 + langs.join(",\n") + m3; - }); - fs.writeFileSync(modelistPath, modelist, "utf8"); - console.log("Updated modelist at: " + path.normalize(modelistPath)); -} - -if (!module.parent) { - var args = process.argv.slice(2); - var displayName = args[0]; - var extRe = args[1]; - if (!displayName || ! extRe) { - console.log("Usage: ModeName ext1|ext2"); - process.exit(1); - } -} else { - module.exports = main; -} - diff --git a/tool/lib.js b/tool/lib.js deleted file mode 100644 index 3d57b6e0..00000000 --- a/tool/lib.js +++ /dev/null @@ -1,182 +0,0 @@ -var plist = require("plist"); -var util = require("util"); -var url = require("url"); -var cson = require("cson"); - -var https = require("https"); -var http = require("http"); - -exports.parsePlist = function(xmlOrJSON, callback) { - var json; - if (xmlOrJSON[0] == "<") { - plist.parseString(xmlOrJSON, function(_, result) { - json = result[0]; - }); - } else { - try { - xmlOrJSON = xmlOrJSON.replace( - /("(?:\\.|[^"])*")|(?:,\s*)+([\]\}])|(\w+)\s*:|([\]\}]\s*[\[\{])|(\/\/.*|\/\*(?:[^\*]|\*(?=[^\/]))*?\*\/)/g, - function(_, str, extraComma, noQuote, missingComma, comment) { - if (comment) - return ""; - if (missingComma) - return missingComma[0] + "," + missingComma.slice(1); - return str || extraComma || '"' + noQuote + '":'; - }); - json = JSON.parse(xmlOrJSON); - } catch(e) { - json = cson.parse(xmlOrJSON); - } - } - callback && callback(json); - return json; -}; - - -exports.formatJSON = function(object, initialIndent) { - return JSON.stringify(object, null, 4).replace(/^/gm, initialIndent||""); -}; - -exports.formatJS = function(object, initialIndent) { - return formatJS(object, 4, initialIndent); -}; - -function formatJS(object, indent, initialIndent) { - if (typeof indent == "number") - indent = Array(indent + 1).join(" "); - - function $format(buffer, totalIndent, state, o) { - if (typeof o != "object" || !o) { - if (typeof o == "string") - buffer.push(JSON.stringify(o)); - else - buffer.push("" + o); - } - else if (Array.isArray(o)) { - buffer.push("[") - - var len = totalIndent.length - var oneLine = true; - for (var i = 0; i < o.length; i++) { - if (typeof o[i] == "string") { - len += o[i].length + 2 - } else if (!o[i]) { - len += (o[i] + "").length - } else { - oneLine = false; - break; - } - len += 2; - if (len > 60) { - oneLine = false; - break; - } - } - - for (var i = 0; i < o.length; i++) { - if (o[i] && typeof o[i] == "object") { - $format(buffer, totalIndent, state, o[i]); - if (i < o.length - 1) - buffer.push(", "); - } else { - if (oneLine) - i && buffer.push(" "); - else - buffer.push("\n", totalIndent + indent) - $format(buffer, totalIndent + indent, state, o[i]); - if (i < o.length - 1) - buffer.push(","); - } - - } - if (!oneLine && buffer[buffer.length - 1] != "}") - buffer.push("\n" + totalIndent) - buffer.push("]") - } - else { - var keys = Object.keys(o); - buffer.push("{", "\n"); - for (var i = 0; i < keys.length; i++) { - buffer.push(totalIndent + indent); - if (/^\w+$/.test(keys[i])) - buffer.push(keys[i]); - else - buffer.push(JSON.stringify(keys[i])); - buffer.push(": ") - - if (keys[i] == "regex" && typeof o[keys[i]] == "string") { - try { - var re = new RegExp(o[keys[i]]); - buffer.push("/" + re.source.replace(/\\.|\//g, function(f) { - return f.length == 1 ? "\\" + f : f; - }) + "/"); - } catch(e) { - $format(buffer, totalIndent + indent, state, o[keys[i]]); - } - } else { - $format(buffer, totalIndent + indent, state, o[keys[i]]); - } - - if (i < keys.length - 1) - buffer.push(",", "\n"); - } - buffer.push("\n", totalIndent, "}"); - } - } - var buffer = []; - $format(buffer, initialIndent || "", {}, object); - return buffer.join(""); -} - -exports.fillTemplate = function(template, replacements) { - return template.replace(/%(.+?)%/g, function(str, m) { - return replacements[m] || ""; - }); -}; - -exports.hyphenate = function(str) { - return str.replace(/([A-Z])/g, "-$1").replace(/[_\s\-]+/g, "-").toLowerCase(); -}; - -exports.camelCase = function(str) { - return str.replace(/[\-_\s]+(.?)/g, function(x, y) {return y.toUpperCase()}); -}; - -exports.snakeCase = function(str) { - return str.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[_\s\-]+/g, "_").toLowerCase(); -}; - -exports.quoteString = function(str) { - return '"' + str.replace(/\\/, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\\n") + '"'; -}; - - -exports.restoreJSONComments = function(objStr) { - return objStr.replace(/^(\s*)comment: '(.*)'/gm, function(_, i, c) { - return i + "//" + c.replace(/\\n(\\t)*/g, "\n" + i + "//") + "\n" + i; - }).replace(/ \/\/ ERROR/g, '", // ERROR'); -}; - - -exports.download = function(href, callback) { - var options = url.parse(href); - var protocol = options.protocol === "https:" ? https : http; - console.log("connecting to " + options.host + " " + options.path); - var request = protocol.get(options, function(res) { - var data = ""; - res.setEncoding("utf-8"); - - res.on("data", function(chunk) { - data += chunk; - }); - - res.on("end", function(){ - callback(data); - }); - }); -}; - - -exports.AceRoot = __dirname + "/../"; -exports.AceLib = __dirname + "/../lib/"; - diff --git a/tool/mode_creator.html b/tool/mode_creator.html deleted file mode 100644 index 259ba64e..00000000 --- a/tool/mode_creator.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - Ace Mode Creator - - - - - - - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - - - - - - - - - - \ No newline at end of file diff --git a/tool/mode_creator.js b/tool/mode_creator.js deleted file mode 100644 index 44aa67d0..00000000 --- a/tool/mode_creator.js +++ /dev/null @@ -1,259 +0,0 @@ -define(function(require, exports, module) { - -/** creates globals intentionally to make things easily accessible from console **/ - -require("ace/ext/language_tools"); -require("ace/config").setDefaultValues("editor", { - enableBasicAutocompletion: true, - enableSnippets: true -}); -var net = require("ace/lib/net"); -var Range = require("ace/range").Range; -var util = require("demo/kitchen-sink/util"); -var layout = require("demo/kitchen-sink/layout"); -var modelist = require("ace/ext/modelist"); -var doclist = require("demo/kitchen-sink/doclist"); -var TokenTooltip = require("demo/kitchen-sink/token_tooltip").TokenTooltip; - -var EditSession = require("ace/edit_session").EditSession; -var UndoManager = require("ace/undomanager").UndoManager; - -var DebugTokenizer = require("ace/tokenizer_dev").Tokenizer; -var Tokenizer = require("ace/tokenizer").Tokenizer; - -// createEditor -var splitEditor = window.splitEditor = util.createSplitEditor("editor"); - -var editor1 = window.editor1 = splitEditor.editor0; -var editor2 = window.editor2 = splitEditor.editor1; -new TokenTooltip(editor2); - -var timeout = null; -var schedule = function() { - if (timeout != null) { - clearTimeout(timeout); - } - timeout = setTimeout(run, 800); -}; - - -var setAutorunEnabled = function(val) { - if (val) - editor1.on('change', schedule); - else - editor1.removeEventListener('change', schedule); -}; - -util.bindCheckbox("autorunEl", setAutorunEnabled); - - -var docEl = document.getElementById("doc"); -util.fillDropdown(docEl, doclist.docs); -util.bindDropdown("doc", function(value) { - doclist.loadDoc(value, function(session) { - if (session) { - editor2.setSession(session); - updateSaveButtonState(null, editor2); - } - }); -}); - -var modeEl = document.getElementById("modeEl"); -util.fillDropdown(modeEl, modelist.modes); -var modeSessions = {}; - -util.bindDropdown(modeEl, function(value) { - if (modeSessions[value]) { - editor1.setSession(modeSessions[value]); - schedule(); - return; - } - var hp = "./lib/ace/mode/" + value + "_highlight_rules.js"; - net.get(hp, function(text) { - var session = new EditSession(text); - session.setUndoManager(new UndoManager()); - - modeSessions[value] = session; - session.setMode("ace/mode/javascript", function() { - if (session.getLine(0).match(/^\s*\//)) - session.toggleFoldWidget(0); // fold licence comment - }); - - editor1.setSession(modeSessions[value]); - updateSaveButtonState(null, editor1); - schedule(); - }); -}); - -document.getElementById("syncToMode").onclick = function() { - docEl.value = modelist.modesByName[modeEl.value].desc; - docEl.onchange(); - run(); -}; - -editor1.saveButton = document.getElementById("saveButton1"); -editor2.saveButton = document.getElementById("saveButton2"); -editor1.saveButton.editor = editor1; -editor2.saveButton.editor = editor2; - -editor1.saveButton.onclick = function() { - doclist.saveDoc({ - path: "./lib/ace/mode/" + modeEl.value + "_highlight_rules.js", - session: editor1.session - }, function(err) { - handleSaveResult(err, editor1); - }); -}; -editor1.commands.bindKey({ - win: "Ctrl-S", mac: "Cmd-s" -}, editor1.saveButton.onclick); -editor2.saveButton.onclick = function() { - doclist.saveDoc(docEl.value, function(err) { - handleSaveResult(err, editor2); - }); -}; -editor2.commands.bindKey({ - win: "Ctrl-S", mac: "Cmd-s" -}, editor2.saveButton.onclick); -function updateSaveButtonState(e, editor){ - editor.saveButton.disabled = editor.session.getUndoManager().isClean(); -} -editor1.on("input", updateSaveButtonState); -editor2.on("input", updateSaveButtonState); - -function handleSaveResult(err, editor) { - if (err) { - return log( - "Write access to this file is disabled.\n"+ - "To enable saving your changes to disk, clone the Ace repository\n"+ - "and run the included web server with the --allow-save option\n"+ - "`node static.js --allow-save` or `static.py --puttable=*`" - ); - } - editor.session.getUndoManager().markClean(); - updateSaveButtonState(null, editor); -} - -document.getElementById("perfTest").onclick = function() { - var lines = editor2.session.doc.getAllLines(); - if (!lines.length) - return; - while (lines.length < 1000) { - lines = lines.concat(lines); - } - - var tk = new Tokenizer(currentRules); - var testPerf = function(lines, tk) { - var state = "start"; - for (var i=0, l = lines.length; i + + + + + Editor + + + + +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/tool/package.json b/tool/package.json
                                                                                                                                                                                                                                                                                                                                                                                                                                                              deleted file mode 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                              index 974673c6..00000000
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- a/tool/package.json
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +++ /dev/null
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -1,10 +0,0 @@
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -{
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  "name": "ace-tools",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  "version": "0.1.0",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  "dependencies": {
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    "cson": "^3.0.1",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    "css-parse": "1.0.3",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    "css-stringify": "1.0.3",
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    "plist": ""
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -  }
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -}
                                                                                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/tool/perf-test.html b/tool/perf-test.html
                                                                                                                                                                                                                                                                                                                                                                                                                                                              index ee8f6d0f..74603400 100644
                                                                                                                                                                                                                                                                                                                                                                                                                                                              --- a/tool/perf-test.html
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +++ b/tool/perf-test.html
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -7,16 +7,11 @@
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   Ace Profile  util
                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -    
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - - - - - - - - - - - - - - - - - - - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              @@ -82,11 +77,8 @@ - - - @@ -97,12 +89,11 @@ - + - @@ -116,10 +107,8 @@ - - @@ -247,54 +236,14 @@ - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - - - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - - - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - - - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - - - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - +
                                                                                                                                                                                                                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                                              +